win286

Learning GUI

8 posts in this topic

Hi All,

Until now an UI wasn't much more than a file picker, progress bar and splash screen. I'm in the process of learning AutoIt's GUI tools via Koda (1st tool I was able to get to work). Are there any other GUI tools that work?

To learn the GUI I've created two forms so far, a tic-tac-toe game and a seperate button menu form to run the game in black&white or in color. Now I want to modify this to work with dual monitors so both see the same thing. Can this be done with AutoIt? And if so, where would I start?

TIA,

Share this post


Link to post
Share on other sites



Hi All,

Is it possible to reference an object on one form from a second form? So if I'm on form2 can I connect to form1.button5?

TIA

Share this post


Link to post
Share on other sites
5 hours ago, win286 said:

Hi All,

Is it possible to reference an object on one form from a second form? So if I'm on form2 can I connect to form1.button5?

TIA

This all depends on where and how you've defined your variables. If form1 is in scope when you reference it then yes, you can access it from the second. In regards to other GUI tools, Koda is probably the best one you're going to find. A lot of the fancier stuff is easier to control when you do it from code anyway.


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

One way you could (how I like to) deal with it, is to define an Array which holds ids/handles of GUI controls/elements and use ENUM CONSTs with names that are meaningful.  You can check out my Plasma_kIt post to see what I mean:

Main GUI defined starting @ line #34

Pallete Mixer GUI defined starting @ line #73

Plasma Editor GUI defined starting @ line #130

 

Share this post


Link to post
Share on other sites


Thanks for the replies...

anthonyjr2 - Keeping scope sounds like it may not work reliably in all cases. But good to know. I like Koda for doing the layout. Is there a way to modify the case statement template? At the very least I'd like Koda to generate something like:

  Case Button1
      MyButtonFunc("Button1")
  Case Button2
      MyButtonFunc("Button2")

 

spudw2k - It's like you read my mind, my next question was going to be about using an array. I took a brief look at your example and I'm gonna need to sit for a bit to have any hope of understanding that. I'm gonna setup an array or two and see how it goes? If there are any rules with multiple r/w access to arrays please let me know.

Thanks Again.

Share this post


Link to post
Share on other sites

Koda probably won't do the cases for you. I usually do the same thing as you are, I make the layout in Koda first and then just manually put in all of the code structure. I haven't seen any way to auto-generate them but it could be possible.


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

Hi All,

Just FYI there are templates in Koda and they are easy to update.... I found them about 30 minutes after I posted.

Thanks for the example on the array. My issue ended up being object names, forms are not independent and can not use same name for different objects (such as button1 on 2 diff forms).

New question... Is there a way to open or move forms to different desktops now that Windows supports supports multiple desktops?

TIA,

Share this post


Link to post
Share on other sites

Hi All,

To clarify my need, I want to open an AutoIt exe and a form or two in the primary/default desktop. Then based on the users button click in the primary desktop, I want to open an additional form in a different desktop that would already be in use by VNC.

So far all I've found was how to change settings in another desktop, and how to open a new desktop & launch another exe at the same time. But not how to open a form in an existing alternate desktop from an already running AutoIt exe. Hope someone can help.

TIA

Share this post


Link to post
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