From 957a258b42efe906683d420784a7a478a92cf32c Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 27 Dec 2003 15:37:29 +0000 Subject: [PATCH] dynamically calculating the required size for the clock bar window based on the font size [patch of Ge van Geldorp ] svn path=/trunk/; revision=7266 --- reactos/subsys/system/explorer/doxy-footer.html | 2 +- reactos/subsys/system/explorer/make_explorer.dsp | 4 ++++ reactos/subsys/system/explorer/taskbar/traynotify.cpp | 9 ++++++++- reactos/subsys/system/explorer/taskbar/traynotify.h | 1 - 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/system/explorer/doxy-footer.html b/reactos/subsys/system/explorer/doxy-footer.html index 0cba69c1e46..17ff02a4f85 100644 --- a/reactos/subsys/system/explorer/doxy-footer.html +++ b/reactos/subsys/system/explorer/doxy-footer.html @@ -3,7 +3,7 @@
ROS Explorer Source Code Documentation -
generated on 23.12.2003 by +
generated on 27.12.2003 by
doxygen
diff --git a/reactos/subsys/system/explorer/make_explorer.dsp b/reactos/subsys/system/explorer/make_explorer.dsp index 8ac2c776fa2..91b4a7d08d1 100644 --- a/reactos/subsys/system/explorer/make_explorer.dsp +++ b/reactos/subsys/system/explorer/make_explorer.dsp @@ -191,6 +191,10 @@ SOURCE=.\Jamfile # End Source File # Begin Source File +SOURCE=.\Makefile +# End Source File +# Begin Source File + SOURCE=.\Makefile.MinGW # End Source File # Begin Source File diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index 1121dd282e7..f48ca741904 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -307,9 +307,16 @@ HWND ClockWindow::Create(HWND hwndParent) { ClientRect clnt(hwndParent); + WindowCanvas canvas(hwndParent); + FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT)); + + RECT rect = {0, 0, 0, 0}; + DrawText(canvas, TEXT("00:00"), -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT); + int clockwindowWidth = rect.right-rect.left + 4; + return Window::Create(WINDOW_CREATOR(ClockWindow), 0, BtnWindowClass(CLASSNAME_CLOCKWINDOW,CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, - clnt.right-(CLOCKWINDOW_WIDTH+1), 1, CLOCKWINDOW_WIDTH, clnt.bottom-2, hwndParent); + clnt.right-(clockwindowWidth+1), 1, clockwindowWidth, clnt.bottom-2, hwndParent); } LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.h b/reactos/subsys/system/explorer/taskbar/traynotify.h index ae96c3e7f28..c29b8dae612 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.h +++ b/reactos/subsys/system/explorer/taskbar/traynotify.h @@ -32,7 +32,6 @@ #define CLASSNAME_CLOCKWINDOW TEXT("TrayClockWClass") #define NOTIFYAREA_WIDTH 244 -#define CLOCKWINDOW_WIDTH 32 /// NotifyIconIndex is used for maintaining the order of notification icons.