~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Wrappers/TestApp.Managed/Test_MultilistBox.cs

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using System;
2
 
using MyGUI.Managed;
3
 
using MyGUI.Managed.Demo;
4
 
 
5
 
namespace TestApp.Sharp
6
 
{
7
 
    public class Test_MultiListBox
8
 
    {
9
 
        public static void Test()
10
 
        {
11
 
            MultiListBox box = Gui.Instance.CreateWidget<MultiListBox>("MultiListBox", new IntCoord(220, 520, 200, 200), Align.Default, "Main");
12
 
            box.EventListChangePosition += new MultiListBox.HandleListChangePosition(box_EventListChangePosition);
13
 
            box.EventListSelectAccept += new MultiListBox.HandleListSelectAccept(box_EventListSelectAccept);
14
 
 
15
 
            box.AddColumn("column2", 96, "column2");
16
 
            box.AddColumn("column3", 96);
17
 
            box.InsertColumnAt(0, "column1", 96, "column1");
18
 
            box.InsertColumnAt(0, "column4", 96);
19
 
 
20
 
            string data = box.GetColumnDataAt(0) as string;
21
 
            box.ClearColumnDataAt(0);
22
 
            data = box.GetColumnDataAt(0) as string;
23
 
 
24
 
            uint count = box.ColumnCount;
25
 
 
26
 
            box.SetColumnNameAt(0, "new column");
27
 
            string name = box.GetColumnNameAt(0);
28
 
            int width = box.GetColumnWidthAt(0);
29
 
            box.SetColumnWidthAt(0, width + 1);
30
 
            width = box.GetColumnWidthAt(0);
31
 
 
32
 
            box.AddItem("item0", "0");
33
 
            box.AddItem("item1", "1");
34
 
            box.AddItem("item2");
35
 
            box.AddItem("item3", "3");
36
 
            box.InsertItemAt(0, "insert item4", "4");
37
 
            box.InsertItemAt(0, "insert item5");
38
 
 
39
 
            count = box.ItemCount;
40
 
 
41
 
            name = box.GetItemNameAt(0);
42
 
            box.SetItemNameAt(0, "new item 0");
43
 
            name = box.GetItemNameAt(0);
44
 
 
45
 
            data = box.GetItemDataAt(0) as string;
46
 
            box.ClearItemDataAt(0);
47
 
            data = box.GetItemDataAt(0) as string;
48
 
 
49
 
            box.SetSubItemNameAt(0, 3, "sub item 3");
50
 
            name = box.GetSubItemNameAt(0, 0);
51
 
            box.SetSubItemNameAt(1, 4, "sub item 4");
52
 
 
53
 
            box.SetSubItemDataAt(0, 0, "sub item0");
54
 
            data = box.GetSubItemDataAt(0, 0) as string;
55
 
            box.ClearSubItemDataAt(0, 0);
56
 
            data = box.GetSubItemDataAt(0, 0) as string;
57
 
 
58
 
            box.SwapItemsAt(0, 1);
59
 
 
60
 
            count = box.ItemCount;
61
 
            box.RemoveItemAt(0);
62
 
            count = box.ItemCount;
63
 
 
64
 
            box.IndexSelected = 0;
65
 
            box.IndexSelected = box.IndexSelected + 1;
66
 
 
67
 
            box.SortByColumn(0, false);
68
 
        }
69
 
 
70
 
        static void box_EventListSelectAccept(MultiListBox _sender, uint _index)
71
 
        {
72
 
            Export.DebugOut("EventListSelectAccept  index=" + _index.ToString());
73
 
        }
74
 
 
75
 
        static void box_EventListChangePosition(MultiListBox _sender, uint _index)
76
 
        {
77
 
            Export.DebugOut("EventListChangePosition  index=" + _index.ToString());
78
 
        }
79
 
    }
80
 
}