decompressdlg.h

00001 
00002 // Name:        decompressdlg.h
00003 // Purpose:     wxPackageDecompressDlg definition
00004 // Author:      Francesco Montorsi
00005 // Modified by: 
00006 // Created:     17/07/2006 23:38:05
00007 // RCS-ID:      $Id: decompressdlg.h,v 1.2 2007/01/01 20:06:20 frm Exp $
00008 // Copyright:   (c) 2006 Francesco Montorsi
00009 // Licence:     wxWidgets license
00011 
00012 #ifndef _PMDECOMPRESSDLG_H_
00013 #define _PMDECOMPRESSDLG_H_
00014 
00015 
00020 #include <wx/statline.h>
00021 #include <wx/filepicker.h>
00022 
00023 #include "wxp/package.h"
00024 
00025 
00030 class wxPackage;
00031 
00032 
00037 
00038 #define SYMBOL_WXPACKAGEDECOMPRESSDLG_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX
00039 #define SYMBOL_WXPACKAGEDECOMPRESSDLG_TITLE _("Decompress")
00040 #define SYMBOL_WXPACKAGEDECOMPRESSDLG_IDNAME wxID_ANY
00041 #define SYMBOL_WXPACKAGEDECOMPRESSDLG_SIZE wxSize(400, 300)
00042 #define SYMBOL_WXPACKAGEDECOMPRESSDLG_POSITION wxDefaultPosition
00043 #define ID_DECOMPRESS_DESTINATION 10030
00044 #define ID_DECOMPRESS_PROGRESS 10038
00046 
00047 
00048 
00049 // ----------------------------------------------------------------------------
00050 // wxPackageDecompressDlg
00051 // ----------------------------------------------------------------------------
00052 
00053 class wxPackageDecompressDlg: public wxDialog
00054 {    
00055     DECLARE_DYNAMIC_CLASS( wxPackageDecompressDlg )
00056     DECLARE_EVENT_TABLE()
00057 
00058 public:
00060     wxPackageDecompressDlg( );
00061     wxPackageDecompressDlg( wxWindow* parent, 
00062                             wxWindowID id = SYMBOL_WXPACKAGEDECOMPRESSDLG_IDNAME, 
00063                             const wxString& caption = SYMBOL_WXPACKAGEDECOMPRESSDLG_TITLE, 
00064                             const wxPoint& pos = SYMBOL_WXPACKAGEDECOMPRESSDLG_POSITION, 
00065                             const wxSize& size = SYMBOL_WXPACKAGEDECOMPRESSDLG_SIZE, 
00066                             long style = SYMBOL_WXPACKAGEDECOMPRESSDLG_STYLE );
00067 
00069     bool Create( wxWindow* parent, 
00070                  wxWindowID id = SYMBOL_WXPACKAGEDECOMPRESSDLG_IDNAME, 
00071                  const wxString& caption = SYMBOL_WXPACKAGEDECOMPRESSDLG_TITLE, 
00072                  const wxPoint& pos = SYMBOL_WXPACKAGEDECOMPRESSDLG_POSITION, 
00073                  const wxSize& size = SYMBOL_WXPACKAGEDECOMPRESSDLG_SIZE, 
00074                  long style = SYMBOL_WXPACKAGEDECOMPRESSDLG_STYLE );
00075 
00077     void CreateControls();
00078 
00080     static bool ShowToolTips();
00081 
00082 public:     // event handlers
00083 
00084     void OnDestinationChange(wxFileDirPickerEvent &);
00085     void OnOK(wxCommandEvent &);
00086 
00087 public:     // public API
00088 
00089     void UpdateFreeSpace();
00090 
00091     void SetPackage(const wxPackage &pkg);
00092 
00093     void SetDestination(const wxString &dest)
00094         { m_pDestination->SetPath(dest); UpdateFreeSpace(); }
00095 
00096     wxString GetDestination() const
00097         { return m_pDestination->GetPath(); }
00098 
00099 protected:      // controls
00100 
00101     wxStaticText* m_pRequiredSpace;
00102     wxStaticText* m_pFreeSpace;
00103     wxTextCtrl* m_pCompressedFileName;
00104     wxDirPickerCtrl *m_pDestination;
00105     wxGauge *m_pProgress;
00106 
00107 protected:
00108 
00109     wxPackage m_pkg;
00110 };
00111 
00112 #endif
00113     // _PMDECOMPRESSDLG_H_

Generated on Thu Feb 1 22:14:30 2007 for wxWidgets Package Manager by  doxygen 1.5.1-p1