diff options
author | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2007-04-30 11:37:36 +0000 |
---|---|---|
committer | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2007-04-30 11:37:36 +0000 |
commit | a9a3387d03d83dbe43fb6e005209952e22f9e1fc (patch) | |
tree | 0ea4702b5fbf446fb88d06fb34d09b2e57109b7a | |
parent | c439ebb76fa412511b3be2bc82805d756cff5bcc (diff) | |
download | tigervnc-a9a3387d03d83dbe43fb6e005209952e22f9e1fc.tar.gz tigervnc-a9a3387d03d83dbe43fb6e005209952e22f9e1fc.zip |
Added controls to manage the scale filters in the vncviewer options dialog.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2289 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | win/vncviewer/OptionsDialog.cxx | 27 | ||||
-rw-r--r-- | win/vncviewer/resource.h | 4 | ||||
-rw-r--r-- | win/vncviewer/vncviewer.rc | 33 |
3 files changed, 50 insertions, 14 deletions
diff --git a/win/vncviewer/OptionsDialog.cxx b/win/vncviewer/OptionsDialog.cxx index 08990f74..c326645e 100644 --- a/win/vncviewer/OptionsDialog.cxx +++ b/win/vncviewer/OptionsDialog.cxx @@ -176,6 +176,14 @@ public: } else { SetDlgItemInt(handle, IDC_COMBO_SCALE, dlg->options.scale, FALSE); } + HWND hScaleFilterCombo = GetDlgItem(handle, IDC_COMBO_SCALE_FILTER); + SendMessage(hScaleFilterCombo, CB_RESETCONTENT, 0, 0); + ScaleFilters scaleFilters; + for (i = 0; i <= rfb::scaleFilterMaxNumber; i++) { + SendMessage(hScaleFilterCombo, CB_ADDSTRING, (WPARAM)0, (LPARAM)(int FAR*)scaleFilters[i].name); + } + SendMessage(hScaleFilterCombo, CB_SETCURSEL, (WPARAM)dlg->options.scaleFilter, (LPARAM)0); + if (dlg->options.scale == 100 && !dlg->options.autoScaling) enableItem(IDC_COMBO_SCALE_FILTER, 0); } virtual bool onOk() { dlg->options.shared = isItemChecked(IDC_CONN_SHARED); @@ -197,9 +205,28 @@ public: dlg->options.autoScaling = true; } } + dlg->options.scaleFilter = SendMessage(GetDlgItem(handle, IDC_COMBO_SCALE_FILTER), CB_GETCURSEL, 0, 0); ((ViewerOptions*)propSheet)->setChanged(); return true; } + virtual bool onCommand(int id, int cmd) { + if (id == IDC_COMBO_SCALE) { + if (cmd == CBN_SELENDOK || cmd == CBN_EDITCHANGE) { + char scaleStr[20]; + if (cmd == CBN_SELENDOK) { + HWND handleComboScale = GetDlgItem(handle, IDC_COMBO_SCALE); + int index = SendMessage(handleComboScale, CB_GETCURSEL, 0, 0); + SendMessage(handleComboScale, CB_GETLBTEXT, (WPARAM)index, (LPARAM)scaleStr); + } else { + GetDlgItemText(handle, IDC_COMBO_SCALE, scaleStr, 20); + } + if (strcmp(scaleStr, "100") == 0) enableItem(IDC_COMBO_SCALE_FILTER, 0); + else enableItem(IDC_COMBO_SCALE_FILTER, 1); + return true; + } + } + return false; + } protected: OptionsInfo* dlg; }; diff --git a/win/vncviewer/resource.h b/win/vncviewer/resource.h index 0016b74d..362d56ec 100644 --- a/win/vncviewer/resource.h +++ b/win/vncviewer/resource.h @@ -123,6 +123,8 @@ #define IDC_STATIC_SCALE 1097 #define IDC_COMBO_SCALE 1098 #define IDC_STATIC_PERCENT 1099 +#define IDC_COMBO_SCALE_FILTER 1100 +#define IDC_SCALE_FILTER 1101 #define ID_TOOLBAR 40002 #define ID_CLOSE 40003 #define ID_OPTIONS 40004 @@ -155,7 +157,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 134 #define _APS_NEXT_COMMAND_VALUE 40028 -#define _APS_NEXT_CONTROL_VALUE 1100 +#define _APS_NEXT_CONTROL_VALUE 1102 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/win/vncviewer/vncviewer.rc b/win/vncviewer/vncviewer.rc index bf8a8252..ae479c1d 100644 --- a/win/vncviewer/vncviewer.rc +++ b/win/vncviewer/vncviewer.rc @@ -210,32 +210,36 @@ BEGIN LTEXT "quality (1=poor, 9=best)",IDC_STATIC,44,140,81,9 END -IDD_MISC DIALOG DISCARDABLE 0, 0, 213, 137 +IDD_MISC DIALOG DISCARDABLE 0, 0, 216, 138 STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Misc" FONT 8, "MS Sans Serif" BEGIN CONTROL "Shared connection (do not disconnect other viewers)", IDC_CONN_SHARED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 10,199,15 + 10,202,15 CONTROL "Full-screen mode",IDC_FULL_SCREEN,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,25,99,15 - CONTROL "Show toolbar",IDC_SHOW_TOOLBAR,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,106,25,100,15 CONTROL "Render cursor locally",IDC_LOCAL_CURSOR,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,40,99,15 CONTROL "Allow dynamic desktop resizing",IDC_DESKTOP_RESIZE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,55,199,15 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,55,112,15 CONTROL "Only use protocol version 3.3",IDC_PROTOCOL_3_3,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,70,199,15 + BS_AUTOCHECKBOX | WS_TABSTOP,7,70,111,15 CONTROL "Beep when requested to by the server",IDC_ACCEPT_BELL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,199,15 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,202,15 CONTROL "Offer to automatically reconnect",IDC_AUTO_RECONNECT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,100,199,15 - LTEXT "Scale by:",IDC_STATIC_SCALE,106,40,34,15,SS_CENTERIMAGE - COMBOBOX IDC_COMBO_SCALE,140,40,40,134,CBS_DROPDOWN | CBS_SORT | + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,100,202,15 + CONTROL "Show toolbar",IDC_SHOW_TOOLBAR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,106,25,103,15 + COMBOBOX IDC_COMBO_SCALE,138,40,42,134,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "%",IDC_STATIC_PERCENT,185,40,21,15,SS_CENTERIMAGE + COMBOBOX IDC_COMBO_SCALE_FILTER,138,70,71,113,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "Scale by:",IDC_STATIC_SCALE,106,40,32,15,SS_CENTERIMAGE + LTEXT "%",IDC_STATIC_PERCENT,185,40,24,15,SS_CENTERIMAGE + LTEXT "With filter:",IDC_SCALE_FILTER,138,55,71,15, + SS_CENTERIMAGE END IDD_INPUTS DIALOG DISCARDABLE 0, 0, 186, 162 @@ -502,10 +506,13 @@ BEGIN IDD_MISC, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 206 + RIGHTMARGIN, 209 VERTGUIDE, 106 + VERTGUIDE, 138 + VERTGUIDE, 180 + VERTGUIDE, 185 TOPMARGIN, 7 - BOTTOMMARGIN, 130 + BOTTOMMARGIN, 131 HORZGUIDE, 10 HORZGUIDE, 25 HORZGUIDE, 40 |