comparison mde/content/Items.d @ 113:9824bee909fd

Popup menu; works for simple menus except that clicking an item doesn't close it. Revised popup support a bit; EnumContentWidget is broken and due to be replaced.
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 19 Dec 2008 10:32:28 +0000
parents fe061009029d
children 1b1e2297e2fc
comparison
equal deleted inserted replaced
112:fe061009029d 113:9824bee909fd
19 module mde.content.Items; 19 module mde.content.Items;
20 20
21 import mde.content.Content; 21 import mde.content.Content;
22 import mde.gui.exception; 22 import mde.gui.exception;
23 23
24 import mde.imde; 24 import imde = mde.imde;
25 import mde.lookup.Options; 25 import mde.lookup.Options;
26 import mde.lookup.Translation; 26 import mde.lookup.Translation;
27 27
28 debug { 28 debug {
29 import tango.util.log.Log : Log, Logger; 29 import tango.util.log.Log : Log, Logger;
57 if (q && item is null) // enforce item is an exact match 57 if (q && item is null) // enforce item is an exact match
58 return *q; 58 return *q;
59 } 59 }
60 } else if (h == "imde") { 60 } else if (h == "imde") {
61 h = head (item); 61 h = head (item);
62 if (h == "quit" && item is null) 62 if (h == "menu" && item is null)
63 return quit; 63 return imde.menu;
64 else if (h == "quit" && item is null)
65 return imde.quit;
64 } 66 }
65 throw new ContentItemException (h); 67 throw new ContentItemException (h);
66 } 68 }
67 69
68 /** Creates some content on first run (required by get()). 70 /** Creates some content on first run (required by get()).
107 } 109 }
108 } 110 }
109 } 111 }
110 112
111 // Translate imde: 113 // Translate imde:
114 trle = Translation.get ("imde").getStruct ("menu");
115 imde.menu.name (trle.name, trle.desc);
112 trle = Translation.get ("imde").getStruct ("quit"); 116 trle = Translation.get ("imde").getStruct ("quit");
113 quit.name (trle.name, trle.desc); 117 imde.quit.name (trle.name, trle.desc);
114 118
115 currentL10n = miscOpts.L10n(); 119 currentL10n = miscOpts.L10n();
116 } 120 }
117 121
118 private: 122 private: