TOPIC: TabsControl example from users manual doesn't work
#1723
TabsControl example from users manual doesn't work 8 Months, 2 Weeks ago
TabsControl example from users manual doesn't work with suneido trunk and suneido091118, although it works with suneido071021.

Code:


.tab0= .tabs.WndPane  //tab 0 handler
.f1= .tab0.Vert.F1 //<<<<<< Complains here




Also comparing TabsControl in WinMerge from version 071021 and 091118 I noted they differ in several places.

How to setup suneido using Version Control to be able to compare different database versions for example stdlib from 071021 and 091118 ?

I'm using svn to retrieve trunk version but the stdlib (suneido.db) isn't under svn source control, how to stay in sync with stdlib ?

There are any public suneido VersionControl server ?
 
 
Last Edit: 2009/12/09 11:26 By mingodad.
 
#1726
Re:TabsControl example from users manual doesn't work 8 Months, 2 Weeks ago
Thanks for letting me know. I am not very good at updating examples.

There is no public Suneido version control. I would like to set one up but I would like it to be readonly and we do not support that yet.

The easiest way to compare versions is dump the library from the old version, rename the file (e.g. rename stdlib.su to stdlib_old.su), and then load the renamed library into the new copy. Then you can use the LibDiff function to compare.
 
 
andrew
 
#1729
Re:TabsControl example from users manual doesn't work 8 Months, 2 Weeks ago
That was a contributed example. I cleaned it up:

Code:

Controller
    {
    Title: 'tab example'
    Xmin: 100
    Ymin: 100
    New()
        {
        .inittab = true
        .images = CreateImageList(16, 16, IDI.SUNEIDO, IDI.DOCUMENT, IDI.PROCESS)
        //
        .tabs = .Vert.Tabs
        .tabs.SetImageList(.images)
        //
        .tab0 = .tabs.WndPane  //tab 0 handler
        .f1 = .FindControl('F1')
        .st11 = .FindControl('ST11')
        .st12 = .FindControl('ST12')
        .color = 0x00ff0000
        .st11.SetColor(.color)
        .st12.SetColor(.color)
        //
        .tab1_firstime =true
        .tab1 = false //tab 1 handler, set by Setup()
        .tab2_firstime =true
        .tab2 = false //tab 2 handler, set by Setup()
        .stbar = .Vert.Status
        .stbar.AddPanel(100)
        .stbar.AddPanel(100)
        .stbar.AddPanel(200)
        }
    Setup()
        {
        //force load tab handles
        .tabs.Select(1)
        .tabs.Select(2)
        .tabs.Select(0)
        .tabs.SetImage(0, 0)
        .tabs.SetImage(1, 1)
        .tabs.SetImage(2, 2)
        .f2.Set('field 2')
        .f3.Set('field 3')
        .setstatics()
        }
    Commands:
        ((Exit,"Ctrl+X"))
     Controls:
        (Vert
            (Tabs
                (Tab: "one", Vert
                    (Skip)
                    (Static 'edit field 1')
                    (Field name:'F1', set:'field 1')
                    (Skip 10)
                    (Static 'field content in tab 1')
                    (Static '' name:'ST11')
                    (Skip)
                    (Static 'field content in tab 2')
                    (Static '' name:'ST12')
                )
                (Tab: "two", Vert
                    (Skip)
                    (Static 'edit field 2')
                    (Field name:'F2')
                    (Skip 10)
                    (Static 'field content in tab 0')
                    (Static '' name:'ST21')
                    (Skip)
                    (Static 'field content in tab 2')
                    (Static '' name:'ST22')
                )
                (Tab: "three", Vert
                    (Skip)
                    (Static 'edit field 3')
                    (Field name:'F3')
                    (Skip 10)
                    (Static 'field content in tab 0')
                    (Static '' name:'ST31')
                    (Skip)
                    (Static 'field content in tab 1')
                    (Static '' name:'ST32')
                )
            )
            (Statusbar)
        )
    TabsControl_SelectTab(source)
        {
        if (.tabs.GetSelected() is 1 and .tab1_firstime)
            {
            .tab1_firstime = false
            .f2 = .FindControl('F2')
            .st21 = .FindControl('ST21')
            .st22 = .FindControl('ST22')
            .st21.SetColor(.color)
            .st22.SetColor(.color)
            }
        if (.tabs.GetSelected() is 2 and .tab2_firstime)
            {
            .tab2_firstime = false
            .f3 = .FindControl('F3')
            .st31 = .FindControl('ST31')
            .st32 = .FindControl('ST32')
            .st31.SetColor(.color)
            .st32.SetColor(.color)
            }
        if (not .inittab)
            .setstatics()
        else
            .inittab= false
        }
    TabClick(i)
        {
        .stbar.Set('cliked tab ' $ i, 1)
        }
    SelectTab(i)
        {
        .stbar.Set('selected tab ' $ i, 0)
        }
    setstatics()
        {
        .st11.Set(.f2.Get())
        .st12.Set(.f3.Get())
        .st21.Set(.f1.Get())
        .st22.Set(.f3.Get())
        .st31.Set(.f1.Get())
        .st32.Set(.f2.Get())
        }
    TabContextMenu(x, y)
        {
        menu = #((name: 'four'), (name: 'five'), '', (name: 'six'))
        ContextMenu(menu).ShowCall(this, x, y)
        }
    On_Context_four()
        {
        .stbar.Set('clicked menu item four', 2)
        }
    On_Context_five()
        {
        .stbar.Set('clicked menu item five', 2)
        }
    On_Context_six()
        {
        .stbar.Set('clicked menu item six', 2)
        }
    }

 
 
andrew