orbs Posted May 19, 2016 Share Posted May 19, 2016 GUICtrlCreateGraphic accepts position and size parameters (top,left,width,height). what do they mean? even if i set all to zero i can still draw graphics all over my GUI: #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI = GUICreate("Example") ; setting the graphic area to basically nothing: Local $gGraphic = GUICtrlCreateGraphic(0, 0, 0, 0) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 10, 10) GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 40) ; the above line is drawn even though it's out of te graphi area! GUISetState(@SW_SHOW, $hGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUI) EndFunc ;==>Example Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
LarsJ Posted May 20, 2016 Share Posted May 20, 2016 Width and height parameters are used by GUICtrlSetBkColor and similar commands. Mouse clicks are detected only in the area delimited by width and height. See the example for GUICtrlCreateGraphic in Help file. Left and top parameters is the starting point for x- and y-coordinates of GUICtrlSetGraphic as stated in the Help file: "The point position (x,y) is relative to the GUICtrlCreateGraphic() coordinates. It can be outside the graphic control but inside of the GUI window." "relative to the GUICtrlCreateGraphic() coordinates" means relative to left and top parameters. If left and top is in the middle of the GUI, x- and y-coordinates can be negative. If you only want to draw graphics with GUICtrlSetGraphic and don't need commands like GUICtrlSetBkColor and don't need to detect mouse clicks, you can set width and height to zero. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
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