Jump to content

GUICtrlCreateGraphic parameters meaning?


orbs
 Share

Recommended Posts

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

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...