Sign in to follow this  
Followers 0
jaberwacky

Will you beta test my current script, please?

48 posts in this topic

#1 ·  Posted (edited)

I am restructuring Jos' SciTEConfig to allow more control over SciTE.

I would greatly appreciate if you would run it on your machine and tell me if it presents an accurate picture of your current SciTE configuration, please.

This is not intended to replace the current SciTEConfig. This is just an alternative for those of us that want more control.

This script will now perform the following duties:

1. Load a new theme.

2. Change the default action of scripts, I.E., change from edit to run.

3. Enable and disable tools from the Tools menu.

4. Change the loaded definitions from production to beta.

5. Enable and disable the context menu entries.

6. A live preview for on the fly tweaking!

Note: For most of these items, the script must be compiled.

Note: If you decide to change any of the 'Context Menu' items then be sure to back up your current registry!!!!!!!!!!!!!!!!!!!!

Note: Back up your au3.properties too.

Note: Works best with the latest AutoIt3 beta version (3.3.9). Also, works best with Jos' latest SciTE4AutoIt3 betas.

Enjoy!

SciTE Customizer previous: 15|5|4|0|21|0|10|5|9|11|6

Edited by LaCastiglione

Share this post


Link to post
Share on other sites



Nice little program, but I have noticed a few english errors (Such as a button spelt hilite rather than highlight in the general tab). Also, I have found that it doesnt actually work for me :)

Before you get worried, the reason is that the scite I tested it on was running off my thumbdrive - there is no autoit installation on the computer I am currently using. Therefore, I think that it might be a good idea to have an option for the user to change the directory that it checks for the scite settings in if they are not found by the program, and also have an optional override if they want to use it on a computer (such as my own one, not the one I am using now) where there is a local installation and one on another drive.

Well, thats about it for my criticism for now. Other than that, it is quite well laid out - not horribly cluttered or anything like that. If this were to become a finished project, I would definately use it.

Hope this has helped, and given you a good idea for the program.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you for the kind words. Seeing as to how Australia is the opposite side of Earth and another hemisphere, things there are the opposite of what they are here. My winters are your summers and my nights are your days. Right? I hope that my constructive criticism isn't your sarcasm. =P Kidding.

I corrected the spelling mistakes and am now thinking of how to best implement your suggestions. Thanks!

SciTE was running at the time right? This is strange because SciTE has an interface for getting user settings. No need to know where the SciTE directory is located.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

The original SciTeconfig would write the configuration for some of the settings in properties files that are normally in the User's profile folder and not in the Scite folder. It would ignore the SciTE folder and put them there even if you don't have AutoIt3 and Scite installed on the computer. If yours can overcome that defect I would definitely be interested in taking a look at it.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The original SciTeconfig would write the configuration for some of the settings in properties files that are normally in the User's profile folder and not in the Scite folder. It would ignore the SciTE folder and put them there even if you don't have AutoIt3 and Scite installed on the computer. If yours can overcome that defect I would definitely be interested in taking a look at it.

Have you run the script on your machine? If so, did it get your configuration or did it even work at all?

If SciTE and AutoIt are not installed then SciTEConfig wouldn't be on your computer.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

If where talking anal here ...

In relation to the "User Include Folders" setting, adding some additional support for handling the possible multiple path's here might be a idea.


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

If where talking anal here ...

In relation to the "User Include Folders" setting, adding some additional support for handling the possible multiple path's here might be a idea.

I'm not sure what you mean. Doesn't AutoIt only use one folder as the include folder?

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

So, I'm assuming that you ran the script and that it presented your current SciTE and Tidy configurations accurately?

Well, Yes. Although I did not pay to much attention if settings where actually correct compared to what I use. (Will do that later ... )

I'm not sure what you mean. Doesn't AutoIt only use one folder as the include folder?

Nope, you can use more locations/folders if you like in the 'User' Include setting. (semicolon delimited path setting) ... "X:/Path1;Y:/Path2"

- Useful for keeping different types of 'User' includes files separated. (Debug, Personal function, Others, etc)

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Could not find any settings problem. Except maybe the Tidy:'Tail comments'. All four check-marks are on. (I'm not using any of the related settings in Tidy.ini. ... Except for "endfunc_comment=0", but that one seems to be a old/depreciated option name.)

---

Personal code comment:

When using a lot of switch cases I generally use a initial "Nothing to do" case. (Just a personal habit to eliminate a full scan in case its not really needed.)

$message = GUIGetMsg()
Switch $message ; main edit messages
Case 0 ;; nothing to do.
Case $bgcolor_btn
...
Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

If were talking anal here ...

In relation to the "User Include Folders" setting, adding some additional support for handling the possible multiple paths here might be a idea.

Please try the latest version to see if this is what you wanted. I did the Case 0 thing. I can't believe that I never thought to do that!

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

Observed change: Additional folder selection for the "Standard library" setting.

No no. :) Although being able to change the "Standard library" setting was missing. That was not what I had in mind.

