]> source.dussan.org Git - tigervnc.git/commitdiff
Removed CTRL_BAR_HEIGHT constant.
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Sun, 17 Apr 2005 12:01:48 +0000 (12:01 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Sun, 17 Apr 2005 12:01:48 +0000 (12:01 +0000)
Align toolbar buttons by toolbar height.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@293 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/rfbplayer.cxx

index ba8450d0cc203e4827e933665d4511a63d828049..ae5a8f84c902dbc839fd589a4b0db0d7575e652d 100644 (file)
@@ -73,7 +73,6 @@ char usage_msg[] =
 #define MAX_SPEED 10.00
 #define CALCULATION_ERROR MAX_SPEED / 1000
 #define MAX_POS_TRACKBAR_RANGE 50
-#define CTRL_BAR_HEIGHT 28
 #define DEFAULT_PLAYER_WIDTH 640
 #define DEFAULT_PLAYER_HEIGHT 480 
 
@@ -305,13 +304,13 @@ RfbPlayer::processMainMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   
   case WM_CREATE:
     {
+      createToolBar(hwnd);
+
       // Create the frame window
       frameHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, (const TCHAR*)frameClass.classAtom,
-        0, WS_CHILD | WS_VISIBLE, 0, CTRL_BAR_HEIGHT, 10, CTRL_BAR_HEIGHT + 10,
+        0, WS_CHILD | WS_VISIBLE, 0, tb.getHeight(), 10, tb.getHeight() + 10,
         hwnd, 0, frameClass.instance, this);
 
-      createToolBar(hwnd);
-
       hMenu = GetMenu(hwnd);
 
       return 0;
@@ -435,8 +434,8 @@ RfbPlayer::processMainMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
       // Update the cached sizing information
       RECT r;
       GetClientRect(getMainHandle(), &r);
-      MoveWindow(getFrameHandle(), 0, CTRL_BAR_HEIGHT, r.right - r.left,
-                 r.bottom - r.top - CTRL_BAR_HEIGHT, TRUE);
+      MoveWindow(getFrameHandle(), 0, tb.getHeight(), r.right - r.left,
+                 r.bottom - r.top - tb.getHeight(), TRUE);
 
       GetWindowRect(getFrameHandle(), &r);
       window_size = Rect(r.left, r.top, r.right, r.bottom);
@@ -624,7 +623,7 @@ void RfbPlayer::createToolBar(HWND parentHwnd) {
   RECT tRect;
   InitCommonControls();
 
-  tb.create(ID_TOOLBAR, parentHwnd);
+  tb.create(ID_TOOLBAR, parentHwnd, WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | CCS_NORESIZE);
   tb.addBitmap(4, IDB_TOOLBAR);
 
   // Create the control buttons
@@ -745,7 +744,7 @@ void RfbPlayer::setFrameSize(int width, int height) {
   RECT r = {0, 0, width, height};
   AdjustWindowRectEx(&r, GetWindowLong(getFrameHandle(), GWL_STYLE), TRUE, 
     GetWindowLong(getFrameHandle(), GWL_EXSTYLE));
-  r.bottom += CTRL_BAR_HEIGHT; // Include RfbPlayr's controls area
+  r.bottom += tb.getHeight(); // Include RfbPlayr's controls area
   AdjustWindowRect(&r, GetWindowLong(getMainHandle(), GWL_STYLE), FALSE);
   int x = max(0, (GetSystemMetrics(SM_CXSCREEN) - (r.right - r.left)) / 2);
   int y = max(0, (GetSystemMetrics(SM_CYSCREEN) - (r.bottom - r.top)) / 2);