0bf7fae253d9df92e5b1af6ce89c5617c230feed
[sdk] / ecere / src / gui / dialogs / WindowList.ec
1 namespace gui::dialogs;
2
3 import "Window"
4
5 public class WindowList : Window
6 {
7 public:
8    minClientSize = { 300, 300 };
9    text = "Windows";
10    tabCycle = true;
11    borderStyle = sizable;
12    hasClose = true;
13    background = activeBorder;
14
15 private:
16    bool OnCreate()
17    {
18       master.ListChildren(listBox);
19       return true;
20    }
21
22    Button ok
23    {
24       this, isDefault = true, text = "OK", anchor = { horz = -45, bottom = 10 }, size = { 80 };
25
26       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
27       {
28          Destroy(listBox.GetTag());
29          return true;
30       }
31    };
32
33    Button cancel
34    {
35       this, text = "Cancel", anchor = { horz = 45, bottom = 10 }, size = { 80 }, hotKey = escape;
36       NotifyClicked = ButtonCloseDialog;
37    };
38
39    ListBox listBox
40    {
41       this, borderStyle = deep, text = "Select a Window to Activate...", anchor = { left = 10, right = 10, top = 30, bottom = 40 }, hotKey = altW;
42
43       bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
44       {
45          return ok.NotifyClicked(this, ok, x, y, mods);
46       }
47    };    
48
49    Label label
50    {
51       this, position = { 10, 10 }, labeledWindow = listBox;
52    };
53 };