Rev 2302 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2302 | Rev 2338 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | button apply;
|
33 | button apply;
|
34 | 34 | ||
35 | option_listener* olis; |
35 | option_listener* olis; |
36 | 36 | ||
37 | options_list (int show_apply = 0) { |
37 | options_list (int show_apply = 0) { |
- | 38 | ||
- | 39 | #ifdef __WIDGET_MOVE__
|
|
38 | widget* w[] = {&option, this, &left, &right, &apply, 0}; |
40 | widget* w[] = {&option, this, &left, &right, &apply, 0}; |
39 | makefam (w); |
41 | makefam (w); |
- | 42 | #endif
|
|
- | 43 | ||
40 | left.set_dir (arrow_button::left); |
44 | left.set_dir (arrow_button::left); |
41 | right.set_dir (arrow_button::right); |
45 | right.set_dir (arrow_button::right); |
42 | left.set_listener (this); |
46 | left.set_listener (this); |
43 | right.set_listener (this); |
47 | right.set_listener (this); |
- | 48 | ||
44 | apply.set_text ("Apply"); |
49 | apply.set_text ("Apply"); |
45 | if (show_apply) apply.show (); else apply.hide (); |
50 | if (show_apply) apply.show (); else apply.hide (); |
- | 51 | ||
46 | olis = 0; |
52 | olis = 0; |
47 | }
|
53 | }
|
48 | 54 | ||
49 | void set_text (const std::string& t) { |
55 | void set_text (const std::string& t) { |
50 | option.set_text (t); |
56 | option.set_text (t); |
51 | set_name (t); |
57 | set_name (t); |
52 | set_pos (posx, posy); |
58 | set_pos (posx, posy); |
53 | }
|
59 | }
|
54 | 60 | ||
55 | void set_listener (option_listener* _olis) { |
- | |
56 | olis = _olis; |
- | |
57 | }
|
- | |
58 | - | ||
59 | static const int spacing = 4; |
61 | static const int spacing = 4; |
60 | 62 | ||
61 | void set_pos (int x, int y) { |
63 | void set_pos (int x, int y) { |
62 | 64 | ||
63 | widget::set_pos (x, y); |
65 | widget::set_pos (x, y); |
Line 68... | Line 70... | ||
68 | right.set_pos (x, y + fnt.lift); |
70 | right.set_pos (x, y + fnt.lift); |
69 | advance_right (x, right, spacing + 1); |
71 | advance_right (x, right, spacing + 1); |
70 | 72 | ||
71 | option.set_pos (x, y); |
73 | option.set_pos (x, y); |
72 | 74 | ||
73 | - | ||
74 | widget* rw = 0; |
75 | widget* rw = 0; |
75 | if (apply.visible) { |
76 | if (apply.visible) { |
76 | rw = &apply; |
77 | rw = &apply; |
77 | set_apply_pos (); |
78 | set_apply_pos (); |
78 | } else rw = &option; |
79 | } else rw = &option; |
- | 80 | ||
79 | set_extents (left.extents.left, option.extents.bottom, rw->extents.right, rw->extents.top); |
81 | set_extents (left.extents.left, option.extents.bottom, rw->extents.right, rw->extents.top); |
80 | 82 | ||
81 | }
|
83 | }
|
82 | 84 | ||
83 | void set_apply_pos () { |
85 | void set_apply_pos () { |
Line 119... | Line 121... | ||
119 | void set_moveable (int m, int mc, int* pmb) { |
121 | void set_moveable (int m, int mc, int* pmb) { |
120 | option.set_moveable (m, mc, pmb); |
122 | option.set_moveable (m, mc, pmb); |
121 | widget::set_moveable (m, mc, pmb); |
123 | widget::set_moveable (m, mc, pmb); |
122 | }
|
124 | }
|
123 | 125 | ||
- | 126 | void set_listener (option_listener* _olis) { |
|
- | 127 | olis = _olis; |
|
- | 128 | }
|
|
- | 129 | ||
124 | }; |
130 | }; |
125 | 131 | ||
126 | #endif
|
132 | #endif
|