From 8b9277ebfdb5d6524749e1a38f5cef2486e388e6 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 25 Aug 2019 16:10:04 -0400 Subject: [PATCH 1/4] use built in label class --- minigui.d | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/minigui.d b/minigui.d index 97b4564..f6d4838 100644 --- a/minigui.d +++ b/minigui.d @@ -3179,6 +3179,26 @@ class TabWidgetPage : Widget { this(string title, Widget parent) { this.title = title; super(parent); + + /* + version(win32_widgets) { + static bool classRegistered = false; + if(!classRegistered) { + HINSTANCE hInstance = cast(HINSTANCE) GetModuleHandle(null); + WNDCLASSEX wc; + wc.cbSize = wc.sizeof; + wc.hInstance = hInstance; + wc.lpfnWndProc = &DefWindowProc; + wc.lpszClassName = "arsd_minigui_TabWidgetPage"w.ptr; + if(!RegisterClassExW(&wc)) + throw new Exception("RegisterClass ");// ~ to!string(GetLastError())); + classRegistered = true; + } + + + createWin32Window(this, "arsd_minigui_TabWidgetPage"w, "", 0); + } + */ } override int minHeight() { @@ -5518,15 +5538,16 @@ class TextLabel : Widget { @scriptable void label(string l) { label_ = l; - redraw(); + version(win32_widgets) { + WCharzBuffer bfr = WCharzBuffer(l); + SetWindowTextW(hwnd, bfr.ptr); + } else version(custom_widgets) + redraw(); } /// this(string label, Widget parent = null) { - this.label_ = label; - this.alignment = TextAlignment.Right; - this.tabStop = false; - super(parent); + this(label, TextAlignment.Right, parent); } /// @@ -5535,10 +5556,14 @@ class TextLabel : Widget { this.alignment = alignment; this.tabStop = false; super(parent); + + version(win32_widgets) + createWin32Window(this, "static"w, label, 0, alignment == TextAlignment.Right ? WS_EX_RIGHT : WS_EX_LEFT); } TextAlignment alignment; + version(custom_widgets) override void paint(ScreenPainter painter) { painter.outlineColor = Color.black; painter.drawText(Point(0, 0), this.label, Point(width, height), alignment); From 149a23ec0980e6820725c22ec93fdc51ce6537bd Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 25 Aug 2019 21:47:08 -0400 Subject: [PATCH 2/4] invalidate for child windows on resize --- minigui.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/minigui.d b/minigui.d index f6d4838..491d526 100644 --- a/minigui.d +++ b/minigui.d @@ -3397,6 +3397,8 @@ class Window : Widget { this.width = w; this.height = h; recomputeChildLayout(); + version(win32_widgets) + InvalidateRect(hwnd, null, true); redraw(); }; From 5d1c2c1c33a2cf29d245eec06357fa488895c63a Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 26 Aug 2019 21:56:24 -0400 Subject: [PATCH 3/4] spikespaz bug --- minigui.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/minigui.d b/minigui.d index 491d526..ab6cf07 100644 --- a/minigui.d +++ b/minigui.d @@ -3079,6 +3079,10 @@ class TabWidget : Widget { recomputeChildLayout(); } } + + version(win32_widgets) { + InvalidateRect(parentWindow.hwnd, null, true); + } } } From d559032bfe74c7fd3bded847fa881b3b6bc8aa7a Mon Sep 17 00:00:00 2001 From: "H. S. Teoh" Date: Fri, 30 Aug 2019 22:11:47 -0700 Subject: [PATCH 4/4] Recognize TERM=rxvt-unicode-256color. --- terminal.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal.d b/terminal.d index 47543b8..2ddd6b5 100644 --- a/terminal.d +++ b/terminal.d @@ -308,7 +308,7 @@ vs|xterm|xterm-color|xterm-256color|vs100|xterm terminal emulator (X Window Syst #rxvt, added by me -rxvt|rxvt-unicode:\ +rxvt|rxvt-unicode|rxvt-unicode-256color:\ :am:bs:mi@:km:co#80:li#55:\ :im@:ei@:\ :ct=\E[3k:ue=\E[m:\