jpm Posted October 11, 2004 Posted October 11, 2004 @jpm: I hope the code helps clarify. The bottom group of radio buttons should have images like the checkboxes, but they do not...Global $BS_PUSHLIKE = 0x1000, $BS_ICON = 0x40 GuiCreate("Example") ; Top group of checkboxes For $i = 1 to 3 GuiCtrlCreateCheckbox("", $i*50, 10, 50, 50, BitOr($BS_PUSHLIKE, $BS_ICON)) GUICtrlSetImage(-1, "shell32.dll", $i) Next ; Bottom group of radio buttons For $i = 1 to 3 GuiCtrlCreateRadio("", $i*50, 100, 50, 50, BitOr($BS_PUSHLIKE, $BS_ICON)) GUICtrlSetImage(-1, "shell32.dll", $i) Next GuiSetState() While GuiGetMsg() <> -3 WEnd<{POST_SNAPBACK}>now I understand why you want this function you will have it
Administrators Jon Posted October 11, 2004 Administrators Posted October 11, 2004 Opt("WinTitleMatchMode", 4);advanced $titlebar = 10 $main = GuiCreate("foo", 1,1+$titlebar, 290, (@DesktopHeight-300)/2, 0x04CF000) WinMove("handle=" & $main,"", 100, 100, 100, 100) GuiSetState(@SW_SHOW) While GuiGetMsg() <> -3 WEnd ExitAs a side note, if you have a variable that contains a proper window handle (as $main does) then all the Win... commands accept it as the first parameterWinMove($main,"", 100, 100, 100, 100)This is posible because AutoIt knows that $main is not a string so it uses it as a handle regardless of the titlematch mode. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Administrators Jon Posted October 11, 2004 Administrators Posted October 11, 2004 But don't worry about this.... I'm much more interested in a function that returns the ID# of the control currently under the mouse? I've added extra info to GuiGetCursorInfo() about the control ID the cursor is over. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
CyberSlug Posted October 11, 2004 Author Posted October 11, 2004 Excellent! I think that will be my last major request for a while Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Josbe Posted October 11, 2004 Posted October 11, 2004 I've added extra info to GuiGetCursorInfo() about the control ID the cursor is over.<{POST_SNAPBACK}>Cool! Thanks.@CS: Thanks 4 to suggest and to cause that good ideas to be implemented. BTW: I have noticed that creating a TreeView and soon giving click on him, throws an array error...I know it's not finished, like said this-is-me, but your prototype looks very good! AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
CyberSlug Posted October 11, 2004 Author Posted October 11, 2004 BTW: I have noticed that creating a TreeView and soon giving click on him, throws an array error...I know it's not finished, like said this-is-me, but your prototype looks very good! I noticed that, too I've also noticed that groups and tab controls are not exactly reported by GuiGetCursorInfo() when I mouse over them... Is this a feature or bug?GuiCreate("Example") GuiCtrlCreateButton("Button", 20, 130, 100, 30) GuiCtrlCreateGroup("Frame", 10, 180, 70, 70) guictrlcreateTab(10, 10, 100, 100) guiCtrlcreateTabItem("one") guiCtrlcreateTabItem("two") GuiSetState() while Guigetmsg() <> -3;$GUI_EVENT_CLOSE $info = GuiGetCursorInfo() If isArray($info) Then ToolTip("ID#: " & $info[4]) Wend Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
CyberSlug Posted October 12, 2004 Author Posted October 12, 2004 http://www.autoitscript.com/fileman/users/public/CyberSlug/prototypeoct11.zip but there is not much to look at- replaced pushbutton checkboxes with radio buttons (thanks jpm)- added slider control- started playing with GuiGetCursorInfo and overlays.... and broke drag-n-drop moving of controls as a result - most difficulties I've run into are in other posts...By the way, it appears that label controls only like custom styles at creation time.... Try the followingGuiCreate("Example") GuiCtrlCreateLabel("Label", 100, 100, 100, 100) GUICtrlSetStyle(-1, 0x107) ;;;GuiCtrlCreateLabel("Label", 100, 100, 100, 100, 0x107) GuiSetState() While GuiGetMsg() <> -3 WEnd Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
this-is-me Posted October 12, 2004 Posted October 12, 2004 Looking good as always... Who else would I be?
CyberSlug Posted October 13, 2004 Author Posted October 13, 2004 "Million dollar" question: Take a look at line 87 of my prototype below...;When done drawing, select the "cursor" on the toolbar again ;;;GuiCtrlSetState($type[1], 1);$GUI_CHECK ControlClick("Choose Control Type","",$type[1])Why the heck does ControlClick work but GuiCtrlSetState causes all sorts of problems!!!If you try running the code with GuiCtrlSetState uncommented (and ControlClick commented out), then weird stuff happens when you click on the toolbar buttons. Try clicking a different toolbar button each time and immediately drawing that control on the form window.... I'm too exhausted to explain....http://www.autoitscript.com/fileman/users/public/CyberSlug/oct12proto.zip This prototype is not as fully featured as the others because I was banging my head trying to figure out my bug 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 13, 2004 Posted October 13, 2004 "Million dollar" question: Take a look at line 87 of my prototype below...;When done drawing, select the "cursor" on the toolbar again ;;;GuiCtrlSetState($type[1], 1);$GUI_CHECK ControlClick("Choose Control Type","",$type[1])Why the heck does ControlClick work but GuiCtrlSetState causes all sorts of problems!!!If you try running the code with GuiCtrlSetState uncommented (and ControlClick commented out), then weird stuff happens when you click on the toolbar buttons. Try clicking a different toolbar button each time and immediately drawing that control on the form window.... I'm too exhausted to explain....http://www.autoitscript.com/fileman/users/public/CyberSlug/oct12proto.zip This prototype is not as fully featured as the others because I was banging my head trying to figure out my bug <{POST_SNAPBACK}>I don't understand the pb your facing on GuiCtrlSetState becuase this code is working #include <GuiConstants.au3> GUICreate ("checkbox test", 250, 150, 20, 20) GuiSetState() $checkCN = GuiCtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20) GUICtrlSetState ($checkCN,$GUI_CHECKED) ; Run the GUI until the dialog is closed or timeout $start=TimerInit() While GUIGetMsg() <> -3 if TimerDiff($start)>=5000 then exitloop Wend
CyberSlug Posted October 14, 2004 Author Posted October 14, 2004 http://www.autoitscript.com/fileman/users/public/CyberSlug/oct13proto.zipCode had been a little cleaner, but then I tried to add "grippy" support Known issues: moving updown controls causes them to shrink could improve behavior when moving controls out-of-bounds.... Frames (group controls) are not movable, and tabs are not implemented A redrawing bug in AutoIt? Move a checkbox control to slightly overlap with a label 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!
jpm Posted October 14, 2004 Posted October 14, 2004 http://www.autoitscript.com/fileman/users/public/CyberSlug/prototypeoct11.zip but there is not much to look at- replaced pushbutton checkboxes with radio buttons (thanks jpm)- added slider control- started playing with GuiGetCursorInfo and overlays.... and broke drag-n-drop moving of controls as a result - most difficulties I've run into are in other posts...By the way, it appears that label controls only like custom styles at creation time.... Try the followingGuiCreate("Example") GuiCtrlCreateLabel("Label", 100, 100, 100, 100) GUICtrlSetStyle(-1, 0x107) ;;;GuiCtrlCreateLabel("Label", 100, 100, 100, 100, 0x107) GuiSetState() While GuiGetMsg() <> -3 WEnd<{POST_SNAPBACK}>I finally get the difference when calling GUICtrlSetStyle the $WS_CHILD and the $WS_VISIBLE are reset.so GUICtrlSetStyle(-1, BitOR (0x107 ,$WS_CHILD, $WS_VISIBLE))is OK
CyberSlug Posted October 14, 2004 Author Posted October 14, 2004 I finally get the difference when calling GUICtrlSetStyle the $WS_CHILD and the $WS_VISIBLE are reset.so GUICtrlSetStyle(-1, BitOR (0x107 ,$WS_CHILD, $WS_VISIBLE))is OK <{POST_SNAPBACK}>Now I understand! Thank you Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
CyberSlug Posted October 14, 2004 Author Posted October 14, 2004 Forgot to mention: The October 13 prototype uses "mouse down - drag - mouse up" for creating and moving controls Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
CyberSlug Posted October 17, 2004 Author Posted October 17, 2004 (edited) October 16 Prototype Barely usable now!EDIT: Silently uploaded a version with a bug fix regarding snap-to-grid....- Most controls available; unsupported controls are grayed out.- Creation and moving by mouseDown-drag-mouseUp- "Grippy" control resizing VERY BASIC GUI SCRIPT GENERATION- Copy and Paste hotkeys (Ctrl+C and Ctrl+V)- Control deletion (Delete hotkey)- Menus to toggle grid and snap-to-grid stuff- Menu to change control texthttp://www.autoitscript.com/fileman/users/public/CyberSlug/oct16proto.zip Edited October 17, 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!
this-is-me Posted October 17, 2004 Posted October 17, 2004 (edited) Great work. I just tried it, and it works good so far. Some things I would like to see in future versions: menu creation stuff in another gui window like the menu editor in vb context menus for each control in the builder if "paste at mouse position" is turned off, maybe have the new control show 10 pixels down and to the right of the original instead of at the top left clicking on a part of the gui not related to a control makes grippies disappear double click on a control brings up properties for that control real time preview in the future for images also, inserting an image should bring up the image in its original size, since larry was so good to lend us a hand on the image size script. EDIT: also, how 'bout a feature to select controls by dragging around them? it would be very useful in deleting multiple controls at once. EDIT2: what about a realtime properties inspector like in vb? a separate toolwindow that holds the properties of the currently selected object, including the main window, title, button text, window styles, etc. A couple of bugs: make a button make a combo on top of that button try to move that combo using anything in the white area this also applies to progress bars, and so on. I believe the problem lies in the fact that a button does not pop to the top on mouseover if anything but a button is above it. /EDIT: I see this happens to many controls, so it may be part of the "under mouse" guimsg. I am very sleepy at this time, so please excuse my punctuation and lousy grammer and other things. Edited October 17, 2004 by this-is-me Who else would I be?
CyberSlug Posted October 17, 2004 Author Posted October 17, 2004 Thanks for the ideas; much is this is already on my to-do list (which I haven't written down yet ) As for overlapping controls, AVOID OVERLAPPING CONTROLS. Apart from Group and Tab controls (which I have yet to re-implement due to their complexity), AutoIt does not like when you have overlapping controls. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
CyberSlug Posted October 17, 2004 Author Posted October 17, 2004 - Menu creation stuff: On the to-do list. I don't like VB's menu editor, so I'm thinking of alternate implementations - Context menus for each control: Not really possible until AutoIt gets this feature - paste control at 10x10 instead of 0x0: easy enough change; I was just going by VB's behavior - Click on GUI to make grippies disappear: I'll try - Bring up control properties by double click: I'll try.... - real time preview in the future for images: On the to-do list - Insert image in its original size: Could you give me the link to Larry's code? - Select multiple controls like in VB: I'd like this, too, but is low priority due to perceived difficulty. - Separate toolwindow with properties: I'm in the planning states of this. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
this-is-me Posted October 17, 2004 Posted October 17, 2004 (edited) What I mean is that if you draw a control on top of another one just so you can have it on the page to move and resize later, it makes moving and resizing it hard.It just so happens I am wrong about who made the image size udf. It was not made by larry : http://www.autoitscript.com/forum/index.ph...opic=4159&st=15 look at the last post.EDIT: It looks like today is ideas day. Here are some more ideas I cooked up for autobuilder:Holding ctrl while dragging a control with the mouse duplicates the control and letting go releases the new control.Pressing the up, down, left and right buttons move the control with grippy focus 1 pixelHolding shift while using the direction buttons moves in steps of 10 pixelsHolding ctrl while using the direction buttons resizes the bottom and right of a controlMaybe also a redundant ctrl+d for duplicating a controlIndividual hotkeys for each type of new control (ctrl+i for image, ctrl+t for treeview, etc.)The properties inspector (not made yet) also allows you to change the variable name for the control in the codePossibility to preview avi files on/off switchSeparate gui window editor for default treeview/menu/listview/etc. items? (perhaps this is something that could be included in the properties double-click)Just for reference, on the 10x10, I do mean 10x10 from the top/left of the original control, not 10x10 of the top/left of the window. Edited October 18, 2004 by this-is-me Who else would I be?
Josbe Posted October 18, 2004 Posted October 18, 2004 Great! Good job! I want comment/suggest: Properties for GUI form.(Background color, Title) Very small bug: Missed quote in code's output for ICON. (Line 391/859, Col. 54, for Protoype Oct16 ) Right-click for a context menu, maybe with options like "Repeat last action", "Properties"...Maybe it's in you list already... BTW: Nice ideas from 'this-is-me', too. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
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