Sign in to follow this  
Followers 0
jpm

Autoii3-gui (beta)

19 posts in this topic

I am glad that with the help of a lot of you we reach a point that we can say the functions to manage the GUI directly inside AutoIt is ready for testing.

Now is time to see if it fit in your script (AU3GUI like) before final inclusion in a release of AutoIt3.

You can download from http://www.hiddensoft.com/fileman/users/jpm/AutoIt3-gui

(actual version is 101.4)

Have a nice testing just report by this thread.

as a reminder the functions are:

  • GUICoordMode (option)

  • GUICreate ( "title", width, height, [left, top [,style [,exStyle]]] )
  • GUICreateEx ( helpfile [,background [,iconfile]] )
  • GUISetControl ( type, "text", left, top [,width [,height [,style [,exStyle]]] )
  • GUISetControlCurFont (size [,weight [,fontname [,attribute]]])
  • GUISetControlData ( data [,default] )
  • GUISetControlEx ( state [,tip [,ext]] )
  • GUISetControlNotify ( [action [,controlref]] )

  • GUIWaitClose ( [timeout] )

  • GUIShow ( )

  • GUIisChanged ( [timeout] )

  • GUIRead ( [controlref] )
  • GUIWrite ( controlref ,state [,info] )

  • GUIHide ( )
  • GUIDelete ( )

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Wow! After short checking I mean this is exactly I wanted! Thanks again for excellent work! B)

So here another mad idea :whistle: If this is not very hard or size consuming, how about add similarity to GUIRead and GUIWrite functions? Now GUIWrite can set state of controls, for some controls - Input, Edit and Button - can set text for it. So for Combo and List will be logically to set active item (maybe given date for Date too), like GUIRead get them. So "info" in the GUIWrite will be mean:

Combo, List sets the selection to given value

Date sets the given date

Of course, we know this is possible with ControlCommand function, but in this case it will not be linked to the control reference!

Edited by Kot

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

@jpm: Thanks :angry:

So I reinserted my lines to the new code and a progressbar looks like this:

..sh...doesn't work at geocities.com... :whistle:

Ok, try it with the zip-file at the end...

The skript could be look so:

$PBS_SMOOTH = 1
$PBS_VERTICAL = 4

GUICreate("Progressbar",220,100)
$progressbar1 = GUISetControl("progress","clrbar=32250|clrbk=0",10,10,200,20)
$progressbar2 = GUISetControl("progress","",10,40,200,20,$PBS_SMOOTH)
; other sample $progressbar = GUISetControl("progress","clrbar=8192|clrbk=0",10,10,200,20,$PBS_SMOOTH)
$button = GUISetControl("button","Start",75,70,70,20)
GUISetControlNotify(2)
GUIShow()

$wait = 20; wait 20ms for next progressstep
$s = 0; progressbar-saveposition
$n = 0
While $n = 0
   $n = GUIisChanged(0)
      If $n > 0 And $n = $button Then
         GUIWrite($button,0,"Stop")
         For $i = $s To 100
            If GUIRead($progressbar1) = 50 Then Msgbox(0,"Info","The half is done...")
            $m = GUIisChanged(0)
            If $m = -3 Then
               ExitLoop
            Else
            If $m > 0 And $m = $button Then
               GUIWrite($button,0,"Next")
               $s = $i;save the current bar-position to $s
               $n = 0
               ExitLoop
            Else
               GuiWrite($progressbar1,0,"perc=" & $i)
               GuiWrite($progressbar2,0,"perc=" & (100 - $i))
               Sleep($wait)
            EndIf
         EndIf
      Next
   Else
      If $n = -3 Then ExitLoop
   EndIf
   Sleep(1)
WEnd

I think it is possible to optimize the script...I try it...

Thanks again Holger

P.S.:a sample-exe could be found here:

Sample-Zip

Maybe a downloadmanager doesn't function.

You know its my first time to write something in c++ B)

Edited by kotschi

Share this post


Link to post
Share on other sites

Very nice jpm and all who helped make autoit-gui.

Writing my first gui with it, noticed I am getting a "0" return from GUIWaitClose() if I click a Close button in the gui and also from the X button on the window. The latter should give me a -3 return?

Share this post


Link to post
Share on other sites

Wow! After short checking I mean this is exactly I wanted! Thanks again for excellent work!  B)

So here another mad idea  :whistle:  If this is not very hard or size consuming, how about add similarity to GUIRead and GUIWrite functions? Now GUIWrite can set state of controls, for some controls - Input, Edit and Button - can set text for it. So for Combo and List will be logically to set active item (maybe given date for Date too), like GUIRead get them. So "info" in the GUIWrite will be mean:

Combo, List  sets the selection to given value

Date    sets the given date

Of course, we know this is possible with ControlCommand function, but in this case it will not be linked to the control reference!

Thanks,

I leave the answer to Larry, because I try to do exactly the same as AU3GUI does.

