aboutsummaryrefslogtreecommitdiffstats
path: root/rfbplayer/OptionsDialog.h
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-03-10 14:26:00 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-03-10 14:26:00 +0000
commit5e7af746d12167956076fb4df60485779af2846f (patch)
treeed8984fe1656de814b36b4d9445cdb91d6ef4aed /rfbplayer/OptionsDialog.h
parentf1794c33a48403018f80c840179614d4a3597274 (diff)
downloadtigervnc-5e7af746d12167956076fb4df60485779af2846f.tar.gz
tigervnc-5e7af746d12167956076fb4df60485779af2846f.zip
1. Added PlayerOptions class for managing the player options.
2. Added OptionsDialog. 3. Added ChoosePixelFormatDialog class. It is used for choosing the pixel format before the session playing. 4. Code improvements. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@238 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'rfbplayer/OptionsDialog.h')
-rw-r--r--rfbplayer/OptionsDialog.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/rfbplayer/OptionsDialog.h b/rfbplayer/OptionsDialog.h
new file mode 100644
index 00000000..c7affca0
--- /dev/null
+++ b/rfbplayer/OptionsDialog.h
@@ -0,0 +1,83 @@
+/* Copyright (C) 2004 TightVNC Team. All Rights Reserved.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+// -=- OptionsDialog.h
+
+#include <rfb_win32/Dialog.h>
+
+#include <rfbplayer/PlayerOptions.h>
+
+class OptionsDialog : public rfb::win32::Dialog {
+public:
+ OptionsDialog(PlayerOptions *_options)
+ : Dialog(GetModuleHandle(0)), options(_options), combo(0) {}
+ // - Show the dialog and return true if OK was clicked,
+ // false in case of error or Cancel
+ virtual bool showDialog() {
+ return Dialog::showDialog(MAKEINTRESOURCE(IDD_OPTIONS));
+ }
+protected:
+
+ // Dialog methods (protected)
+ virtual void initDialog() {
+ combo = GetDlgItem(handle, IDC_PIXELFORMAT);
+ SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("Auto"));
+ SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("8 bit depth (RGB332)"));
+ SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("16 bit depth (RGB655)"));
+ SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("24 bit depth (RGB888)"));
+ SendMessage(combo, CB_SETCURSEL, options->pixelFormat, 0);
+ if (options->askPixelFormat) {
+ setItemChecked(IDC_ASK_PF, true);
+ enableItem(IDC_PIXELFORMAT, false);
+ }
+ setItemChecked(IDC_ACCEPT_BELL, options->acceptBell);
+ setItemChecked(IDC_ACCEPT_CUT_TEXT, options->acceptCutText);
+ setItemChecked(IDC_AUTO_STORE_PARAM, options->autoStoreSettings);
+ setItemChecked(IDC_AUTOPLAY, options->autoPlay);
+ }
+ virtual bool onOk() {
+ if (!isItemChecked(IDC_ASK_PF)) {
+ options->pixelFormat = SendMessage(combo, CB_GETCURSEL, 0, 0);
+ }
+ options->askPixelFormat = isItemChecked(IDC_ASK_PF);
+ options->acceptBell = isItemChecked(IDC_ACCEPT_BELL);
+ options->acceptCutText = isItemChecked(IDC_ACCEPT_CUT_TEXT);
+ options->autoStoreSettings = isItemChecked(IDC_AUTO_STORE_PARAM);
+ options->autoPlay = isItemChecked(IDC_AUTOPLAY);
+ options->writeToRegistry();
+ return true;
+ }
+ virtual bool onCommand(int item, int cmd) {
+ if (item == IDC_ASK_PF) {
+ enableItem(IDC_PIXELFORMAT, !isItemChecked(IDC_ASK_PF));
+ }
+ if (item == IDC_DEFAULT) {
+ SendMessage(combo, CB_SETCURSEL, DEFAULT_PF, 0);
+ enableItem(IDC_PIXELFORMAT, !DEFAULT_ASK_PF);
+ setItemChecked(IDC_ASK_PF, DEFAULT_ASK_PF);
+ setItemChecked(IDC_ACCEPT_BELL, DEFAULT_ACCEPT_BELL);
+ setItemChecked(IDC_ACCEPT_CUT_TEXT, DEFAULT_ACCEPT_CUT_TEXT);
+ setItemChecked(IDC_AUTO_STORE_PARAM, DEFAULT_STORE_SETTINGS);
+ setItemChecked(IDC_AUTOPLAY, DEFAULT_AUTOPLAY);
+ }
+ return false;
+ }
+
+ HWND combo;
+ PlayerOptions *options;
+}; \ No newline at end of file