Sign in to follow this  
Followers 0
mrbloody369

Should I take a difFrent rout?

3 posts in this topic

#1 ·  Posted (edited)

I'm trying to script a GUI for a game that gives you the probability that you will have when trying to creating an item based on 4 inputs(stat LVL's). The issue is I have a pagecontrol with 6 tabsheets(diffrent types of items per tab) each with it's own combobox. I wanted to make it when the user clicks the tab it sets the other tabsheets combobox'es to "NONE" & set a value to $value so the GUI knows what combobox to use..

example follows:

#include <GUIConstants.au3>
$Value = 0
$box = 0
#Region ### START Koda GUI section ### Form=c:documents and settingsusermy documentstestb-ilro_blacksmith_cala.kxf
$dlgTabbed = GUICreate("Bloody's  blackSmithing Calc", 671, 148, 192, 119)
GUISetIcon("D:05.ico")
$PageControl1 = GUICtrlCreateTab(103, 8, 400, 55)
$EXIT = GUICtrlCreateButton("&Close", 406, 88, 75, 25, 0)
$OK = GUICtrlCreateButton("&OK", 300, 88, 75, 25, 0)
$TabSheet1 = GUICtrlCreateTabItem("Dagger")
$Combo1 = GUICtrlCreateCombo("NONE", 136, 32, 335, 25)
GUICtrlSetData(-1,"KNIFE|CUTTER|MAIN GAUCHE|DIRK|DAGGER|STILETTO|GLADIUS|DAMASCUS") 
GUICtrlSetState(-1,$GUI_SHOW) ;~~  SHOW FIRST
;~~> tab 1 = 1
$TabSheet2 = GUICtrlCreateTabItem("Sword ")
$Combo2 = GUICtrlCreateCombo("NONE", 136, 32, 335, 25)
GUICtrlSetData(-1,"SWORD|FALCHION|BLADE|RAPIER|SCIMITAR|RING POMMEL SABER|SABER|HAEDONGGUM|TSURUGI|FLAMBERGE")  
;~~> tab 2 = 2
$TabSheet3 = GUICtrlCreateTabItem("Two-Handed Sword")
$Combo3 = GUICtrlCreateCombo("NONE", 136, 32, 335, 25)
GUICtrlSetData(-1,"SLAYER|BASTARD SWORD|TWO-HANDED SWORD|BROAD SWORD|CLAYMORE") 
;~~>  tab 3 = 3

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $Msg = GUIGetMsg()
        
        If $msg = $OK Then
            _getBOX()
            MsgBox(1, "Message", $box & " was selected")
        EndIf
        
    If $msg = $EXIT Then ExitLoop
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend ; returns to the while to create the loop.
    
    Func _getBOX()
        If $Value = 1 Then
            $box = $Combo1
        EndIf
        If $Value = 2 Then
            $box = $Combo2
        EndIf
        If $Value = 3 Then
            $box = $Combo3
        EndIf
    EndFunc
    ;~~> _getvalue
    
    Func _getvalue()
        ;????? how i set a value when a person clicks on a tab and "NONE"(NULLS) out
        ;the othe tab comboboxes?
    EndFunc
    ;~~> _getBOX

All and any pushes in the right or better direction is gratefully appreciated.

Mr B.

p.s. What happened to the spell check in the post options?? Its little box is gone :) ...

update... Spell check returned =D

Edited by mrbloody369

Favorite Quotes"If you apply your mind you can create any thing you can dream of" "Any thing can get done by simply click of a button"

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe look at this:

#include <GUIConstants.au3>
$Value = 0
;~ $box = 0
#Region ### START Koda GUI section ### Form=c:documents and settingsusermy documentstestb-ilro_blacksmith_cala.kxf
$dlgTabbed = GUICreate("Bloody's  blackSmithing Calc", 671, 148, 192, 119)
GUISetIcon("D:05.ico")
$PageControl1 = GUICtrlCreateTab(103, 8, 400, 55)
$EXIT = GUICtrlCreateButton("&Close", 406, 88, 75, 25, 0)
$OK = GUICtrlCreateButton("&OK", 300, 88, 75, 25, 0)
$TabSheet1 = GUICtrlCreateTabItem("Dagger")
$Combo1 = GUICtrlCreateCombo("NONE", 136, 32, 335, 25)
GUICtrlSetData(-1,"KNIFE|CUTTER|MAIN GAUCHE|DIRK|DAGGER|STILETTO|GLADIUS|DAMASCUS") 
GUICtrlSetState(-1,$GUI_SHOW) ;~~  SHOW FIRST
;~~> tab 1 = 1
$TabSheet2 = GUICtrlCreateTabItem("Sword ")
$Combo2 = GUICtrlCreateCombo("NONE", 136, 32, 335, 25)
GUICtrlSetData(-1,"SWORD|FALCHION|BLADE|RAPIER|SCIMITAR|RING POMMEL SABER|SABER|HAEDONGGUM|TSURUGI|FLAMBERGE")  
;~~> tab 2 = 2
$TabSheet3 = GUICtrlCreateTabItem("Two-Handed Sword")
$Combo3 = GUICtrlCreateCombo("NONE", 136, 32, 335, 25)
GUICtrlSetData(-1,"SLAYER|BASTARD SWORD|TWO-HANDED SWORD|BROAD SWORD|CLAYMORE") 
;~~>  tab 3 = 3

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Switch GUIGetMsg()
        Case $OK
            $id = _getBOX()
            MsgBox(1, "ComboBox controlID: " & $id, GUICtrlRead($id) & " was selected.")
        Case $GUI_EVENT_CLOSE, $EXIT
            ExitLoop
    EndSwitch
Wend
    
Func _getBOX()
    Switch GUICtrlRead($PageControl1)   ;get active tab page index
        Case 0  ;dagger
            $box = $Combo1
        Case 1  ;1h sword
            $box = $Combo2
        Case 2 ;2h sword
            $box = $Combo3
    EndSwitch
    Return $box
EndFunc
Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

@Siao

Thank you , I never would of thought use "GUICtrlRead($PageControl1)", but i can finish the script.

Thanks..

Mr B.


Favorite Quotes"If you apply your mind you can create any thing you can dream of" "Any thing can get done by simply click of a button"

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