george82 | e8f95d2 | 2005-11-03 15:23:02 +0000 | [diff] [blame] | 1 | /* 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 | |
| 24 | void 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); |
george82 | 6f61579 | 2005-11-04 13:22:29 +0000 | [diff] [blame] | 42 | addButton(8, ID_FILE_TRANSFER); |
george82 | e8f95d2 | 2005-11-03 15:23:02 +0000 | [diff] [blame] | 43 | 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 | } |
george82 | 2a54ed6 | 2005-11-27 16:25:52 +0000 | [diff] [blame^] | 51 | |
| 52 | void ViewerToolBar::show() { |
| 53 | ShowWindow(getHandle(), SW_SHOW); |
| 54 | SendMessage(parentHwnd, WM_SIZE, 0, 0); |
| 55 | } |
| 56 | |
| 57 | void ViewerToolBar::hide() { |
| 58 | ShowWindow(getHandle(), SW_HIDE); |
| 59 | SendMessage(parentHwnd, WM_SIZE, 0, 0); |
| 60 | } |