The general problem I have in mind is that here, and in SciteConfig. When you use the [select] on the "User-defined libraries" setting. It allows you only to changed the whole string with a new, but single, path.

So in the case of a user that has a "User-defined libraries" setting with multiple paths (aka: Me). The [select] feature is of no real use.

... But considering the potential work needed versus the minor benefits. I would first take a good look at it ... (+Source code is available, so If I really feel like I need something like that, I could/should try it myself of course.)

Tidy:'Tail comments': Seems ok now, But can't say much more as Tidy itself is giving me unexpected results after trying to ditch the "endfunc_comment=N" option. ... and dinner is calling.


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Thank you for the kind words. Seeing as to how Australia is the opposite side of Earth and another hemisphere, things there are the opposite of what they are here. My winters are your summers and my nights are your days. Right? I hope that my constructive criticism isn't your sarcasm. =P Kidding.

I corrected the spelling mistakes and am now thinking of how to best implement your suggestions. Thanks!

SciTE was running at the time right? This is strange because SciTE has an interface for getting user settings. No need to know where the SciTE directory is located.

Yeah I had it running. But because I use it on numerous computers (and I am a huge fan of portable applications), I had it running off my thumbdrive. Well, I will be looking forward to see whether you will implement that idea of mine, and if so, I will be :) <As happy as that guy there haha.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Yeah I had it running. But because I use it on numerous computers (and I am a huge fan of portable applications), I had it running off my thumbdrive. Well, I will be looking forward to see whether you will implement that idea of mine, and if so, I will be :) <As happy as that guy there haha.

I don't think it can be done. That is if I'm understanding you. I'm going to put SciTE on a thumbdrive and try it on a computer which has never had SciTE installed.

Edit: Forgot to Quote Mikeman

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

I can't get this to run for me. If I run the script from SciTE it errors with the following error:

C:AutoItScriptsSciTE4AU3 ConfigSciTE Director.au3 (26) : ==> The requested action with this object has failed.:

$this.AddProperty("Hwnd", $elscope_private, $hwnd)

$this.AddProperty("Hwnd", $elscope_private, $hwnd)^ ERROR

If I run the .exe it just puts an icon in the System tray and no GUI shows up and it does nothing.

Windows 7 Enterprise, x86, running as an administrator.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I can't get this to run for me. If I run the script from SciTE it errors with the following error:

If I run the .exe it just puts an icon in the System tray and no GUI shows up and it does nothing.

Windows 7 Enterprise, x86, running as an administrator.

Beta or release version of AutoIt? I forgot to mention that the beta version is needed.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

I was using the release. With the Beta version the error goes away, but I found another issue, when I try to change the font used, as soon as I select a font and click OK in the font window I get a series of errors and the font change doesn't get applied.

BTW, this is being used on an installed version of AutoIt, not a portable version, so far.

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2578)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2579)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2580)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2581)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2582)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2583)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2584)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2585)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2586)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2587)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2588)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2589)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2590)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2591)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2592)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2593)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2594)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2595)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2596)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2597)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2598)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2599)

source :

helpfile :

helpcontext : 2036879460

=============================================

=============================================

! AutoItCOM Test: We intercepted a COM error!

description :

windescription: Member not found.

number : 0x80020003

lastdllerror : 0

scriptline : (2600)

source :

helpfile :

helpcontext : 2036879460

=============================================


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I was using the release. With the Beta version the error goes away, but I found another issue, when I try to change the font used, as soon as I select a font and click OK in the font window I get a series of errors and the font change doesn't get applied.

BTW, this is being used on an installed version of AutoIt, not a portable version, so far.

Updated. See OP.

Share this post


Link to post
Share on other sites

Ok, the error with the font selection is gone now, that's a good thing. :)

But, the theme tab doesn't accurately show the console window colors. Also, the Tools tab isn't showing anything in it.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Ok, the error with the font selection is gone now, that's a good thing. :)

But, the theme tab doesn't accurately show the console window colors. Also, the Tools tab isn't showing anything in it.

