Jump to content

general GUI help


Recommended Posts

hi all

i have a few simple questions about my gui. the questions are bellow but i think it all makes more sense if you run the program or at least look at the code. so i have uploaded the file and i have put the appropriates q? by the the area of script that i think it belongs with.

1. is it possible to get my program to sense how many Hard drives my computer has then display the appropriate number of check boxes

2. how do i make the passes item un usable until options (Classified- DoD 5220-22.M or Top Secret- Guttman Algorithm are selected)

3. How do i stop the passes item going lower than 1 and higher than 35

4. How do i set the Button color with out losing the pic?

5. How do i make a Case statement run another Case statement

any help on any of these items would be great

thanks again

options.au3

Link to comment
Share on other sites

Q1- Yes. Try this in your code. I think you know where it goes :rolleyes: I also added the label :x

; TREEVIEW DrivOP
$DriveOP = GuiCtrlCreateTreeView(70, 130, 41, 80, $TVS_CHECKBOXES); is it posiable to get my program to sense how many drives my computer has then disply the aproprout number of check boxes
$drives = DriveGetDrive ("FIXED")
$x = 132
For $i = 1 to $drives[0]
    $label = DriveGetLabel($drives[$i])
    GuiCtrlCreateTreeViewItem($drives[$i], $DriveOP)
    GuiCtrlCreateLabel($label, 110, $x, 80, 20)
    $x += 16
Next
GUICtrlSetColor ($DriveOP,0xD00000)
GUICtrlSetBkColor ($DriveOP,0x4AB5FF)

GuiCtrlCreateLabel("Select securaty settings:", 70, 270, 200, 20)

I've got to go now... So probably not much more help from me :rambo:

Link to comment
Share on other sites

3. How do i stop the passes item going lower than 1 and higher than 35

Use GuiCtrlSetLimit().

Add the limit statement after you create your UpDown control, thus:

GuiCtrlCreateLabel("Passes", 340, 270)                                              ;How do i stop the passes item going lowere than 1 and higher than 35
GuiCtrlCreateInput("2", 340, 285, 40, 20)
GuiCtrlCreateUpDown(-1)
GUICtrlSetLimit(-1,35,1)

5. How do i make a Case statement run another Case statement

You can nest another "Select/EndSelect" inside an existing Case

Hope that helps

Link to comment
Share on other sites

tar man thats a great help but i still don't really understand the nesting the case statement, any chance of a little more help

Here's a simple example, note the 2nd Select construct "nested" inside of the 1st Select after the second Case - Case StringInStr($Str,"John"). If you change the "Smith" in the variable $str to "Brown", you will only get the message box with "John" from the last Case of the nested select. And if that was too confusing, just run the sample :rolleyes:

$str = "John Smith"

Select
    Case StringInStr($Str,"Joe")
        MsgBox(0,"","Joe")

    Case StringInStr($Str,"John")
        Select
            Case StringInStr($Str,"Smith")
                MsgBox(0,"",$Str)
            Case Else
                MsgBox(0,"","John")
        EndSelect

EndSelect
Link to comment
Share on other sites

Here's a simple example, note the 2nd Select construct "nested" inside of the 1st Select after the second Case - Case StringInStr($Str,"John"). If you change the "Smith" in the variable $str to "Brown", you will only get the message box with "John" from the last Case of the nested select. And if that was too confusing, just run the sample :rolleyes:

$str = "John Smith"

Select
    Case StringInStr($Str,"Joe")
        MsgBox(0,"","Joe")

    Case StringInStr($Str,"John")
        Select
            Case StringInStr($Str,"Smith")
                MsgBox(0,"",$Str)
            Case Else
                MsgBox(0,"","John")
        EndSelect

EndSelect
lol no i understand how to nest the case what i don't understand is well let me demonstrate with my code:

Case $msg = $Hellpbutton1

Msgbox(64,"PUP- Quick Star Help","Select one of the options etc")

Case $msg = $SUBMenuHELPitem

$msg = $SUBMenuaboutitem1

Case $msg = $SUBMenuaboutitem1

MsgBox(64,"About","PUP - Data deletion program etc")

what id like to do is get Case $msg = $SUBMenuHELPitem to run Case $msg = $SUBMenuaboutitem1 or at least display its msgbox with out just copying and pasting it in. sorry i should have been more clear. any ideas or have i just missed the plot

Link to comment
Share on other sites

what id like to do is get Case $msg = $SUBMenuHELPitem to run Case $msg = $SUBMenuaboutitem1 or at least display its msgbox with out just copying and pasting it in. sorry i should have been more clear. any ideas or have i just missed the plot

Either:

Case $msg = $SUBMenuHELPitem OR $msg = $SUBMenuaboutitem1
   MsgBox(64,"About","PUP - Data deletion program etc")

Or, to use your original code structure, checkout the ContinueCase example in the helpfile.

Link to comment
Share on other sites

  • 2 weeks later...

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...