jaberwacky Posted October 5 Posted October 5 (edited) For many years now I have been fascinated with AutoItObject. I have also been fascinated with creating GUIs that are structured by AutoItObject. And so I have had this on and off again pet project that I have finally made some progress with. GUIObjects as I call it allows you to create GUIs using a Canvas object that creates a form and allows you to add controls to the form. Multiple forms are implemented. You can also register event handlers for the forms and their subsequent controls. DPI awareness is baked in automatically. This doesn't do anything that AutoIt can't already do and it's not faster. In fact it's slower. I just love the structure and the way GUI code becomes organized in this manner. It falls into line with how I think about programs. I'm a systems thinker and I love software design and management concepts. If you like to create GUIs like this too then please feel free to download and share your thoughts! If you have any implementation questions then please ask! GUIObjects.zip downloads: 87 Latest Update! More controls have been added! And I have been converting the examples found in the AutoIt helpfile over too! [10/15/2026] -- Hello! I added many more examples that I converted from the examples in the helpfile. Also, run Example.au3 for a familiar visual treat! Using the helpfile examples have revealed a lot of bugs/questionable design decisions. (As though my designs aren't already questionable! 😁) Edited 5 hours ago by jaberwacky Parsix and WildByDesign 2 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
WildByDesign Posted October 5 Posted October 5 15 minutes ago, jaberwacky said: One cool thing is that DPI awareness is baked in! Very nice. I'm very curious about this project and I'm still checking it out right now. I just wanted to point out that there is a newer version of _WinAPI_DPI UDF over here that is much more complete that you should be able to swap out. jaberwacky 1
jaberwacky Posted October 6 Author Posted October 6 Just as I predicted, I did restructure how to register events. Check out the example! Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 6 Author Posted October 6 1 hour ago, WildByDesign said: Very nice. I'm very curious about this project and I'm still checking it out right now. I just wanted to point out that there is a newer version of _WinAPI_DPI UDF over here that is much more complete that you should be able to swap out. I'll have to look in to how to use it tomorrow. Looks like the script it would need to be compiled every time (?). Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
corz Posted October 6 Posted October 6 I have no idea what I'm looking at! It may be the alcohol. What is happening here? What is this doing that AutoIt can't already? nothing is foolproof to the sufficiently talented fool..
jaberwacky Posted October 6 Author Posted October 6 (edited) 8 hours ago, corz said: I have no idea what I'm looking at! It may be the alcohol. What is happening here? What is this doing that AutoIt can't already? Good question! 😅 It offers nothing that AutoIt can't already do. I simply have a fascination with the concept and won't be satisfied until I have implemented it. With that being said, if anyone out there has any input then please do share. Edit: I also have a fascination with AutoItObject therefore I try to completely structure all of my scripts with it. I believe that this UDF will allow me to do that eventually. Side note: I'm not a professional programmer, this is just a hobby for me. Edited October 6 by jaberwacky corz and Parsix 2 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
ahmet Posted October 6 Posted October 6 What about using GUIRegisterMsgEx or GUIRegisterMsg20? It should be possible to add more actions to controls easier. I think there is one more implementation beside _GUIRegisterMsgEx (UDF) - Like native, but for controls but I can not find that now.
jaberwacky Posted October 6 Author Posted October 6 Seems to me that each event handler wouldn't have access to the owning object. Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
Parsix Posted October 6 Posted October 6 How to change the text Color and background color of a control?
jaberwacky Posted October 6 Author Posted October 6 I haven't implemented it yet ... I'll do it right quick, brb Parsix 1 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 6 Author Posted October 6 (edited) Actually, I did .... $myControl.SetForeColor(... color ...) and $myControl.SetBkColor(... color ...) Note: I plan to change SetBkColor to SetBackColor soon Edited October 6 by jaberwacky Parsix 1 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
argumentum Posted October 6 Posted October 6 Just now, jaberwacky said: Note: I plan to change SetBkColor to SetBackColor soon ..I'd leave the "lingo" as previously know as possible because of... memory, yes, memory. I remember the names Am not going to use it but, if you like the reasons 🤔 "My 2 cents." jaberwacky 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting
jaberwacky Posted October 6 Author Posted October 6 You're right, most of us do know it as BkColor don't we? argumentum and WildByDesign 2 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 7 Author Posted October 7 (edited) Latest update! Added ability to register events for the GUI. Changed .SetForeColor to .SetColor() to correspond with the native GUICtrlSetColor(...) Also added .SetBkColor and .SetCursor to the gui (Canvas()) More to come over time! Edited October 7 by jaberwacky Parsix and argumentum 2 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 7 Author Posted October 7 (edited) Actually, another update! I added a ton of functionality and a lot more controls! The example demonstrates two forms at the same time. Edit: Scratch the 2 GUIs idea for now. It doesn't work like I had hoped. Edited October 7 by jaberwacky Parsix 1 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 7 Author Posted October 7 Latest update. I rewrote the original post and posted the latest version. Multiple GUIs works now! Currently working on adding context menus. Then will add more controls after that. Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
ahmet Posted October 7 Posted October 7 23 hours ago, jaberwacky said: Seems to me that each event handler wouldn't have access to the owning object. What about using SetPropW and GetPropW as is being done here?
jaberwacky Posted October 7 Author Posted October 7 That's a pretty cool concept. I'll look into it more and try to see if I can integrate it! Thank you. ahmet 1 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 8 Author Posted October 8 (edited) Latest update! Context Menus have been integrated! Here's how to use them: ; ... Local $myContextMenuItem1 = $canvas.ContextMenu.AddItem("My Context Menu Item 1") $myContextMenuItem1.OnEvent("MyContextMenuItem1Handler") Local $myContextSubMenuItem2 = $canvas.ContextMenu.AddItem("My Context Sub Menu Item 2", True) Local $myContextSubMenuItem2A = $myContextSubMenuItem2.AddItem("My Context Sub Menu Item 2A") $myContextSubMenuItem2A.OnEvent("MyContextSubMenuItem2AHandler") ; .... Func MyContextMenuItem1Handler($this, Const $event) Consolewrite("MyContextMenuItem1Handler Clicked!" & @CRLF) Return True EndFunc Func MyContextSubMenuItem2AHandler($this, Const $event) Consolewrite("MyContextSubMenuItem2AHandler Clicked!" & @CRLF) Return True EndFunc Tabs have been changed. To switch to a tab to add controls use: ; ... Local $myTabItem = $myTab.Add("My Tab Item") $myTabItem.Close() $myTabItem.Switch() Local $myButton = $canvas.Button("My Button", 20, 160) $myTabItem.Close() ; ... Edited October 8 by jaberwacky Parsix 1 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
jaberwacky Posted October 9 Author Posted October 9 All of my projects are terrible. I can't access other controls inside of the event handlers. 😞 Back to the drawing board. Parsix 1 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
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