Mercurial > projects > mde
comparison mde/gui/widget/createWidget.d @ 117:aba2dd815a1f
Some tweaks to popup events and widgets.
Moved gui.mtt to guiDemo.mtt
Changed handling of clicks with popups.
Made some of the popup widgets use usual from widget data construction.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 26 Dec 2008 12:07:38 +0000 |
parents | 5ee69b3ed9c9 |
children | d28aea50c6da |
comparison
equal
deleted
inserted
replaced
116:5ee69b3ed9c9 | 117:aba2dd815a1f |
---|---|
103 // blank: 0x1 | 103 // blank: 0x1 |
104 FixedBlank = 0x1, | 104 FixedBlank = 0x1, |
105 SizableBlank = 0x2, | 105 SizableBlank = 0x2, |
106 Debug = 0xF, | 106 Debug = 0xF, |
107 | 107 |
108 // buttons: 0x10 | 108 // popup widgets: 0x10 |
109 PopupMenu = TAKES_CONTENT | 0x11, | 109 PopupMenu = TAKES_CONTENT | 0x11, |
110 SubMenu = TAKES_CONTENT | 0x12, | |
110 | 111 |
111 // labels: 0x20 | 112 // labels: 0x20 |
112 ContentLabel = TAKES_CONTENT | 0x20, | 113 ContentLabel = TAKES_CONTENT | 0x20, |
113 TextLabel = 0x21, | 114 TextLabel = 0x21, |
114 | 115 |
115 // content functions: 0x30 | 116 // content functions: 0x30 |
116 editContent = FUNCTION | TAKES_CONTENT | SAFE_RECURSION | 0x30, | 117 editContent = FUNCTION | TAKES_CONTENT | SAFE_RECURSION | 0x30, |
117 addContent = FUNCTION | 0x31, | 118 addContent = FUNCTION | 0x31, |
119 flatMenuContent = FUNCTION | TAKES_CONTENT | SAFE_RECURSION | 0x32, | |
120 subMenuContent = FUNCTION | TAKES_CONTENT | 0x33, | |
118 | 121 |
119 // content widgets: 0x40 | 122 // content widgets: 0x40 |
120 DisplayContent = TAKES_CONTENT | 0x40, | 123 DisplayContent = TAKES_CONTENT | 0x40, |
121 BoolContent = TAKES_CONTENT | 0x41, | 124 BoolContent = TAKES_CONTENT | 0x41, |
122 AStringContent = TAKES_CONTENT | 0x42, | 125 AStringContent = TAKES_CONTENT | 0x42, |
123 ButtonContent = TAKES_CONTENT | 0x43, | 126 ButtonContent = TAKES_CONTENT | 0x43, |
127 MenuButtonContent = TAKES_CONTENT | 0x44, | |
124 | 128 |
125 GridLayout = TAKES_CONTENT | 0x100, | 129 GridLayout = TAKES_CONTENT | 0x100, |
126 ContentList = TAKES_CONTENT | SAFE_RECURSION | 0x110, | 130 ContentList = TAKES_CONTENT | SAFE_RECURSION | 0x110, |
127 | 131 |
128 FloatingArea = 0x200, | 132 FloatingArea = 0x200, |
137 "Debug", | 141 "Debug", |
138 "TextLabel", | 142 "TextLabel", |
139 "FloatingArea", | 143 "FloatingArea", |
140 "addContent", | 144 "addContent", |
141 "PopupMenu", | 145 "PopupMenu", |
146 "SubMenu", | |
142 "ContentLabel", | 147 "ContentLabel", |
143 "DisplayContent", | 148 "DisplayContent", |
144 "BoolContent", | 149 "BoolContent", |
145 "AStringContent", | 150 "AStringContent", |
146 "ButtonContent", | 151 "ButtonContent", |
152 "MenuButtonContent", | |
147 "GridLayout", | 153 "GridLayout", |
154 "subMenuContent", | |
148 "ContentList", | 155 "ContentList", |
149 "editContent"]; | 156 "editContent", |
157 "flatMenuContent"]; | |
150 | 158 |
151 /* Generates a binary search algorithm. */ | 159 /* Generates a binary search algorithm. */ |
152 char[] binarySearch (char[] var, char[][] consts) { | 160 char[] binarySearch (char[] var, char[][] consts) { |
153 if (consts.length > 3) { | 161 if (consts.length > 3) { |
154 return "if (" ~ var ~ " <= WIDGET_TYPE." ~ consts[$/2 - 1] ~ ") {\n" ~ | 162 return "if (" ~ var ~ " <= WIDGET_TYPE." ~ consts[$/2 - 1] ~ ") {\n" ~ |