- final public void drawAll() {
- if ((flush) && (!repaint)) {
- backend.flushScreen();
- flush = false;
- return;
- }
-
- if (!repaint) {
- return;
- }
-
- // If true, the cursor is not visible
- boolean cursor = false;
-
- // Start with a clean screen
- backend.screen.clear();
-
- // Draw the background
- CellAttributes background = theme.getColor("tapplication.background");
- backend.screen.putAll(GraphicsChars.HATCH, background);
-
- /*
- // Draw each window in reverse Z order
- TWindow [] sorted = windows.dup;
- sorted.sort.reverse;
- foreach (w; sorted) {
- w.drawChildren();
- }
-
- // Draw the blank menubar line - reset the screen clipping first so
- // it won't trim it out.
- backend.screen.resetClipping();
- backend.screen.hLineXY(0, 0, backend.screen.getWidth(), ' ',
- theme.getColor("tmenu"));
- // Now draw the menus.
- int x = 1;
- foreach (m; menus) {
- CellAttributes menuColor;
- CellAttributes menuMnemonicColor;
- if (m.active) {
- menuColor = theme.getColor("tmenu.highlighted");
- menuMnemonicColor = theme.getColor("tmenu.mnemonic.highlighted");
- } else {
- menuColor = theme.getColor("tmenu");
- menuMnemonicColor = theme.getColor("tmenu.mnemonic");
- }
- // Draw the menu title
- backend.screen.hLineXY(x, 0, cast(int)m.title.length + 2, ' ',
- menuColor);
- backend.screen.putStrXY(x + 1, 0, m.title, menuColor);
- // Draw the highlight character
- backend.screen.putCharXY(x + 1 + m.mnemonic.shortcutIdx, 0,
- m.mnemonic.shortcut, menuMnemonicColor);
-
- if (m.active) {
- m.drawChildren();
- // Reset the screen clipping so we can draw the next title.
- backend.screen.resetClipping();
- }
- x += m.title.length + 2;
- }
-
- foreach (m; subMenus) {
- // Reset the screen clipping so we can draw the next sub-menu.
- backend.screen.resetClipping();
- m.drawChildren();
- }
- */
-
- // Draw the mouse pointer
- drawMouse();
-
- /*
- // Place the cursor if it is visible
- TWidget activeWidget = null;
- if (sorted.length > 0) {
- activeWidget = sorted[$ - 1].getActiveChild();
- if (activeWidget.hasCursor) {
- backend.screen.putCursor(true, activeWidget.getCursorAbsoluteX(),
- activeWidget.getCursorAbsoluteY());
- cursor = true;
- }
- }
-
- // Kill the cursor
- if (cursor == false) {
- backend.screen.hideCursor();
- }
- */
-
- // Flush the screen contents
- backend.flushScreen();
-
- repaint = false;
- flush = false;
+ public final void drawAll() {
+ if ((flush) && (!repaint)) {
+ backend.flushScreen();
+ flush = false;
+ return;
+ }
+
+ if (!repaint) {
+ return;
+ }
+
+ // If true, the cursor is not visible
+ boolean cursor = false;
+
+ // Start with a clean screen
+ backend.getScreen().clear();
+
+ // Draw the background
+ CellAttributes background = theme.getColor("tapplication.background");
+ backend.getScreen().putAll(GraphicsChars.HATCH, background);
+
+ /*
+ // Draw each window in reverse Z order
+ TWindow [] sorted = windows.dup;
+ sorted.sort.reverse;
+ foreach (w; sorted) {
+ w.drawChildren();
+ }
+
+ // Draw the blank menubar line - reset the screen clipping first so
+ // it won't trim it out.
+ backend.getScreen().resetClipping();
+ backend.getScreen().hLineXY(0, 0, backend.getScreen().getWidth(), ' ',
+ theme.getColor("tmenu"));
+ // Now draw the menus.
+ int x = 1;
+ foreach (m; menus) {
+ CellAttributes menuColor;
+ CellAttributes menuMnemonicColor;
+ if (m.active) {
+ menuColor = theme.getColor("tmenu.highlighted");
+ menuMnemonicColor = theme.getColor("tmenu.mnemonic.highlighted");
+ } else {
+ menuColor = theme.getColor("tmenu");
+ menuMnemonicColor = theme.getColor("tmenu.mnemonic");
+ }
+ // Draw the menu title
+ backend.getScreen().hLineXY(x, 0, cast(int)m.title.length + 2, ' ',
+ menuColor);
+ backend.getScreen().putStrXY(x + 1, 0, m.title, menuColor);
+ // Draw the highlight character
+ backend.getScreen().putCharXY(x + 1 + m.mnemonic.shortcutIdx, 0,
+ m.mnemonic.shortcut, menuMnemonicColor);
+
+ if (m.active) {
+ m.drawChildren();
+ // Reset the screen clipping so we can draw the next title.
+ backend.getScreen().resetClipping();
+ }
+ x += m.title.length + 2;
+ }
+
+ foreach (m; subMenus) {
+ // Reset the screen clipping so we can draw the next sub-menu.
+ backend.getScreen().resetClipping();
+ m.drawChildren();
+ }
+ */
+
+ // Draw the mouse pointer
+ drawMouse();
+
+ /*
+ // Place the cursor if it is visible
+ TWidget activeWidget = null;
+ if (sorted.length > 0) {
+ activeWidget = sorted[$ - 1].getActiveChild();
+ if (activeWidget.hasCursor) {
+ backend.getScreen().putCursor(true, activeWidget.getCursorAbsoluteX(),
+ activeWidget.getCursorAbsoluteY());
+ cursor = true;
+ }
+ }
+
+ // Kill the cursor
+ if (cursor == false) {
+ backend.getScreen().hideCursor();
+ }
+ */
+
+ // Flush the screen contents
+ backend.flushScreen();
+
+ repaint = false;
+ flush = false;