Added ToolBar::getTotalWidth(). It returns the total size
of all buttons and separators in the toolbar.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2205 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/rfb_win32/ToolBar.cxx b/win/rfb_win32/ToolBar.cxx
index 6392ebd..857db45 100644
--- a/win/rfb_win32/ToolBar.cxx
+++ b/win/rfb_win32/ToolBar.cxx
@@ -202,6 +202,12 @@
   return r.bottom - r.top;
 }
 
+int ToolBar::getTotalWidth() {
+  SIZE *size;
+  SendMessage(getHandle(), TB_GETMAXSIZE, 0, (LPARAM)&size);
+  return size->cx;
+}
+
 void ToolBar::show() {
   ShowWindow(getHandle(), SW_SHOW);
 }
diff --git a/win/rfb_win32/ToolBar.h b/win/rfb_win32/ToolBar.h
index 2242c2a..f256c99 100644
--- a/win/rfb_win32/ToolBar.h
+++ b/win/rfb_win32/ToolBar.h
@@ -112,6 +112,10 @@
       // getHeight() returns the toolbar window height.
       int getHeight();
 
+      // getTotalWidth() returns the total size of all buttons and 
+      // separators in the toolbar.
+      int getTotalWidth();
+
       // show() displays the toolbar window.
       void show();