Sign in to follow this  
Followers 0
cueclub

Tab problems

18 posts in this topic

I'm trying to create a 10 tab gui. with 20 input boxes in each, and a save button.

This is what i came up with

#Include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg, $GUI_SHOW
    Local $Button_1, $msg, $test4box1, $test4box2, $test4box3, $test4box4, $test4box5, $test4box6, $test4box7, $test4box8, $test4box9, $test4box10, $test4box
    Local $test4box11, $test4box12, $test4box13, $test4box14, $test4box15, $test4box16, $test4box17, $test4box18, $test4box19, $test4box20
                                                                
    
    
    
   GUICreate("Test Program", 400, 650, 5, 200, 1, $WS_EX_TOPMOST)

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    $tab = GUICtrlCreateTab(10, 10, 450, 550)

        
    GUICtrlCreateLabel("box # 1", 11, 30, 150)
$test4box1 = GUICtrlCreateInput("", 10, 50, 50, 20)
    GUICtrlCreateLabel("box # 2", 101, 30, 100)
$test4box2 = GUICtrlCreateInput("", 100, 50, 50, 20)     ;  
    GUICtrlCreateLabel("box # 3", 10, 80, 100)
$test4box3 = GUICtrlCreateInput("", 10, 100, 50, 20)
    GUICtrlCreateLabel("box # 4", 101, 80, 100)
$test4box4 = GUICtrlCreateInput("", 100, 100, 50, 20)  
    GUICtrlCreateLabel("box # 5", 10, 130, 100)
$test4box5 = GUICtrlCreateInput("", 10, 150, 50, 20)
    GUICtrlCreateLabel("box # 6", 101, 130, 100)
$test4box6 = GUICtrlCreateInput("", 101, 150, 50, 20)  
    GUICtrlCreateLabel("box # 7", 10, 180, 100)
$test4box7 = GUICtrlCreateInput("", 10, 200, 50, 20)
    GUICtrlCreateLabel("box # 8", 101, 180, 100)
$test4box8 = GUICtrlCreateInput("", 101, 200, 50, 20)  
    GUICtrlCreateLabel("box # 9", 10, 230, 100)
$test4box9 = GUICtrlCreateInput("", 10, 250, 50, 20)
    GUICtrlCreateLabel("box # 10", 101, 230, 100)
$test4box10 = GUICtrlCreateInput("", 101, 250, 50, 20)
    GUICtrlCreateLabel("box # 11", 11, 280, 150)
$test4box11 = GUICtrlCreateInput("", 10, 300, 50, 20)
    GUICtrlCreateLabel("box # 12", 101, 280, 100)
$test4box12 = GUICtrlCreateInput("", 100, 300, 50, 20)     ;    
    GUICtrlCreateLabel("box # 13", 10, 330, 100)
$test4box13 = GUICtrlCreateInput("", 10, 350, 50, 20)
    GUICtrlCreateLabel("box # 14", 101, 330, 100)
$test4box14 = GUICtrlCreateInput("", 100, 350, 50, 20)  
    GUICtrlCreateLabel("box # 15", 10, 380, 100)
$test4box15 = GUICtrlCreateInput("", 10, 400, 50, 20)
    GUICtrlCreateLabel("box # 16", 101, 380, 100)
$test4box16 = GUICtrlCreateInput("", 101, 400, 50, 20)  
    GUICtrlCreateLabel("box # 17", 10, 430, 100)
$test4box17 = GUICtrlCreateInput("", 10, 450, 50, 20)
    GUICtrlCreateLabel("box # 18", 101, 430, 100)
$test4box18 = GUICtrlCreateInput("", 101, 450, 50, 20)  
    GUICtrlCreateLabel("box # 19", 10, 480, 100)
$test4box19 = GUICtrlCreateInput("", 10, 500, 50, 20)
    GUICtrlCreateLabel("box # 20", 101, 480, 100)
$test4box20 = GUICtrlCreateInput("", 101, 500, 50, 20)

        
GUISetState(@SW_ENABLE )

