blob: 9846262b08ef6273b4c89d4d579ecda4f5ed50ac [file] [log] [blame]
george82e8f95d22005-11-03 15:23:02 +00001/* Copyright (C) 2005 TightVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19// -=- ViewerToolBar.cxx
20
21#include <vncviewer/ViewerToolBar.h>
22#include <vncviewer/resource.h>
23
24void ViewerToolBar::create(HWND parentHwnd) {
25 // Create the toolbar panel
26 ToolBar::create(ID_TOOLBAR, parentHwnd, WS_CHILD | WS_VISIBLE |
27 TBSTYLE_FLAT | CCS_NORESIZE);
28 addBitmap(4, IDB_TOOLBAR);
29
30 // Create the control buttons
31 addButton(0, ID_OPTIONS);
32 addButton(1, ID_INFO);
33 addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP);
34 addButton(2, ID_FULLSCREEN);
35 addButton(3, ID_REQUEST_REFRESH);
36 addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP);
37 addButton(4, ID_SEND_CAD);
38 addButton(5, ID_SEND_CTLESC);
39 addButton(6, ID_CTRL_KEY);
40 addButton(7, ID_ALT_KEY);
41 addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP);
george826f615792005-11-04 13:22:29 +000042 addButton(8, ID_FILE_TRANSFER);
george82e8f95d22005-11-03 15:23:02 +000043 addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP);
44 addButton(9, ID_NEW_CONNECTION);
45 addButton(10, ID_CONN_SAVE_AS);
46 addButton(11, ID_CLOSE);
47
48 // Resize the toolbar window
49 autoSize();
50}
george822a54ed62005-11-27 16:25:52 +000051
52void ViewerToolBar::show() {
53 ShowWindow(getHandle(), SW_SHOW);
54 SendMessage(parentHwnd, WM_SIZE, 0, 0);
55}
56
57void ViewerToolBar::hide() {
58 ShowWindow(getHandle(), SW_HIDE);
59 SendMessage(parentHwnd, WM_SIZE, 0, 0);
60}