<?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=8863&amp;type=atom" />
	<updated>2013-11-05T09:17:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8863</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение размеров Gui контролов - мышью]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=76930#p76930" />
			<content type="html"><![CDATA[<p>Лучше использовать &quot;gosub&quot; вместо таймера, иначе глюк получается при быстром перемещении.<br />И эта строчка ненужна:<br /></p><div class="codebox"><pre><code>GuiControl, +Redraw, SizeBar </code></pre></div><p>Периодически из-за этого исчезает второй Edit.</p><p>Больше нечем даже дополнить, код идеальный.</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2013-11-05T09:17:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=76930#p76930</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Изменение размеров Gui контролов - мышью]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=76924#p76924" />
			<content type="html"><![CDATA[<p>Попытался сделать аналог контрола SizeBar (серая полоска посередине), для изменения размеров полей:<br /></p><div class="codebox"><pre><code>
#SingleInstance Force  
#NoEnv
SetBatchLines, -1 
CoordMode, Mouse, Client
C_SIZEWE := DllCall(&quot;User32.dll\LoadCursor&quot;, &quot;Ptr&quot;, NULL, &quot;Int&quot;, 32644, &quot;UPtr&quot;)  
wSizeBar := 4, Margin := 2

Gui, Margin, 5, 5
Gui, -DPIScale
Gui, Add, Edit, w200 h200 -vscroll
Gui, Add, Progress, x+%Margin% yp hp w%wSizeBar% vSizeBar BackgroundDbbbbbb
Gui, Add, Edit, w200 h200 -vscroll x+%Margin%
Gui, Show  
OnMessage(0x200, &quot;SizeBar&quot;), OnMessage(0x201, &quot;SizeBar&quot;) 
Return  

SizeBar(wParam, lParam, msg) {
    Global C_SIZEWE, wSizeBar, Margin
    Static KeepSizeBar
    
    If (msg = 0x200) 
    { 
        If (A_GuiControl = &quot;SizeBar&quot;)
            DllCall(&quot;User32.dll\SetCursor&quot;, &quot;Ptr&quot;, C_SIZEWE) 
        If KeepSizeBar
        { 
            DllCall(&quot;User32.dll\SetCursor&quot;, &quot;Ptr&quot;, C_SIZEWE) 
            SetTimer, MoveSizeBar, -10
        }
    } 
    Else If (msg = 0x201 &amp;&amp; A_GuiControl = &quot;SizeBar&quot;) 
    {
        KeepSizeBar := 1
        KeyWait LButton
        KeepSizeBar := 0 
        GoSub MoveControls
    }
    Return
    
    MoveSizeBar:
        MouseGetPos, SizeBarX
        GuiControl, Move, SizeBar, x%SizeBarX% 
        GuiControl, +Redraw, SizeBar 
        Return
        
    MoveControls: 
        GuiControlGet, SizeBar, Pos  
        GuiControlGet, Edit1, Pos  
        GuiControl, Move, Edit1, % &quot;w&quot; SizeBarX-Edit1X-Margin 
        GuiControlGet, Edit2, Pos  
        GuiControl, Move, Edit2, % &quot;x&quot; SizeBarX+Margin+wSizeBar &quot; w&quot; (Edit2X+Edit2W)-SizeBarX-Margin-wSizeBar
        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-11-04T20:22:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=76924#p76924</id>
		</entry>
</feed>
