faustf

checkbox many .. questions

3 posts in this topic

hi guys ,  i have a script 
 with many checkbox , and i must read them , how is  possible  read  all ,wih out repeat  ctrlread  for all checkbox ??

Func _Config_site()

    $SITIWEB_NewItem_ConfigSite_Form2 = GUICreate($GUI_Lang[203], 290, 256, 624, 128, -1, $WS_EX_TOPMOST) ; Configurazione inserimento piu siti
    $SITIWEB_NewItem_ConfigSite_Group1 = GUICtrlCreateGroup("", 0, -3, 289, 257)
    $SITIWEB_NewItem_ConfigSite_Checkbox1 = GUICtrlCreateCheckbox("eBay Italia", 6, 11, 81, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox2 = GUICtrlCreateCheckbox("eBay Australia", 6, 29, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox3 = GUICtrlCreateCheckbox("eBay Austria", 6, 47, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox4 = GUICtrlCreateCheckbox("eBay Belgium", 6, 65, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox5 = GUICtrlCreateCheckbox("eBay Belgium (French)", 6, 83, 137, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox6 = GUICtrlCreateCheckbox("eBay Canada (English)", 6, 101, 129, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox7 = GUICtrlCreateCheckbox("eBay Canada (French)", 6, 119, 129, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox8 = GUICtrlCreateCheckbox("eBay French", 6, 137, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox16 = GUICtrlCreateCheckbox("eBay Germany", 6, 156, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox15 = GUICtrlCreateCheckbox("eBay Hong Kong", 6, 175, 113, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox14 = GUICtrlCreateCheckbox("eBay India", 6, 194, 81, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox13 = GUICtrlCreateCheckbox("eBay Ireland", 6, 213, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox9 = GUICtrlCreateCheckbox("eBay Netherlands", 6, 231, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox10 = GUICtrlCreateCheckbox("eBay Singapore", 171, 10, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox11 = GUICtrlCreateCheckbox("eBay Spain", 171, 28, 81, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox12 = GUICtrlCreateCheckbox("eBay Switaerland", 171, 46, 113, 18)
    $SITIWEB_NewItem_ConfigSite_Checkbox17 = GUICtrlCreateCheckbox("eBay UK", 171, 65, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox18 = GUICtrlCreateCheckbox("eBay United States", 171, 84, 113, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox19 = GUICtrlCreateCheckbox("eBay Poland", 171, 103, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox20 = GUICtrlCreateCheckbox("eBay Philippines", 171, 122, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox21 = GUICtrlCreateCheckbox("eBay Malaysia", 171, 140, 97, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox22 = GUICtrlCreateCheckbox($GUI_Lang[201], 218, 179, 57, 17) ; tutti
    GUICtrlSetState(-1, $GUI_CHECKED)
    $SITIWEB_NewItem_ConfigSite_Button1 = GUICtrlCreateButton($GUI_Lang[202], 182, 214, 75, 21) ; imposta
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)

    GUISetOnEvent($GUI_EVENT_CLOSE, _chiudi_config_site_in_new_item)
    GUICtrlSetOnEvent($SITIWEB_NewItem_ConfigSite_Button1, _set_site_publish_eBay)

EndFunc   ;==>_Config_site

Func _set_site_publish_eBay()
    If GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox22) = 1 Then
        MsgBox(0, '', 'flaggato tutti')
    Else

        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox1)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox2)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox3)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox4)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox5)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox6)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox7)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox8)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox16)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox15)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox14)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox13)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox9)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox10)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox11)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox12)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox17)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox18)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox19)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox20)
        Local = GUICtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox21)

        MsgBox(0, '', 'leggo chi ce e lo piazzo nel ini file ')
    EndIf

    ;settato 1 no settato 4
EndFunc   ;==>_set_site_publish_eBay

thankz at all

Share this post


Link to post
Share on other sites



Save the CTRL handles in an Array like: 

$SITIWEB_NewItem_ConfigSite_Checkbox[1] = GUICtrlCreateCheckbox("eBay Italia", 6, 11, 81, 17)
    $SITIWEB_NewItem_ConfigSite_Checkbox[2] = GUICtrlCreateCheckbox("eBay Australia", 6, 29, 97, 17)

and use a for next loop to do a GuiCtrlRead($SITIWEB_NewItem_ConfigSite_Checkbox[$x]) 

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

o thankz so much  i wil do  :)

 

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