Sign in to follow this  
Followers 0
gcriaco

CodeWizard

66 posts in this topic

#1 ·  Posted (edited)

CodeWizard is a code generator.

It generates code according to the user choices for the following functions:

  • Message Box
  • Input Box
  • ToolTip
  • SplashText
  • SplashImage
  • GUISetBkColor
  • GUICtrlSetColor
  • GUICtrlSetBkColor
  • GUICtrlSetFont
  • GUICtrlSetCursor
It's embedded in the Scite4AutoIt package (Thanks Jos)

Version 1.5.2 released - 11/19/2006

Changelog:

- Changed: update the context help being keyhh.exe no longer installed with autoit

- Changed: Indentation of generated code with @Tab (previously 3 blank chars)

- Changed: "Dim" => "Local" in generated code

Happy coding

Peppe

CodeWizard_1.5.2.zip

Edited by gcriaco

Share this post


Link to post
Share on other sites



Man, your MsgBox and InputBox wizard were great, and now you merged them on a single program. Thank you for your program, it gives me a lot of time and make my life easier :lmao:

Share this post


Link to post
Share on other sites

good job these are really cool, maybe you could have it somehow tell you what number the message box will return when you press that button too. you could press Preview and when you click a button it tells you what number the box returned, this would make it alot easier (especialy for newbies)


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites

Great use of $BS_PUSHLIKE+$BS_ICON checkboxes :lmao:

....maybe you could have it somehow tell you what number the message box will return when you press that button too. you could press Preview and when you click a button it tells you what number the box returned...

<{POST_SNAPBACK}>

You can have a secondary AutoIt script display a tooltip when the mouse hovers over a msgBox button. Example implementation attached o:)

Modify CodeWizard.au3 around line 293 as follows:

Case $msg = $btnPreview                 ;Preview Button
         If GUICtrlRead($txtMTitle) = "" Then GuiCtrlSetData($txtMTitle, " ");ShowHelpfulToolTips does not like a null title
         Run(@AutoItExe & " " & "ShowHelpfulToolTips.au3 " & '"' & GUICtrlRead($txtMTitle) & '"')
         $returnValue = MsgBox(_SetFlag(), GUICtrlRead($txtMTitle), GUICtrlRead($txtMText), GUICtrlRead($txtMTimeout))
         If GUICtrlRead($txtMTitle) = " " Then GuiCtrlSetData($txtMTitle, "");Restore title if it were null
        ;Let's also report if the MsgBox timed out
         If $returnValue = -1 Then
             Tooltip("********************" & @CRLF & " Message box timed out!")
             sleep(1000)
             Tooltip('')
         EndIf

TWO OTHER NOTES:

1) I think your value for the right-justified attribute is wrong: It should be 524288. This was previously wrong in the help file and has been corrected.

2) I think that your three "Miscellaneous" option buttons should really be two checkboxes becuase you might want any combination of top-most and right-justified attributes.

ShowHelpfulToolTips.au3


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Unfortunately, it doesn't work on non english OS, because message box buttons texts depend on Windows OS language (i.e. Sì, No instead of Yes, No on my pc). :)

I thought that another solution could be using a SplashTextOn function to display a popup window with an abstract of the MsgBox features.

Any other ideas?

About the other 2 comments, I fixed code and will release it ASAP.

Thanks CyberSlug.

Great use of $BS_PUSHLIKE+$BS_ICON checkboxes :lmao:

You can have a secondary AutoIt script display a tooltip when the mouse hovers over a msgBox button.  Example implementation attached o:)

Modify CodeWizard.au3 around line 293 as follows:

