Applied Patch #1502801: Missing Clone() functions from some events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -170,10 +170,14 @@ public:
|
|||||||
wxColour GetColour() const { return m_colour; }
|
wxColour GetColour() const { return m_colour; }
|
||||||
void SetColour(const wxColour &c) { m_colour = c; }
|
void SetColour(const wxColour &c) { m_colour = c; }
|
||||||
|
|
||||||
|
|
||||||
|
// default copy ctor, assignment operator and dtor are ok
|
||||||
|
virtual wxEvent *Clone() const { return new wxColourPickerEvent(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxColour m_colour;
|
wxColour m_colour;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxColourPickerEvent)
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxColourPickerEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -34,10 +34,13 @@ public:
|
|||||||
const wxDateTime& GetDate() const { return m_date; }
|
const wxDateTime& GetDate() const { return m_date; }
|
||||||
void SetDate(const wxDateTime &date) { m_date = date; }
|
void SetDate(const wxDateTime &date) { m_date = date; }
|
||||||
|
|
||||||
|
// default copy ctor, assignment operator and dtor are ok
|
||||||
|
virtual wxEvent *Clone() const { return new wxDateEvent(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxDateTime m_date;
|
wxDateTime m_date;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDateEvent)
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDateEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -343,10 +343,13 @@ public:
|
|||||||
wxString GetPath() const { return m_path; }
|
wxString GetPath() const { return m_path; }
|
||||||
void SetPath(const wxString &p) { m_path = p; }
|
void SetPath(const wxString &p) { m_path = p; }
|
||||||
|
|
||||||
|
// default copy ctor, assignment operator and dtor are ok
|
||||||
|
virtual wxEvent *Clone() const { return new wxFileDirPickerEvent(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_path;
|
wxString m_path;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFileDirPickerEvent)
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -194,10 +194,13 @@ public:
|
|||||||
wxFont GetFont() const { return m_font; }
|
wxFont GetFont() const { return m_font; }
|
||||||
void SetFont(const wxFont &c) { m_font = c; }
|
void SetFont(const wxFont &c) { m_font = c; }
|
||||||
|
|
||||||
|
// default copy ctor, assignment operator and dtor are ok
|
||||||
|
virtual wxEvent *Clone() const { return new wxFontPickerEvent(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxFont m_font;
|
wxFont m_font;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontPickerEvent)
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFontPickerEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -171,35 +171,50 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
class WXDLLIMPEXP_ADV wxHyperlinkEvent : public wxCommandEvent
|
class WXDLLIMPEXP_ADV wxHyperlinkEvent : public wxCommandEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxHyperlinkEvent() {}
|
wxHyperlinkEvent() {}
|
||||||
wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url)
|
wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url)
|
||||||
: wxCommandEvent(wxEVT_COMMAND_HYPERLINK, id), m_url(url)
|
: wxCommandEvent(wxEVT_COMMAND_HYPERLINK, id),
|
||||||
{ SetEventObject(generator); }
|
m_url(url)
|
||||||
|
{
|
||||||
|
SetEventObject(generator);
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the URL associated with the hyperlink control
|
// Returns the URL associated with the hyperlink control
|
||||||
// that the user clicked on.
|
// that the user clicked on.
|
||||||
wxString GetURL() const { return m_url; }
|
wxString GetURL() const { return m_url; }
|
||||||
void SetURL(const wxString &url) { m_url=url; }
|
void SetURL(const wxString &url) { m_url=url; }
|
||||||
|
|
||||||
|
// default copy ctor, assignment operator and dtor are ok
|
||||||
|
virtual wxEvent *Clone() const { return new wxHyperlinkEvent(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// URL associated with the hyperlink control that the used clicked on.
|
// URL associated with the hyperlink control that the used clicked on.
|
||||||
wxString m_url;
|
wxString m_url;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHyperlinkEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Define a typedef for event handler functions.
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// event types and macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
typedef void (wxEvtHandler::*wxHyperlinkEventFunction)(wxHyperlinkEvent&);
|
typedef void (wxEvtHandler::*wxHyperlinkEventFunction)(wxHyperlinkEvent&);
|
||||||
|
|
||||||
// Define an event table macro.
|
|
||||||
#define EVT_HYPERLINK(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_HYPERLINK, \
|
|
||||||
id, id, (wxObjectEventFunction) (wxEventFunction) \
|
|
||||||
wxStaticCastEvent(wxHyperlinkEventFunction, &fn), (wxObject *) NULL),
|
|
||||||
|
|
||||||
// Newer event macro
|
|
||||||
#define wxHyperlinkEventHandler(func) \
|
#define wxHyperlinkEventHandler(func) \
|
||||||
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHyperlinkEventFunction, &func)
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHyperlinkEventFunction, &func)
|
||||||
|
|
||||||
|
#define EVT_HYPERLINK(id, fn) \
|
||||||
|
wx__DECLARE_EVT1(wxEVT_COMMAND_HYPERLINK, id, wxHyperlinkEventHandler(fn))
|
||||||
|
|
||||||
|
#ifdef _WX_DEFINE_DATE_EVENTS_
|
||||||
|
DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK)
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkEvent, wxCommandEvent)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // wxUSE_HYPERLINKCTRL
|
#endif // wxUSE_HYPERLINKCTRL
|
||||||
|
|
||||||
#endif // _WX_HYPERLINK_H__
|
#endif // _WX_HYPERLINK_H__
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrl, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrl, wxControl)
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkEvent, wxCommandEvent)
|
||||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK)
|
DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK)
|
||||||
|
|
||||||
// reserved for internal use only
|
// reserved for internal use only
|
||||||
|
Reference in New Issue
Block a user