Jump to content

I need some help to hide a radio button group until the user selects a button


LetsAuto
 Share

Recommended Posts

Follow up with an update as to what problem you are currently facing?

Remember to always note at which line(s) the errors are occurring. Feel free to ask about anything that you don't fully understand as it's always the small things that keep a program from functioning.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

add items from one list box to another using an add button is done how?... ahah... so this is my code (i used the Koda build tool)

#include
#include 
#include 
#include 
#include 
#Region ### START Koda GUI section ### Form=
$automationWizardStep2 = GUICreate("Automation Wizard Step 2", 532, 420, 192, 124)
$optionsListBox = GUICtrlCreateList("", 26, 99, 161, 227)
GUICtrlSetData(-1, "DoAddFunction1()|DoAddFunction2()")
$addButton = GUICtrlCreateButton("--->", 233, 104, 65, 41)
$removeButton = GUICtrlCreateButton("<---", 233, 160, 65, 41)
$nextButton = GUICtrlCreateButton("Next", 217, 331, 97, 49)
$Label1 = GUICtrlCreateLabel("Please Select the functions that you want to run", 26, 32, 244, 25)
$selectAllButton = GUICtrlCreateButton("Select All", 233, 216, 65, 41)
$addedBox = GUICtrlCreateList("", 346, 99, 161, 227)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $addButton

EndSwitch
WEnd

the window works, i just need to know how to get the buttons to work with the selected index of the populated list box.. i feel as if using an array to populate the listbox would be much easier

Link to comment
Share on other sites

First let's think about the real world logic...

If [right ARROW] is pressed, move the highlighted item from [left COLUMN] to [right COLUMN]

Now programming logic...

If [right ARROW] is pressed,

read the selected control from left column

delete selected control from left column

insert the read control into the right column

Now to code. This is tested and works.

#include <GUIConstants.au3>
#include <GuiListBox.au3>

#Region ### START Koda GUI section ### Form=
$automationWizardStep2 = GUICreate("Automation Wizard Step 2", 532, 420, 192, 124)
$optionsListBox = GUICtrlCreateList("", 26, 99, 161, 227)
GUICtrlSetData(-1, "DoAddFunction1()|DoAddFunction2()")
$addButton = GUICtrlCreateButton("--->", 233, 104, 65, 41)
$removeButton = GUICtrlCreateButton("<---", 233, 160, 65, 41)
$nextButton = GUICtrlCreateButton("Next", 217, 331, 97, 49)
$Label1 = GUICtrlCreateLabel("Please Select the functions that you want to run", 26, 32, 244, 25)
$selectAllButton = GUICtrlCreateButton("Select All", 233, 216, 65, 41)
$addedBox = GUICtrlCreateList("", 346, 99, 161, 227)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $addButton
            _LeftToRight($optionsListBox, $addedBox)
    EndSwitch
WEnd

Func _LeftToRight(Const $list, Const $addlist)
    Local $sRead
    $sRead = GUICtrlRead($list)
    ConsoleWrite($sRead & @CR)
    If $sRead = "" Then
        msgbox(16+262144, @ScriptName, "No value selected!")
    Else
        ConsoleWrite(_GUICtrlListBox_DeleteString($list, _GUICtrlListBox_FindString($list, $sRead, True)) & @CR)
        ConsoleWrite(_GUICtrlListBox_AddString($addlist, $sRead) & @CR)
    EndIf
EndFunc

Now just create the same function, but you're going to do it in reverse for the left arrow.

EDIT: Changed function name to be more clear.

Edited by Mechaflash
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

you are correct sir

EDIT: And GuiCtrlRead() the $addlist instead of the $list

Edited by Mechaflash
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...