blob: 5e54f5a6c8d3f08571197c870386a81a56e0d53d [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
29 virtual bool showDialog() {
30 return Dialog::showDialog(MAKEINTRESOURCE(IDD_PIXELFORMAT));
31 }
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)"));
42 SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)("24 bit depth (RGB888)"));
43 SendMessage(combo, CB_SETCURSEL, pf, 0);
44 }
45 virtual bool onOk() {
46 pf = SendMessage(combo, CB_GETCURSEL, 0, 0);
47 return true;
48 }
49 virtual bool onCancel() {
50 pf = -1;
51 return false;
52 }
53
54 long pf;
55 HWND combo;
56};