class wxPropertyInfo;
-class wxDialogEditorPropertyListDialog: public wxPropertyListDialog
+class wxDialogEditorPropertyListFrame: public wxPropertyListFrame
{
friend class wxPropertyInfo;
public:
- wxDialogEditorPropertyListDialog(wxPropertyListView *v, wxWindow *parent, const wxString& title,
+ wxDialogEditorPropertyListFrame(wxPropertyListView *v, wxFrame *parent, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox");
- ~wxDialogEditorPropertyListDialog();
+ long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
+ ~wxDialogEditorPropertyListFrame();
private:
wxPropertySheet* m_propSheet;
class wxResourcePropertyListView: public wxPropertyListView
{
public:
- wxPropertyInfo *propertyInfo;
-
wxResourcePropertyListView(wxPropertyInfo *info, wxPanel *propPanel = NULL, long flags = wxPROP_BUTTON_DEFAULT):
wxPropertyListView(propPanel, flags)
{
- propertyInfo = info;
+ m_propertyInfo = info;
}
void OnPropertyChanged(wxProperty *property);
bool OnClose(void);
+
+ wxPropertyInfo* m_propertyInfo;
+
};
// Generic class for relating an object to a collection of properties.
// them with separate classes.
class wxPropertyInfo: public wxObject
{
- friend class wxDialogEditorPropertyListDialog;
+ friend class wxDialogEditorPropertyListFrame;
protected:
static wxWindow *sm_propertyWindow;
wxPropertyInfo(void)
// For all windows
class wxWindowPropertyInfo: public wxPropertyInfo
{
- protected:
- wxWindow *propertyWindow;
- wxItemResource *propertyResource;
public:
wxWindowPropertyInfo(wxWindow *win, wxItemResource *res = NULL);
~wxWindowPropertyInfo(void);
bool SetProperty(wxString& name, wxProperty *property);
void GetPropertyNames(wxStringList& names);
- inline void SetPropertyWindow(wxWindow *win) { propertyWindow = win; }
+ inline void SetPropertyWindow(wxWindow *win) { m_propertyWindow = win; }
- inline void SetResource(wxItemResource *res) { propertyResource = res; }
+ inline void SetResource(wxItemResource *res) { m_propertyResource = res; }
// Helper functions for font properties
// Fill in the wxItemResource members to mirror the current window settings
virtual bool InstantiateResource(wxItemResource *resource);
+
+ // Set the window style
+ void SetWindowStyle(wxWindow* win, long style, bool set);
+
+ protected:
+ wxWindow* m_propertyWindow;
+ wxItemResource* m_propertyResource;
};
// For panel items
bool InstantiateResource(wxItemResource *resource);
};
+// For choice items
+class wxComboBoxPropertyInfo: public wxChoicePropertyInfo
+{
+ protected:
+ public:
+ wxComboBoxPropertyInfo(wxWindow *win, wxItemResource *res = NULL):
+ wxChoicePropertyInfo(win, res) {}
+ ~wxComboBoxPropertyInfo(void) {}
+ wxProperty *GetProperty(wxString& name);
+ bool SetProperty(wxString& name, wxProperty *property);
+ void GetPropertyNames(wxStringList& names);
+ bool InstantiateResource(wxItemResource *resource);
+};
+
// For radiobox items
class wxRadioBoxPropertyInfo: public wxItemPropertyInfo
{
bool InstantiateResource(wxItemResource *resource);
};
+// For radiobutton items
+class wxRadioButtonPropertyInfo: public wxItemPropertyInfo
+{
+ protected:
+ public:
+ wxRadioButtonPropertyInfo(wxWindow *win, wxItemResource *res = NULL):
+ wxItemPropertyInfo(win, res) {}
+ ~wxRadioButtonPropertyInfo(void) {}
+ wxProperty *GetProperty(wxString& name);
+ bool SetProperty(wxString& name, wxProperty *property);
+ void GetPropertyNames(wxStringList& names);
+ bool InstantiateResource(wxItemResource *resource);
+};
+
// For gauge items
class wxGaugePropertyInfo: public wxItemPropertyInfo
{
bool SetProperty(wxString& name, wxProperty *property);
void GetPropertyNames(wxStringList& names);
bool InstantiateResource(wxItemResource *resource);
+
+ // Convert this dialog, and its children, to or from dialog units
+ void ConvertDialogUnits(bool toDialogUnits);
};
int wxStringToFontWeight(wxString& val);
int wxStringToFontStyle(wxString& val);
int wxStringToFontFamily(wxString& val);
-#endif
+/*
+ * A validator to allow editing symbol/id pairs
+ */
+
+class wxResourceSymbolValidator: public wxPropertyListValidator
+{
+ DECLARE_DYNAMIC_CLASS(wxResourceSymbolValidator)
+ protected:
+ public:
+ wxResourceSymbolValidator(long flags = 0);
+
+ ~wxResourceSymbolValidator(void);
+
+ // Called when TICK is pressed or focus is lost.
+ // Return FALSE if value didn't check out; signal to restore old value.
+ bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
+
+ // Called when TICK is pressed or focus is lost or view wants to update
+ // the property list.
+ // Does the transferance from the property editing area to the property itself
+ bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
+ bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
+
+ bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
+
+ bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
+
+ // Called when the edit (...) button is pressed.
+ void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
+};
+/*
+ * A dialog for editing symbol/id pairs
+ */
+
+class wxResourceSymbolDialog: public wxDialog
+{
+public:
+ wxResourceSymbolDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL);
+
+ void Init();
+
+ inline void SetSymbol(const wxString& symbol) { m_symbolName = symbol; }
+ inline void SetId(long id) { m_symbolId = id; }
+
+ inline wxString GetSymbol() const { return m_symbolName; }
+ inline long GetId() const { return m_symbolId; }
+
+ bool CheckValues();
+ void OnOK(wxCommandEvent& event);
+ void OnComboBoxSelect(wxCommandEvent& event);
+ void OnSymbolNameUpdate(wxCommandEvent& event);
+
+protected:
+ wxString m_symbolName;
+ long m_symbolId;
+ wxComboBox* m_nameCtrl;
+ wxTextCtrl* m_idCtrl;
+
+DECLARE_EVENT_TABLE()
+};
+
+#define ID_SYMBOLNAME_COMBOBOX 100
+#define ID_SYMBOLID_TEXTCTRL 101
+
+#endif
+ // _WINPROP_H_