diff options
author | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-07 09:17:38 +0000 |
---|---|---|
committer | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-07 09:17:38 +0000 |
commit | 6c6786d2b046d588032b0154cfc4a9be95ec3154 (patch) | |
tree | 78d467846125b7c18926e8d2602228efd6fe2a08 | |
parent | 8a19ce4b49be0a6c4ec1eaa296aa5ca296db2aac (diff) | |
download | tigervnc-6c6786d2b046d588032b0154cfc4a9be95ec3154.tar.gz tigervnc-6c6786d2b046d588032b0154cfc4a9be95ec3154.zip |
Created code for FTDialog::createFTDialog, FTDialog::destroyFTDialog methods.
Deleted Dialog class as a base class for FTDialog.
Code improvements.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@382 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | vncviewer/FTDialog.cxx | 57 | ||||
-rw-r--r-- | vncviewer/FTDialog.h | 13 | ||||
-rw-r--r-- | vncviewer/FTListView.cxx | 4 |
3 files changed, 66 insertions, 8 deletions
diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx index 08bb7717..f4f82206 100644 --- a/vncviewer/FTDialog.cxx +++ b/vncviewer/FTDialog.cxx @@ -26,7 +26,7 @@ using namespace rfb; using namespace rfb::win32; -FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT) : Dialog(hInst) +FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT) { m_pFileTransfer = pFT; m_hInstance = hInst; @@ -35,17 +35,46 @@ FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT) : Dialog(hInst) m_szRemotePath[0] = '\0'; m_szLocalPathTmp[0] = '\0'; m_szRemotePathTmp[0] = '\0'; + + m_pLocalLV = NULL; + m_pRemoteLV = NULL; + m_pProgress = NULL; } FTDialog::~FTDialog() { - closeFTDialog(); + destroyFTDialog(); } bool FTDialog::createFTDialog() { - return false; + m_hwndFTDialog = CreateDialogParam(m_hInstance, + MAKEINTRESOURCE(IDD_FILETRANSFER_DLG), + NULL, + (DLGPROC) FTDialogProc, + (LONG) this); + + if (m_hwndFTDialog == NULL) return false; + + m_pLocalLV = new FTListView(GetDlgItem(m_hwndFTDialog, IDC_FTLOCALLIST)); + m_pRemoteLV = new FTListView(GetDlgItem(m_hwndFTDialog, IDC_FTREMOTELIST)); + + m_pProgress = new FTProgress(m_hwndFTDialog); + + if ((m_pLocalLV == NULL) || (m_pRemoteLV == NULL) || (m_pProgress == NULL)) { + destroyFTDialog(); + return false; + } + + m_pLocalLV->initialize(m_hInstance); + m_pRemoteLV->initialize(m_hInstance); + + ShowWindow(m_hwndFTDialog, SW_SHOW); + UpdateWindow(m_hwndFTDialog); + m_bDlgShown = true; + + return true; } bool @@ -54,9 +83,29 @@ FTDialog::initFTDialog() return false; } -void +bool FTDialog::closeFTDialog() { + return false; +} + +void +FTDialog::destroyFTDialog() +{ + if (m_pLocalLV != NULL) { + delete m_pLocalLV; + m_pLocalLV = NULL; + } + + if (m_pRemoteLV != NULL) { + delete m_pRemoteLV; + m_pRemoteLV = NULL; + } + + if (m_pProgress != NULL) { + delete m_pProgress; + m_pProgress = NULL; + } } BOOL CALLBACK diff --git a/vncviewer/FTDialog.h b/vncviewer/FTDialog.h index 2748d9c0..5bd165c9 100644 --- a/vncviewer/FTDialog.h +++ b/vncviewer/FTDialog.h @@ -28,20 +28,22 @@ #include <commctrl.h> #include <rfb/FileInfo.h> -#include <rfb_win32/Dialog.h> +#include <vncviewer/FTListView.h> +#include <vncviewer/FTProgress.h> #include <vncviewer/FileTransfer.h> #include <vncviewer/resource.h> namespace rfb { namespace win32 { - class FTDialog : public Dialog + class FTDialog { public: FTDialog(HINSTANCE hInst, FileTransfer *pFT); ~FTDialog(); bool createFTDialog(); - void closeFTDialog(); + bool closeFTDialog(); + void destroyFTDialog(); static BOOL CALLBACK FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -74,6 +76,11 @@ namespace rfb { char m_szRemotePathTmp[MAX_PATH]; bool m_bDlgShown; + + FTListView *m_pLocalLV; + FTListView *m_pRemoteLV; + + FTProgress *m_pProgress; }; } } diff --git a/vncviewer/FTListView.cxx b/vncviewer/FTListView.cxx index 8b43ba5a..ab43cbd5 100644 --- a/vncviewer/FTListView.cxx +++ b/vncviewer/FTListView.cxx @@ -56,7 +56,9 @@ FTListView::initialize(HINSTANCE hInst) addColumn("Name", 0, xwidth0, LVCFMT_LEFT); addColumn("Size", 1, xwidth1, LVCFMT_RIGHT); addColumn("Data", 2, xwidth2, LVCFMT_LEFT); - + + ListView_SetExtendedListViewStyleEx(m_hListView, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); + return true; } |