Could you show me a screen shot of the Theme Settings window and of your console window which show the colors in question?

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

  • Similar Content

    • jmstubiera
      Toggle a form state
      By jmstubiera
      Hello team,
      Any ideas on how I can have a combo box change it's guistate. Below is my code:
      $comboBox = GUICtrlCreateCombo("-- Select Type --", 280, 104, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_DISABLED)) GUICtrlSetData(-1, "One|Two|Three|Four") So basically, once I click on a button, the $combo box's state will change from being disabled to being active again.
       
      Thanks in advance.
    • czardas
      Row Sum (Σ) Formula Validation
      By czardas
      Much work still needs to be done on my current project, but design concepts often benefit more from early criticism. Although there may be nothing particularly innovative about this project, user experience is everything. I would like you to look at the behaviour of the controls on this GUI. Unless you type something really awful, it allows you to finish typing the formula before testing the input. When typing into an edit control, pressing the enter key activates the okay button.
      The program itself, mainly consists of a listview control, which you can't see - just imagine it looks like a stone age version of Excel with a nice paint job, but no bells or whistles. What Row Sum (Σ) is intended to do is loop through all the rows, calculate a sum and print the output in a newly created column. The user is prompted to type a formula into the following GUI. Please try to figure it out, and break it any way you can.
      #include <GUIConstants.au3> #include <GuiEdit.au3> #include <Misc.au3> Global $g_iAvailableCols = 24 ; arbitary dev variable [column count will eventually be read from a listview control] ; missing several thousand lines of code... Formula() ; caution about including columns containing empty fields in the formula ; empty fields are treated as zero ; with addition and subtraction there is never any problem ; multiplication by an empty field (or by zero) returns zero ; division by an empty field (or by zero) returns an empty field [unless - see exception] ; use of the power operator is limited to rows in which all referenced fields contain numbers ; imaginary roots of negative numbers return an empty field [unless - see exception] ; exception: infinity (or an imaginary number) to the power of zero returns a meaningless number Func FormulaSyntax() MsgBox(BitOR(64, 8192), "Row Sum (" & ChrW(0x03A3) & ") : Syntax To Use", _ ; $MB_ICONINFORMATION, $MB_TASKMODAL " mathematical operators :" & @TAB & "+ - * / ^" & @CRLF & _ " column numbers :" & @TAB & @TAB & "c1, c2, c3 etc..." & @CRLF & _ " decimal digits :" & @TAB & @TAB & "0 to 9 and ." & @CRLF & _ " parenthesis :" & @TAB & @TAB & "( )" & @CRLF & _ " minus sign :" & @TAB & @TAB & "-1, -c2, -(c3) etc..." & @CRLF & _ " example :" & @TAB & @TAB & @TAB & "c1 +c2 -c3") EndFunc ;==> FormulaSyntax Func Formula() ; ($hParent, $idListView, $hListView) ; [missing parent window] Local $sTitle = "Row Sum (" & ChrW(0x03A3) & ")", _ $iStyle = BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), _ $iExStyle = BitOR($WS_EX_MDICHILD, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST) Local $hChild = GUICreate($sTitle, 334 +25, 105 +1, Default + 100, Default + 100); , $iStyle, $iExStyle, $hParent) Local $hLabel = GUICtrlCreateLabel("Formula :", 8, 8, 55, 18) GUICtrlSetFont(-1, 10) Local $hSyntax = GUICtrlCreateButton("???", 72, 7, 40, 20) Local $hLabel = GUICtrlCreateLabel("Header :", 127, 8, 49, 18) GUICtrlSetFont(-1, 10) Local $hHeader = GUICtrlCreateInput("", 182, 7, 170, 20) GUICtrlSetFont(-1, 10) Local $hInput = GUICtrlCreateInput("", 7, 33, 320 +25, 40, BitOR($WS_TABSTOP, $ES_MULTILINE)) GUICtrlSetFont(-1, 10) Local $hCheckBox = GUICtrlCreateCheckbox(" Round to", 7, 79, 75, 20) GUICtrlSetFont(-1, 10) Local $hPlaces = GUICtrlCreateInput("2", 86, 79 +1, 20, 20, BitOR($WS_TABSTOP, $ES_CENTER, $ES_NUMBER)) GUICtrlCreateLabel("decimal places", 114 -2, 79 +2, 92, 18) GUICtrlSetFont(-1, 10) Local $hCancel = GUICtrlCreateButton("Cancel", 210, 79 +1, 66, 20) Local $hOkay = GUICtrlCreateButton("OK", 285, 79 +1, 66, 20) GUISetState(@SW_SHOW) Local $sInput = "", $aArray, $iError = 0, $iCols = $g_iAvailableCols ; $iCols = _GUICtrlListView_GetColumnCount($hListView), _ ; >>> CHANGE THIS LATER ;$iRows = _GUICtrlListView_GetItemCount($hListView), $aColOrder = _GUICtrlListView_GetColumnOrderArray($hListView) Local $vTemp, $msg2, $iPlaces = '2' While 1 $msg2 = GUIGetMsg() If $msg2 = $hCancel Or $msg2 = $GUI_EVENT_CLOSE Then ExitLoop If $msg2 = $hSyntax Then FormulaSyntax() ContinueLoop EndIf $vTemp = GUICtrlRead($hPlaces) If $vTemp <> $iPlaces Then If $vTemp > 14 Then GUICtrlSetData($hPlaces, 14) $iPlaces = 14 _GUICtrlEdit_SetSel($hPlaces, 0, -1) ElseIf Not $vTemp Then GUICtrlSetData($hPlaces ,'0') $iPlaces = '0' _GUICtrlEdit_SetSel($hPlaces, 0, -1) EndIf EndIf If BitAND(GUICtrlRead($hCheckBox), $GUI_CHECKED) == $GUI_CHECKED _ And BitAND(GUICtrlGetState($hPlaces), $GUI_DISABLE) == $GUI_DISABLE Then GUICtrlSetState($hPlaces, $GUI_ENABLE) ElseIf BitAND(GUICtrlRead($hCheckBox), $GUI_CHECKED) <> $GUI_CHECKED _ And BitAND(GUICtrlGetState($hPlaces), $GUI_ENABLE) == $GUI_ENABLE Then GUICtrlSetState($hPlaces, $GUI_DISABLE) EndIf $sFormula = GUICtrlRead($hInput) If $sFormula <> $sInput Then If StringRegExp($sFormula, '[^ ]') Then ; spaces between components are ignored If Not ValidSyntax($sFormula, $iCols) Then If @extended < 5 Then If $iError = 0 Then GUICtrlSetBkColor($hInput, 0xFFA090) $iError = 1 ElseIf $iError Then GUICtrlSetBkColor($hInput, 0xFFFFFF) $iError = 0 EndIf ElseIf $iError Then GUICtrlSetBkColor($hInput, 0xFFFFFF) $iError = 0 EndIf ElseIf $iError Then GUICtrlSetBkColor($hInput, 0xFFFFFF) $iError = 0 EndIf $sInput = $sFormula EndIf ; BitAND(WinGetState($hChild), $WIN_STATE_ACTIVE) = 8 If $msg2 = $hOkay Or (_IsPressed("0D") And BitAND(WinGetState($hChild), 8) = 8 And (ControlGetFocus($hChild) = "Edit2" Or ControlGetFocus($hChild) = "Edit1")) Then $sFormula = GUICtrlRead($hInput) ; If StringRegExp($sFormula, '[^ ]') And ValidSyntax($sFormula, $iCols) Then ; missing formula execution code MsgBox(0, "VALID SYNTAX", "Well done, your formula can safely be executed, but" & @CRLF & "can't find parent window.") ExitLoop Else Switch @extended Case 1 $vTemp = "The formula contains illegal characters." Case 2 $vTemp = "No such column exists." Case 3 $vTemp = "The formula contains a syntax error." Case 4 $vTemp = "The formula is missing opening parenthesis." Case 5 $vTemp = "The formula is unterminated" case 6 $vTemp = "The formula is missing closing parenthesis." EndSwitch MsgBox(262160, "uh-uh!", StringRegExp($sFormula, '[^ ]') ? $vTemp : "Please enter a formula.") While _IsPressed("0D") Sleep(50) WEnd ;$iError = 1 EndIf EndIf WEnd GUIDelete($hChild) EndFunc ; formula Func ValidSyntax($sFormula, $iMax) ; [currently requires external check that string <> ""] ; quick test for accepted characters If StringRegExp($sFormula, '(?i)[^c \d\.\+\-\*/\^\(\)]') Then Return SetExtended(1, False) ; illegal characters If StringRegExp($sFormula, '(?i)\.\D|c[0\D]|\d\s+[\.\d]') Then Return SetExtended(3, False) ; syntax $sFormula = StringStripWS($sFormula, 8) ; strip all spaces ; split to separate formula components Local $aFormula = StringRegExp($sFormula, '(?i)\-?c\d+|\-?c|\-?\d*\.\d*|\-?\d+|\-\(|[\+\-\*/\^\(\)]|.+', 3), _ ; create array [ADDED] ==> |.+ $iLast, $sTest, $sExpect = '(?i)\-?\(|\-?c\d+|\-?c|\-?\d*\.\d*|\-?\d+|\-', _ ; valid first component $iBracket = 0, $bSyntax = False, $bNoSuch = False, $bTermination = False ; error tracking variables For $i = 0 To UBound($aFormula) -1 If Not StringRegExp($aFormula[$i], $sExpect) Then ; unexpected code sequence $bSyntax = True ExitLoop EndIf If StringRegExp($aFormula[$i], '(?i)\-?c\d+') Then ; column number $sTest = StringRegExpReplace($aFormula[$i], '(?i)[\-c]+', '') If $sTest > $iMax Or $sTest == 0 Then ; no such column exists $bNoSuch = True ExitLoop EndIf $sExpect = '[\+\-\*/\^\)]' ; operators / closing brackets ElseIf StringRegExp($aFormula[$i], '\-?\d*\.\d*') Then ; decimal If $aFormula[$i] == '.' Or $aFormula[$i] == '-.' Then If $i = UBound($aFormula) -1 Then $bTermination = True ExitLoop EndIf $bSyntax = True ; badly formated decimal ExitLoop EndIf $sExpect = '[\+\-\*/\^\)]' ; as above ElseIf StringRegExp($aFormula[$i], '\-?\d+') Then ; integer $sExpect = '[\+\-\*/\^\)]' ElseIf StringRegExp($aFormula[$i], '\A[\+\-\*/\^]\z') Then ; operator $iLast = UBound($aFormula) -1 If $i = $iLast Or ($i = $iLast -1 And $aFormula[$iLast] == '-') Then $bTermination = True ExitLoop EndIf $sExpect = '(?i)\-?\(|\-?c\d+|\-?c|\-?\d*\.\d*|\-?\d+' ElseIf $aFormula[$i] == '(' Or $aFormula[$i] == '-(' Then ; opening bracket $iBracket += 1 $sExpect = '(?i)\-?\(|\-?c\d+|\-?c|\-?\d*\.\d*|\-?\d+|\-' ElseIf $aFormula[$i] == ')' Then ; closing bracket $iBracket -= 1 $sExpect = '[\+\-\*/\^\)]' ElseIf $aFormula[$i] = 'c' Or $aFormula[$i] = '-c' Then ; unterminated column number If $i = UBound($aFormula) -1 Then $bTermination = True Else $bSyntax = True ExitLoop EndIf Else ; unexpected exception [this should never happen] $bSyntax = True ExitLoop EndIf If $iBracket < 0 Then ExitLoop ; closing (unopened) parenthesis error ; [formula looks okay so far] Next ; better to be a bit wordy [for clarity] If $bNoSuch Then Return SetExtended(2, False) ; no such column exists If $bSyntax Then Return SetExtended(3, False) ; syntax error If $iBracket < 0 Then Return SetExtended(4, False) ; missing opening parenthesis If $bTermination Then Return SetExtended(5, False) ; formula may not terminate with operator or c If $iBracket > 0 Then Return SetExtended(6, False) ; missing closing parenthesis ; ConsoleWrite('valid' & @LF) Return True ; formula is correct EndFunc ;==> ValidSyntax  
    • david1337
      add/remove from txt file inside GUI
      By david1337
      Hey guys
      I need help to get further with this script
       
      Test.txt contains lines like this:
      _______________
      Line1
      Line2
      Line3
      _______________
      I have managed to view the content of a txt file in the left side of a GUI like this:
      #Include <File.au3> #include <GUIConstants.au3> Global $file = FileRead("Test.txt") GUICreate("", 800, 800, 192, 124) $control = GUICtrlCreateEdit($file, 0, 0, 400, 800, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY) GUICtrlSetFont(-1, 14, 400, 0, "@Arial Unicode MS") GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetState($control, $GUI_FOCUS) ;Makes sure that text is not highlighted by default GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
      Okay so is it possible to make each line become a clickable item?
      Say I want to delete Line2, then I highlight it and click a "remove" button.
      Also an "add" button would be needed to add new lines
      On Case $GUI_EVENT_CLOSE the changes should be saved to Test.txt (Or with a save button)
       
      Is this possible?
      I hope you can help me :-)

       
    • genius257
      Is it possible to throw an error in a ScriptControl object, via AutoIt
      By genius257
      First of all I've been searching on the forum, and while there's been done something like this with: https://www.autoitscript.com/forum/topic/141004-comobject-proxy-seamless-windows-script-control-autoitobj/
      I could not find any solution to my predicament.
       
      Is it possible to throw an error in a ScriptControl object, via AutoIt?
      I have a script, where AutoIt calls ScriptControl:JavaScript which in turn calls AutoIt.
      However i would like to be able to make AutoIt invoke an exception within ScriptControl, if the called functionality fails.
      Here's some code for reference:
      #AutoIt3Wrapper_Run_AU3Check=n #include-once #include "AutoitObject.au3" #include <WinAPIDiag.au3> $oJS = ObjCreate("ScriptControl") $oJS.Language = "JScript" $oJS.TimeOut = 0; A value of 0 means that the ScriptControl will monitor the execution of the script and will trigger the Timeout event if it determines that the script is hung. _AutoItObject_Startup() $oAutoIt = _AutoItObject_Create() _AutoItObject_AddMethod($oAutoIt, "Execute", "_Execute", False) $oJS.AddObject("AutoIt", $oAutoIt, True) OnAutoItExitRegister("_CleanUp") $_AutoItError = ObjEvent("AutoIt.Error", "_AutoItError") Func _CleanUp() ConsoleWrite("Cleaning up..."&@CRLF) $oJS = 0 $oAutoIt = 0 _AutoItObject_Shutdown() EndFunc Func _Execute($oSelf, $sString) $vReturn = Execute($sString) If @error<>0 Then Return $oJS.Eval("throw new SyntaxError();"); Does invoke exception, but not within the try/catch Return $vReturn EndFunc Func _AutoItError($oError) $oError2 = $oJS.Error ConsoleWrite( _ "Column: " & $oError2.Column & @CRLF & _ "Description: " & $oError2.Description & @CRLF & _ "HelpContext: " & $oError2.HelpContext & @CRLF & _ "HelpFile: " & $oError2.HelpFile & @CRLF & _ "Line: " & $oError2.Line & @CRLF & _ "Number: " & $oError2.Number & @CRLF & _ "Source: " & $oError2.Source & @CRLF & _ "Text: " & $oError2.Text & @CRLF _ ) $oError2.Clear() EndFunc $oJS.Eval("(function(){"& _ "try{"& _ "AutoIt.Execute('MsgBox(0,\'\', \'a\')');"& _ "AutoIt.Execute('a.b');/*error should occur here*/"& _ "AutoIt.Execute('MsgBox(0,\'\', \'b\')');"& _ "}catch(e){"& _ "AutoIt.Execute('ConsoleWrite(\'Error\'&@CRLF)');"& _ "}"& _ "})()")  
    • Morthawt
      Utilising existing GUI code in koda.
      By Morthawt
      I have a program I made long ago for something but I never saved the koda file so it would make it a complete pain for me to visually tweak anything because as far as I am aware, I would have to design an entirely new GUI.
      Would it be possible for you guys at AutoIt to add functionality to Koda so that you can take an existing GUI section, with while loop and cases and all and then koda would literally build it ready for tweaking and where existing things still exist and have been tweaked, it would tweak such details and keep all the existing case information and added formatting things that were manually tweaked etc?
      This would be really amazing and I feel that other people would benefit from it. I can't be the only person who makes a GUI, doesn't save it and then has no problems making minor tweaks in-code but struggles like hell to go rearranging things perfectly. That is where using a GUI (koda) to make and arrange a GUI you are making, makes everything easy and pleasure to deal with.
      tldr;
      Example:
      A friend gives me his code and wants help. The GUI is just a mess, but trying to do all the alignment and positioning all by digits in code would be a pain. I cannot just hallucinate where everything is based on pixel locations and sizes. So I would take the entire GUI chunk of code, all the form/controls/formatting functions/while loop/switch/case in it's entirety and paste it into an area of Koda and press a button. Koda would then build the GUI on the screen, placing all the controls and formatting them with the instructions that may have been added and keeps the case information as-is. Then when you make your alterations in Koda, you go to export it and it makes an entirely new export that re-makes (from scratch as if you had made this GUI from scratch) all the code for controls, size, placement etc and then also adds all the existing case code back as part of the code you then send (or manually copy/paste as I do) to Scite editor.
      Is there any chance this could be implemented? I think this could help a lot of people with their own scripts and others'.