blob: 9c930322ef279868c6e82313cb123dff1555b446 [file] [log] [blame]
Dennis Syrovatsky32ed3322005-12-15 09:37:38 +00001/* Copyright (C) 2005 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 * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
19 *
20 */
21
22// -=- FTBrpwseDlg.cxx
23
24#include <vncviewer/FTBrowseDlg.h>
25
26using namespace rfb;
27using namespace rfb::win32;
28
29FTBrowseDlg::FTBrowseDlg(FTDialog *pFTDlg)
30{
Dennis Syrovatsky04e05c32005-12-15 09:51:03 +000031 m_pFTDlg = pFTDlg;
32 m_hwndDlg = NULL;
Dennis Syrovatsky32ed3322005-12-15 09:37:38 +000033}
34
35FTBrowseDlg::~FTBrowseDlg()
36{
Dennis Syrovatsky04e05c32005-12-15 09:51:03 +000037 destroy();
38}
Dennis Syrovatsky32ed3322005-12-15 09:37:38 +000039
Dennis Syrovatsky04e05c32005-12-15 09:51:03 +000040bool
41FTBrowseDlg::create()
42{
43 m_hwndDlg = CreateDialogParam(GetModuleHandle(0), MAKEINTRESOURCE(IDD_FTBROWSE),
44 m_pFTDlg->getWndHandle(), (DLGPROC) FTBrowseDlgProc,
45 (LONG) this);
46
47 if (m_hwndDlg == NULL) return false;
48
49 ShowWindow(m_hwndDlg, SW_SHOW);
50 UpdateWindow(m_hwndDlg);
51
52 return true;
53}
54
55void
56FTBrowseDlg::destroy()
57{
58 EndDialog(m_hwndDlg, 0);
Dennis Syrovatsky32ed3322005-12-15 09:37:38 +000059}
Dennis Syrovatsky2eee1c72005-12-15 09:43:34 +000060
61BOOL CALLBACK
62FTBrowseDlg::FTBrowseDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
63{
64 FTBrowseDlg *_this = (FTBrowseDlg *) GetWindowLong(hwnd, GWL_USERDATA);
65 switch (uMsg)
66 {
67 case WM_INITDIALOG:
68 {
69 SetWindowLong(hwnd, GWL_USERDATA, lParam);
70 return FALSE;
71 }
72 break;
73 case WM_COMMAND:
74 {
75 switch (LOWORD(wParam))
76 {
77 case IDOK:
78 return FALSE;
79 case IDCANCEL:
80 return FALSE;
81 }
82 }
83 break;
84 case WM_NOTIFY:
85 switch (LOWORD(wParam))
86 {
87 case IDC_FTBROWSETREE:
88 switch (((LPNMHDR) lParam)->code)
89 {
90 case TVN_SELCHANGED:
91 return FALSE;
92 case TVN_ITEMEXPANDING:
93 return FALSE;
94 }
95 break;
96 }
97 break;
98 case WM_CLOSE:
99 case WM_DESTROY:
100 return FALSE;
101 }
102 return 0;
103}