<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12663&amp;type=atom" />
	<updated>2018-07-14T16:53:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12663</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127059#p127059" />
			<content type="html"><![CDATA[<p>По кнопке надо создать вторую вкладку, или переключится на неё?</p><p>И то, и другое.<br /></p><div class="codebox"><pre><code>Gui, Add, Tab3, w222 vTab, Вкладка 1|Вкладка 2
Gui, Tab, 1 
Gui, Add, Button, w100 gButton, Кнопка
Gui, Tab, 2
Gui, Show
return

Button:
	GuiControl, Choose, Tab, Вкладка 2
	GuiControl, , Tab, Вкладка 3
	return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-07-14T16:53:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127059#p127059</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127050#p127050" />
			<content type="html"><![CDATA[<p>Как создать функцию для кнопки, которая в tab1, при нажатии которой появлялась tab2?</p>]]></content>
			<author>
				<name><![CDATA[TheBimboCool]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39388</uri>
			</author>
			<updated>2018-07-14T06:14:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127050#p127050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115877#p115877" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Название переменных не всегда уместно обсуждать, но может &quot;hChild&quot;, или нет?</p></blockquote></div><p>hParent в том смысле, что оно будет родительским для добавленных позже контролов.<br /></p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>То есть добавленные контролы как бы не имеют родственной связи с табом, а только с #32770?</p></blockquote></div><p>Ну да, они для него дочерние, а он является дочерним для Gui, и sibling&#039;ом для таба:<br /></p><div class="codebox"><pre><code>Gui, +hwndhGui
Gui, Add, Tab3, hwndhTab, 1
hGW_HWNDNEXT := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, hTab, &quot;Uint&quot;, 2)
WinGetClass, winClass, ahk_id %hGW_HWNDNEXT%
MsgBox, % winClass
hParent := DllCall(&quot;GetParent&quot;, Ptr, hGW_HWNDNEXT)  ; получаем родительское для #32770
MsgBox, % &quot;Хэндл родительского для #32770 = &quot; . Format(&quot;{:#x}&quot;, hParent) . &quot;`nhTab = &quot; hTab &quot;`nhGui = &quot; hGui</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-05-15T17:02:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115877#p115877</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115876#p115876" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>т. к. добавленные к Tab3 контролы не являются дочерними для таба (и для отдельных вкладок).</p></blockquote></div><p>То есть добавленные контролы как бы не имеют родственной связи с табом, а только с #32770?</p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>hParent := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, hTab, &quot;Uint&quot;, 2)</p></blockquote></div><p>Название переменных не всегда уместно обсуждать, но может &quot;hChild&quot;, или нет?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-05-15T16:52:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115876#p115876</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115875#p115875" />
			<content type="html"><![CDATA[<p>Тут путаница вышла. При добавлении Tab3 добавляется также контрол #32770. Я думал, что он добавляется только когда к Tab3 добавлен ещё какой-то контрол. Но эта идея была изначально неверной, т. к. добавленные к Tab3 контролы не являются дочерними для таба (и для отдельных вкладок). Так что контрол #32770 добавляется в любом случае.</p><div class="codebox"><pre><code>
Gui, Add, Tab3, hwndhTab, 1
hGW_HWNDNEXT := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, hTab, &quot;Uint&quot;, 2)   ; можно и GW_HWNDLAST = 1
MsgBox % hGW_HWNDNEXT
WinGetClass, winClass, ahk_id %hGW_HWNDNEXT%
MsgBox, % winClass</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-05-15T16:40:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115875#p115875</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115874#p115874" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Тоже так показалось.</p></blockquote></div><p>Я там выше добавил, это про tab2. В tab3 он есть безусловно.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Не понял, что именно почему.</p></blockquote></div><p>Из описания GetWindow я не понял, почему она возвращает в данном случае - &quot;то что требуется&quot;.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-05-15T16:36:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115874#p115874</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115873#p115873" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Возможно, что можно обойтись без создания контрола в Tab3</p></blockquote></div><p>Да, у меня получилось, попробовал:<br /></p><div class="codebox"><pre><code>Gui, Main: Default
Gui, Margin, 0, 0
Gui, Add, Tab3, hwndhTab vMainTab w400 h300 gMainTab AltSubmit, Вкладка 1|Вкладка 2|Вкладка 3
hParent := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, hTab, &quot;Uint&quot;, 2)
WinGetPos,,, W, H, ahk_id %hParent%

Colors := [&quot;Red&quot;, &quot;Lime&quot;, &quot;Blue&quot;]
Loop 3  {
   Gui, Tab%A_Index%: Default
   Gui, +Parent%hParent% -Caption +ToolWindow
   Gui, Add, Tab3, % &quot;x&quot; 5 &quot; y&quot; 5 &quot; w&quot; W - 20 &quot; h&quot; H - 20, Вкладка %A_Index%-1|Вкладка %A_Index%-2|Вкладка %A_Index%-3
   Gui, Tab, 1
   Gui, Add, Edit, w200 h100, Edit %A_Index%-1
   Gui, Tab, 2
   Gui, Add, Button, gOnClick w100, Кнопка %A_Index%-2
   Gui, Tab, 3
   Gui, Add, Progress, % &quot;w200 h20 c&quot; Colors[A_Index], % 100 * A_Index/3
   Gui, Show, % &quot;Hide x5 y5 w&quot; W - 10 &quot; h&quot; H - 10
}
Gui, Tab1:Show, NA

Gui,Main: Show, w400 h300
Return

OnClick:
   MsgBox, % A_GuiControl
   Return
   
MainTab:
   Gui, Tab%MainTab%:Show, Hide
   GuiControlGet, MainTab, Main:
   Gui, Tab%MainTab%:Show, NA
   Return
   
MainGuiClose:
   ExitApp</code></pre></div><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>#32770, причём он создаётся только если в таб добавлен хотя бы один контрол.</p></blockquote></div><p>Тоже так показалось. </p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Ещё вопрос, если с GetWindow работает, то почему?</p></blockquote></div><p>Не понял, что именно почему.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-05-15T16:31:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115873#p115873</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115872#p115872" />
			<content type="html"><![CDATA[<p>Возможно, что можно обойтись без создания контрола <span class="bbu">в Tab3</span>:<br /></p><div class="codebox"><pre><code>
Gui, Add, Tab3, hwndhTab, 1
Gui, Tab, 1
Gui, Add, Text, hwndhStatic hidden
hParentStatic := DllCall(&quot;GetParent&quot;, Ptr, hStatic, Ptr)
hGW_HWNDNEXT := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, hTab, &quot;Uint&quot;, 2)   ; можно и GW_HWNDLAST = 1
MsgBox % hParentStatic &quot;`n&quot; hGW_HWNDNEXT &quot;`n&quot; (hParentStatic = hGW_HWNDNEXT)
</code></pre></div><p>Ещё вопрос, если с GetWindow работает, то почему? <br /></p><div class="codebox"><pre><code>
Gui, Add, Tab3, hwndhTab, 1
hGW_HWNDNEXT := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, hTab, &quot;Uint&quot;, 2)   ; можно и GW_HWNDLAST = 1
MsgBox % hGW_HWNDNEXT
</code></pre></div><p>Из описания не понял.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-05-15T16:19:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115872#p115872</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115757#p115757" />
			<content type="html"><![CDATA[<p>Не только Static, с остальными тоже самое, также если и tab является родительским как в 7 посте.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>В моём варианте дочерние окна добавляются именно к тому элементу, к которому их добавляет AHK</p></blockquote></div><p>Да, принцип понятен, не заметил сразу что там есть ещё контрол #32770, причём он создаётся только если в таб добавлен хотя бы один контрол.</p><p>АПД: </p><div class="quotebox"><blockquote><p>#32770, причём он создаётся только если в таб добавлен хотя бы один контрол.</p></blockquote></div><p>Как оказалось, это про tab2.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-05-09T09:32:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115757#p115757</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115756#p115756" />
			<content type="html"><![CDATA[<p>Не-а, насколько я понял, у вкладок нет отдельных окон, это просто синтаксис AHK такой, что появление/скрытие контролов, добавленных после <em>Gui, tab, [номер вкладки]</em> программируется автоматически.</p><p>У тебя в последнем примере родительские окна — элементы «Static», они по идее не предназначены для этой роли (хотя я о каких-то ограничениях нигде на читал), я бы опасался каких-нибудь проблем — у тебя же с tab3 почему-то нестабильно работало. В моём варианте дочерние окна добавляются именно к тому элементу, к которому их добавляет AHK.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-05-09T08:45:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115756#p115756</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115755#p115755" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />С GetParent интересный ход, но можно ли&nbsp; tab сделать дочерним именно вкладке, наподобии как у меня в 11 посте, чтобы не скрывать \ показывать окна при переключении вкладок.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-05-09T07:43:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115755#p115755</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115752#p115752" />
			<content type="html"><![CDATA[<p>Тоже ради интереса сделал, всё работает с Tab3:<br /></p><div class="codebox"><pre><code>Gui, Main: Default
Gui, Margin, 0, 0
Gui, Add, Tab3, vMainTab w400 h300 gMainTab AltSubmit, Вкладка 1|Вкладка 2|Вкладка 3
Gui, Tab, 1
Gui, Add, Text, hwndhStatic hidden
hParent := DllCall(&quot;GetParent&quot;, Ptr, hStatic, Ptr)
WinGetPos,,, W, H, ahk_id %hParent%

Colors := [&quot;Red&quot;, &quot;Lime&quot;, &quot;Blue&quot;]
Loop 3  {
   Gui, Tab%A_Index%: Default
   Gui, +Parent%hParent% -Caption +ToolWindow
   Gui, Add, Tab3, % &quot;x&quot; 5 &quot; y&quot; 5 &quot; w&quot; W - 20 &quot; h&quot; H - 20, Вкладка %A_Index%-1|Вкладка %A_Index%-2|Вкладка %A_Index%-3
   Gui, Tab, 1
   Gui, Add, Edit, w200 h100, Edit %A_Index%-1
   Gui, Tab, 2
   Gui, Add, Button, gOnClick w100, Кнопка %A_Index%-2
   Gui, Tab, 3
   Gui, Add, Progress, % &quot;w200 h20 c&quot; Colors[A_Index], % Round(100 * A_Index/3)
   Gui, Show, % &quot;Hide x5 y5 w&quot; W - 10 &quot; h&quot; H - 10
}
Gui, Tab1:Show, NA

Gui,Main: Show, w400 h300
Return

OnClick:
   MsgBox, % A_GuiControl
   Return
   
MainTab:
   Gui, Tab%MainTab%:Show, Hide
   GuiControlGet, MainTab, Main:
   Gui, Tab%MainTab%:Show, NA
   Return
   
MainGuiClose:
   ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-05-08T19:15:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115752#p115752</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115744#p115744" />
			<content type="html"><![CDATA[<p>Можно сделать наоборот, чтобы скрывать ЭУ не по одному, а &quot;оптом&quot;.<br /></p><div class="codebox"><pre><code>Gui, Add, Button, w100 x10  y10 gTAB1, Вкладка1
Gui, Add, Button, w100 x120 y10 gTAB2, Вкладка2

Gui, Add, Tab, x10 y50 w600 h600 vTAB1, Подвкладка 1-1|Подвкладка 1-2
Gui, Tab, 1, 1
Gui, Add, Text, , 1111111
Gui, Tab, 2, 1
Gui, Add, Text, , 2222222

Gui, Add, Tab, x10 y50 w600 h600 vTAB2, Подвкладка 2-1|Подвкладка 2-2
Gui, Tab, 1,2
Gui, Add, Edit, , 3333333
Gui, Tab, 2,2
Gui, Add, Edit, , 4444444

GUIcontrol, Hide, TAB2

GUI, Show
Return



TAB1:
GUIcontrol, Hide, TAB2
GUIcontrol, Show, TAB1
Return

TAB2:
GUIcontrol, Hide, TAB1
GUIcontrol, Show, TAB2
Return</code></pre></div><p>Кроме того, можно прикрутить ЭУ типа &quot;флажок&quot; или &quot;радио-точка&quot;, чтобы было видно, в которой вкладке происходит работа.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-05-08T07:41:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115744#p115744</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115729#p115729" />
			<content type="html"><![CDATA[<p>Я уже сделал все по примеру yupppu. Пришлось немножко попотеть чтобы присвоить всем текстовым контролам переменные и все их в hide занести, но оно того стоило - все просто идеально. Ещё раз спасибо!</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-05-07T19:38:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115729#p115729</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Несколько подвкладок в главной вкладке (GUI tab)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115728#p115728" />
			<content type="html"><![CDATA[<p>А если в Tab3 добавлять Tab2, то работает.<br /></p><div class="codebox"><pre><code>Color = 0xC2E2A7
w := 300, h := 200
Gui, -DPIScale
Gui, Color, %Color%
Gui, Add, Tab3, w%w% h%h%, основное|макросы|другое 
Gui, Tab, 1
Gui, Add, Text, HWNDhTab1 x10 y10 w%w% h%h%, % &quot;&quot;
Gui, Tab, 2
Gui, Add, Text, HWNDhTab2 x10 y10 w%w% h%h%, % &quot;&quot;
Gui, Tab, 3
Gui, Add, Text, , другое

Gui, Tab1:Default
Gui, Color, %Color%
Gui, +Parent%hTab1% -Caption -DPIScale
Gui, Add, Tab2, x0 y0 w%w% h%h%, основное 1|основное 2
Gui, Tab, 1
Gui, Add, Edit, , основное 1
Gui, Tab, 2
Gui, Add, Text, , основное 2
Gui, Show, Na x1 y25

Gui, Tab2:Default
Gui, Color, %Color%
Gui, +Parent%hTab2% -Caption -DPIScale
Gui, Add, Tab2, x0 y0 w%w% h%h%, макросы 1|макросы 2|макросы 3
Gui, Tab, 1
Gui, Add, Text, , макросы 1 
Gui, Tab, 2
Gui, Add, Edit, , макросы 2 
Gui, Tab, 3
Gui, Add, Button, , макросы 3
Gui, Show, Na x1 y25

Gui, 1:Default
Gui, Show 
Return </code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-05-07T18:47:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115728#p115728</id>
		</entry>
</feed>
