]> source.dussan.org Git - tigervnc.git/commitdiff
Added ToolBar::autoSize, ToolBar::getButtonRect().
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Tue, 18 Jan 2005 16:00:35 +0000 (16:00 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Tue, 18 Jan 2005 16:00:35 +0000 (16:00 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@103 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/ToolBar.cxx
rfbplayer/ToolBar.h

index bd7d4a9b11a2e15486a40ca83088de850f3f6309..c4808cc14289c0fe8581547666ef795baad8cb2b 100644 (file)
@@ -153,6 +153,12 @@ bool ToolBar::pressButton(int idButton, bool press) {
   return (result ? true : false);
 }
 
+bool ToolBar::getButtonRect(int nIndex, LPRECT buttonRect) {
+  int result = SendMessage(getHandle(), TB_GETITEMRECT, 
+    nIndex, (LPARAM)buttonRect);
+  return (result ? true : false);
+}
+
 bool ToolBar::setButtonSize(int width, int height) {
   assert(width > 0);
   assert(height > 0);
@@ -164,3 +170,7 @@ bool ToolBar::setButtonSize(int width, int height) {
   }
   return false; 
 }
+
+void ToolBar::autoSize() {
+  SendMessage(getHandle(), TB_AUTOSIZE, 0, 0);
+}
index 03d58a86cdbd2569885f3b442bfe5cac4f4be598..18061739a923e0554410283a603a295ce41a648b 100644 (file)
@@ -79,10 +79,17 @@ public:
   // pressButton() presses or releases the specified button in the toolbar.
   bool pressButton(int idButton, bool press);
 
+  // getButtonRect() gets the bounding rectangle of a button in a toolbar.
+  bool getButtonRect(int nIndex, LPRECT buttonRect);
+  
   // setButtonSize() sets the size of the buttons to be added to a toolbar.
   // Button size must be largen the button bitmap.
   bool setButtonSize(int width, int height);
 
+   
+  
+  // autoSize() resizes the toolbar window.
+  void autoSize();
 
   // getHandle() returns handle to a toolbar window.
   HWND getHandle() { return hwndToolBar; }