<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Подпрограмма кнопки в GUI]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10672&amp;type=atom" />
	<updated>2015-06-02T12:24:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10672</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94325#p94325" />
			<content type="html"><![CDATA[<p>Тут дело в том, что в новой ветке окном по умолчанию считается то окно, которое её запустило. Соответственно, этот код</p><div class="codebox"><pre><code>Gui,  -SysMenu ; Вот в этом окне не работают кнопки
Gui, Add, Progress, yp+20 x3 w200 h20 -Smooth vPR, 0
Gui, Add, Text, vtext x30 y5 w200, Запуск...
Gui, Add, Button, yp+35 x3 w100, Вернутся`nв &amp;меню
Gui, Add, Button, xp yp+43w200, назад
Gui, Add, Button, x103 yp-43 w100, Выйти из &amp;программы</code></pre></div><p>относится к Gui 6, т. к. запущен его меткой, а явным образом номер текущего окна не указан. Значит, либо к меткам кнопок нужно было добавить шестёрку, либо перед созданием окна указать окно по умолчанию для ветки:<br /></p><div class="codebox"><pre><code>Gui, 1:Default
Gui,  -SysMenu ; Вот в этом окне не работают кнопки
Gui, Add, Progress, yp+20 x3 w200 h20 -Smooth vPR, 0
Gui, Add, Text, vtext x30 y5 w200, Запуск...
Gui, Add, Button, yp+35 x3 w100, Вернутся`nв &amp;меню
Gui, Add, Button, xp yp+43 w200, назад
Gui, Add, Button, x103 yp-43 w100, Выйти из &amp;программы</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-06-02T12:24:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94325#p94325</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94324#p94324" />
			<content type="html"><![CDATA[<p><strong>sergeiplugatyr</strong>, в ФуллКоде так и написано, но это не работает..</p>]]></content>
			<author>
				<name><![CDATA[Demy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33099</uri>
			</author>
			<updated>2015-06-02T12:01:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94324#p94324</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94321#p94321" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>Demy</strong>, оформите код, <a href="http://forum.script-coding.com/viewtopic.php?id=6148">как положено</a>.</span></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-06-02T09:38:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94321#p94321</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94320#p94320" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Gui, Add, Button, yp+35 x3 w100, Вернутся`nв &amp;меню<br />Gui, Add, Button, xp yp+43w200, назад<br />Gui, Add, Button, x103 yp-43 w100, Выйти из &amp;программы</p></blockquote></div><p>Убрать символы и пробелы:<br /></p><div class="codebox"><pre><code>Gui, Add, Button, yp+35 x3 w100, Вернутся`nв &amp;меню
Gui, Add, Button, xp yp+43w200, назад
Gui, Add, Button, x103 yp-43 w100, Выйти из &amp;программы
Gui, Show, AutoSize
return

ButtonВыйтиизпрограммы:
MsgBox
return

ButtonВернутсявменю:
MsgBox, 1
return

GuiClose:
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sergeiplugatyr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30382</uri>
			</author>
			<updated>2015-06-02T08:53:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94320#p94320</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94319#p94319" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alectric пишет:</cite><blockquote><p>Лучше делать индивидуальные метки перехода, не зависящие от названия кнопки: &quot;gMyLabel&quot;.</p></blockquote></div><p>Большое спасибо</p>]]></content>
			<author>
				<name><![CDATA[Demy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33099</uri>
			</author>
			<updated>2015-06-02T08:26:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94319#p94319</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94318#p94318" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>По идее, подпрограмма <span style="color: blue">6ButtonПродолжить:</span> должна запускаться. Проверяйте, нет ли в ней самой ошибок.</p></blockquote></div><div class="codebox"><pre><code>6ButtonПродолжить </code></pre></div><p>работает, а вот <br /></p><div class="codebox"><pre><code>Gui, Add, Button, yp+35 x3 w100, Вернутся`nв &amp;меню
Gui, Add, Button, xp yp+43w200, назад
Gui, Add, Button, x103 yp-43 w100, Выйти из &amp;программы</code></pre></div><p>нет</p>]]></content>
			<author>
				<name><![CDATA[Demy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33099</uri>
			</author>
			<updated>2015-06-02T08:18:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94318#p94318</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94315#p94315" />
			<content type="html"><![CDATA[<p>Лучше делать индивидуальные метки перехода, не зависящие от названия кнопки: &quot;gMyLabel&quot;.</p><div class="codebox"><pre><code>
Gui, Add, Button, yp+35 x3 w100 gGoBack, Вернутся`nв &amp;меню

GoBack:
Msgbox
Return

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-06-02T06:57:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94315#p94315</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94313#p94313" />
			<content type="html"><![CDATA[<p>По идее, подпрограмма <span style="color: blue">6ButtonПродолжить:</span> должна запускаться. Проверяйте, нет ли в ней самой ошибок.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-06-02T06:38:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94313#p94313</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94309#p94309" />
			<content type="html"><![CDATA[<p><strong>Demy</strong>, придумайте какое-нибудь более <a href="http://forum.script-coding.com/viewtopic.php?pid=44437#p44437">внятное название</a> для темы.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-06-01T21:31:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94309#p94309</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Подпрограмма кнопки в GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94308#p94308" />
			<content type="html"><![CDATA[<p>Проблема в том, что в последнем окне не работают кнопки. Пытался найти причину эту, но не смог. Выяснил одно: если<br />заменить кнопку в 6ом окне<br /></p><div class="codebox"><pre><code>Gui, 6: Add, Button, w242 yp+22 xp-6, Продолжить
Gui, 6: show
return

6ButtonПродолжить:</code></pre></div><p>на<br /></p><div class="codebox"><pre><code>Gui, 6:show
sleep 2000
goto, Продолжить

Продолжить:</code></pre></div><p>Увы, такой способ плох...<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Full Code</div><div class="fancy_spoiler"><div class="codebox"><pre><code>!1::
Gui, 6: -SysMenu
Gui, 6: Add, GroupBox, h80 w240, Выберите функции для отпимизации:
loop, Bin\*.ahk,, 0 ; Данный выбор не имеет значения
{
    MAXFUNC++    
    Gui, 6: Add, Checkbox, yp+15 xs+5 vFun%A_Index%, %A_LoopFileName%
}
Gui, 6: Add, Button, w242 yp+22 xp-6, Продолжить
Gui, 6: show
return

6ButtonПродолжить:
Gui, 6: Submit, nohide
count_segments = 0
loop %MAXFUNC%
    count_segments:=count_segments+Fun%A_Index%
count_segments  = 1
if count_segments = 0
{
   soundplay *16
    Gui, 3: -SysMenu
    Gui, 3: Add, Text,, Вы не выбрали функции!
    Gui, 3: Add, Button, xp yp+15 wp, Назад
    Gui, 3: Show
    return
}

Gui, 6: destroy
segment = 0
    segment:=100//count_segments
Gui,  -SysMenu ; Вот в этом окне не работают кнопки
Gui, Add, Progress, yp+20 x3 w200 h20 -Smooth vPR, 0
Gui, Add, Text, vtext x30 y5 w200, Запуск...
Gui, Add, Button, yp+35 x3 w100, Вернутся`nв &amp;меню
Gui, Add, Button, xp yp+43w200, назад
Gui, Add, Button, x103 yp-43 w100, Выйти из &amp;программы

GuiControl,Disable, Вернутся`nв &amp;меню
GuiControl,Disable, Выйти из &amp;программы
Gui, Show,w206 
sleep 2000
loop, Bin\*.ahk
    if Fun%A_Index% = 1
    {
        filereadline, FUNCVERB, Bin\FUNCSDATA.txt, %A_Index%
        GuiControl,,text, %FUNCVERB%
        RunWait, Bin\%A_LoopFileName%, 5
        GuiControl,, PR, +%segment%
    }

GuiControl,, PR, 100
GuiControl,,text, Оптимизация завершена!
GuiControl,Enable, Вернуться`nв &amp;меню
GuiControl,Enable, Выйти из &amp;программы
return

ButtonВернутьсявменю:
ButtonВыйтиизпрограммы:
ButtonТест:
Buttonназад:
msgbox, test
return</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Demy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33099</uri>
			</author>
			<updated>2015-06-01T20:16:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94308#p94308</id>
		</entry>
</feed>
