5fda198f65
git-svn-id: svn://10.65.10.50/branches/R_10_00@22947 c028cbd2-c16b-5b4b-a496-9718f37d4682
119 lines
4.6 KiB
C++
119 lines
4.6 KiB
C++
#pragma once
|
|
#ifndef __GTDIALOG_H__
|
|
#define __GTDIALOG_H__
|
|
|
|
class wxAuiNotebook;
|
|
class wxCalendarEvent;
|
|
class wxDateEvent;
|
|
|
|
#ifndef _WX_HASHMAP_H_
|
|
#include <wx/hashmap.h>
|
|
#endif
|
|
|
|
#ifndef __GTART_H__
|
|
#include "gtart.h"
|
|
#endif
|
|
|
|
class gtBaseDlg : public wxDialog
|
|
{
|
|
DECLARE_DYNAMIC_CLASS(gtBaseDlg);
|
|
DECLARE_EVENT_TABLE();
|
|
wxString m_msg;
|
|
wxColour m_rgbTheme;
|
|
|
|
protected:
|
|
gtBaseDlg() { wxASSERT(false); }
|
|
virtual void CreateControls(wxSizer& WXUNUSED(sizer)) { wxASSERT(false); }
|
|
virtual void OnIdle(wxIdleEvent& evt);
|
|
bool Init();
|
|
gtBaseDlg(const wxString& title, int nFlags = wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP);
|
|
const wxColour& ThemeColour() const { return m_rgbTheme; }
|
|
public:
|
|
|
|
wxButton* PrependButton(wxWindowID id, wxString strLabel, wxArtID art);
|
|
|
|
bool gtError(const wxString msg);
|
|
};
|
|
|
|
class gtPropertyDlg : public gtBaseDlg
|
|
{
|
|
DECLARE_DYNAMIC_CLASS(gtPropertyDlg);
|
|
wxAuiNotebook* m_pNoteBook;
|
|
|
|
WX_DECLARE_STRING_HASH_MAP(wxWindow*, gtPropertyCtrls);
|
|
gtPropertyCtrls m_hControls;
|
|
|
|
protected:
|
|
gtPropertyDlg() : m_pNoteBook(NULL) { }
|
|
wxWindow* FindControl(const char* strName) const;
|
|
|
|
wxPanel* GetCurrPanel();
|
|
virtual void CreateControls(wxSizer& sizer);
|
|
virtual bool TransferDataToWindow();
|
|
virtual bool TransferDataFromWindow();
|
|
void AddLabel(const wxString& strLabel);
|
|
|
|
void OnTextChanged(wxFocusEvent& evt);
|
|
void OnCheckChanged(wxCommandEvent& evt);
|
|
void OnComboChanged(wxCommandEvent& evt);
|
|
void OnRadioBoxChanged(wxCommandEvent& evt);
|
|
void OnDateChanged(wxCalendarEvent& evt);
|
|
void OnDatePickChanged(wxDateEvent& evt);
|
|
|
|
public:
|
|
virtual void AddPage(const wxString& strLabel);
|
|
virtual void AddCategory(const wxString& strLabel);
|
|
virtual void AddProperty(const char* strName, const wxString& strValue, const wxString& strLabel = wxEmptyString,
|
|
long flags = 0, const wxString& strHint = wxEmptyString);
|
|
virtual void AddProperty(const char* strName, int nValue, const wxString& strLabel = wxEmptyString,
|
|
long flags = 0, const wxString& strHint = wxEmptyString);
|
|
virtual void AddProperty(const char* strName, double nValue, const wxString& strLabel = wxEmptyString,
|
|
long flags = 0, const wxString& strHint = wxEmptyString);
|
|
virtual void AddProperty(const char* strName, bool bValue, const wxString& strLabel = wxEmptyString, long flags = 0);
|
|
virtual void AddProperty(const char* strName, const wxArrayString& aValues, int nValue = 0,
|
|
const wxString& strLabel = wxEmptyString, long flags = 0);
|
|
virtual void AddProperty(const char* strName, const wxArrayString& aValues, const wxString& strValue = wxEmptyString,
|
|
const wxString& strLabel = wxEmptyString, long flags = 0);
|
|
virtual void AddProperty(const char* strName, const wxDateTime& dt, const wxString& strLabel, long flags = 0);
|
|
virtual void OnSqlPressed(wxCommandEvent& evt);
|
|
virtual void AddPropertyDB(const char* strName, const wxString& strValue, const wxString& strLabel,
|
|
long flags = 0, const wxString& strHint = wxEmptyString, const char* strTable = NULL);
|
|
|
|
virtual bool SetProperty(const char* strName, const wxVariant& var);
|
|
virtual wxVariant GetProperty(const char* strName) const;
|
|
|
|
wxString GetString(const char* strName) const;
|
|
int GetInt(const char* strName) const;
|
|
double GetDouble(const char* strName) const;
|
|
bool GetBool(const char* strName) const;
|
|
wxDateTime GetDate(const char* strName) const;
|
|
|
|
virtual bool IsPropertyEnabled(const wxString& name) const;
|
|
virtual bool EnableProperty(const wxString& name, bool on = true);
|
|
bool DisableProperty(const wxString& name) { return EnableProperty(name, false); }
|
|
|
|
virtual bool IsPropertyShown(const wxString& name) const;
|
|
virtual bool ShowProperty(const wxString& name, bool on = true);
|
|
bool HideProperty(const wxString& name) { return ShowProperty(name, false); }
|
|
|
|
virtual bool OnDecodeProperty(wxVariant& var);
|
|
virtual bool OnValidateProperty(wxVariant& val);
|
|
virtual bool OnPropertyChanged(const wxVariant& val);
|
|
|
|
virtual bool SaveDefault() const;
|
|
virtual bool LoadDefault();
|
|
|
|
virtual int ShowModal();
|
|
gtPropertyDlg(const wxString& strTitle, int flags = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxSTAY_ON_TOP);
|
|
};
|
|
|
|
bool gtMessage(const wxString str);
|
|
bool gtWarning(const wxString str);
|
|
bool gtError(const wxString str);
|
|
bool gtAsk(const wxString str);
|
|
|
|
bool TryToUpdateFile(const wxString& strFile);
|
|
bool TryToRemoveFile(wxString& strFile);
|
|
|
|
#endif
|