So If the combo or list or date can be set with AU3GUI it should work with AutoIt3-gui.

Pehaps I don't understand the remarks just be more precise with an example how it should work

Be on touch

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Very nice jpm and all who helped make autoit-gui.

Writing my first gui with it, noticed I am getting a "0" return from GUIWaitClose() if I click a Close button in the gui and also from the X button on the window. The latter should give me a -3 return?

I am not sure with GUIWaitClose but it does with GuiIsChanged.

EDIT I made a doc error GUIWaitClose does not return -3 but 0 on close with red button. I will update the doc

I try to have GUIWaitClose the simpler so less return code.

Edited by jpm

Share this post


Link to post
Share on other sites

Very nice addition, and I think it easy to found use for it :whistle: I would be like if this will be implemented officially.

I cannot download from geocitie your stuff.

How can I do it?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

@jpm/larry/kot: I 'upload'ed the changed files to:

guibox-changed-files

I marked (hopefully) all edited lines with // ... Holger...

Search for 'holger' then you find them....

Thanks.

Ok, see/read you all next week, cause I'm ill since today :whistle:

Edited by kotschi

Share this post


Link to post
Share on other sites

I am impressed. And the executable is still less than 100 K (83.5K) :whistle:


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

@jpm/larry/kot: I 'upload'ed the changed files to:

guibox-changed-files

I marked (hopefully) all edited lines with // ... Holger...

Search for 'holger' then you find them....

Thanks.

Ok, see/read you all next week, cause I'm ill since today  :whistle:

still no success to access geocities I send you a post an email so you can email them to me directly just the update

Thanks

Share this post


Link to post
Share on other sites

I am impressed.  And the executable is still less than 100 K (83.5K) :angry:

Thanks David,

Perhaps you don't know but you were part of the game the inputbox calss was my starter. B)

The Increment for debug was the same size (dbg-bastard) we will see what yoi reach (I know It will be a special link ...) :whistle:

Share this post


Link to post
Share on other sites

Thanks David,

Perhaps you don't know but you were part of the game the inputbox calss was my starter. :evil:

The Increment for debug was the same size (dbg-bastard) we will see what yoi reach (I know It will be a special link ...) B)

You are welcome. That was a bit of work. So you took what I did there and then expanded to the general case with all the function calls. All I had to work with when I did that was Jon's old V2 InputBox and a version I wrote with MFC. Then I had to write my own callback function to manage the windows messages and take out all references to the MFC.

I'm still trying to figure out how to intercept the keypresses in the edit box. That way I can automatically capitalize or lower-case or whatever. :angry::whistle:

Yeah, but this debug will do a whole lot more than dbg-bastard did.


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

I palying couple days with the new GUI and I'm impressed! But one thing in the GUI remain unclear for me :whistle: I've seen GUIWriteList.au3 example, but in this one you can change combo/list data only if this directly after control initialization. This is possible to set current list/combo selection (or change its data) using control ref number (without using controlcommand to avoid linking to window title/control class)? Maybe it possible to add such feature, for example in the GUIWrite function?

GUIWrite(controlref, state [, info])

where "info" - string which must be selected, or maybe line number, or maybe data as in the GUISetControlData - any of this will be good.

Share this post


Link to post
Share on other sites

I palying couple days with the new GUI and I'm impressed! But one thing in the GUI remain unclear for me  :whistle:  I've seen GUIWriteList.au3 example, but in this one you can change combo/list data only if this directly after control initialization. This is possible to set current list/combo selection (or change its data) using control ref number (without using controlcommand to avoid linking to window title/control class)? Maybe it possible to add such feature, for example in the GUIWrite function?

GUIWrite(controlref, state [, info])

where "info" - string which must be selected, or maybe line number, or maybe data as in the GUISetControlData - any of this will be good.

I did some improvement in 101.5 release.

After getting a message by GUIMsg you can set info to the clicked control with GUISetControlData or GUISetControlEx see 101.5 doc

and tell me if that fit with your script. B)

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

I hope this will be enough for me B)

But it seems not for all - just read discussion in other thread :angry:

Edit: hmm... new build already out. But I still can't find way to set data/selection into concrete control... It seems Valik is right - it's need to add controlref into GuiSetControlData... Or i can't found something? :whistle:

Edited by Kot

Share this post


Link to post
Share on other sites

how to setup the gui so that i can use it,

the gui did not come with the original autoit3 setup files

do i need to register it

thanks

Share this post


Link to post
Share on other sites

how to setup the gui so that i can use it,

the gui did not come with the original autoit3 setup files

do i need to register it

thanks

No need to register, just run the autoit3-gui.exe giving or script as a parameter.

Or rename temparory the AutoIt3.exe standard install and copy AutoIt3-gui.exe as Autoit3.exe same place.

good testing :whistle:

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
Sign in to follow this  
Followers 0