comparison mde/gui/WMScreen.d @ 174:3d58adc17d20

Temporary commit to allow backup
author Diggory Hardy <diggory.hardy@gmail.com>
date Mon, 31 Aug 2009 13:54:23 +0200
parents a1ba9157510e
children
comparison
equal deleted inserted replaced
173:a1ba9157510e 174:3d58adc17d20
19 * This is the module to use externally to create a graphical user interface 19 * This is the module to use externally to create a graphical user interface
20 * (likely also with content modules). 20 * (likely also with content modules).
21 *****************************************************************************/ 21 *****************************************************************************/
22 module mde.gui.WMScreen; 22 module mde.gui.WMScreen;
23 23
24 import mde.gui.WidgetManager; 24 import mde.gui.widget.WidgetManager;
25 import mde.gui.WidgetLoader; 25 import mde.gui.WidgetLoader;
26 import mde.gui.widget.Ifaces; 26 import mde.gui.widget.Ifaces;
27 27
28 import mde.setup.Screen; 28 import mde.setup.Screen;
29 import mde.input.Input; 29 import mde.input.Input;
72 // Make sure the keyboard is not locked in text-entry mode. 72 // Make sure the keyboard is not locked in text-entry mode.
73 input.setLetterCallback (null); 73 input.setLetterCallback (null);
74 } 74 }
75 75
76 /** Draw the gui. */ 76 /** Draw the gui. */
77 void draw() { 77 override void draw() {
78 synchronized(mutex) { 78 synchronized(mutex) {
79 debug (mdeDrawEvents) 79 debug (mdeDrawEvents)
80 logger.trace ("drawing"); 80 logger.trace ("drawing");
81 wmDrawWidgets(); 81 super.draw;
82 } 82 }
83 } 83 }
84 84
85 /** For mouse click events. */ 85 /** For mouse click events. */
86 void clickEvent (ushort usx, ushort usy, ubyte b, bool state) { 86 void clickEvent (ushort usx, ushort usy, ubyte b, bool state) {
107 107
108 /** Notification of externally-caused screen resize. 108 /** Notification of externally-caused screen resize.
109 * 109 *
110 * Should be called before createWidgets to prevent widgets being squashed 110 * Should be called before createWidgets to prevent widgets being squashed
111 * to min-dims on loading (losing saved dimensions of columns, etc). */ 111 * to min-dims on loading (losing saved dimensions of columns, etc). */
112 void sizeEvent (int nw, int nh) { // IDrawable function 112 override void sizeEvent (int nw, int nh) { // IDrawable function
113 mutex.lock; 113 synchronized (mutex) {
114 scope(exit) mutex.unlock; 114 wmSizeEvent (nw, nh);
115 115 }
116 w = cast(wdim) nw;
117 h = cast(wdim) nh;
118 matchMinimalSize;
119
120 if (!childRoot) return; // if not created yet.
121 childRoot.setWidth (w, -1);
122 childRoot.setHeight (h, -1);
123 childRoot.setPosition (0,0);
124 } 116 }
125 117
126 protected: 118 protected:
127 final override void setLetterCallback(void delegate(ushort, char[]) dlg) { 119 final override void setLetterCallback(void delegate(ushort, char[]) dlg) {
128 input.setLetterCallback (dlg); 120 input.setLetterCallback (dlg);