Constantin Kaplinsky | 729598c | 2006-05-25 05:12:25 +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 | |
| 27 | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | 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); |
george82 | 1d3cc61 | 2006-09-09 14:42:20 +0000 | [diff] [blame^] | 37 | addButton(4, ID_ZOOM_IN); |
| 38 | addButton(5, ID_ZOOM_OUT); |
| 39 | addButton(6, ID_ACTUAL_SIZE); |
| 40 | addButton(7, ID_AUTO_SIZE); |
Constantin Kaplinsky | 729598c | 2006-05-25 05:12:25 +0000 | [diff] [blame] | 41 | addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP); |
george82 | 1d3cc61 | 2006-09-09 14:42:20 +0000 | [diff] [blame^] | 42 | addButton(8, ID_SEND_CAD); |
| 43 | addButton(9, ID_SEND_CTLESC); |
| 44 | addButton(10, ID_CTRL_KEY); |
| 45 | addButton(11, ID_ALT_KEY); |
Constantin Kaplinsky | 729598c | 2006-05-25 05:12:25 +0000 | [diff] [blame] | 46 | addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP); |
george82 | 1d3cc61 | 2006-09-09 14:42:20 +0000 | [diff] [blame^] | 47 | addButton(12, ID_FILE_TRANSFER); |
| 48 | addButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP); |
| 49 | addButton(13, ID_NEW_CONNECTION); |
| 50 | addButton(14, ID_CONN_SAVE_AS); |
| 51 | addButton(15, ID_CLOSE); |
Constantin Kaplinsky | 729598c | 2006-05-25 05:12:25 +0000 | [diff] [blame] | 52 | |
| 53 | // Resize the toolbar window |
| 54 | autoSize(); |
| 55 | } |
| 56 | |
| 57 | LRESULT ViewerToolBar::processWM_NOTIFY(WPARAM wParam, LPARAM lParam) { |
| 58 | switch (((LPNMHDR)lParam)->code) { |
| 59 | // Process tooltips text |
| 60 | case TTN_NEEDTEXT: |
| 61 | { |
| 62 | LPTOOLTIPTEXT TTStr = (LPTOOLTIPTEXT)lParam; |
| 63 | if (TTStr->hdr.code != TTN_NEEDTEXT) |
| 64 | return 0; |
| 65 | |
| 66 | switch (TTStr->hdr.idFrom) { |
| 67 | case ID_OPTIONS: |
| 68 | TTStr->lpszText = "Connection options..."; |
| 69 | break; |
| 70 | case ID_INFO: |
| 71 | TTStr->lpszText = "Connection info"; |
| 72 | break; |
| 73 | case ID_FULLSCREEN: |
| 74 | TTStr->lpszText = "Full screen"; |
| 75 | break; |
| 76 | case ID_REQUEST_REFRESH: |
| 77 | TTStr->lpszText = "Request screen refresh"; |
| 78 | break; |
| 79 | case ID_SEND_CAD: |
| 80 | TTStr->lpszText = "Send Ctrl-Alt-Del"; |
| 81 | break; |
| 82 | case ID_SEND_CTLESC: |
| 83 | TTStr->lpszText = "Send Ctrl-Esc"; |
| 84 | break; |
| 85 | case ID_CTRL_KEY: |
| 86 | TTStr->lpszText = "Send Ctrl key press/release"; |
| 87 | break; |
| 88 | case ID_ALT_KEY: |
| 89 | TTStr->lpszText = "Send Alt key press/release"; |
| 90 | break; |
| 91 | case ID_FILE_TRANSFER: |
| 92 | TTStr->lpszText = "Transfer files..."; |
| 93 | break; |
| 94 | case ID_NEW_CONNECTION: |
| 95 | TTStr->lpszText = "New connection..."; |
| 96 | break; |
| 97 | case ID_CONN_SAVE_AS: |
| 98 | TTStr->lpszText = "Save connection info as..."; |
| 99 | break; |
| 100 | case ID_CLOSE: |
| 101 | TTStr->lpszText = "Disconnect"; |
| 102 | break; |
| 103 | default: |
| 104 | break; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | default: |
| 109 | break; |
| 110 | } |
| 111 | return 0; |
| 112 | } |