<?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=18417&amp;type=atom" />
	<updated>2025-04-05T15:40:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18417</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162194#p162194" />
			<content type="html"><![CDATA[<p>Я бы просто предотвратил появление контекстного меню, и, если&nbsp; нужно, показал бы свое с соответствующей обработкой.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-05T15:40:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162194#p162194</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162193#p162193" />
			<content type="html"><![CDATA[<p>Впрочем, эта мера не поможет, если удерживать клавишу, которой нет в списке.</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-05T09:35:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162193#p162193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162192#p162192" />
			<content type="html"><![CDATA[<p>В качестве обхода невозможности отловить вставку из контекстного меню, видимо, можно удалить опцию &quot;number&quot; -<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, w240 number hwndhEdit</code></pre></div><p>и воспользоваться следующим кодом в функции события, разрешив ввод перечисленных символов:<br /></p><div class="codebox"><pre><code>WM_CHAR(wp) {
   if (wp = 22) { ; Ctrl + V
      Clipboard := StrReplace(Clipboard, &quot; &quot;)
   }
   Chr := Chr(wp)
   if Chr not in 0,1,2,3,4,5,6,7,8,9
      Return 0
}</code></pre></div><p>Как добавить в этот список с цифрами - пробел?</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-05T09:21:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162192#p162192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162187#p162187" />
			<content type="html"><![CDATA[<p>Спасибо! Правильно понимаю, что событие вставки из контекстного меню не может быть так же обработано?</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-04T12:30:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162187#p162187</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162184#p162184" />
			<content type="html"><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>Gui, +AlwaysOnTop hwndMainWin
Gui, Font, s13 w400, Tahoma
Gui, Add, Edit, w240 number hwndhEdit
Gui, Add, Button,  default, OK
obj := {h: hEdit}
obj.f := fn := Func(&quot;SetDots&quot;).Bind(obj)
GuiControl, +g, %hEdit%, % fn
Gui, Show
OnMessage(0x102, &quot;WM_CHAR&quot;)
Return

WM_CHAR(wp) {
   if (wp = 22) { ; Ctrl + V
      Clipboard := StrReplace(Clipboard, &quot; &quot;)
   }
}

SetDots(obj)  {
   GuiControl, -g, % obj.h
   GuiControlGet, num,, % obj.h
   num := StrReplace(num, &quot; &quot;)
   GuiControl,, % obj.h, % RegExReplace(num, &quot;\d(?=(\d{3})+$)&quot;, &quot;$0 &quot;)
   Send {End}
   fn := obj.f
   GuiControl, +g, % obj.h, % fn
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-03T23:00:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162184#p162184</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162183#p162183" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong> Я примерно догадываюсь, что там надо добавить событие для вставки из буфера, но затрудняюсь с его поиском.</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T20:00:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162183#p162183</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162182#p162182" />
			<content type="html"><![CDATA[<p><strong>1srafel</strong> Для начала разберите каждую строку, что для чего. Тогда ясно станет всё. Если вы не понимаете элементарного, толку указывать что-то?</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2025-04-03T19:43:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162182#p162182</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162181#p162181" />
			<content type="html"><![CDATA[<p>Следующий код при вводе разбивает числовые разряды пробелами и допускает ввод только цифр. Как перехватить момент вставки числа с пробелами из буфера обмена, чтобы предварительно удалить пробелы?<br /></p><div class="codebox"><pre><code>Gui, +AlwaysOnTop hwndMainWin
Gui, Font, s13 w400, Tahoma
Gui, Add, Edit, w240 number hwndhEdit
Gui, Add, Button,  default, OK
obj := {h: hEdit}
obj.f := fn := Func(&quot;SetDots&quot;).Bind(obj)
GuiControl, +g, %hEdit%, % fn
Gui, Show
Return

SetDots(obj)  {
   GuiControl, -g, % obj.h
   GuiControlGet, num,, % obj.h
   num := RegExReplace(num, &quot; &quot;)
   GuiControl,, % obj.h, % RegExReplace(num, &quot;\d(?=(\d{3})+$)&quot;, &quot;$0 &quot;)
   Send {End}
   fn := obj.f
   GuiControl, +g, % obj.h, % fn
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T17:34:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162181#p162181</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162180#p162180" />
			<content type="html"><![CDATA[<p><strong>Alectric</strong>, спасибо!</p><div class="quotebox"><cite>1srafel пишет:</cite><blockquote><p>опция, для задания лимита цифр, которые можно ввести в Gui-окно - например, не более 18 цифр?</p></blockquote></div><div class="codebox"><pre><code>Gui, Add, Edit, Limit18</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T16:44:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162180#p162180</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162179#p162179" />
			<content type="html"><![CDATA[<p>Наверно так:<br /></p><div class="codebox"><pre><code>
...
Gui, Add, Edit, w240 number vnumber hwndhEdit
...
ButtonOK:
  Gui, Submit
  MsgBox, %number%
...
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2025-04-03T14:22:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162179#p162179</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162178#p162178" />
			<content type="html"><![CDATA[<p>Как передать введенное число в MsgBox по нажатии кнопки OK?</p><div class="codebox"><pre><code>Gui, +AlwaysOnTop hwndMainWin
Gui, Font, s13 w400, Tahoma
Gui, Add, Edit, w240 number hwndhEdit
Gui, Add, Button,  default, OK
obj := {h: hEdit}
obj.f := fn := Func(&quot;SetDots&quot;).Bind(obj)
GuiControl, +g, %hEdit%, % fn
Gui, Show
Return

SetDots(obj)  {
   GuiControl, -g, % obj.h
   GuiControlGet, num,, % obj.h
   num := RegExReplace(num, &quot; &quot;)
   GuiControl,, % obj.h, % RegExReplace(num, &quot;\d(?=(\d{3})+$)&quot;, &quot;$0 &quot;)
   Send {End}
   fn := obj.f
   GuiControl, +g, % obj.h, % fn
}
GuiClose:
   ExitApp

ButtonOK:
   Gui, Submit

   MsgBox, %hEdit%

   Pause
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T01:42:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162178#p162178</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162177#p162177" />
			<content type="html"><![CDATA[<p>Есть ли аналогичная &quot;+Number&quot; опция, для задания лимита цифр, которые можно ввести в Gui-окно - например, не более 18 цифр?</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T01:21:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162177#p162177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162176#p162176" />
			<content type="html"><![CDATA[<p>Все-таки, работает -<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, w150 number hwndhEdit
obj := {h: hEdit}
obj.f := fn := Func(&quot;SetDots&quot;).Bind(obj)
GuiControl, +g, %hEdit%, % fn
Gui, Show
Return

SetDots(obj)  {
   GuiControl, -g, % obj.h
   GuiControlGet, num,, % obj.h
   num := RegExReplace(num, &quot; &quot;)
   GuiControl,, % obj.h, % RegExReplace(num, &quot;\d(?=(\d{3})+$)&quot;, &quot;$0 &quot;)
   Send {End}
   fn := obj.f
   GuiControl, +g, % obj.h, % fn
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T01:14:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162176#p162176</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162175#p162175" />
			<content type="html"><![CDATA[<p>По ссылке есть решение для точки, но с пробелом не срабатывает - <a href="https://forum.script-coding.com/viewtopic.php?pid=126480#p126480">?pid=126480#p126480</a>.</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T01:09:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162175#p162175</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Gui для ввода цифр с отбивкой разрядов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162174#p162174" />
			<content type="html"><![CDATA[<p>Есть ли возможность при вводе чисел в окно GUI - разряды отделять пробелом/отступом, как это сделано во встроенном калькуляторе? Напр.: 8 201 794.<br /></p><div class="codebox"><pre><code>Gui, +AlwaysOnTop hwndMainWin
Gui, Font, s12 w400, Tahoma
Gui, Add, Edit, x+0 yp4 w252 h24 +Center +Number vToggleLen
Gui, Show, Center w400 h100, %script_name%
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-03T01:03:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162174#p162174</id>
		</entry>
</feed>
