blob: 130da4bc20f2ddd8a69936a17401c78a7e3b37e7 [file] [log] [blame]
george823d0c56e2005-03-09 08:30:27 +00001/* Copyright (C) 2004 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// -=- ChoosePixelFormatDialog.h
20
21#include <rfb_win32/Dialog.h>
22
23class ChoosePixelFormatDialog : public rfb::win32::Dialog {
24public:
25 ChoosePixelFormatDialog(long _pf) : Dialog(GetModuleHandle(0)),
26 pf(_pf), combo(0) {}
27 // - Show the dialog and return true if OK was clicked,
28 // false in case of error or Cancel
george82d9957b72005-03-11 14:22:14 +000029 virtual bool showDialog(HWND parent) {
30 return Dialog::showDialog(MAKEINTRESOURCE(IDD_PIXELFORMAT), parent);
george823d0c56e2005-03-09 08:30:27 +000031 }
32 const long getPF() const {return pf;}
33protected:
34
35 // Dialog methods (protected)
36 virtual void initDialog() {
37 combo = GetDlgItem(handle, IDC_PIXELFORMAT);
38 SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("Auto"));
39 SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("8 bit depth (RGB332)"));
40 SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("16 bit depth (RGB655)"));
41 SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("24 bit depth (RGB888)"));
george823d0c56e2005-03-09 08:30:27 +000042 SendMessage(combo, CB_SETCURSEL, pf, 0);
43 }
44 virtual bool onOk() {
45 pf = SendMessage(combo, CB_GETCURSEL, 0, 0);
46 return true;
47 }
48 virtual bool onCancel() {
49 pf = -1;
50 return false;
51 }
52
53 long pf;
54 HWND combo;
55};