picker controls improvements: fixes to valid paths recognition and event generation under GTK (patch 1510064)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,12 +39,6 @@
|
||||
{ \
|
||||
m_dialog->Destroy(); \
|
||||
return wxButton::Destroy(); \
|
||||
} \
|
||||
\
|
||||
virtual void SetPath(const wxString &str) \
|
||||
{ \
|
||||
m_path=str; \
|
||||
UpdateDialogPath(m_dialog); \
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +99,8 @@ public: // some overrides
|
||||
~(wxFD_SAVE | wxFD_OVERWRITE_PROMPT)) | wxFD_OPEN;
|
||||
}
|
||||
|
||||
virtual void SetPath(const wxString &str);
|
||||
|
||||
// see macro defined above
|
||||
FILEDIRBTN_OVERRIDES
|
||||
|
||||
@@ -123,7 +119,7 @@ private:
|
||||
class WXDLLIMPEXP_CORE wxDirButton : public wxGenericDirButton
|
||||
{
|
||||
public:
|
||||
wxDirButton() { m_dialog = NULL;}
|
||||
wxDirButton() { Init(); }
|
||||
wxDirButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
@@ -135,7 +131,8 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr)
|
||||
{
|
||||
m_dialog = NULL;
|
||||
Init();
|
||||
|
||||
Create(parent, id, label, path, message, wxEmptyString,
|
||||
pos, size, style, validator, name);
|
||||
}
|
||||
@@ -157,9 +154,6 @@ public: // overrides
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr);
|
||||
|
||||
// used by the GTK callback only
|
||||
void UpdatePath(char *gtkpath)
|
||||
{ m_path = wxString::FromAscii(gtkpath); }
|
||||
|
||||
// GtkFileChooserButton does not support GTK_FILE_CHOOSER_CREATE_FOLDER
|
||||
// thus we must ensure that the wxDD_DIR_MUST_EXIST style was given
|
||||
@@ -168,12 +162,28 @@ public: // overrides
|
||||
return (wxGenericDirButton::GetDialogStyle() | wxDD_DIR_MUST_EXIST);
|
||||
}
|
||||
|
||||
virtual void SetPath(const wxString &str);
|
||||
|
||||
// see macro defined above
|
||||
FILEDIRBTN_OVERRIDES
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init()
|
||||
{
|
||||
m_dialog = NULL;
|
||||
m_bIgnoreNextChange = false;
|
||||
}
|
||||
|
||||
wxDialog *m_dialog;
|
||||
|
||||
public: // used by the GTK callback only
|
||||
|
||||
bool m_bIgnoreNextChange;
|
||||
|
||||
void UpdatePath(const char *gtkpath)
|
||||
{ m_path = wxString::FromAscii(gtkpath); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDirButton)
|
||||
};
|
||||
|
Reference in New Issue
Block a user