$Button_1 = GUICtrlCreateButton("save", 40, 530, 100)
        While 1
        $msg = GUIGetMsg()
        Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "1st", GUICtrlRead($test4box1))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "2nd", GUICtrlRead($test4box2))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "3rd", GUICtrlRead($test4box3))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "4th", GUICtrlRead($test4box4))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "5th", GUICtrlRead($test4box5))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "6th", GUICtrlRead($test4box6))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "7th", GUICtrlRead($test4box7))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "8th", GUICtrlRead($test4box8))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "9th", GUICtrlRead($test4box9))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "10th", GUICtrlRead($test4box10))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "11th", GUICtrlRead($test4box11))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "12th", GUICtrlRead($test4box12))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "13th", GUICtrlRead($test4box13))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "14th", GUICtrlRead($test4box14))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "15th", GUICtrlRead($test4box15))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "16th", GUICtrlRead($test4box16))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "17th", GUICtrlRead($test4box17))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "18th", GUICtrlRead($test4box18))    
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "19th", GUICtrlRead($test4box19))
            IniWrite(@ScriptDir & "\settings.ini", "customer input", "20th", GUICtrlRead($test4box20))
            
        




        EndSelect
        WEnd

;==>Example


    GUICtrlCreateTabItem("input 2")
    

    
    
    
    

    GUICtrlCreateTabItem("input 4")    ; end tabitem definition

    GUICtrlCreateTabItem("input 5")    ; end tabitem definition
    
    GUICtrlCreateTabItem("input 6")    ; end tabitem definition
    
    GUICtrlCreateTabItem("input 7")    ; end tabitem definition
    
    GUICtrlCreateTabItem("input 8")    ; end tabitem definition
    
    GUICtrlCreateTabItem("input 9")    ; end tabitem definition
    
    GUICtrlCreateTabItem("input 10")    ; end tabitem definition
    
    

  

    ; box the GUI until the dialog is closed
    
EndFunc   ;==>Example

problem is, it doesnt run at all it just hangs and nothing shows in the output, or the gui itself. Any ideas?

Was also wondering if there were an easier way to write multiple Locals. Instead of local $t1, $t1, $t3 is there somthing like local $t1-3 ?

Thanks

Cue

Share this post


Link to post
Share on other sites



First off take a look at using an array for those controls. Study the help file for how to use arrays.

Second:

Change

GUISetState(@SW_ENABLE )

to

GUISetState(@SW_SHOW)


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

I was looking at the examples in the help section, Doesnt show the guistate($show) for this one. I added it as you had suggested. It only shows the input boxes and the labels. But not the other tabs. hmm I will look over the array section again and see if there is something i can use to help in this situation. Till i find what i am looking for i shall be doing this :( might come to me by the time i pass out. LOL

Thanks for the feed back

Cue

Share this post


Link to post
Share on other sites

Lately we've noticed a few examples that should be re-written. Which one in particular are you looking at?


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@Cueclub

Geosoft means you change your $test4box1 to 20 into

$test4box[21] (amount +1) where $test4box[0] = 20

This will reduce the amount of declaration on the top

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

cueclub,

Here is a version using arrays. It works for me - and it is a bit shorter: :)

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $msg
    Local $aTabBox[10][20], $aButton[10]

    GUICreate("Test Program", 520, 650, 100, 200, -1, $WS_EX_TOPMOST)

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    ; Create Tab control
    $tab = GUICtrlCreateTab(10, 10, 500, 555)

    ; Create 10 tabs
    For $i = 0 To 9

        ; Create tab
        GUICtrlCreateTabItem("Input " & $i + 1)

        ; Create inputs in this tab
        For $j = 0 To 19 Step 2
            GUICtrlCreateLabel("box # " & $j + 1,          12, 35 + (25 * $j), 150)
            $aTabBox[$i][$j] = GUICtrlCreateInput("",      11, 55 + (25 * $j), 50, 20)
            GUICtrlCreateLabel("box # " & $j + 2 ,        102, 35 + (25 * $j), 100)
            $aTabBox[$i][$j + 1] = GUICtrlCreateInput("", 101, 55 + (25 * $j), 50, 20) ;
        Next

        ; Create button in this tab
        $aButton[$i] = GUICtrlCreateButton("Save", 40, 530, 100)

    Next

    ; end tabitem definition
    GUICtrlCreateTabItem("") 

    GUISetState(@SW_SHOW)

    While 1
        
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect

        ; Check buttons
        For $i = 0 To 9
            If $msg = $aButton[$i] Then
                ; If button pressed, write ini 
                For $j = 0 To 19
                    IniWrite(@ScriptDir & "\settings.ini", "customer " & $i + 1 & " input ", $j + 1, GUICtrlRead($aTabBox[$i][$j]))
                Next
            EndIf
        Next

    WEnd

EndFunc   ;==>Example

