removed wxFunction
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
b28b097d59
commit
70dc287a39
@ -365,18 +365,6 @@ typedef int wxWindowID;
|
||||
#define WXDLLEXPORT_CTORFN
|
||||
#endif
|
||||
|
||||
// For ostream, istream ofstream
|
||||
#if defined(__BORLANDC__) && defined( _RTLDLL )
|
||||
# define WXDLLIMPORT __import
|
||||
#else
|
||||
# define WXDLLIMPORT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
class WXDLLEXPORT wxObject;
|
||||
class WXDLLEXPORT wxEvent;
|
||||
#endif
|
||||
|
||||
// symbolic constant used by all Find()-like functions returning positive
|
||||
// integer on success as failure indicator
|
||||
#define wxNOT_FOUND (-1)
|
||||
@ -487,11 +475,6 @@ class WXDLLEXPORT wxEvent;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Callback function type definition
|
||||
#ifdef __cplusplus
|
||||
typedef void (*wxFunction) (wxObject&, wxEvent&);
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// OS mnemonics -- Identify the running OS (useful for Windows)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -80,17 +80,6 @@ public:
|
||||
|
||||
// TODO: virtual void SetTitle(const wxString& title);
|
||||
|
||||
// compatibility only
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
wxMenu(const wxString& title, const wxFunction func)
|
||||
: wxMenuBase(title)
|
||||
{
|
||||
Init();
|
||||
|
||||
Callback(func);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
// implementation
|
||||
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
|
||||
|
||||
|
@ -80,17 +80,6 @@ public:
|
||||
|
||||
// TODO: virtual void SetTitle(const wxString& title);
|
||||
|
||||
// compatibility only
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
wxMenu(const wxString& title, const wxFunction func)
|
||||
: wxMenuBase(title)
|
||||
{
|
||||
Init();
|
||||
|
||||
Callback(func);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
// implementation
|
||||
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
|
||||
|
||||
|
@ -92,14 +92,6 @@ public:
|
||||
inline virtual void SetButtonFont(const wxFont& font);
|
||||
inline wxFont& GetLabelFont() const;
|
||||
inline wxFont& GetButtonFont() const;
|
||||
|
||||
// Adds callback
|
||||
inline void Callback(const wxFunction function);
|
||||
|
||||
wxFunction GetCallback() { return m_callback; }
|
||||
|
||||
protected:
|
||||
wxFunction m_callback; // Callback associated with the window
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
@ -119,7 +111,6 @@ private:
|
||||
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline void wxControl::Callback(const wxFunction f) { m_callback = f; };
|
||||
inline wxFont& wxControl::GetLabelFont() const { return GetFont(); }
|
||||
inline wxFont& wxControl::GetButtonFont() const { return GetFont(); }
|
||||
inline void wxControl::SetLabelFont(const wxFont& font) { SetFont(font); }
|
||||
|
@ -46,14 +46,6 @@ public:
|
||||
// MSW-specific
|
||||
bool ProcessCommand(wxCommandEvent& event);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxMenu(const wxString& title, const wxFunction func)
|
||||
: wxMenuBase(title)
|
||||
{
|
||||
Callback(func);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
|
@ -38,21 +38,6 @@ class WXDLLEXPORT wxMenuItem;
|
||||
WX_DECLARE_EXPORTED_LIST(wxMenu, wxMenuList);
|
||||
WX_DECLARE_EXPORTED_LIST(wxMenuItem, wxMenuItemList);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// having callbacks in menus is a wxWin 1.6x feature which should be replaced
|
||||
// with event tables in wxWin 2.xx code - however provide it because many
|
||||
// people like it a lot by default
|
||||
#ifndef wxUSE_MENU_CALLBACK
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
#define wxUSE_MENU_CALLBACK 1
|
||||
#else
|
||||
#define wxUSE_MENU_CALLBACK 0
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
#endif // !defined(wxUSE_MENU_CALLBACK)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenu
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -353,14 +338,6 @@ public:
|
||||
wxList& GetItems() const { return (wxList &)m_items; }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
#if wxUSE_MENU_CALLBACK || defined(__WXMOTIF__)
|
||||
// wxWin 1.6x compatible menu event handling
|
||||
wxFunction GetCallback() const { return m_callback; }
|
||||
void Callback(const wxFunction func) { m_callback = func; }
|
||||
|
||||
wxFunction m_callback;
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
|
||||
protected:
|
||||
// virtuals to override in derived classes
|
||||
// ---------------------------------------
|
||||
|
@ -54,12 +54,6 @@ public:
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel() const ;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
|
||||
|
||||
wxFunction GetCallback() { return m_callback; }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
bool InSetValue() const { return m_inSetValue; }
|
||||
|
||||
protected:
|
||||
@ -73,15 +67,11 @@ protected:
|
||||
const wxValidator& validator,
|
||||
const wxString& name);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxFunction m_callback; // Callback associated with the window
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
bool m_inSetValue; // Motif: prevent callbacks being called while
|
||||
// in SetValue
|
||||
// Motif: prevent callbacks being called while in SetValue
|
||||
bool m_inSetValue;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CONTROL_H_
|
||||
#endif // _WX_CONTROL_H_
|
||||
|
||||
|
@ -47,14 +47,6 @@ public:
|
||||
|
||||
bool ProcessCommand(wxCommandEvent& event);
|
||||
|
||||
wxMenu(const wxString& title, const wxFunction func)
|
||||
: wxMenuBase(title)
|
||||
{
|
||||
Init();
|
||||
|
||||
Callback(func);
|
||||
}
|
||||
|
||||
//// Motif-specific
|
||||
WXWidget GetButtonWidget() const { return m_buttonWidget; }
|
||||
void SetButtonWidget(WXWidget buttonWidget) { m_buttonWidget = buttonWidget; }
|
||||
|
@ -71,18 +71,10 @@ public:
|
||||
virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
|
||||
wxColour* GetButtonColour() const { return NULL; }
|
||||
|
||||
inline virtual void SetLabelFont(const wxFont& font);
|
||||
inline virtual void SetButtonFont(const wxFont& font);
|
||||
inline wxFont& GetLabelFont() const;
|
||||
inline wxFont& GetButtonFont() const;
|
||||
|
||||
// Adds callback
|
||||
inline void Callback(const wxFunction function);
|
||||
|
||||
wxFunction GetCallback() { return m_callback; }
|
||||
|
||||
protected:
|
||||
wxFunction m_callback; // Callback associated with the window
|
||||
virtual void SetLabelFont(const wxFont& font);
|
||||
virtual void SetButtonFont(const wxFont& font);
|
||||
wxFont& GetLabelFont() const;
|
||||
wxFont& GetButtonFont() const;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
@ -131,7 +123,6 @@ private:
|
||||
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline void wxControl::Callback(const wxFunction f) { m_callback = f; };
|
||||
inline wxFont& wxControl::GetLabelFont() const { return (wxFont &)GetFont(); }
|
||||
inline wxFont& wxControl::GetButtonFont() const { return (wxFont &)GetFont(); }
|
||||
inline void wxControl::SetLabelFont(const wxFont& font) { SetFont(font); }
|
||||
|
@ -49,17 +49,6 @@ public:
|
||||
|
||||
virtual void SetTitle(const wxString& title);
|
||||
|
||||
// deprecated functions
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
wxMenu(const wxString& title, const wxFunction func)
|
||||
: wxMenuBase(title)
|
||||
{
|
||||
Init();
|
||||
|
||||
Callback(func);
|
||||
}
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
|
@ -100,14 +100,6 @@ public:
|
||||
int GetNumVer() const;
|
||||
int GetNumHor() const;
|
||||
|
||||
// compatibility ctor
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
||||
int x = -1, int y = -1, int width = -1, int height = -1,
|
||||
int n = 0, char **choices = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
// subclass one radio button
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
|
@ -89,15 +89,6 @@ public:
|
||||
inline virtual void SetButtonFont(const wxFont& rFont);
|
||||
inline wxFont& GetLabelFont(void) const;
|
||||
inline wxFont& GetButtonFont(void) const;
|
||||
|
||||
//
|
||||
// Adds callback
|
||||
//
|
||||
inline void Callback(const wxFunction function);
|
||||
wxFunction GetCallback(void) { return m_callback; }
|
||||
|
||||
protected:
|
||||
wxFunction m_callback; // Callback associated with the window
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
public:
|
||||
@ -148,7 +139,6 @@ private:
|
||||
}; // end of wxControl
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline void wxControl::Callback(const wxFunction f) { m_callback = f; };
|
||||
inline wxFont& wxControl::GetLabelFont(void) const { return GetFont(); }
|
||||
inline wxFont& wxControl::GetButtonFont(void) const { return GetFont(); }
|
||||
inline void wxControl::SetLabelFont(const wxFont& rFont) { SetFont(rFont); }
|
||||
|
@ -63,17 +63,6 @@ public:
|
||||
virtual void Break(void);
|
||||
virtual void SetTitle(const wxString& rTitle);
|
||||
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
wxMenu( const wxString& rTitle
|
||||
,const wxFunction fnFunc
|
||||
)
|
||||
: wxMenuBase(rTitle)
|
||||
{
|
||||
Init();
|
||||
Callback(fnFunc);
|
||||
}
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
|
||||
//
|
||||
// Implementation only from now on
|
||||
// -------------------------------
|
||||
|
@ -285,10 +285,6 @@ void wxMenuBase::Init(long style)
|
||||
m_style = style;
|
||||
m_clientData = (void *)NULL;
|
||||
m_eventHandler = this;
|
||||
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
m_callback = (wxFunction) NULL;
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
}
|
||||
|
||||
wxMenuBase::~wxMenuBase()
|
||||
@ -584,15 +580,6 @@ bool wxMenuBase::SendEvent(int id, int checked)
|
||||
|
||||
bool processed = FALSE;
|
||||
|
||||
#if wxUSE_MENU_CALLBACK
|
||||
// Try a callback
|
||||
if (m_callback)
|
||||
{
|
||||
(void)(*(m_callback))(*this, event);
|
||||
processed = TRUE;
|
||||
}
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
|
||||
// Try the menu's event handler
|
||||
if ( !processed )
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ WXDIR = ..\..
|
||||
|
||||
include ..\makesc.env
|
||||
|
||||
DEBUG=0
|
||||
DEBUG=1
|
||||
|
||||
LIBTARGET = $(LIBDIR)\wx$(SC_SUFFIX).lib
|
||||
|
||||
|
@ -183,22 +183,6 @@ bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxRadioBox::wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
||||
int x, int y, int width, int height,
|
||||
int n, char **choices,
|
||||
int majorDim, long style, const char *name)
|
||||
{
|
||||
wxString *choices2 = new wxString[n];
|
||||
for ( int i = 0; i < n; i ++) choices2[i] = choices[i];
|
||||
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, choices2, majorDim, style,
|
||||
wxDefaultValidator, name);
|
||||
Callback(func);
|
||||
delete choices2;
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// Radio box item
|
||||
wxRadioBox::wxRadioBox()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user