Jump to content
Sign in to follow this  
Orkhayiq

How to disable a control when another control has certain data set

Recommended Posts

Orkhayiq

In my script I have 2 parts. The code inside a While Select Case and the code outside of it above where all the GUICreate.. etc goes. (Sorry, Still learning so I gotta elaborate on simple things I don't know terms for or whatever just to get my point across! :mellow: )

I have $DirectX_CmbBox which is a ComboBox with the set data of "Auto|9|10|11" and I'd like my radio buttons to be disabled $GUI_DISABLE when the user selects "9" from the ComboBox except for the first radio button of $AF_Radio_1x.

I have managed to make the radio buttons disabled if the ComboBox GUICtrlReads "9" and when the control reads Auto, 10 or 11 they are enabled though I have one problem. The radio buttons are constantly flashing/blinking.

All the code is inside a While amongst other Cases. The code itself that I've written so far is most likely long winded and not very efficient, but all I'd really like help with is stopping the controls from blinking (the radio buttons).

Case GUICtrlRead($DirectX_CmbBox) = "9"
            
            GUICtrlSetState($AF_Radio_1x, $GUI_CHECKED)

            GUICtrlSetState($AA_Radio_2x, $GUI_DISABLE)
            GUICtrlSetState($AA_Radio_4x, $GUI_DISABLE)
            GUICtrlSetState($AA_Radio_8x, $GUI_DISABLE)
            GUICtrlSetState($AA_Radio_8xQ, $GUI_DISABLE)
            GUICtrlSetState($AA_Radio_16x, $GUI_DISABLE)
            GUICtrlSetState($AA_Radio_16xQ, $GUI_DISABLE)
            
            
        Case GUICtrlRead($DirectX_CmbBox) = "10"
            
            GUICtrlSetState($AA_Radio_2x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_4x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_8x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_8xQ, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_16x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_16xQ, $GUI_ENABLE)
            
        Case GUICtrlRead($DirectX_CmbBox) = "11"
            
            GUICtrlSetState($AA_Radio_2x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_4x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_8x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_8xQ, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_16x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_16xQ, $GUI_ENABLE)
            
        Case GUICtrlRead($DirectX_CmbBox) = "Auto"
            
            GUICtrlSetState($AA_Radio_2x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_4x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_8x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_8xQ, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_16x, $GUI_ENABLE)
            GUICtrlSetState($AA_Radio_16xQ, $GUI_ENABLE)

I always do my best to check and understand the helpfile before asking, forgive me if I missed the answer.

TIA!

Edited by Orkhayiq

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

The trick to prevent flashing is to check if the control is already in the state you want before (re)setting it: :(

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hCheck = GUICtrlCreateCheckbox(" Switch", 10, 10, 100, 20)
$hRadio_1 = GUICtrlCreateRadio(" Radio 1", 10, 50, 100, 20)
$hRadio_2 = GUICtrlCreateRadio(" Radio 2", 10, 90, 100, 20)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    If GUICtrlRead($hCheck) = 1 Then

        GUICtrlSetState($hRadio_1, $GUI_DISABLE)

        If BitAND(GUICtrlGetState($hRadio_2), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($hRadio_2, $GUI_DISABLE)

    Else

        GUICtrlSetState($hRadio_1, $GUI_ENABLE)

        If BitAND(GUICtrlGetState($hRadio_2), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($hRadio_2, $GUI_ENABLE)

    EndIf

WEnd

I hope that the difference between the way the 2 radios are dealt with is clear. :mellow:

M23

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

I'm working on figuring out my problem with your example. :mellow:

Just a quick question before I attack it properly. Is your example meant to have Radio 2 flashing?

Is this to show me the difference or just an error on your side or something? Radio 1 is fine.

Thanks.

Edited by Orkhayiq

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

Sorry - a "copy-paste" error meant I got the titles the wrong way round. :mellow:

I have edited the post above. The top radio should flash, the bottom one remain steady, i.e. 1 = flash and 2 = not!

Apologies again! :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

Human error. What can you do..

..Fix it, like you did!

Thanks :mellow:

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

As the English saying goes:

To err is human, to forgive divine*.

Guess you live on Mount Olympus then..... :mellow:

M23

*Alexander Pope, An Essay on Criticism

English poet & satirist (1688 - 1744)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

:mellow:

Funnily, Mr. Pope's old residency is nearby where I live.

I'm no Zeus but I try :lol:

What I've managed so far:

If GUICtrlRead($DirectX_CmbBox) = "9" Then      
        
        If BitAND(GUICtrlGetState($AA_Radio_1x), $GUI_UNCHECKED) <> $GUI_UNCHECKED Then GUICtrlSetState($AA_Radio_1x, $GUI_CHECKED)
            
        If BitAND(GUICtrlGetState($AA_Radio_2x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_2x, $GUI_DISABLE)         
        If BitAND(GUICtrlGetState($AA_Radio_4x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_4x, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_8x, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8xQ), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_8xQ, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_16x, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16xQ), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_16xQ, $GUI_DISABLE) 
        
    Else
        
        If BitAND(GUICtrlGetState($AA_Radio_2x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_2x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_4x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_4x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_8x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8xQ), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_8xQ, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_16x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16xQ), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_16xQ, $GUI_ENABLE)

    EndIf

I can't manage to get the $AF_Radio_1x button to always be checked If GUICtrlRead($DirectX_CmbBox) = "9". Also, if another radio button was previously checked.. and I choose "9" in the ComboBox then the previous just greys out but doesn't remove the check meaning I can then select the first radio button as well resulting in 2 buttons checked. (One enabled checked, one disabled checked.)

I'm guessing if I can manage to get the first button ($AF_Radio_1x) to be checked on "9" then it'll remove the last checked one.

Edited code to include:

If BitAND(GUICtrlGetState($AA_Radio_1x), $GUI_UNCHECKED) <> $GUI_UNCHECKED Then GUICtrlSetState($AA_Radio_1x, $GUI_CHECKED)

Simpler than I thought!

I can settle for the functionality of how it's working now. But..

What would be better is if the previously selected Radio Button would uncheck on selecting "9" (like it does already) but then recheck the last selected button before it had GUISetState'ed it to the first button.

Thanks once again M23 :(

Edited by Orkhayiq

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

Just a thought. If you created your $AA_Radio* controls in IMMEDIATE succession, you could use a loop to save your fingers a whole load of typing. A quick example:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hRadio_1 = GUICtrlCreateRadio(" Radio 1", 10,  10, 100, 20)
GUICtrlCreateRadio(" Radio 2", 10,  50, 100, 20)
GUICtrlCreateRadio(" Radio 3", 10,  90, 100, 20)
GUICtrlCreateRadio(" Radio 4", 10, 130, 100, 20)
GUICtrlCreateRadio(" Radio 5", 10, 170, 100, 20)

GUISetState()

Sleep(2000)

For $i = $hRadio_1 To $hRadio_1 + 4
    GUICtrlSetState($i, $GUI_DISABLE)
Next

Sleep(2000)

For $i = $hRadio_1 To $hRadio_1 + 4
    GUICtrlSetState($i, $GUI_ENABLE)
Next

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Remember - you must have the controls created in IMMEDIATE succession or the ControlIDs are not successive and this will not work. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

Cheers for the advice. I'll see what I can do.

In the meanwhile. Is there anyway to stop the first radio button from being checked unless it is actually clicked.

At the moment, if the mouseovers the "9" in the ComboBox list it causes it to check the first Radio Button. If I could make it only cause the reaction if it is actually clicked would be better.

Got any suggestions where to start? :mellow:

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

Perhaps if you let me see a bit more of the code, I might be able to suggest something...... :mellow: Four Case statements do not a script make! :(

PM the code if you do not want it in open forum.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

The code isn't a money-maker so I don't mind posting it here! ..But it's bloated, messy and too much to look through so I cut out the rest unrelated to the topic. :lol:

#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>

GUICreate("TEST", 500, 500)

    GUISetState(@SW_SHOW)


; DIRECTX
$Graphics_DirectX_ini = IniRead ( @MyDocumentsDir&"\BFBC2\settings.ini", "Graphics", "DxVersion", "NotFound" )

$DirectX_CmbBox = GUICtrlCreateCombo("", 130, 300, 110, 20, $CBS_DROPDOWNLIST)

        $DxVars = GUICtrlSetData(-1, "Auto|9|10|11", $Graphics_DirectX_ini )

; ANTI-ALIASING
$AA = GUICtrlCreateGroup("Anti-Aliasing", 255, 300, 215, 55)
GUICtrlSetFont($AA, "8", 1000)

$Graphics_AA_ini = IniRead ( @MyDocumentsDir&"\BFBC2\settings.ini", "Graphics", "MSAA", "NotFound" )

$AA_Radio_1x = GUICtrlCreateRadio( "1x", 265, 315, -1, 13)
$AA_Radio_2x = GUICtrlCreateRadio( "2x", 305, 315, -1, 13)
$AA_Radio_4x = GUICtrlCreateRadio( "4x", 345, 315, -1, 13)
$AA_Radio_8x = GUICtrlCreateRadio( "8x", 385, 315, -1, 13)
$AA_Radio_8xQ = GUICtrlCreateRadio( "8xQ", 425, 315, -1, 13)
$AA_Radio_16x = GUICtrlCreateRadio( "16x", 265, 335, -1, 13)
$AA_Radio_16xQ = GUICtrlCreateRadio( "16xQ", 305, 335, -1, 13)


While 1


    $msg = GUIGetMsg()
            
    If $msg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf


    
    If GUICtrlRead($DirectX_CmbBox) = "9" Then
        
        If BitAND(GUICtrlGetState($AA_Radio_1x), $GUI_UNCHECKED) <> $GUI_UNCHECKED Then GUICtrlSetState($AA_Radio_1x, $GUI_CHECKED)
        
            
        If BitAND(GUICtrlGetState($AA_Radio_2x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_2x, $GUI_DISABLE)         
        If BitAND(GUICtrlGetState($AA_Radio_4x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_4x, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_8x, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8xQ), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_8xQ, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16x), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_16x, $GUI_DISABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16xQ), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($AA_Radio_16xQ, $GUI_DISABLE)
            
        
    Else
        
        If BitAND(GUICtrlGetState($AA_Radio_2x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_2x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_4x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_4x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_8x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_8xQ), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_8xQ, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16x), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_16x, $GUI_ENABLE)
        If BitAND(GUICtrlGetState($AA_Radio_16xQ), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($AA_Radio_16xQ, $GUI_ENABLE)
        EndIf
        
WEnd

If you select any other value besides "9" on the dropdown and click any other radio box than the first one, and then, move-over the dropdown value "9" and it'll set the radio button to the first one. I'd rather it only happen on mouse-click than mouse-over.

Dig in. :(

Also:

Four Case statements do not a script make! :P

Eh? :mellow:

Oh.. I guess you meant 'make a script!' that took far too long to figure out hah.

Edited by Orkhayiq

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

First things first:

"One swallow does not a summer make, nor one fine day; similarly one day or brief time of happiness does not make a person entirely happy"

Aristotle (384 BC - 322 BC)

; -----------

Now let us talk of AutoIt, "of cabbages and kings, of why the sea is boiling hot, and whether pigs have wings"*

You need to look at the state of the Combobox and wait until it is no longer open before actioning the Case statements. Try this line:

If GUICtrlRead($DirectX_CmbBox) = "9" And _GUICtrlComboBox_GetDroppedState($DirectX_CmbBox) = False Then

and add #Include <GuiComboBox.au3> at the top of the script. I only get the "1x" Radio selected if I select 9 in the Combo, not if I mouse-over it with the Combo still open.

You may have to unselect all the Radios after you have run each Case statement though - I often find you need to reset all controls to a neutral state before any reselection.

I hope this helps. :mellow:

M23

* Lewis Carroll - Through the Looking-Glass and What Alice Found There - 1872


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

..you and your quotes! :(

Thank you very much, that line worked like a charm!

Couldn't of done it without you.

I don't fully understand what you meant by the possible need to unselect the Radios after running each Case, but all seems fine so I don't think I'm getting any problems :mellow:

All that is left to do with my outstanding IniWriter is to attach an Icon to replace the AutoIt default. I managed to find out how to do so using the Aut2exe.exe. The only problem I have is this. It's not essential but it would be nice to fix since with Vista and Win7, most applications come with high-res .icos as standard. Any idea?

Was a Win7 bug. I did try refresh, moving to different folders when it was giving the error but now, on a later attempt, it is working perfectly.

Thanks, officially finished my prog! :lol:

..naturally I've come up with something else I could do. When the user presses the about window, I'd like to display the compiled .ico instead of a question mark(32) icon for example. I'll see if I can figure it out..

Also a question: Do you know if the .exe compiler writes comments into and .exe? like ; This is a comment. Would it be present inside the .exe but left out from running like how the script handles it, or would it not be written at all? (I'm deleting comments just to make it smaller and more like a finished piece.)

Edited by Orkhayiq

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

I don't fully understand what you meant by the possible need to unselect the Radios after running each Case

If you run the script you posted (with my additions) then you will see what I mean. Select anything other than 9 in the Combo and the "1x" radio remain unchecked. Select 9 and it is checked. Reselect anything else and it remains checked. Do you want it selected for the other cases or not?

That is why I said that resetting everything at the end of an operation is not a bad thing as you then start from a known point. :lol:

When the user presses the about window, I'd like to display the compiles .ico instead of a question mark(32) icon

You might like to look at this excellent UDF which may help. :mellow:

Do you know if the .exe compiler writes comments into and .exe?

No, it strips everything bar code. So you have no need to delete your comments - then you might stand a chance of understanding the code in a few months, weeks (or in my case days! :( ) time.

You might like to look at Obfuscator - Jos initially wrote it to befuddle anyone trying to look at the compiled script, but it has developed over time into something much more powerful which amongst other things helps make your exes much smaller. You get it with the full SciTE4AutoIt3 package, which you can download here. I cannot recommend it highly enough - you get lots of goodies to make your life easier. In fact most people wonder how they ever lived without it once they have installed it! (Another commission payment please Jos! :P )

M23

P.S. No quotes this time, did you notice?


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

If you run the script you posted (with my additions) then you will see what I mean. Select anything other than 9 in the Combo and the "1x" radio remain unchecked. Select 9 and it is checked. Reselect anything else and it remains checked. Do you want it selected for the other cases or not?

That is why I said that resetting everything at the end of an operation is not a bad thing as you then start from a known point. :P

Ah I think I understand you now!

You might like to look at this excellent UDF which may help. :mellow:

I did do a search or two but wasn't probably searching the right keywords it seems. If I can implement it within a couple hours that'll be good otherwise I'll keep this in mind for future projects, thanks. :P

EDIT: Looks like I already have that UDF, didn't know it had that functionality. Now to do some reading, testing, compiling then deploying!

No, it strips everything bar code. So you have no need to delete your comments - then you might stand a chance of understanding the code in a few months, weeks (or in my case days! :( ) time.

Ahh, very nice. Now I gotta copy the comments back in from my outdated backup .au3! Atleast I won't be making this mistake again. :lol:

You might like to look at Obfuscator - Jos initially wrote it to befuddle anyone trying to look at the compiled script, but it has developed over time into something much more powerful which amongst other things helps make your exes much smaller. You get it with the full SciTE4AutoIt3 package, which you can download here. I cannot recommend it highly enough - you get lots of goodies to make your life easier. In fact most people wonder how they ever lived without it once they have installed it! (Another commission payment please Jos! :D )

I've downloaded the SciTE full pack a couple days ago an noticed a lot of the menubar submenus had a lot more in 'em!

I tried using the Obfuscator without much success. It's most likely my code or error on my behalf because I couldn't get it to work! ..and it looked like it was making my code bigger than actually smaller. 1000 lines of code transformed into 9000 haha and the filesize of the compiled .exe went up to the same size as the one packing a 200kb high res icon included. I'm doing something wrong here I know it. Well, I've got time to figure it out at another point. 680kb for my mini-app is just fine for me liking.

Thanks for all your help! :>

P.S No quotes? I knew you'd run out soon Hahah :evil:

Edited by Orkhayiq

Share this post


Link to post
Share on other sites
Melba23

Orkhayiq,

Your code probably became bigger because all of the include files were added. You might want to use Obfusctor with the /StripOnly parameter to get rid of all the functions in the include files that you are not using.

It takes a while to get used to all the new toys in the full SciTE version, but it is worth persevering as they really do help. :mellow:

Jos,

Getting better - it was only 5% last time. Although I suppose that as even 100% would still be nothing, I have not really gained anything! :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Orkhayiq

In that case I'll take a cut please too. :(

I just discovered the Koda(FormDesigner) and oh my God..

This is great! Wish I'd known about it at the start of the project.

Making big GUI changes at the end of the project can be a pain moving all the elements around!

I'm guessing you can use it to change the layout at any point relatively easily..

Lovely beginners tool and for the lazy advanced ones too :lol:

Looks like an all-round time saver.

We live and learn, and I've got a lot of the later left.. in fact, quite a lot of both.

Haha, take it easy :mellow:

Edited by Orkhayiq

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.