From da8613d83340d1352217ca273df7b0a8a45e6863 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 30 May 2015 03:28:50 -0400 Subject: [PATCH] More fixes. --- redo/windows/control.c | 27 +++++++++++++++++++++++++++ redo/windows/tab.c | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/redo/windows/control.c b/redo/windows/control.c index 6308d6bf..d6113cf6 100644 --- a/redo/windows/control.c +++ b/redo/windows/control.c @@ -167,3 +167,30 @@ uiControl *uiWindowsNewSingleHWNDControl(uintmax_t type) setSingleHWNDFuncs(c); return c; } + +// TODO migrate these to the system set up above + +char *uiWindowsControlText(uiControl *c) +{ + HWND hwnd; + WCHAR *wtext; + char *text; + + hwnd = (HWND) uiControlHandle(c); + wtext = windowText(hwnd); + text = toUTF8(wtext); + uiFree(wtext); + return text; +} + +void uiWindowsControlSetText(uiControl *c, const char *text) +{ + HWND hwnd; + WCHAR *wtext; + + hwnd = (HWND) uiControlHandle(c); + wtext = toUTF16(text); + if (SetWindowTextW(hwnd, wtext) == 0) + logLastError("error setting control text in uiWindowsControlSetText()"); + uiFree(wtext); +} diff --git a/redo/windows/tab.c b/redo/windows/tab.c index 1cf5743e..168d6d9f 100644 --- a/redo/windows/tab.c +++ b/redo/windows/tab.c @@ -34,7 +34,7 @@ static void showHidePage(struct tab *t, LRESULT which, int hide) return; page = ptrArrayIndex(t->pages, struct tabPage *, which); if (hide) -//TODO uiControlContainerHide(page->control); +;//TODO uiControlContainerHide(page->control); else { //TODO uiControlContainerShow(page->control); // we only resize the current page, so we have to do this here