I changed a few sizes to get it all to fit in. Please ask if you do not understand anything. :(

Arrays can seem a bit daunting at first - look at the Wiki tutorial here for more information.

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

Lately we've noticed a few examples that should be re-written. Which one in particular are you looking at?

I wasnt really sure which one to look at, I was looking at them all.

And for someone who has more time on here, they may seem complete as far as explanation, however to some one just starting out it seems a bit confusing. I try to use what is in the help files first before i ask. And appreciate all feedback.

@Cueclub

Geosoft means you change your $test4box1 to 20 into

$test4box[21] (amount +1) where $test4box[0] = 20

This will reduce the amount of declaration on the top

I see what you are saying but for a semi beginner it is a little confusing till i work with it more.

cueclub,

Here is a version using arrays. It works for me - and it is a bit shorter: ;)

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $msg
    Local $aTabBox[10][20], $aButton[10]

    GUICreate("Test Program", 520, 650, 100, 200, -1, $WS_EX_TOPMOST)

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    ; Create Tab control
    $tab = GUICtrlCreateTab(10, 10, 500, 555)

    ; Create 10 tabs
    For $i = 0 To 9

        ; Create tab
        GUICtrlCreateTabItem("Input " & $i + 1)

        ; Create inputs in this tab
        For $j = 0 To 19 Step 2
            GUICtrlCreateLabel("box # " & $j + 1,          12, 35 + (25 * $j), 150)
            $aTabBox[$i][$j] = GUICtrlCreateInput("",      11, 55 + (25 * $j), 50, 20)
            GUICtrlCreateLabel("box # " & $j + 2 ,        102, 35 + (25 * $j), 100)
            $aTabBox[$i][$j + 1] = GUICtrlCreateInput("", 101, 55 + (25 * $j), 50, 20) ;
        Next

        ; Create button in this tab
        $aButton[$i] = GUICtrlCreateButton("Save", 40, 530, 100)

    Next

    ; end tabitem definition
    GUICtrlCreateTabItem("") 

    GUISetState(@SW_SHOW)

    While 1
        
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect

        ; Check buttons
        For $i = 0 To 9
            If $msg = $aButton[$i] Then
                ; If button pressed, write ini 
                For $j = 0 To 19
                    IniWrite(@ScriptDir & "\settings.ini", "customer " & $i + 1 & " input ", $j + 1, GUICtrlRead($aTabBox[$i][$j]))
                Next
            EndIf
        Next

    WEnd

EndFunc   ;==>Example

I changed a few sizes to get it all to fit in. Please ask if you do not understand anything. :)

Arrays can seem a bit daunting at first - look at the Wiki tutorial here for more information.

M23

ok i will check out the link you have provided, sometimes thats all i need to get moving. I'm not one to come on here and ask for my items to be re-written, I am just asking for help in understanding how or why something is done. The last time i wrote anything was in Basic, and that was for a school report. lol And I thought that was difficult. :(.

I want to thank the 3 of you for your feedback, and trying to help me understand the way the declarations are done. I will keep working with it till i understand, and that would be less questions from me. :)

Thanks

Cue

Share this post


Link to post
Share on other sites

Just keep up the way you are going and all will be well. Check the help file, if you have a question then awsk in the forums. It's easy to see that you at least put some effort in before asking in the forum.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

cueclub,

