<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Динамический Gui + A_Index]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13189&amp;type=atom" />
	<updated>2017-11-19T12:29:19Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13189</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121371#p121371" />
			<content type="html"><![CDATA[<p>Можно еще самому создавать гуи через dllcall и уже с ними делать, что угодно.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-19T12:29:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121371#p121371</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121366#p121366" />
			<content type="html"><![CDATA[<p>Был у меня подобный случай.<br />Я пришел к следующему умозаключению:<br />	при &quot;удалении&quot; контрола мы его просто скрываем, а при &quot;добавлении&quot; нового мы его редактируем как нам угодно и показываем где нужно. <br />При таких раскладах памяти выделиться ровно столько, сколько раз мы нажали на кнопочку добавить контрол.</p><p>В принципе можно организовать массив с &quot;удаленными&quot; контролами...<br />Надеюсь я вам помог. <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /> <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /> <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[shahlik002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=37352</uri>
			</author>
			<updated>2017-11-19T06:37:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121366#p121366</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121075#p121075" />
			<content type="html"><![CDATA[<p>Полагаю ждать бессмысленно.<br />Во всяком случае в автохотки 2 такого метода нету.<br /><a href="https://lexikos.github.io/v2/docs/objects/GuiControl.htm">https://lexikos.github.io/v2/docs/objec … ontrol.htm</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-12T14:11:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121075#p121075</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121060#p121060" />
			<content type="html"><![CDATA[<p>Значит не обманули буржуины - работает эта фигня!<br />У меня тоже вроде не глючит.<br />Ну а память я не заметил, чтобы много съедало, да и че ее экономить в наше время, когда у всех ее от 6-8 Gb +</p><p>В этой справке обещают сделать GuiControl, Delete:</p><p><a href="https://www.autohotkey.com/docs/commands/GuiControl.htm">https://www.autohotkey.com/docs/commands/GuiControl.htm</a></p><div class="quotebox"><blockquote><p>GuiControl, Delete (not yet implemented): This sub-command does not yet exist. As a workaround, use Hide and/or Disable (above), or destroy and recreate the entire window via Gui Destroy.</p></blockquote></div><p>... но сколько еще ждать - не известно.</p>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-11-12T10:34:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121060#p121060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121055#p121055" />
			<content type="html"><![CDATA[<p>В принципе можно удалять контролы.<br />Правда в памяти Ahk они всё-равно остаются.<br />Но не заметил в этом никаких глюков, разве, что память будет слегка отъедать.<br /></p><div class="codebox"><pre><code>count := points := 2
Gui, +LastFound
Gui Add, Text, w200 y20 Center, Количество Edit Box:
Gui Add, Edit, wp Center Limit1 vNewpoints gAddpoints, % points
Loop % points
{
   Gui Add, Edit, % &quot;wp vVar&quot; A_Index
   If (A_Index = points)
      GuiControlGet, LastPosition, Pos, Var%A_Index%
}
Gui Show
Return

Addpoints:
Gui Submit, NoHide
WinGet, CL, ControlListHwnd
StringReplace, CL, CL, `n, `n, UseErrorLevel
ControlCount := ErrorLevel - 1
if (Newpoints &gt; ControlCount)
{
   Loop % Newpoints - ControlCount
   {
      count++
      LastPositionY+=27
      Gui Add, Edit, % &quot;wp vVar&quot; count &quot; x&quot; LastPositionX &quot; y&quot; LastPositionY
   }
}
else
{
   Loop, Parse, CL, `n
   {
      If (A_Index = Newpoints + 2)
         GuiControlGet, LastPosition, Pos, %A_LoopField%
      If (A_Index &gt; Newpoints + 2)
         DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, A_LoopField)
   }
}
Gui Show, AutoSize
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-12T04:13:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121055#p121055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121042#p121042" />
			<content type="html"><![CDATA[<p>печалька .... буду че-нить другое изобретать ...</p>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-11-11T21:53:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121042#p121042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121041#p121041" />
			<content type="html"><![CDATA[<p>Думаю, будет не менее громоздко. Кроме того могут возникнуть проблемы, связанные с тем, что такое удаление не поддерживается GUI-синтаксисом AHK.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-11-11T21:50:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121041#p121041</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121040#p121040" />
			<content type="html"><![CDATA[<p>Кстати, вот линк:</p><p><a href="https://autohotkey.com/board/topic/88055-delete-gui-control/">https://autohotkey.com/board/topic/8805 … i-control/</a></p><p>Может чего не так понял ....</p>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-11-11T21:47:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121040#p121040</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121037#p121037" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, это я знаю - слишком громоздко получается, если show/hide использовать.</p><p>А что по поводу этого:</p><div class="codebox"><pre><code>DllCall(&quot;DestoryWindow&quot;, &quot;UInt&quot;, ControlID)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-11-11T21:30:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121037#p121037</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121036#p121036" />
			<content type="html"><![CDATA[<p>Лучше сразу создать максимальное количество контролов, а потом скрывать и показывать:<br /></p><div class="codebox"><pre><code>EditNumber := 2
editMaxNumber := 10

Loop % editMaxNumber
   list .= (A_Index = 1 ? &quot;&quot; : &quot;|&quot;) . A_Index

Gui, Add, Text, x50 y13 vText, Количество Edit Box:
Gui, Add, ComboBox, vEditNumber gChangeEditNumber x+5 yp-3 w40 Choose%EditNumber% r10, % list

GuiControlGet, Text, Pos
editW := TextW + 40*3 + 5

Loop % editMaxNumber
   Gui, Add, Edit, % &quot;x10 w&quot; . editW . &quot; vVar&quot; . A_Index . (A_Index &gt; EditNumber ? &quot; Hidden&quot; : &quot;&quot;)

GuiControlGet, Var%EditNumber%, Pos
Gui, Show, % &quot;h&quot; Var%EditNumber%Y + Var%EditNumber%H + 10
Return

ChangeEditNumber:
   GuiControlGet, EditNumber
   Loop % editMaxNumber
      GuiControl, % A_Index &gt; EditNumber ? &quot;Hide&quot; : &quot;Show&quot;, Var%A_Index%
   
   GuiControlGet, Var%EditNumber%, Pos
   Gui, Show, % &quot;h&quot; Var%EditNumber%Y + Var%EditNumber%H + 10
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-11-11T21:27:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121036#p121036</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121035#p121035" />
			<content type="html"><![CDATA[<p>Вот щас нарыл на забугорном форуме одну штуку. Пишут, что удаляет контролы, сам еще не разобрался и не пробовал.<br />Рабочих примеров тоже нет, тока это:</p><div class="codebox"><pre><code>DllCall(&quot;DestoryWindow&quot;, &quot;UInt&quot;, ControlID)</code></pre></div><p>Кто-нить пробовал это?</p><p>И ваще как ЭТО прикрутить к ТОМУ???</p>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-11-11T21:25:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121035#p121035</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121033#p121033" />
			<content type="html"><![CDATA[<p>Добавлять можно так:<br /></p><div class="codebox"><pre><code>GoSub, Addpoints
Gui Show
Return

F3::
Addpoints:
points++
Gui Add, Edit, v%points%
Gui Show, AutoSize
Return</code></pre></div><p>А удалять невозможно, только скрыть или уничтожить окно GUI целиком. Поэтому не используйте алгоритмы, в которых требуется удаление ЭУ.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-11-11T21:15:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121033#p121033</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Динамический Gui + A_Index]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121032#p121032" />
			<content type="html"><![CDATA[<p>Нужно сваять динамический gui с добавлением контролов.<br />Вот че получилось:</p><div class="codebox"><pre><code>points := 2

Gui Add, Text, w200 y20 Center, Количество Edit Box:
Gui Add, Edit, wp Center Limit1 vNewpoints gAddpoints, % points
Loop % points {
	Gui Add, Edit, % &quot;wp vVar&quot; A_Index
	}
Gui Show
Return

Addpoints:
	Gui Submit, NoHide
	Loop % Newpoints {
		Gui Add, Edit, % &quot;wp vVar&quot; A_Index
		}
	Gui Show, AutoSize
Return</code></pre></div><p>При увеличении количества Edit вываливает ошибку, типа &quot;Низя одну и ту же переменную юзать!&quot;.<br />Изменяю во втором цикле vVar на vVar1 - работает, но нужно чтоб было &quot;vVar&quot; A_Index<br />Кроме того, как потом уменьшить количество контролов?<br />Ведь такой опции нет, а только GuiControl hide .... GuiControl delete нету .... че делать???</p><p>Помогите пожалуйста ....</p>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-11-11T20:17:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121032#p121032</id>
		</entry>
</feed>
