<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Авто размер GUI, в зависимости от "Text"]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7388&amp;type=atom" />
	<updated>2013-04-28T18:25:38Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7388</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71722#p71722" />
			<content type="html"><![CDATA[<p><span class="postimg"><img src="http://xbmc.ru/forum/images/smilies/facepalm.gif" alt="http://xbmc.ru/forum/images/smilies/facepalm.gif" /></span><br />Да и сабж упрощает тоже:<br /></p><div class="codebox"><pre><code>
Gui +AlwaysOnTop +ToolWindow -0x400000 +E0x08000000
Gui Font, % &quot;bold italic cWhite s&quot; Font := 32, Times New Roman  
Gui Color, 696969

Space::
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, hText)
    Gui Add, Text, hwndhText x%Font% y%Font%, % (T := !T) ? &quot;...&quot; : &quot;Очень`n             длинный текст&quot;  
    Gui Show, NA x5 y5 AutoSize
    Return
</code></pre></div><p>,</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-28T18:25:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71722#p71722</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71721#p71721" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong><br /><img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> ну задавая ширину тексту конечно-же всё просто и очевидно (хотя подобрать под каждый, и чтобы всё ровно было... способ не айс). Речь то про то, что текст заранее неизвестен. </p><p>Но напоминание про AutoSize немного помогло упростить код из 35 поста <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-28T17:52:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71721#p71721</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71718#p71718" />
			<content type="html"><![CDATA[<p>Это был ответ на вопрос о том, как сделать чтоб окно не мелькало, то есть без использования Gui, Destroy.</p><div class="codebox"><pre><code>Gui, +AlwaysOnTop -Border +ToolWindow +Disabled
Gui, Color,  Blue
Gui, font, s22 cWhite
Gui, Add, Text, vMyText, Text0
Gui, Show, NoActivate x5 y5
Return

1::
Config = ...
w := 100
Gosub, GuiConfig
Return

2::
Config = Очень длинный текст
w := 400
Gosub, GuiConfig
Return

GuiConfig:
GUIControl, , MyText, %Config%
GuiControl, MoveDraw, MyText, w%w%
Gui, Show, AutoSize</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2013-04-28T15:44:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71718#p71718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71714#p71714" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong><br />Сильно похоже на голую теорию.<br />Вы код можете привести?</p><p>--------------</p><p>Это как раз было первым что пришло в голову, и сразу ушло:<br /></p><div class="codebox"><pre><code>Space::
    Gui, +AlwaysOnTop -0x400000 +E0x08000000 
    Gui, Color, % T ? &quot;95746A&quot; : &quot;FF8C00&quot;
    Gui, Font, % &quot;Italic s&quot; (T ? &quot;18 cWhite&quot;: &quot;200 c95746A&quot;), Times New Roman 
    Gui Add, Text, x20 y20 Center, % (T := !T) ? &quot;...&quot; : &quot;Очень`n`nдлинный текст&quot;  
    Gui, Show, AutoSize
    Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-28T12:59:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71714#p71714</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71712#p71712" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Как сделать чтоб окно не мелькало, то есть видимо без использования Gui, Destroy.</p></blockquote></div><p>Лишний раз выполнить команду <em>Gui, Show, AutoSize</em>.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2013-04-28T11:31:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71712#p71712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71702#p71702" />
			<content type="html"><![CDATA[<p>Использование клона окна для относительного позиционирования контролов, и перерисовки окна:</p><div class="codebox"><pre><code>
Gui Add, Text, Center vText
Gui, Add, GroupBox, Center vGroupBox
Gui, Add, Button, vButton1 
Gui, Add, Button, vButton2 
Gui, Add, Button, vButton3
Gui, Show
Gosub Space
Return 
    
Space::
    Text := (T := !T) ? &quot;наблюдаем &quot; : &quot;`n`n`n`nза поведением текста`n`n`n`nи кнопок`n`n`n`n&quot;
    Button := (T) ? &quot;min&quot; : &quot;MAXIMIZE&quot; 
    Gui, Clo:Add, Text, vText xm+10 ym+30 Center, % Text
    Gui, Clo:Add, GroupBox, vGroupBox xp-10 ys-20 wp+20 hp+30
    Gui, Clo:Add, Button, vButton2 x+15 y+15 Section, % Button
    Gui, Clo:Add, Button, vButton1 xm ys, % Button
    Gui, Clo:Add, Button, vButton3 xs ym, % Button
    GuiControl, , % Move(&quot;Text&quot;), % Text 
    GuiControl, , % Move(&quot;Button1&quot;), % Button
    GuiControl, , % Move(&quot;Button2&quot;), % Button
    GuiControl, , % Move(&quot;Button3&quot;), % Button 
    GuiControl, , % Move(&quot;GroupBox&quot;), % Button 
    Gui, Clo:Destroy 
    Gui, Show, AutoSize
    Return 
    
Move(Control) {
    GuiControlGet, Pos, Clo:Pos, % Control
    GuiControl, Move, % Control, w%Posw% h%Posh% x%Posx% y%Posy%   
    Return Control
} 
</code></pre></div><p>Или:<br /></p><div class="codebox"><pre><code>
Space::
    Text := (T := !T) ? &quot;наблюдаем &quot; : &quot;`n`n`n`nза поведением текста`n`n`n`nи кнопок`n`n`n`n&quot;
    Button := (T) ? &quot;min&quot; : &quot;MAXIMIZE&quot; 
    
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, hText)
    Gui Add, Text, xm+10 ym+30 Center hwndhText, % Text
    
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, GroupBox)
    Gui, Add, GroupBox, xp-10 yp-20 wp+20 hp+30 Center hwndGroupBox, % Button
    
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, Button1 )
    Gui, Add, Button, hwndButton1  x+15 y+15 Section, % Button
    
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, Button2)
    Gui, Add, Button, hwndButton2 xm ys, % Button
    
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, Button3)
    Gui, Add, Button, hwndButton3 xs ym+15, % Button
    
    Gui, Show, AutoSize 
    Return 
</code></pre></div><p>Есть идеи попроще?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-27T20:19:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71702#p71702</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71238#p71238" />
			<content type="html"><![CDATA[<p>Решил сделать своеобразный ToolTip. <br />И вопросик появился:&nbsp; возможно ли как-то сделать его поверх всех окон? То есть и поверх тех что тоже имеют стиль &quot;AlwaysOnTop&quot;.<br /></p><div class="codebox"><pre><code>

#SingleInstance force   

Space::
    Gui, +AlwaysOnTop -0x400000 +E0x08000000 
    Gui, Color, % T ? &quot;95746A&quot; : &quot;FF8C00&quot;
    Gui, Font, % &quot;Italic s&quot; (T ? &quot;18 cWhite&quot;: &quot;200 c95746A&quot;), Times New Roman
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, hStatic)
    Gui Add, Text, hwndhStatic x20 y20 Center, % (T := !T) ? &quot;...&quot; : &quot;Очень`n`nдлинный текст&quot; 
    GuiControlGet, Pos, Pos, %hStatic%    
    MouseGetPos, mX, mY
    Gui, Show, % &quot;NA x&quot; mX+15 &quot; y&quot; mY+15 &quot; w&quot; PosX*2+PosW &quot; h&quot; PosY*2+PosH
    Return
    
Esc::
    GuiClose:
    ExitApp  

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-09T17:55:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71238#p71238</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71184#p71184" />
			<content type="html"><![CDATA[<p>Решение:<br /></p><div class="codebox"><pre><code> 
Gui +AlwaysOnTop +ToolWindow -0x400000 +E0x08000000
Gui Font, % &quot;s&quot; Font := 22  
Gui Color, FF8C00

Space::
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, hText)
    Gui Add, Text, hwndhText x%Font% y%Font%, % (T := !T) ? &quot;...&quot; : &quot;Очень`n             длинный текст&quot;  
    Gui Show, NA x5 y5 AutoSize
    Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-07T20:42:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71184#p71184</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71182#p71182" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Эх, над дилетантом подшучиваете <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><div class="codebox"><pre><code>
Gui, -Border
Gui, Font, s22
Gui Add, Text, hwndhStatic
Return

Space::
    DllCall(&quot;DestroyWindow&quot;, &quot;Ptr&quot;, hStatic)
    Gui Add, Text, hwndhStatic x10 y15, % (T := !T) ? &quot;...&quot; : &quot;Очень длинный текст &quot;
    GuiControlGet, Pos, Pos, %hStatic% 
    Gui, Show, % &quot;x5 y5 w&quot; PosX*2+PosW &quot; h&quot; PosY*2+PosH
    Return
</code></pre></div><p>Для решения задачки вроде подходит. Или я что-то снова недопонял...</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-07T20:27:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71182#p71182</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71177#p71177" />
			<content type="html"><![CDATA[<p>Точно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2013-04-07T19:15:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71177#p71177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71176#p71176" />
			<content type="html"><![CDATA[<p>То есть исключительно для освобождения ресурсов?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-07T19:12:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71176#p71176</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71174#p71174" />
			<content type="html"><![CDATA[<p>Удаление можно использовать для изменения вида GUI, если есть уверенность, что удаляемый контрол больше не понадобится.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2013-04-07T19:07:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71174#p71174</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71172#p71172" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Не знаю, ссылка на пример же была дана</p></blockquote></div><p>Не очень нравится как оно работает, не много тормознуто и не всегда ровно.</p><p>А как (где, зачем) в принципе можно использовать удаление hwnd?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-07T19:01:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71172#p71172</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71170#p71170" />
			<content type="html"><![CDATA[<p>Не знаю, <a href="http://forum.script-coding.com/viewtopic.php?pid=53476#p53476">ссылка</a> на пример же была дана. Там функция для определения размера текста.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2013-04-07T18:56:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71170#p71170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Авто размер GUI, в зависимости от "Text"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=71168#p71168" />
			<content type="html"><![CDATA[<p>Удаление hwnd, это интересно.<br />А это может как-то решить сабж?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-04-07T18:35:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=71168#p71168</id>
		</entry>
</feed>