I second what George just said. People like you, who have obviusly looked at the Help file and tried something themselves first, should never be worried about posting here. :(

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

Well here it is my problem of the day lol.

Perhaps i lost grasp of the situation and need another kick in the head.

I took the example that Melba had posted and tried to expand on it.

I wanted to try 24 boxes. 8 per line with 3 lines ( or rows )

So this is what I did.

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $msg
    Local $aTabBox[10][240], $aButton[10]

    GUICreate("Test Program", 520, 650, 100, 200, -1, $WS_EX_TOPMOST)

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    ; Create Tab control
    $tab = GUICtrlCreateTab(10, 10, 500, 555)

    ; Create 10 tabs
    For $i = 0 To 9

        ; Create tab
        GUICtrlCreateTabItem("Input " & $i + 1)

        ; Create inputs in this tab
        For $j = 0 To 7 Step 1
            GUICtrlCreateLabel("box # " & $j + 1,          12 + (60 * $j), 35, 150)
            $aTabBox[$i][$j] = GUICtrlCreateInput("",      12 + (60 * $j), 55, 50, 20)
            GUICtrlCreateLabel("box # " & $j + 9 ,        12 + (60 * $j), 185, 100)
            $aTabBox[$i][$j + 1] = GUICtrlCreateInput("", 12 + (60 * $j), 205, 50, 20) ;
            GUICtrlCreateLabel("box # " & $j + 17 ,        12 + (60 * $j),335 , 100)
            $aTabBox[$i][$j] = GUICtrlCreateInput("", 12 + (60 * $j), 355, 50, 20)


        Next

        ; Create button in this tab
        $aButton[$i] = GUICtrlCreateButton("Save", 40, 530, 100)

    Next

    ; end tabitem definition
    GUICtrlCreateTabItem("") 

    GUISetState(@SW_SHOW)

    While 1
        
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect

        ; Check buttons
        For $i = 0 To 9
            If $msg = $aButton[$i] Then
                ; If button pressed, write ini 
                For $j = 0 To 23
                    IniWrite(@ScriptDir & "\settings.ini", "customer " & $i + 1 & " input ", $j + 1, GUICtrlRead($aTabBox[$i][$j]))
                Next
                exit
            EndIf
        Next

    WEnd

EndFunc   ;==>Example

And I thought I hade it.. untill........

I looked at the ini file. I should of had more coffee first. Here is what it listed.

[customer 1 input]

1=3

2=6

3=9

4=12

5=15

6=18

7=21

8=24

9=23

10=0

11=0

12=0

13=0

14=0

15=0

16=0

17=0

18=0

19=0

20=0

21=0

22=0

23=0

24=0

And just to test it I input 1-24 in the boxes. box#1 i put 1 and so on....

Also is there a way to controll which input box the tab goes to first? When I try it coded this way, it tabs at 1,9,17 and then 2, 10, 18 and so on.

I'm starting to run out of brick walls here lol.

I will keep messing with it and reading some more. just asking for any ideas as to where i messed up .

Thanks in advance

Cue

Share this post


Link to post
Share on other sites

cueclub,

You were very close. :(

Look for the <<<<<<<<<<<<<<< lines and I will explain why I changed them below:

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $msg
    Local $aTabBox[10][24], $aButton[10]  ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 1
    GUICreate("Test Program", 520, 650, 100, 200, -1, $WS_EX_TOPMOST)

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    ; Create Tab control
    $tab = GUICtrlCreateTab(10, 10, 500, 555)

    ; Create 10 tabs
    For $i = 0 To 9

        ; Create tab
        GUICtrlCreateTabItem("Input " & $i + 1)

        ; Create inputs in this tab
        For $j = 0 To 7  ; Do not Step 1 - that is the default value <<<<<<<<<<<<<<<<<<<<<<<<<<<<< 2
            GUICtrlCreateLabel("box # " & $j + 1,          12 + (60 * $j),  35, 150)
            $aTabBox[$i][$j] = GUICtrlCreateInput("",      12 + (60 * $j),  55, 50, 20)
            GUICtrlCreateLabel("box # " & $j + 9 ,         12 + (60 * $j), 185, 100)
            $aTabBox[$i][$j + 8] = GUICtrlCreateInput("",  12 + (60 * $j), 205, 50, 20) ; <<<<<<<<<<<<<<<< 3
            GUICtrlCreateLabel("box # " & $j + 17 ,        12 + (60 * $j), 335 , 100)
            $aTabBox[$i][$j + 16] = GUICtrlCreateInput("", 12 + (60 * $j), 355, 50, 20) ; <<<<<<<<<<<<<<<< 3
        Next

        ; Create button in this tab
        $aButton[$i] = GUICtrlCreateButton("Save", 40, 530, 100)

    Next

    ; end tabitem definition
    GUICtrlCreateTabItem("")

    GUISetState(@SW_SHOW)

    While 1

        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect

        ; Check buttons
        For $i = 0 To 9
            If $msg = $aButton[$i] Then
                ; If button pressed, write ini
                For $j = 0 To 23
                    IniWrite(@ScriptDir & "\settings.ini", "customer " & $i + 1 & " input ", $j + 1, GUICtrlRead($aTabBox[$i][$j]))
                Next
                ;exit  Do you really want to Exit here? ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 4
            EndIf
        Next

    WEnd

EndFunc   ;==>Example

1. The array is declared with 2 dimensions - [tab][input] - so initially we had [10][20]. Think of the contents set out like this:

Input 1    Input 1    ...    Input 20

Tab 1   [     ]    [     ]           [     ]        

Tab 2   [     ]    [     ]           [     ]

...

Tab 10  [     ]    [     ]           [     ]

So to increase the number of Inputs per tab, you need only increase the second dimension - setting it to 24. By putting 240, you were allowing for 240 Inputs per tab - the code would have worked, but you would have wasted a lot of memory.

2. Small point only - no need to define default values.

3. Similar reason for both lines. You had adjusted the label value but not the index in the array. So you were not getting the right ControlIDs into the correct places in the array.

4. Do you really want to exit at this point?

I hope these explanations are clear - please ask again if not. :)

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

Ok a few things

So to increase the number of Inputs per tab, you need only increase the second dimension - setting it to 24. By putting 240, you were allowing for 240 Inputs per tab - the code would have worked, but you would have wasted a lot of memory.

I thought they had to be multiples of 10. :(

2. Small point only - no need to define default values.

So the default was 1. Gotcha. In the previous example it was showing step of 2, just assumed that i needed to decrease it to 1 when i had change it. again :)

GUICtrlCreateLabel("box # " & $j + 9 , 12 + (60 * $j), 185, 100)

$aTabBox[$i][$j + 8] = GUICtrlCreateInput("", 12 + (60 * $j), 205, 50, 20) ; <<<<<<<<<<<<<<<< 3

GUICtrlCreateLabel("box # " & $j + 17 , 12 + (60 * $j), 335 , 100)

$aTabBox[$i][$j + 16] = GUICtrlCreateInput("", 12 + (60 * $j), 355, 50, 20) ; <<<<<<<<<<<<<<<< 3

Ok i see what you are saying, And cant believe I missed that step. Its nice having another set of eyes. lol

We as for the exit part, Was getting kind of lazy and just wanted to skip a step, o i threw the exit in as a temp item.

I am starting to understand it, and will try one from scratch on my own to test my knowledge. Smell the fire burning yet?

Now for my question about tab stops for the input:

Is there some where in the help files, to show or explain how to control where the tab stops? ie: hit the tab key to go from 1-2-3-4-5 ect...

Thank you for the quick feed back.

Cue

Share this post


Link to post
Share on other sites

cueclub,

Smell the fire burning yet?

Make sure there is a bucket handy! :)