Case $msg = $btnPreview                ;Preview Button
         If GUICtrlRead($txtMTitle) = "" Then GuiCtrlSetData($txtMTitle, " ");ShowHelpfulToolTips does not like a null title
         Run(@AutoItExe & " " & "ShowHelpfulToolTips.au3 " & '"' & GUICtrlRead($txtMTitle) & '"')
         $returnValue = MsgBox(_SetFlag(), GUICtrlRead($txtMTitle), GUICtrlRead($txtMText), GUICtrlRead($txtMTimeout))
         If GUICtrlRead($txtMTitle) = " " Then GuiCtrlSetData($txtMTitle, "");Restore title if it were null
       ;Let's also report if the MsgBox timed out
         If $returnValue = -1 Then
             Tooltip("********************" & @CRLF & " Message box timed out!")
             sleep(1000)
             Tooltip('')
         EndIf

TWO OTHER NOTES:

1) I think your value for the right-justified attribute is wrong:  It should be 524288.  This was previously wrong in the help file and has been corrected.

2)  I think that your three "Miscellaneous" option buttons should really be two checkboxes becuase you might want any combination of top-most and right-justified attributes.

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Unfortunately, it doesn't work on non english OS, because message box buttons texts depend on Windows OS language (i.e. Sì, No instead of Yes, No on my pc).  :lmao:

<{POST_SNAPBACK}>

An alternative would be to use "Button1" and "Button2" and "Button3" and based on the msgbox style (passed in as a paramter), you could determine the appropriate tooltip to display.

I don't like my two-script approach anyway. If you still wanted to use tooltips, then perhaps it would be better to have the msgBox preview code written to a second script.... Psuedocode with stuff hard-coded:

Case $msg = $btnPreview               ;Preview Button
   FileWriteLine(@TempDir & "\msgboxPreview.au3", 'MsgBox(4096,"ExampleTitle","Text")')
   Run(@AutoItExe & " " & @TempDir & "\msgboxPreview.au3")
   WinWait("ExampleTitle")
   While WinExists("ExampleTitle")
      ;do tooltip processing stuff
   Wend
Edited 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!

Share this post


Link to post
Share on other sites

Man, this script is just awsome.

Hope it gets added to Scite, it makes life much easier. :lmao:

(At least programming life :"> )


[quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

@gcriaco

Nice job.

How about adding another tab for SplashTextOn ?

Share this post


Link to post
Share on other sites

Man, this script is just awsome.

Hope it gets added to Scite, it makes life much easier. :lmao:

(At least programming life  :"> )

<{POST_SNAPBACK}>

Done... will be part of the next installer... o:)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

yeah you should add a tab for splash text and images that would make the program soooo cool


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites

@gcriaco

How about adding another button "Send To SciTE" ?

Share this post


Link to post
Share on other sites

@gcriaco

How about adding another button "Send To SciTE" ?

<{POST_SNAPBACK}>

The current version has already a /StdOut parameter, so when started from SciTE, the output is pasted at the place where the cursor is located.... :lmao:

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Heres a version of a SplashText generator I created a while ago. It uses Au3GuiXp though, but it may give some inspiration, if it's not too much hassle to hack around my environment specific bits it there.

SplashText_ER.au3

Share this post


Link to post
Share on other sites

CodeWizard 1.1 released.

ChangeLog:

1.1 - 8/2/2005

- Fixed: MsgBox right-justified attribute 5244288 => 524288

- Changed: "Miscellaneous" radio buttons => checkboxes (any combination of top-most/right-justified attributes are possible now)

- Added: Resource Info (version, description,...) in the exe file

- Added: #Region....#EndRegion around the generated code lines

About the SplashTextOn function and the MsgBox Preview button tooltips:

maybe i'll implement these features in the future.

At the moment, I have to translate in italian the helpfile o:) .

Thanks guys for suggestions :lmao:

Peppe

Share this post


Link to post
Share on other sites

Done... will be part of the next installer...  o:)

<{POST_SNAPBACK}>

Great! :)

When will the next Scite for AutoIt come out? Coding without Scite is impossible :lmao:


[quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

gcriaco or jdeb

I tried the code wizard in latest Scite4AutoIt and when you click 'Copy' the code is not sent to scite until the code wizard is closed. Am I missing something here or are we going to have to close then reopen the code wizard everytime we use it ?

Share this post


Link to post
Share on other sites

gcriaco or jdeb

I tried the code wizard in latest Scite4AutoIt and when you click 'Copy'  the code is not sent to scite until the code wizard is closed. Am I missing something here or are we going to have to close then reopen the code wizard  everytime we use it ?

<{POST_SNAPBACK}>

agree that, when the Copy button is pressed, the code should be written with ConsoleWrite (to SciTE) when used with /StdOut.

I guess its an relative simple change but will leave it up to gcriaco to make the modifications in his script if he agrees......


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

agree that, when the Copy button is pressed, the code should be written with ConsoleWrite (to SciTE) when used with /StdOut.

I guess its an relative simple change but will leave it up to gcriaco to make the modifications in his script if he agrees......

<{POST_SNAPBACK}>

@jbeb

OK

@gcriaco

I also noticed when the code is written to scite extra blank lines are added for some reason.

#Region --- CodeWizard generated code Start ---

;MsgBox features: Title=Yes, Text=Yes, Buttons=Abort, Retry, and Ignore, Icon=None, Miscellaneous=Top-most attribute

Dim $iMsgBoxAnswer

$iMsgBoxAnswer = MsgBox(262146,"Title goes here","Text goes here")

Select

   Case $iMsgBoxAnswer = 3;Abort



   Case $iMsgBoxAnswer = 4;Retry



   Case $iMsgBoxAnswer = 5;Ignore



EndSelect

#EndRegion --- CodeWizard generated code End ---;

Should be

#Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=Abort, Retry, and Ignore, Icon=None, Miscellaneous=Top-most attribute

Dim $iMsgBoxAnswer

$iMsgBoxAnswer = MsgBox(262146,"Title goes here","Text goes here")
Select
   Case $iMsgBoxAnswer = 3;Abort

   Case $iMsgBoxAnswer = 4;Retry

   Case $iMsgBoxAnswer = 5;Ignore

EndSelect
#EndRegion --- CodeWizard generated code End ---;

Also line 830 there is a mistype

"InputBox features:"

Should be

";InputBox features:"

Edited by bshoenhair

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

gcriaco - I hope you don't mind, but I'm trying to add in an adaptation of my SplashText generator. However, I'm having difficulty fitting everything in. I'm trying to keep in line with your design, but I can't really figure out fitting in the options bits. Namely, check boxes for;

0 = Center justified/always on top/with title (default)

1 = Thin bordered titleless window

2 = Without "always on top" attribute

And radio buttons for;

4 = Left justified text

8 = Right justified text

16 = Windows can be moved

If you're happy for me to play, do you - or anyone else who's better at GUIs, since I don't really like that, want to help with fitting them in?

I've attached what I've got so far. I think I should be able to add the rest as your code is really cleanly written and easy to read.

As I said, as long as you don't mind me doing this - don't want to step on toes.

CodeWizard.au3

Edited by Chris_1013

Share this post


Link to post
Share on other sites

Hi Chris. I prefer adding the SplashText myself.

Now, my priority are:

1. to fix bugs reported by bshoenhair

2. to translate in italian the 3.1 helpfile (it takes many days).

BTW, thanks for help.

Peppe

gcriaco - I hope you don't mind, but I'm trying to add in an adaptation of my SplashText generator. However, I'm having difficulty fitting everything in. I'm trying to keep in line with your design, but I can't really figure out fitting in the options bits. Namely, check boxes for;

0 = Center justified/always on top/with title (default)

1 = Thin bordered titleless window

2 = Without "always on top" attribute

And radio buttons for;

4 = Left justified text

8 = Right justified text

16 = Windows can be moved

If you're happy for me to play, do you - or anyone else who's better at GUIs, since I don't really like that, want to help with fitting them in?

I've attached what I've got so far. I think I should be able to add the rest as your code is really cleanly written and easy to read.

As I said, as long as you don't mind me doing this - don't want to step on toes.

<{POST_SNAPBACK}>

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