<?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=5947&amp;type=atom" />
	<updated>2011-12-01T14:43:59Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5947</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54113#p54113" />
			<content type="html"><![CDATA[<p>Это уже совсем другая тема. Создавайте её отдельно, описывайте подробно, прикладывайте код.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-12-01T14:43:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54113#p54113</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54112#p54112" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong>, спасибо, не знаю как я недоглядел <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /></p><p>У меня появился еще один вопрос, чтобы не создавать новую тему, спрошу здесь:</p><p>Мой скрипт сохраняет сочетания клавиш для разных функций в ini-файл, а при запуске берет настройки оттуда. Проблема такова: если записываешь сочетание, содержащее латинские буквы, то при запуске по умолчанию русская раскладка и сочетания отказываются отображаться в gui hotkey. При смене дефолтного языка системы на английский проблема исчезает. Подскажите, как лучше решить? Проверять раскладку при запуске и менять ее? Другого способа я не смог придумать. Если необходим код скрипта - предоставлю.</p>]]></content>
			<author>
				<name><![CDATA[mj]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27396</uri>
			</author>
			<updated>2011-12-01T14:31:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54112#p54112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54105#p54105" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>IniRead, MoveCheckVar, settings.ini, MoveSettings, enable
Gui, Add, CheckBox, vMoveCheck checked%MoveCheckVar% x6 y7 w190 h20, Move tables
Gui, Add, Button, x326 y247 w90 h20 , Save
Gui, Show, x821 y86 h280 w427,
Return

GuiClose:
ExitApp

ButtonSave:
    GuiControlGet, MoveCheckVar,, MoveCheck
    ;MsgBox, %MoveCheckVar%
    IniWrite, %MoveCheckVar%, settings.ini, MoveSettings, enable    
    Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-12-01T12:40:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54105#p54105</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54103#p54103" />
			<content type="html"><![CDATA[<p>Здравствуйте, прошу помощи - не могу прочитать значение чекбокса в ini файле. <br />Ни один из методов, приведенных здесь, не работает. <br />Что я делаю не так?<br /></p><div class="codebox"><pre><code>IniRead, MoveCheckVar, settings.ini, MoveSettings, enable
Gui, Add, CheckBox, vMoveCheck checked%MoveCheckVar% x6 y7 w190 h20, Move tables
Gui, Add, Button, x326 y247 w90 h20 , Save
Gui, Show, x821 y86 h280 w427,
Return

GuiClose:
ExitApp

ButtonSave:
    GuiControlGet, MoveCheckVar,, MoveCheck
    MsgBox, MoveCheckVar
    ;~ IniWrite, MoveCheckVar, settings.ini, MoveSettings, enable    
    Return</code></pre></div><p>Выдает значение переменной MoveCheckVar=MoveCheckVar.<br />По моей задумке кнопка &quot;Save&quot; считывает положение чекбокса (0/1) и записывает его в необходимый раздел в ini-файле (значение будет использоваться далее в скрипте). Считать не получается, в чем ошибка?</p>]]></content>
			<author>
				<name><![CDATA[mj]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27396</uri>
			</author>
			<updated>2011-12-01T12:13:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54103#p54103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49776#p49776" />
			<content type="html"><![CDATA[<p><strong>InFlames</strong> Спасибо. Все замечательно работает. А я ходил совсем рядом, но так и не хватило наверно практики, а может быть и ума <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br /><strong>ypppu</strong> Пропиши Check3 и у тебя появится третий параметр - в квадратике серая галочка!</p>]]></content>
			<author>
				<name><![CDATA[DaVinchi]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26386</uri>
			</author>
			<updated>2011-07-08T17:19:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49776#p49776</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49775#p49775" />
			<content type="html"><![CDATA[<p>Тоже приведу пример.<br /></p><div class="codebox"><pre><code>var := 1

GUI, Add, Checkbox, vMyCheckbox
GuiControl, , MyCheckbox, % var
GUI, Show</code></pre></div><p>Насколько я понял, если переменная <em>var</em> примет значение 0, квадратик будет пустой; если 1 - отмеченный; если -1, то отмеченный серым цветом. Хотя, при -1 он у меня просто отмечен.&nbsp; <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" /></p><div class="quotebox"><cite>AutoHotkey Help (ENG) пишет:</cite><blockquote><p>Checkbox: Param3 can be 0 to uncheck the button, 1 to check it, or -1 to give it a gray checkmark. Otherwise, Param3 is assumed to be the control&#039;s new caption/text. See Text below for how to override this behavior.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-07-08T16:51:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49775#p49775</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49774#p49774" />
			<content type="html"><![CDATA[<p>Присвоить переменную элементу checkbox<br /></p><div class="codebox"><pre><code>
CheckBoxVar=0 ; или 1. Если не определена, то чекбокс будет отмечен
Gui, Add, Checkbox, vCheckBoxVar checked%CheckBoxVar%, Элемент CheckBox</code></pre></div><p>После выполнения <br /></p><div class="codebox"><pre><code>gui, submit</code></pre></div><p>Этой переменной CheckBoxVar будет присвоено значение 0 или 1, в зависимости от состояние контрола.</p><p>Далее уже эту переменную записываете в INI.</p><p>Прочитайте про iniwrite внимательнее, в примерах показано, что туда писать.</p>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2011-07-08T16:39:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49774#p49774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49773#p49773" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Grey пишет:</cite><blockquote><p><a href="http://www.script-coding.com/AutoHotkey/IniWrite.html">IniWrite</a></p></blockquote></div><p>Я как бы знаю команду! Я знаю как ее использовать. Но с <strong>Checkbox</strong> я еще толком не разобрался!<br />Я так понимаю, что при загрузке скрипта, должно проходить чтение <em>*.ini</em> файла и загружать параметр для <strong>Checked</strong>.<br />Что мне писать в параметрах <strong>Checkbox</strong> и тут<br /></p><div class="codebox"><pre><code>IniWrite, %?%, setup.ini, setup, ChBox</code></pre></div><p>Самое интересное, что записывает нормально. А вот загружает пустой <strong>Checkbox</strong></p>]]></content>
			<author>
				<name><![CDATA[DaVinchi]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26386</uri>
			</author>
			<updated>2011-07-08T16:13:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49773#p49773</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49772#p49772" />
			<content type="html"><![CDATA[<p><a href="http://www.script-coding.com/AutoHotkey/IniWrite.html">IniWrite</a></p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-07-08T15:14:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49772#p49772</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49771#p49771" />
			<content type="html"><![CDATA[<p>Спасибо. Это действительно помогло.<br />Появился новый вопрос. Как заставить сохранять параметр <strong>Checkbox</strong> в *.INI. То что это IniRead я понимаю. Но что то не получается сохранить.</p>]]></content>
			<author>
				<name><![CDATA[DaVinchi]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26386</uri>
			</author>
			<updated>2011-07-08T14:51:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49771#p49771</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49770#p49770" />
			<content type="html"><![CDATA[<p>Вот такой пример, надеюсь, поможет.<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, vmyPIN x107 y97 w90 h20 gMySubroutine,
Gui, Show, xCenter yCenter h132 w204, Введите ПИН
Return

MySubroutine:
GUI, Submit, NoHide
If StrLen(myPIN) = 4
MsgBox, Введено четыре символа!</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-07-08T14:37:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49770#p49770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49769#p49769" />
			<content type="html"><![CDATA[<p>Да пробовал я так. Прикол в том, что при достижении 4х знаков переходит к <strong>SaveLogin2</strong>, но записывает <br /></p><div class="codebox"><pre><code>Gui, Add, Edit, vmyPIN x107 y97 w90 h20 +0x800, % myPIN</code></pre></div><p>эту строку в *.INI только 3 часла из 4х <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[DaVinchi]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26386</uri>
			</author>
			<updated>2011-07-08T14:03:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49769#p49769</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49768#p49768" />
			<content type="html"><![CDATA[<p>Вместо </p><div class="codebox"><pre><code>Else gosub, SaveLogin2</code></pre></div><p>написать </p><div class="codebox"><pre><code>if strlen(mypin)=4
   gosub, SaveLogin2</code></pre></div>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2011-07-08T13:15:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49768#p49768</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49761#p49761" />
			<content type="html"><![CDATA[<p><strong>kirtech, ypppu</strong> Спасибо. Немного разобрался. Оказалось, что я просто пропустил описание <strong>Типы элементов управления GUI</strong> и по этому не разобрался сразу.<br />Но как я не крутил, все равное не получается, что бы при достижении 4х цифры в окне Edit, автоматически переходило к <em>SaveLogin2</em>. Дело в том, что по идее кнопки OK не предусмотрено. И активироваться введенный пин должен по достижению нужного количества знаков в строке.</p><p>Upd.<br />Немного подумал и получилось вот что:<br /></p><div class="codebox"><pre><code>buttonchek:
AddNum:=A_GuiControl
If AddNum Is Number
If StrLen(myPIN)&lt;4
myPIN .=AddNum
Else gosub, SaveLogin2
GuiControl,, myPIN, % myPIN
return</code></pre></div><p>Т.е. по достижению 4х цифр, при нажатии 5й идет переход к SaveLogin2. Но это немного не то пальто. Нужно что бы сразу после введения 4х знаков, шел переход.</p>]]></content>
			<author>
				<name><![CDATA[DaVinchi]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26386</uri>
			</author>
			<updated>2011-07-08T11:53:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49761#p49761</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI прикрепляем к скрипту]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49760#p49760" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>DaVinchi пишет:</cite><blockquote><p>И как сделать так, что бы вводить эти цифры можно было только нажимая на кнопки GUI (запретить с клавиатуры). А по введению к примеру 4х цифр выполнялось <strong>Gosub</strong> автоматически, без нажатия дополнительных клавиш?</p></blockquote></div><div class="codebox"><pre><code>Gui, Destroy
Gui, Font, Courier New
Gui, Add, Button, x4 y82 w24 h21 gbuttonchek, 0
Gui, Add, Button, x62 y56 w24 h21 gbuttonchek, 9
Gui, Add, Button, x33 y56 w24 h21 gbuttonchek, 8
Gui, Add, Button, x4 y56 w24 h21 gbuttonchek, 7
Gui, Add, Button, x62 y30 w24 h21 gbuttonchek, 6
Gui, Add, Button, x33 y30 w24 h21 gbuttonchek, 5
Gui, Add, Button, x4 y30 w24 h21 gbuttonchek, 4
Gui, Add, Button, x62 y4 w24 h21 gbuttonchek, 3
Gui, Add, Button, x33 y4 w24 h21 gbuttonchek, 2
Gui, Add, Button, x4 y4 w24 h21 gbuttonchek, 1
Gui, Add, Button, gSaveLogin2 x36 y82 w50 h20 vOkbt, OK
Gui, Add, Edit, vmyPIN x107 y97 w90 h20 +0x800, % myPIN ; ES_READONLY 0x800 ES_NUMBER 0x2000 
Gui, Add, Text, x107 y9 w81 h72 , 
Gui, Add, Picture, x106 y7 w85 h74 , logo.bmp
Gui, Show, xCenter yCenter h132 w204, Введите ПИН
Return

SaveLogin2:
Return

buttonchek:
AddNum:=A_GuiControl
If AddNum Is Number
If StrLen(myPIN)&lt;4
myPIN .=AddNum
Else myPIN=
GuiControl,, myPIN, % myPIN
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kirtech]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26525</uri>
			</author>
			<updated>2011-07-08T10:53:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49760#p49760</id>
		</entry>
</feed>
