#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)
# endif
#endif
-// Callback function type definition
-#ifdef __cplusplus
-typedef void (*wxFunction) (wxObject&, wxEvent&);
-#endif
-
// ----------------------------------------------------------------------------
// OS mnemonics -- Identify the running OS (useful for Windows)
// ----------------------------------------------------------------------------
// 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;
// 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;
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:
#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); }
// 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
// -------------------------------
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
// ----------------------------------------------------------------------------
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
// ---------------------------------------
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:
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_
+
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; }
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:
#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); }
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
// -------------------------------
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);
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:
}; // 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); }
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
// -------------------------------
m_style = style;
m_clientData = (void *)NULL;
m_eventHandler = this;
-
-#if wxUSE_MENU_CALLBACK
- m_callback = (wxFunction) NULL;
-#endif // wxUSE_MENU_CALLBACK
}
wxMenuBase::~wxMenuBase()
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 )
{
include ..\makesc.env
-DEBUG=0
+DEBUG=1
LIBTARGET = $(LIBDIR)\wx$(SC_SUFFIX).lib
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()
{