diff --git a/minigui.d b/minigui.d index d13aea8..e4c42f4 100644 --- a/minigui.d +++ b/minigui.d @@ -468,6 +468,15 @@ version(Windows) { +/ class Widget : ReflectableProperties { + private bool willDraw() { + return true; + } + + private bool skipPaintCycle() { + return false; + } + + /+ /++ Calling this directly after constructor can give you a reflectable object as-needed so you don't pay for what you don't need. @@ -1783,6 +1792,9 @@ class Widget : ReflectableProperties { if(hidden) return; + if(skipPaintCycle()) + return; + int paintX = x; int paintY = y; if(this.useNativeDrawing()) { @@ -6413,6 +6425,11 @@ abstract class Layout : Widget { tabStop = false; super(parent); } + + version(none) + override bool willDraw() { + return false; + } } /++ @@ -7695,8 +7712,6 @@ class Window : Widget { super(p); } - - private void actualRedraw() { if(recomputeChildLayoutRequired) recomputeChildLayoutEntry(); @@ -7719,7 +7734,7 @@ class Window : Widget { ugh = ugh.parent; } auto painter = w.draw(true); - privatePaint(WidgetPainter(painter, this), lox, loy, Rectangle(0, 0, int.max, int.max), false, true); + privatePaint(WidgetPainter(painter, this), lox, loy, Rectangle(0, 0, int.max, int.max), false, willDraw()); } @@ -10874,6 +10889,9 @@ class Button : MouseActivatedWidget { override int heightStretchiness() { return 3; } override int widthStretchiness() { return 3; } + version(none) + override bool skipPaintCycle() { return true; } + /++ If true, this button will emit trigger events on double (and other quick events, if added) click events as well as on normal single click events.