<?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=9991&amp;type=atom" />
	<updated>2014-09-23T05:13:50Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9991</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: (GUI) Как сделать размер окна изменяемым]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86674#p86674" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>NektoN95 пишет:</cite><blockquote><p>О, спасибо, про GuiSize не знал. И вот еще что любопытно: возможно ли в строке Gui, Add задать размеры и координаты выражением или ссылкой на переменную?</p></blockquote></div><p>Можно, хоть частью объекта:<br /></p><div class="codebox"><pre><code>Controls := {[&quot;Sample1&quot;, &quot;x12 y10 w230 h360&quot;]: &quot;Edit&quot;
            ,[&quot;Sample2&quot;, &quot;x252 y10 w220 h360&quot;]: &quot;Edit&quot;
            ,[&quot;Exit&quot;, &quot;gGuiClose x210 y345 w80 h30&quot;]: &quot;Button&quot;}
Gui, +Resize +MinSize479x379
for k,v in Controls
   Gui, Add, % v, % k[2], % k[1]
Gui, Show, x127 y87 h379 w479, New

wRatio1 := 230/(230 + 10 + 220)   ; 10 — расстояние между полями Edit
Return

GuiClose:
ExitApp

GuiSize:
   wEdit1 := (A_GuiWidth - (479 - (230 + 10 + 220)))*wRatio1
   xEdit2 := 12 + wEdit1 + 10
   wEdit2 := A_GuiWidth - (479 - (230 + 220)) - wEdit1
   hEdit := A_GuiHeight - (410 - 360)
   xButton1 := wEdit2 - 10, yButton1 := hEdit + 15
   
   GuiControl, Move, Edit1, w%wEdit1% h%hEdit%
   GuiControl, Move, Edit2, x%xEdit2% w%wEdit2% h%hEdit%
   GuiControl, Move, Button1, x%xButton1% y%yButton1%
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2014-09-23T05:13:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86674#p86674</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: (GUI) Как сделать размер окна изменяемым]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86672#p86672" />
			<content type="html"><![CDATA[<p>Чтоб поменьше мельканий, можно так:<br /></p><div class="codebox"><pre><code>Gui, +Resize +MinSize479x379
Gui, Add, Edit, x12 y10 w230 h360 , Edit
Gui, Add, Edit, x252 y10 w220 h360 , Edit
Gui, Show, x127 y87 h379 w479, New

wRatio1 := 230/(230 + 10 + 220)   ; 10 — расстояние между полями Edit
Return

GuiClose:
ExitApp

GuiSize:
   wEdit1 := (A_GuiWidth - (479 - (230 + 10 + 220)))*wRatio1
   xEdit2 := 12 + wEdit1 + 10
   wEdit2 := A_GuiWidth - (479 - (230 + 220)) - wEdit1
   hEdit := A_GuiHeight - (379 - 360)
   
   GuiControl, Move, Edit1, w%wEdit1% h%hEdit%
   GuiControl, Move, Edit2, x%xEdit2% w%wEdit2% h%hEdit%
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2014-09-23T04:40:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86672#p86672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: (GUI) Как сделать размер окна изменяемым]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86669#p86669" />
			<content type="html"><![CDATA[<p>О, спасибо, про GuiSize не знал. И вот еще что любопытно: возможно ли в строке Gui, Add задать размеры и координаты выражением или ссылкой на переменную?</p>]]></content>
			<author>
				<name><![CDATA[NektoN95]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32518</uri>
			</author>
			<updated>2014-09-23T02:45:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86669#p86669</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: (GUI) Как сделать размер окна изменяемым]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86668#p86668" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Затем потребуется отлавливать сообщения или периодически проверять размер окна.</p></blockquote></div><p>А почему бы не использовать встроенные метку <em>GuiSize</em> и переменные <em>A_GuiWidth</em> и <em>A_GuiHeight</em>?<br /></p><div class="codebox"><pre><code>Gui, +Resize +MinSize479x379
Gui, Add, Edit, x12 y10 w230 h360 , Edit
Gui, Add, Edit, x252 y10 w220 h360 , Edit
Gui, Show, x127 y87 h379 w479, New

wRatio1 := 230/(230 + 10 + 220)   ; 10 — расстояние между полями Edit
Return

GuiClose:
ExitApp

GuiSize:
   wEdit1 := (A_GuiWidth - (479 - (230 + 10 + 220)))*wRatio1
   xEdit2 := 12 + wEdit1 + 10
   wEdit2 := A_GuiWidth - (479 - (230 + 220)) - wEdit1
   hEdit := A_GuiHeight - (379 - 360)
   
   GuiControl, Move, Edit1, w%wEdit1%
   GuiControl, Move, Edit1, h%hEdit%
   GuiControl, Move, Edit2, x%xEdit2%
   GuiControl, Move, Edit2, w%wEdit2%
   GuiControl, Move, Edit2, h%hEdit%
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-09-22T21:14:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86668#p86668</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: (GUI) Как сделать размер окна изменяемым]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86666#p86666" />
			<content type="html"><![CDATA[<p>Для начала<br /></p><div class="codebox"><pre><code>GUI, +Resize</code></pre></div><p>Затем потребуется отлавливать сообщения или периодически проверять размер окна. Во сколько раз изменился размер окна, во столько раз изменять размеры элементов управления.</p><div class="quotebox"><blockquote><p>а так же присутствовал некоторый размер по умолчанию, меньше которого окно уменьшиться бы не могло</p></blockquote></div><div class="codebox"><pre><code>GUI, MinSize</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2014-09-22T19:26:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86666#p86666</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: (GUI) Как сделать размер окна изменяемым]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86662#p86662" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Gui, Add, Edit, x12 y10 w230 h360 , Edit
Gui, Add, Edit, x252 y10 w220 h360 , Edit
Gui, Show, x127 y87 h379 w479, New
Return

GuiClose:
ExitApp</code></pre></div><p>Как сделать так, чтобы пользователь мог изменять размер окна при наведении на его края и зажатии левой кнопки, причем так, что бы размеры полей Edit изменялись соответственно, а так же присутствовал некоторый размер по умолчанию, меньше которого окно уменьшиться бы не могло?</p>]]></content>
			<author>
				<name><![CDATA[NektoN95]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32518</uri>
			</author>
			<updated>2014-09-22T18:08:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86662#p86662</id>
		</entry>
</feed>
