]> source.dussan.org Git - tigervnc.git/commitdiff
Added UserPixelFormatsDialog.
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Sat, 26 Mar 2005 11:12:25 +0000 (11:12 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Sat, 26 Mar 2005 11:12:25 +0000 (11:12 +0000)
It allows user to define the user pixel formats.
Now "Edit User PF" button on Options Dialog is working.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@267 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/OptionsDialog.h
rfbplayer/UserPixelFormatsDialog.h [new file with mode: 0644]
rfbplayer/resource.h
rfbplayer/rfbplayer.dsp
rfbplayer/rfbplayer.rc

index a0ac38896d9bbbef1711ff3b3d83654ee458cd09..5ca67afca01f6226a35c493583dc95914aa70177 100644 (file)
@@ -18,9 +18,8 @@
 
 // -=- OptionsDialog.h
 
-#include <rfb_win32/Dialog.h>
-
 #include <rfbplayer/PlayerOptions.h>
+#include <rfbplayer/UserPixelFormatsDialog.h>
 
 class OptionsDialog : public rfb::win32::Dialog {
 public:
@@ -89,6 +88,10 @@ protected:
       setItemChecked(IDC_AUTOPLAY, DEFAULT_AUTOPLAY);
       setItemChecked(IDC_BIG_ENDIAN, DEFAULT_BIG_ENDIAN);
     }
+    if (item == IDC_EDIT_UPF) {
+      UserPixelFormatsDialog UpfListDialog(supportedPF);
+      UpfListDialog.showDialog(handle);
+    }
     return false;
   }
 
diff --git a/rfbplayer/UserPixelFormatsDialog.h b/rfbplayer/UserPixelFormatsDialog.h
new file mode 100644 (file)
index 0000000..e3d1aa3
--- /dev/null
@@ -0,0 +1,59 @@
+/* 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.
+ */
+
+// -=- UserPixelFormatsDialog.h
+
+#include <rfb_win32/Dialog.h>
+
+class UserPixelFormatsDialog : public rfb::win32::Dialog {
+public:
+  UserPixelFormatsDialog(PixelFormatList *_supportedPF) 
+  : Dialog(GetModuleHandle(0)), supportedPF(_supportedPF), pfList(0) {}
+  // - Show the dialog and return true if OK was clicked,
+  //   false in case of error or Cancel
+  virtual bool showDialog(HWND parent) {
+    return Dialog::showDialog(MAKEINTRESOURCE(IDD_USERPF_LIST), parent);
+  }
+
+protected:
+  // Dialog methods (protected)
+  virtual void initDialog() {
+    pfList = GetDlgItem(handle, IDC_PF_LIST);
+    for (int i = supportedPF->getDefaultPFCount(); i < supportedPF->count(); i++) {
+      SendMessage(pfList, LB_ADDSTRING, 
+        0, (LPARAM)(LPCTSTR)(((*supportedPF)[i]).format_name));
+    }
+    SendMessage(pfList, LB_SETCURSEL, 0, 0);
+  }
+  virtual bool onCommand(int item, int cmd) { 
+    switch (item) {
+    case IDC_ADD_BUTTON:
+      break;
+    case IDC_REMOVE_BUTTON:
+      break;
+    case IDC_EDIT_BUTTON:
+      break;
+    default:
+      break;
+    }
+    return false;
+  }
+
+  HWND pfList;
+  PixelFormatList *supportedPF;
+};
\ No newline at end of file
index db4d278a37547d6ef42dcdfa7a26124799baf818..ca4901b36f96412bfcef01070edd7041f4f61afd 100644 (file)
@@ -10,6 +10,7 @@
 #define IDD_PIXELFORMAT                 134
 #define IDD_OPTIONS                     137
 #define IDD_ABOUT                       138
+#define IDD_USERPF_LIST                 139
 #define IDC_GOTO_EDIT                   1003
 #define IDC_PIXELFORMAT                 1004
 #define IDC_ASK_PF                      1006
 #define IDC_AUTOPLAY                    1012
 #define IDC_BIG_ENDIAN                  1013
 #define IDC_EDIT_UPF                    1015
+#define IDC_PF_LIST                     1016
+#define IDC_ADD_BUTTON                  1017
+#define IDC_REMOVE_BUTTON               1018
+#define IDC_EDIT_BUTTON                 1019
 #define IDC_COPYRIGHT                   1021
 #define IDC_DESCRIPTION                 1022
 #define ID_OPENFILE                     40011
@@ -48,9 +53,9 @@
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        139
+#define _APS_NEXT_RESOURCE_VALUE        140
 #define _APS_NEXT_COMMAND_VALUE         40045
-#define _APS_NEXT_CONTROL_VALUE         1016
+#define _APS_NEXT_CONTROL_VALUE         1021
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
index 469d1710d961072d0fa733f6acfbe286e1a98bf2..e3249058593644c6005bab670614b62b5aeacbd0 100644 (file)
@@ -174,6 +174,10 @@ SOURCE=.\rfbSessionReader.h
 \r
 SOURCE=.\ToolBar.h\r
 # End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\UserPixelFormatsDialog.h\r
+# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 8e615d44239748b8929c174f0d8b2f28690fd9f0..55b4f3fbeaec32f22ff421e1e31de5fa236a30ad 100644 (file)
@@ -271,6 +271,19 @@ BEGIN
                     IDC_STATIC,40,55,202,15
 END
 
+IDD_USERPF_LIST DIALOG DISCARDABLE  0, 0, 207, 162
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Add / Remove the user pixel formats"
+FONT 8, "MS Sans Serif"
+BEGIN
+    LISTBOX         IDC_PF_LIST,7,7,136,148,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Add",IDC_ADD_BUTTON,150,7,50,14
+    PUSHBUTTON      "Remove",IDC_REMOVE_BUTTON,150,26,50,14
+    PUSHBUTTON      "Edit",IDC_EDIT_BUTTON,150,45,50,14
+    PUSHBUTTON      "Close",IDOK,150,64,50,14
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -339,6 +352,20 @@ BEGIN
         HORZGUIDE, 169
         HORZGUIDE, 174
     END
+
+    IDD_USERPF_LIST, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 200
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 155
+        HORZGUIDE, 21
+        HORZGUIDE, 26
+        HORZGUIDE, 40
+        HORZGUIDE, 45
+        HORZGUIDE, 59
+        HORZGUIDE, 64
+    END
 END
 #endif    // APSTUDIO_INVOKED