diff options
author | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2005-01-10 12:20:01 +0000 |
---|---|---|
committer | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2005-01-10 12:20:01 +0000 |
commit | d35da31bfae734a54cde999640f43a061d0575d8 (patch) | |
tree | ee2fce0fcda17eb84473da24c1d0f193db5564b3 | |
parent | 38baa3a3916cce4225f8838b6871d8c96261d9b0 (diff) | |
download | tigervnc-d35da31bfae734a54cde999640f43a061d0575d8.tar.gz tigervnc-d35da31bfae734a54cde999640f43a061d0575d8.zip |
Added ToolBar:create() function. It creats a windows toolbar.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@90 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | rfbplayer/ToolBar.cxx | 15 | ||||
-rw-r--r-- | rfbplayer/ToolBar.h | 8 |
2 files changed, 21 insertions, 2 deletions
diff --git a/rfbplayer/ToolBar.cxx b/rfbplayer/ToolBar.cxx index a1b20d37..b9cd7bb5 100644 --- a/rfbplayer/ToolBar.cxx +++ b/rfbplayer/ToolBar.cxx @@ -33,3 +33,18 @@ ToolBar::~ToolBar() { DestroyWindow(getHandle()); } +bool ToolBar::create(int _tbID, HWND parentHwnd, DWORD dwStyle) { + dwStyle |= WS_CHILD; + + // Create the ToolBar window + hwndToolBar = CreateWindowEx(0, TOOLBARCLASSNAME, 0, dwStyle, + 0, 0, 25, 25, parentHwnd, (HMENU)_tbID, GetModuleHandle(0), 0); + + if (hwndToolBar) { + tbID = _tbID; + + // It's required for backward compatibility + SendMessage(hwndToolBar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); + } + return (hwndToolBar ? true : false); +}; diff --git a/rfbplayer/ToolBar.h b/rfbplayer/ToolBar.h index aa59533a..e08bd0bc 100644 --- a/rfbplayer/ToolBar.h +++ b/rfbplayer/ToolBar.h @@ -26,11 +26,15 @@ public: ToolBar(); virtual ~ToolBar(); + // 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); + // getHandle() returns handle to a toolbar window. HWND getHandle() { return hwndToolBar; } protected: HWND hwndToolBar; int tbID; - -};
\ No newline at end of file +}; |