diff options
| author | Manolo Gouy <Manolo> | 2016-03-21 17:55:10 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-21 17:55:10 +0000 |
| commit | 3f34aba828983bc783529a30c0fa22c55b7abc05 (patch) | |
| tree | 847fd89384088285bafc22e461a507c0d68e8d78 /src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | |
| parent | 9ba3889ae5a7054b4d75c0ccb0f54e16b9b99159 (diff) | |
Rewrite Fl_Window::label(const char *name, const char *mininame) under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11394 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index f259b62ac..a0a4e57c0 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -394,6 +394,22 @@ void Fl_WinAPI_Window_Driver::make_current() { fl_graphics_driver->clip_region(0); } +void Fl_WinAPI_Window_Driver::label(const char *name,const char *iname) { + if (pWindow->shown() && !pWindow->parent()) { + if (!name) name = ""; + size_t l = strlen(name); + // WCHAR *lab = (WCHAR*) malloc((l + 1) * sizeof(short)); + // l = fl_utf2unicode((unsigned char*)name, l, (xchar*)lab); + unsigned wlen = fl_utf8toUtf16(name, (unsigned) l, NULL, 0); // Pass NULL to query length + wlen++; + unsigned short * lab = (unsigned short*)malloc(sizeof(unsigned short)*wlen); + wlen = fl_utf8toUtf16(name, (unsigned) l, lab, wlen); + lab[wlen] = 0; + SetWindowTextW(fl_xid(pWindow), (WCHAR *)lab); + free(lab); + } +} + // // End of "$Id$". // |
