Jump to content

Recommended Posts

Posted (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 by jaberwacky
Posted
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. :)

Posted
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 (?). 

Posted

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..

Posted (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 by jaberwacky
Posted (edited)

Actually, I did .... $myControl.SetForeColor(... color ...) and $myControl.SetBkColor(... color ...)

 

Note: I plan to change SetBkColor to SetBackColor soon

Edited by jaberwacky
Posted (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 by jaberwacky
Posted (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 by jaberwacky
Posted

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.

Posted
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?

Posted (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 by jaberwacky

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
×
×
  • Create New...