tab stops

These are set with the $WS_TABSTOP style. You normally need not worry about this as the style is usually forced by AutoIt. Look at the Help file for GUICtrlCreateInput - under style you read:

"forced styles : $WS_TABSTOP only if no $ES_READONLY"

Look at GUICtrlCreateButton for a similar statement.

However, the tab stops are set in the order of creation - so you will have to change the order in which you create your inputs if you want to run through them in numerical order. That would be a nice little challenge - best make it 2 buckets! :)

I hope that answers the question. :(

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

hmm think it might be easier just to change the labels :(

But I <guess> will look at the examples given. And i have the buckets handy.

Thanks again

Cue

Share this post


Link to post
Share on other sites

cueclub,

might be easier just to change the labels

That is the sort of pragmatic lateral thinking solution that means you have begun to understand the art of coding! :(:)

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

It could get worse, he might actually begin to understand you.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

lol thanks

Share this post


Link to post
Share on other sites

ok ok after an hour of playing around i figured it out. A little help from the files did the trick as well.

For those browsing the forums looking for info and have yet to find anything to help you. You have 2 options Keep looking or you can take a peek here.

For $j = 0 To 7 ; Do not Step 1 - that is the default value <<<<<<<<<<<<<<<<<<<<<<<<<<<<< 2

GUICtrlCreateLabel("box # " & $j + 1, 12 + (60 * $j), 35, 150)

$aTabBox[$i][$j] = GUICtrlCreateInput("", 12 + (60 * $j), 55, 50, 20)

for $h = 0 to 7

GUICtrlCreateLabel("box # " & $j + 9 , 12 + (60 * $j), 185, 100)

$aTabBox[$i][$j + 8] = GUICtrlCreateInput("", 12 + (60 * $j), 205, 50, 20) ; <<<<<<<<<<<<<<<< 3

next

for $k = 0 to 7

GUICtrlCreateLabel("box # " & $j + 17 , 12 + (60 * $j), 335 , 100)

$aTabBox[$i][$j + 16] = GUICtrlCreateInput("", 12 + (60 * $j), 355, 50, 20) ; <<<<<<<<<<<<<<<< 3

next

Next

this will align the tab order. :)

But I suggest you keep looking/playing with it. Only way to learn.

Thanks to M23 and Geo for their assistance, and patience. :)

Cue

btw it only took 1 bucket this time :(

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