summaryrefslogtreecommitdiffstats
path: root/rfb_win32
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-07-28 07:04:23 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-07-28 07:04:23 +0000
commit454b1b1381a676d15010697fa455cefe1b180c25 (patch)
tree95e5d6b308fd5152548e5b718d17573d82809649 /rfb_win32
parent0e3d2946e3370546b5671fe27e1b516b09dbd703 (diff)
downloadtigervnc-454b1b1381a676d15010697fa455cefe1b180c25.tar.gz
tigervnc-454b1b1381a676d15010697fa455cefe1b180c25.zip
ToolBar class must be in rfb::win32 namespace.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@302 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'rfb_win32')
-rw-r--r--rfb_win32/ToolBar.cxx2
-rw-r--r--rfb_win32/ToolBar.h140
2 files changed, 78 insertions, 64 deletions
diff --git a/rfb_win32/ToolBar.cxx b/rfb_win32/ToolBar.cxx
index 77a2f3d5..963a5d10 100644
--- a/rfb_win32/ToolBar.cxx
+++ b/rfb_win32/ToolBar.cxx
@@ -20,6 +20,8 @@
#include "ToolBar.h"
+using namespace rfb::win32;
+
ToolBar::ToolBar() : hwndToolBar(0), tbID(-1) {
INITCOMMONCONTROLSEX icex;
diff --git a/rfb_win32/ToolBar.h b/rfb_win32/ToolBar.h
index d1c0d0ad..dd7373c3 100644
--- a/rfb_win32/ToolBar.h
+++ b/rfb_win32/ToolBar.h
@@ -16,95 +16,107 @@
* USA.
*/
-// -=- ToolBar.h
+// -=- ToolBar control class.
#include <windows.h>
#include <commctrl.h>
#include <assert.h>
-class ToolBar {
-public:
- ToolBar();
- virtual ~ToolBar();
+namespace rfb {
- // create() creates a windows toolbar. dwStyle is a combination of
- // the toolbar control and button styles. It returns TRUE if successful,
- // or FALSE otherwise.
- bool create(int tbID, HWND parentHwnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT);
+ namespace win32 {
- // -=- Button images operations
+ class ToolBar {
+ public:
+ ToolBar();
+ virtual ~ToolBar();
- // addBitmap() adds one or more images from resources to the list of button
- // images available for a toolbar. Returns the index of the first new image
- // if successful, or -1 otherwise.
- int addBitmap(int nButtons, UINT bitmapID);
+ // create() creates a windows toolbar. dwStyle is a combination of
+ // the toolbar control and button styles. It returns TRUE if successful,
+ // or FALSE otherwise.
+ bool create(int tbID, HWND parentHwnd,
+ DWORD dwStyle = WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT);
- // addSystemBitmap() adds the system-defined button bitmaps to the list
- // of the toolbar button specifying by stdBitmapID. Returns the index of
- // the first new image if successful, or -1 otherwise.
- int addSystemBitmap(UINT stdBitmapID);
+ // -=- Button images operations
- // setBitmapSize() sets the size of the bitmapped images to be added
- // to a toolbar. It returns TRUE if successful, or FALSE otherwise.
- // You must call it before addBitmap().
- bool setBitmapSize(int width, int height);
+ // addBitmap() adds one or more images from resources to
+ // the list of button images available for a toolbar.
+ // Returns the index of the first new image if successful,
+ // or -1 otherwise.
+ int addBitmap(int nButtons, UINT bitmapID);
- // -=- Button operations
+ // addSystemBitmap() adds the system-defined button bitmaps to the list
+ // of the toolbar button specifying by stdBitmapID. Returns the index of
+ // the first new image if successful, or -1 otherwise.
+ int addSystemBitmap(UINT stdBitmapID);
- // addButton() adds one button.
- bool addButton(int iBitmap, int idCommand, BYTE state=TBSTATE_ENABLED, BYTE style=TBSTYLE_BUTTON, UINT dwData=0, int iString=0);
+ // setBitmapSize() sets the size of the bitmapped images to be added
+ // to a toolbar. It returns TRUE if successful, or FALSE otherwise.
+ // You must call it before addBitmap().
+ bool setBitmapSize(int width, int height);
- // addNButton() adds nButtons buttons to a toolbar.
- bool addNButton(int nButtons, LPTBBUTTON tbb);
+ // -=- Button operations
- // deleteButton() removes a button from the toolbar.
- bool deleteButton(int nIndex);
+ // addButton() adds one button.
+ bool addButton(int iBitmap, int idCommand, BYTE state=TBSTATE_ENABLED,
+ BYTE style=TBSTYLE_BUTTON, UINT dwData=0, int iString=0);
- // insertButton() inserts a button in a toolbar control by index.
- bool insertButton(int nIndex, LPTBBUTTON tbb);
+ // addNButton() adds nButtons buttons to a toolbar.
+ bool addNButton(int nButtons, LPTBBUTTON tbb);
- // getButtonInfo() retrieves extended information about a toolbar's button.
- // It returns index of the button if successful, or -1 otherwise.
- int getButtonInfo(int idButton, TBBUTTONINFO *btnInfo);
+ // deleteButton() removes a button from the toolbar.
+ bool deleteButton(int nIndex);
- // getButtonsHeight() retrieves the height of the toolbar buttons.
- int getButtonsHeight();
+ // insertButton() inserts a button in a toolbar control by index.
+ bool insertButton(int nIndex, LPTBBUTTON tbb);
- // getButtonsWidth() retrieves the width of the toolbar buttons.
- int getButtonsWidth();
+ // getButtonInfo() retrieves extended information about a toolbar's
+ // button. It returns index of the button if successful, or -1 otherwise.
+ int getButtonInfo(int idButton, TBBUTTONINFO *btnInfo);
- // setButtonInfo() sets the information for an existing button in a toolbar.
- bool setButtonInfo(int idButton, TBBUTTONINFO* ptbbi);
+ // getButtonsHeight() retrieves the height of the toolbar buttons.
+ int getButtonsHeight();
- // checkButton() checks or unchecks a given button in a toolbar control.
- bool checkButton(int idButton, bool check);
+ // getButtonsWidth() retrieves the width of the toolbar buttons.
+ int getButtonsWidth();
- // enableButton() enables or disables the specified button in the toolbar.
- bool enableButton(int idButton, bool enable);
+ // setButtonInfo() sets the information for an existing button
+ // in a toolbar.
+ bool setButtonInfo(int idButton, TBBUTTONINFO* ptbbi);
- // pressButton() presses or releases the specified button in the toolbar.
- bool pressButton(int idButton, bool press);
+ // checkButton() checks or unchecks a given button in a toolbar control.
+ bool checkButton(int idButton, bool check);
- // 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);
+ // enableButton() enables or disables the specified button
+ // in the toolbar.
+ bool enableButton(int idButton, bool enable);
+
+ // 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);
- // autoSize() resizes the toolbar window.
- void autoSize();
+ // 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; }
+
+ // getHeight() returns the toolbar window height.
+ int getHeight();
- // getHandle() returns handle to a toolbar window.
- HWND getHandle() { return hwndToolBar; }
+ protected:
+ HWND hwndToolBar;
+ HWND parentHwnd;
+ int tbID;
+ };
- // getHeight() returns the toolbar window height.
- int getHeight();
+ }; // win32
-protected:
- HWND hwndToolBar;
- HWND parentHwnd;
- int tbID;
-};
+}; // rfb