CyberSlug Posted October 23, 2004 Posted October 23, 2004 I'm attempting to simulate a selection rectangle..... but the GUI does not appear to refresh correctly, and I get a lot of "ghost" lines as I resize the rectangle.... Suggestions? GuiCreate("Mouse down ... drag southeast ... mouse up") Dim $p[2];used to backup previous mouse position $rect = GuiCtrlCreateLabel("foo", -99, -99, 1, 1, 0x107) ;transparent label with black border GuiSetState() Do $i = GUIGetCursorInfo() If $i[2] == 1 Then;primary mouse is down If $p[0] = -99 Then $p[0] = $i[0];x-coord If $p[1] = -99 Then $p[1] = $i[1];y-coord GUICtrlSetPos($rect, $p[0], $p[1], $i[0]-$p[0], $i[1]-$p[1]) Else GUICtrlSetPos($rect, -99, -99, 1, 1) $p[0] = -99 $p[1] = -99 EndIf Until GuiGetMsg() = -3 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
megahyperion Posted October 23, 2004 Posted October 23, 2004 I'm not sure what this script does but I dont get any ghosting with it. I only get a grey window that appears to do nuthing.
jpm Posted October 23, 2004 Posted October 23, 2004 I'm attempting to simulate a selection rectangle..... but the GUI does not appear to refresh correctly, and I get a lot of "ghost" lines as I resize the rectangle....Suggestions?GuiCreate("Mouse down ... drag southeast ... mouse up") Dim $p[2];used to backup previous mouse position $rect = GuiCtrlCreateLabel("foo", -99, -99, 1, 1, 0x107);transparent label with black border GuiSetState() Do $i = GUIGetCursorInfo() If $i[2] == 1 Then;primary mouse is down If $p[0] = -99 Then $p[0] = $i[0];x-coord If $p[1] = -99 Then $p[1] = $i[1];y-coord GUICtrlSetPos($rect, $p[0], $p[1], $i[0]-$p[0], $i[1]-$p[1]) Else GUICtrlSetPos($rect, -99, -99, 1, 1) $p[0] = -99 $p[1] = -99 EndIf Until GuiGetMsg() = -3<{POST_SNAPBACK}>I just upload a new AutoIt3-gui tha's solved the problem for you I hope I din't create more filckering problem for others
Josbe Posted October 23, 2004 Posted October 23, 2004 I just upload a new AutoIt3-gui tha's solved the problem for you I hope I din't create more filckering problem for others <{POST_SNAPBACK}>It's good to know that..... (I had this problem too. I thought that it could be a limitation) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
CyberSlug Posted October 23, 2004 Author Posted October 23, 2004 I just upload a new AutoIt3-gui tha's solved the problem for you I hope I din't create more filckering problem for others <{POST_SNAPBACK}>Yikes, my AutoBuilder Prototype has major flickering problems with that AutoIt3-gui Try the following (use the background.bmp file from AutoBuilder):GuiCreate("Mouse down ... drag southeast ... mouse up") Dim $p[2];used to backup previous mouse position $rect = GuiCtrlCreateLabel("foo", -99, -99, 1, 1, 0x107) ;transparent label with black border $background = GuiCtrlCreatePic(@ScriptDir & "\background.bmp", 100, 100, 1024, 768) $button = GuiCtrlCreateButton("Button", 200, 200, 100, 40) GuiSetState() Do $i = GUIGetCursorInfo() If $i[2] == 1 Then;primary mouse is down If $p[0] = -99 Then $p[0] = $i[0];x-coord If $p[1] = -99 Then $p[1] = $i[1];y-coord GUICtrlSetPos($rect, $p[0], $p[1], $i[0]-$p[0], $i[1]-$p[1]) Else GUICtrlSetPos($rect, -99, -99, 1, 1) $p[0] = -99 $p[1] = -99 EndIf Until GuiGetMsg() = -3 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
jpm Posted October 24, 2004 Posted October 24, 2004 (edited) Yikes, my AutoBuilder Prototype has major flickering problems with that AutoIt3-gui I found a solution for not flickering but the bad news is that on the .bmp is not painting. see AutoitGui.6I think that is due to overlap control. I don't if i will ever find a solution on this overlap problem. EDIT: I got a solution create the .bmp before the label Edited October 24, 2004 by jpm
CyberSlug Posted October 24, 2004 Author Posted October 24, 2004 (edited) I've tried creating the .bmp before the label .... it works okay, but there is still a bit of flicker with AutoBuilder when I move the mouse over a control (due to overlay label) Edited October 24, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
jpm Posted October 24, 2004 Posted October 24, 2004 I've tried creating the .bmp before the label .... it works okay, but there is still a bit of flicker with AutoBuilder when I move the mouse over a control (due to overlay label) <{POST_SNAPBACK}>I see the flickering no idea what the relation with the modification I did for CtrlSetPos I have a look if I can avoid it
jpm Posted October 24, 2004 Posted October 24, 2004 I am not sure to understand the prototype but It looks like you need to us GuiCtrlSetPos during the move of the mouse. If yes what is the exact line(s) in the 16 oct version so I can find a go around
CyberSlug Posted October 24, 2004 Author Posted October 24, 2004 jpm, please try this simplified AutoBuilder-like code..... (You need the background.bmp file from AutoBuilder) GuiCreate("Refresh Example...") $overlay = GuiCtrlCreateLabel("", -99, -99, 1, 1, 0x107);transparent label with black border $background = GUICtrlCreatePic(@ScriptDir & "\background.bmp", 0, 0, 1024,768);used to show a grid GUICtrlSetState($background, 128);disable background so $i[4] below contains a useful value... $button1 = GuiCtrlCreateButton("Button1", 130, 130, 100, 30) $button2 = GuiCtrlCreateButton("Button2", 130, 180, 100, 30) $button2 = GuiCtrlCreateCheckbox("Button3", 130, 230, 100, 30) $button2 = GuiCtrlCreateCheckbox("Button4", 130, 270, 100, 30) GuiSetState() Do $i = GuiGetCursorInfo();we are interested in array element 4 ; When mouse hovers over a control, display an overlay on top of it If $i[4] <> 0 And $i[4] <> $background Then $p = ControlGetPos("","",$i[4]) GuiCtrlSetPos($overlay, $p[0], $p[1], $p[2], $p[3]) Else GuiCtrlSetPos($overlay, -99, -99, 1, 1);"hide" the overlay off screen EndIf Until GuiGetMsg() = -3;I should use $GUI_EVENT_CLOSE Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Holger Posted October 24, 2004 Posted October 24, 2004 (edited) @CyberSlug:what do you think about this?:expandcollapse popup$WS_CLIPSIBLINGS = 0x04000000 $width = 400 $height = 400 GUICreate("Mouse down ... drag southeast ... mouse up", $width, $height) $background = GUICtrlCreatePic(@ScriptDir & "\background.bmp", 0, 0, 1024, 768,$WS_CLIPSIBLINGS) $button = GUICtrlCreateButton("Button", 200, 200, 100, 40) $rect = GUICtrlCreateLabel("foo", -1, -1, 1, 1,0x107);transparent label with black border $clicked = 0 $px = -1 $py = -1 $pxn = -1 $pyn = -1 GUICtrlSetPos($rect, 0, 0, 1, 1) GuiSetState() Do $i = GUIGetCursorInfo() $x = $i[0] $y = $i[1] If $i[2] == 1 Then If $clicked = 0 Then $px = $i[0] $py = $i[1] $clicked = 1 ElseIf $clicked = 1 And ($pxn <> $i[0] Or $pyn <> $i[1]) Then $pxn = $i[0] $pyn = $i[1] $x = $px $y = $py $w = Abs($px - $i[0]) $h = Abs($py - $i[1]) If $i[0] < $px Then $x = $i[0] If $i[1] < $py Then $y = $i[1] If $x >= 0 And $y >= 0 And ($x + $w) <= $width And ($y + $h) <= $height Then ;GUICtrlSetPos($rect, 0, 0, 1, 1); only needed for older gui-beta-version GUICtrlSetPos($rect, $x, $y, $w, $h) EndIf EndIf EndIf If $i[2] == 0 Then If $clicked = 1 Then $px = -1 $py = -1 $pxn = -1 $pyn = -1 $clicked = 0 GUICtrlSetPos($rect, 0, 0, 1, 1) EndIf EndIf Until GUIGetMsg() = -3Regards HolgerUpd: maybe WS_CLIPSIBLINGS is the answer... Edited October 24, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
CyberSlug Posted October 24, 2004 Author Posted October 24, 2004 Upd: maybe WS_CLIPSIBLINGS is the answer...<{POST_SNAPBACK}>Very nice What about the post right before yours? I'm still trying to reduce the flicker with jpm's AutoBuilds when I display the overlay label on top of a control.... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Holger Posted October 24, 2004 Posted October 24, 2004 @CyberSlug: do you know what? with the official unstable version and WS_CLIPSIBLINGS it works, but with JPM's newest version it doesn't -> so I think there is now a problem in the JPM-version. But I don't know what he did to get away the flickering thing.... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
jpm Posted October 25, 2004 Posted October 25, 2004 @CyberSlug: do you know what? with the official unstable version and WS_CLIPSIBLINGS it works, but with JPM's newest version it doesn't -> so I think there is now a problem in the JPM-version.But I don't know what he did to get away the flickering thing....<{POST_SNAPBACK}>I did the same as jon for the refresh of the resizing of the label which is ok for the border around the label but bad for the the mouse movement.
jpm Posted October 25, 2004 Posted October 25, 2004 jpm, please try this simplified AutoBuilder-like code..... (You need the background.bmp file from AutoBuilder)GuiCreate("Refresh Example...") $overlay = GuiCtrlCreateLabel("", -99, -99, 1, 1, 0x107);transparent label with black border $background = GUICtrlCreatePic(@ScriptDir & "\background.bmp", 0, 0, 1024,768);used to show a grid GUICtrlSetState($background, 128);disable background so $i[4] below contains a useful value... $button1 = GuiCtrlCreateButton("Button1", 130, 130, 100, 30) $button2 = GuiCtrlCreateButton("Button2", 130, 180, 100, 30) $button2 = GuiCtrlCreateCheckbox("Button3", 130, 230, 100, 30) $button2 = GuiCtrlCreateCheckbox("Button4", 130, 270, 100, 30) GuiSetState() Do $i = GuiGetCursorInfo();we are interested in array element 4 ; When mouse hovers over a control, display an overlay on top of it If $i[4] <> 0 And $i[4] <> $background Then $p = ControlGetPos("","",$i[4]) GuiCtrlSetPos($overlay, $p[0], $p[1], $p[2], $p[3]) Else GuiCtrlSetPos($overlay, -99, -99, 1, 1);"hide" the overlay off screen EndIf Until GuiGetMsg() = -3;I should use $GUI_EVENT_CLOSE<{POST_SNAPBACK}>At least the modification I did will solve your case see AUTOIT-GUI.7 I am on the way to update it
CyberSlug Posted October 25, 2004 Author Posted October 25, 2004 (edited) :)There is a *little bit* of flicker in this code when resizing the selection rectangle around the button...... but I will gladly live with this because everything else is improved!!! Edited October 25, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Administrators Jon Posted October 25, 2004 Administrators Posted October 25, 2004 At least the modification I did will solve your case see AUTOIT-GUI.7 I am on the way to update it Can you just send me the bits you change rather than the whole diff again (I just added most of the .6 version and don't want to look through a big diff file again). Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
jpm Posted October 26, 2004 Posted October 26, 2004 Can you just send me the bits you change rather than the whole diff again (I just added most of the .6 version and don't want to look through a big diff file again). <{POST_SNAPBACK}>no problem I was thinking you were just slipping ... I mean working for money ...
jpm Posted October 26, 2004 Posted October 26, 2004 :)There is a *little bit* of flicker in this code when resizing the selection rectangle around the button...... but I will gladly live with this because everything else is improved!!! <{POST_SNAPBACK}>I think we cannot avoid this can of flickering when control overlay
Holger Posted October 26, 2004 Posted October 26, 2004 @JPM: that is normally cause the transparent label is like a complete rect that has to be repainted I think!? And in CyberSlugs script there is a bug too, so the function GUICtrlSetPos will ever be called if the mouse button is hold. So I changed it a little bit that the function is only called when there is a change of the mouse position So long Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now