WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
-WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2)
WX_ARG_ENABLE(compat22, [ --enable-compat22 enable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2)
WX_ARG_ENABLE(compat24, [ --disable-compat24 disable wxWindows 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, disable)
dnl compatibility level
dnl ---------------------------------------------------------------------------
-if test "$WXWIN_COMPATIBILITY_2" = "yes"; then
- AC_DEFINE(WXWIN_COMPATIBILITY_2)
-
- WXWIN_COMPATIBILITY_2_2="yes"
-fi
-
if test "x$WXWIN_COMPATIBILITY_2_2" = "xyes"; then
AC_DEFINE(WXWIN_COMPATIBILITY_2_2)
echo " Should wxWindows be compiled in Unicode mode? ${wxUSE_UNICODE:-no}"
echo " What level of wxWindows compatibility should be enabled?"
-echo " wxWindows 2.0 ${WXWIN_COMPATIBILITY_2:-no}"
echo " wxWindows 2.2 ${WXWIN_COMPATIBILITY_2_2:-no}"
echo " wxWindows 2.4 ${WXWIN_COMPATIBILITY_2_4:-yes}"
#endif
// WXWIN_COMPATIBILITY macros affect presence of virtual functions
-#if WXWIN_COMPATIBILITY
- #define __WX_BO_WXWIN_COMPAT_1_68 ",compatible with 1.68"
-#else
- #define __WX_BO_WXWIN_COMPAT_1_68
-#endif
-#if WXWIN_COMPATIBILITY_2
- #define __WX_BO_WXWIN_COMPAT_2_0 ",compatible with 2.0"
-#else
- #define __WX_BO_WXWIN_COMPAT_2_0
-#endif
#if WXWIN_COMPATIBILITY_2_2
#define __WX_BO_WXWIN_COMPAT_2_2 ",compatible with 2.2"
#else
__WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \
" (" __WX_BO_DEBUG "," __WX_BO_UNICODE \
__WX_BO_COMPILER \
- __WX_BO_WXWIN_COMPAT_1_68 __WX_BO_WXWIN_COMPAT_2_0 \
__WX_BO_WXWIN_COMPAT_2_2 __WX_BO_WXWIN_COMPAT_2_4 \
")"
// Calls the callback and appropriate event handlers
bool ProcessCommand(wxCommandEvent& event);
-#if WXWIN_COMPATIBILITY
- 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
-#endif // WXWIN_COMPATIBILITY
-
protected:
virtual wxSize DoGetBestSize() const;
};
-
-#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); }
- inline void wxControl::SetButtonFont(const wxFont& font) { SetFont(font); }
-#endif // WXWIN_COMPATIBILITY
-
#endif // __WX_COCOA_CONTROL_H__
}
#endif // !Win16
-#if WXWIN_COMPATIBILITY
-
- void GetTextExtent(const wxString& string, float *x, float *y,
- float *descent = NULL, float *externalLeading = NULL,
- wxFont *theFont = NULL, bool use16bit = FALSE) const ;
- void GetSize(float* width, float* height) const { int w, h; GetSize(& w, & h); *width = w; *height = h; }
- void GetSizeMM(float *width, float *height) const { int w, h; GetSizeMM(& w, & h); *width = (float) w; *height = (float) h; }
-
-#endif // WXWIN_COMPATIBILITY
-
protected:
// the pure virtual functions which should be implemented by wxDC
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
#define wxFRAME_NO_WINDOW_MENU 0x0100
-#if WXWIN_COMPATIBILITY
-#define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
-#endif
-
#define wxDEFAULT_FRAME_STYLE \
(wxSYSTEM_MENU | wxRESIZE_BORDER | \
wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX | \
// Override to do cleanup/veto close
virtual bool OnClose(bool deleteWindow);
-#if WXWIN_COMPATIBILITY
- // Defeat compiler warning
- bool OnClose() { return wxEvtHandler::OnClose(); }
-#endif
-
// Extend event processing to search the document's event table
virtual bool ProcessEvent(wxEvent& event);
extern const wxEventType WXDLLIMPEXP_CORE wxEVT_COMMAND_TEXT_UPDATED;
#endif
-#if WXWIN_COMPATIBILITY
-
-#define wxEVENT_TYPE_BUTTON_COMMAND wxEVT_COMMAND_BUTTON_CLICKED
-#define wxEVENT_TYPE_CHECKBOX_COMMAND wxEVT_COMMAND_CHECKBOX_CLICKED
-#define wxEVENT_TYPE_CHOICE_COMMAND wxEVT_COMMAND_CHOICE_SELECTED
-#define wxEVENT_TYPE_LISTBOX_COMMAND wxEVT_COMMAND_LISTBOX_SELECTED
-#define wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
-#define wxEVENT_TYPE_TEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
-#define wxEVENT_TYPE_MULTITEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
-#define wxEVENT_TYPE_MENU_COMMAND wxEVT_COMMAND_MENU_SELECTED
-#define wxEVENT_TYPE_SLIDER_COMMAND wxEVT_COMMAND_SLIDER_UPDATED
-#define wxEVENT_TYPE_RADIOBOX_COMMAND wxEVT_COMMAND_RADIOBOX_SELECTED
-#define wxEVENT_TYPE_RADIOBUTTON_COMMAND wxEVT_COMMAND_RADIOBUTTON_SELECTED
-#define wxEVENT_TYPE_TEXT_ENTER_COMMAND wxEVT_COMMAND_TEXT_ENTER
-#define wxEVENT_TYPE_SET_FOCUS wxEVT_SET_FOCUS
-#define wxEVENT_TYPE_KILL_FOCUS wxEVT_KILL_FOCUS
-#define wxEVENT_TYPE_SCROLLBAR_COMMAND wxEVT_COMMAND_SCROLLBAR_UPDATED
-#define wxEVENT_TYPE_VIRT_LISTBOX_COMMAND wxEVT_COMMAND_VLBOX_SELECTED
-#define wxEVENT_TYPE_COMBOBOX_COMMAND wxEVT_COMMAND_COMBOBOX_SELECTED
-
-#define wxEVENT_TYPE_LEFT_DOWN wxEVT_LEFT_DOWN
-#define wxEVENT_TYPE_LEFT_UP wxEVT_LEFT_UP
-#define wxEVENT_TYPE_MIDDLE_DOWN wxEVT_MIDDLE_DOWN
-#define wxEVENT_TYPE_MIDDLE_UP wxEVT_MIDDLE_UP
-#define wxEVENT_TYPE_RIGHT_DOWN wxEVT_RIGHT_DOWN
-#define wxEVENT_TYPE_RIGHT_UP wxEVT_RIGHT_UP
-#define wxEVENT_TYPE_MOTION wxEVT_MOTION
-#define wxEVENT_TYPE_ENTER_WINDOW wxEVT_ENTER_WINDOW
-#define wxEVENT_TYPE_LEAVE_WINDOW wxEVT_LEAVE_WINDOW
-#define wxEVENT_TYPE_LEFT_DCLICK wxEVT_LEFT_DCLICK
-#define wxEVENT_TYPE_MIDDLE_DCLICK wxEVT_MIDDLE_DCLICK
-#define wxEVENT_TYPE_RIGHT_DCLICK wxEVT_RIGHT_DCLICK
-#define wxEVENT_TYPE_CHAR wxEVT_CHAR
-#define wxEVENT_TYPE_SCROLL_TOP wxEVT_SCROLL_TOP
-#define wxEVENT_TYPE_SCROLL_BOTTOM wxEVT_SCROLL_BOTTOM
-#define wxEVENT_TYPE_SCROLL_LINEUP wxEVT_SCROLL_LINEUP
-#define wxEVENT_TYPE_SCROLL_LINEDOWN wxEVT_SCROLL_LINEDOWN
-#define wxEVENT_TYPE_SCROLL_PAGEUP wxEVT_SCROLL_PAGEUP
-#define wxEVENT_TYPE_SCROLL_PAGEDOWN wxEVT_SCROLL_PAGEDOWN
-#define wxEVENT_TYPE_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBTRACK
-#define wxEVENT_TYPE_SCROLL_ENDSCROLL wxEVT_SCROLL_ENDSCROLL
-
-#endif // WXWIN_COMPATIBILITY
-
// the predefined constants for the number of times we propagate event
// upwards window child-parent chain
enum Propagation_state
virtual wxEvent *Clone() const { return new wxCommandEvent(*this); }
-#if WXWIN_COMPATIBILITY_2
- bool Checked() const { return IsChecked(); }
-#endif // WXWIN_COMPATIBILITY_2
-
public:
wxString m_commandString; // String event argument
int m_commandInt;
// Find the logical position of the event given the DC
wxPoint GetLogicalPosition(const wxDC& dc) const;
- // Compatibility
-#if WXWIN_COMPATIBILITY
- void Position(long *xpos, long *ypos) const
- {
- if (xpos)
- *xpos = (long)m_x;
- if (ypos)
- *ypos = (long)m_y;
- }
-
- void Position(float *xpos, float *ypos) const
- {
- *xpos = (float) m_x; *ypos = (float) m_y;
- }
-#endif // WXWIN_COMPATIBILITY
-
// Get X position
wxCoord GetX() const { return m_x; }
: wxEvent(winid, type),
m_loggingOff(TRUE),
m_veto(FALSE), // should be FALSE by default
- m_canVeto(TRUE)
- {
-#if WXWIN_COMPATIBILITY
- m_force = FALSE;
-#endif // WXWIN_COMPATIBILITY
- }
+ m_canVeto(TRUE) {}
+
wxCloseEvent(const wxCloseEvent & event)
: wxEvent(event),
m_loggingOff(event.m_loggingOff),
m_veto(event.m_veto),
- m_canVeto(event.m_canVeto)
- {
-#if WXWIN_COMPATIBILITY
- m_force = event.m_force;
-#endif // WXWIN_COMPATIBILITY
- }
+ m_canVeto(event.m_canVeto) {}
void SetLoggingOff(bool logOff) { m_loggingOff = logOff; }
bool GetLoggingOff() const { return m_loggingOff; }
bool CanVeto() const { return m_canVeto; }
bool GetVeto() const { return m_canVeto && m_veto; }
-#if WXWIN_COMPATIBILITY
- // This is probably obsolete now, since we use CanVeto instead, in
- // both OnCloseWindow and OnQueryEndSession.
- // m_force == ! m_canVeto i.e., can't veto means we must force it to close.
- void SetForce(bool force) { m_force = force; }
- bool GetForce() const { return m_force; }
-#endif
-
virtual wxEvent *Clone() const { return new wxCloseEvent(*this); }
protected:
bool m_loggingOff;
bool m_veto, m_canVeto;
-#if WXWIN_COMPATIBILITY
- bool m_force;
-#endif
-
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCloseEvent)
};
#endif
- // old stuff
-
-#if WXWIN_COMPATIBILITY_2
- virtual void OnCommand(wxWindow& WXUNUSED(win),
- wxCommandEvent& WXUNUSED(event))
- {
- wxFAIL_MSG(wxT("shouldn't be called any more"));
- }
-
- // Called if child control has no callback function
- virtual long Default()
- { return GetNextHandler() ? GetNextHandler()->Default() : 0; };
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
- virtual bool OnClose();
-#endif
-
private:
static const wxEventTableEntry sm_eventTableEntries[];
// compatibility defines, don't use in new code
#define wxDirExists wxPathExists
-#if WXWIN_COMPATIBILITY_2
- #define FileExists wxFileExists
- #define DirExists wxDirExists
- #define IsAbsolutePath wxIsAbsolutePath
- #define FileNameFromPath wxFileNameFromPath
- #define PathOnly wxPathOnly
- #define Dos2UnixFilename wxDos2UnixFilename
- #define Unix2DosFilename wxUnix2DosFilename
-#endif
-
// ----------------------------------------------------------------------------
// separators in file names
// ----------------------------------------------------------------------------
wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; }
};
-#if WXWIN_COMPATIBILITY
- #define wxIntPoint wxPoint
- #define wxRectangle wxRect
-#endif // WXWIN_COMPATIBILITY
-
// ---------------------------------------------------------------------------
// wxRect
// ---------------------------------------------------------------------------
void OnOK(wxCommandEvent& event);
void OnListBoxDClick(wxCommandEvent& event);
- // old, deprecated methods
-#if WXWIN_COMPATIBILITY_2
- wxSingleChoiceDialog(wxWindow *parent,
- const wxString& message,
- const wxString& caption,
- const wxStringList& choices,
- char **clientData = (char **)NULL,
- long style = wxCHOICEDLG_STYLE,
- const wxPoint& pos = wxDefaultPosition);
-
- bool Create(wxWindow *parent,
- const wxString& message,
- const wxString& caption,
- const wxStringList& choices,
- char **clientData = (char **)NULL,
- long style = wxCHOICEDLG_STYLE,
- const wxPoint& pos = wxDefaultPosition);
-#endif // WXWIN_COMPATIBILITY_2
-
protected:
int m_selection;
wxString m_stringSelection;
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT);
-// ----------------------------------------------------------------------------
-// these methods are for backwards compatibility only, not documented and
-// deprecated
-// ----------------------------------------------------------------------------
-
-#if WXWIN_COMPATIBILITY_2
-
-WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message,
- const wxString& caption,
- int n, wxChar *choices[],
- wxWindow *parent = (wxWindow *) NULL,
- int x = -1,
- int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH,
- int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message,
- const wxString& caption,
- int n, wxChar *choices[],
- wxWindow *parent = (wxWindow *) NULL,
- int x = -1,
- int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH,
- int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message,
- const wxString& caption,
- int n, wxChar **choices,
- void **client_data,
- wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH,
- int height = wxCHOICE_HEIGHT);
-
-
-#endif // WXWIN_COMPATIBILITY_2
-
#endif // __CHOICEDLGH_G__
virtual void DoSetVirtualSize(int x, int y);
-#if WXWIN_COMPATIBILITY
- virtual void GetScrollUnitsPerPage(int *x_page, int *y_page) const;
- virtual void CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const;
- // Need to do this otherwise the compiler gets confuced
- // between float and int calls to this function.
- void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
- { wxScrollHelper::CalcScrolledPosition(x, y, xx, yy); }
- wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
- { return wxScrollHelper::CalcScrolledPosition(pt); }
-#endif // WXWIN_COMPATIBILITY
-
protected:
// this is needed for wxEVT_PAINT processing hack described in
// wxScrollHelperEvtHandler::ProcessEvent()
#define wxHTML_FONT_SIZE_7 32
#endif
-
-#if WXWIN_COMPATIBILITY_2
-
-#define HTML_ALIGN_LEFT wxHTML_ALIGN_LEFT
-#define HTML_ALIGN_RIGHT wxHTML_ALIGN_RIGHT
-#define HTML_ALIGN_TOP wxHTML_ALIGN_TOP
-#define HTML_ALIGN_BOTTOM wxHTML_ALIGN_BOTTOM
-#define HTML_ALIGN_CENTER wxHTML_ALIGN_CENTER
-#define HTML_CLR_FOREGROUND wxHTML_CLR_FOREGROUND
-#define HTML_CLR_BACKGROUND wxHTML_CLR_BACKGROUND
-#define HTML_UNITS_PIXELS wxHTML_UNITS_PIXELS
-#define HTML_UNITS_PERCENT wxHTML_UNITS_PERCENT
-#define HTML_INDENT_LEFT wxHTML_INDENT_LEFT
-#define HTML_INDENT_RIGHT wxHTML_INDENT_RIGHT
-#define HTML_INDENT_TOP wxHTML_INDENT_TOP
-#define HTML_INDENT_BOTTOM wxHTML_INDENT_BOTTOM
-#define HTML_INDENT_HORIZONTAL wxHTML_INDENT_HORIZONTAL
-#define HTML_INDENT_VERTICAL wxHTML_INDENT_VERTICAL
-#define HTML_INDENT_ALL wxHTML_INDENT_ALL
-#define HTML_COND_ISANCHOR wxHTML_COND_ISANCHOR
-#define HTML_COND_ISIMAGEMAP wxHTML_COND_ISIMAGEMAP
-#define HTML_COND_USER wxHTML_COND_USER
-
-#endif
-
-
-
#endif
#endif
// accessors
bool Ok() const {return m_isInit; }
- // Let's remove this inelegant function
-#if WXWIN_COMPATIBILITY
- void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
-#endif
-
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ;
WXWidget GetMacControl() { return m_macControl ;}
-#if WXWIN_COMPATIBILITY
- 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;
-#endif // WXWIN_COMPATIBILITY
-
protected:
// For controls like radiobuttons which are really composite
WXWidget m_macControl ;
};
-#if WXWIN_COMPATIBILITY
- inline wxFont& wxControl::GetLabelFont() const { return GetFont(); }
- inline wxFont& wxControl::GetButtonFont() const { return GetFont(); }
- inline void wxControl::SetLabelFont(const wxFont& font) { SetFont(font); }
- inline void wxControl::SetButtonFont(const wxFont& font) { SetFont(font); }
-#endif // WXWIN_COMPATIBILITY
-
wxControl *wxFindControlFromMacControl(WXWidget inControl ) ;
void wxAssociateControlWithMacControl(WXWidget inControl, wxControl *control) ;
void wxRemoveMacControlAssociation(wxControl *control) ;
// returns TRUE if we're in a modal loop
bool IsModalShowing() const;
-#if WXWIN_COMPATIBILITY
- bool Iconized() const { return IsIconized(); };
-#endif
-
// implementation
// --------------
virtual void SetLabelTop( size_t pos, const wxString& label );
virtual wxString GetLabelTop( size_t pos ) const;
- // compatibility: these functions are deprecated
-#if WXWIN_COMPATIBILITY
- void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
- wxEvtHandler *GetEventHandler() { return m_eventHandler; }
-
- bool Enabled(int id) const { return IsEnabled(id); }
- bool Checked(int id) const { return IsChecked(id); }
-#endif // WXWIN_COMPATIBILITY
-
// implementation from now on
WXHMENU Create();
int FindMenu(const wxString& title);
void Init();
wxWindow *m_invokingWindow;
-#if WXWIN_COMPATIBILITY
- wxEvtHandler *m_eventHandler;
-#endif // WXWIN_COMPATIBILITY
-
wxArrayString m_titles;
private:
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 1.68 API:
-// Level 0: no backward compatibility, all new features
-// Level 1: some extra methods are defined for compatibility.
-//
-// Default is 0.
-//
-// Recommended setting: 0 (in fact the compatibility code is now very minimal
-// so there is little advantage to setting it to 1.
-#define WXWIN_COMPATIBILITY 0
-
-// This setting determines the compatibility with 2.0 API: set it to 1 to
-// enable it
-//
-// Default is 0.
-//
-// Recommended setting: 0 (please update your code instead!)
-#define WXWIN_COMPATIBILITY_2 0
-
// This setting determines the compatibility with 2.0 API: set it to 1 to
// enable it
//
// Accept files for dragging
virtual void DragAcceptFiles(bool accept);
-#if WXWIN_COMPATIBILITY
- // Set/get scroll attributes
- virtual void SetScrollRange(int orient, int range, bool refresh = TRUE);
- virtual void SetScrollPage(int orient, int page, bool refresh = TRUE);
- virtual int OldGetScrollRange(int orient) const;
- virtual int GetScrollPage(int orient) const;
-
- // event handlers
- // Handle a control command
- virtual void OnCommand(wxWindowMac& win, wxCommandEvent& event);
-
- // Override to define new behaviour for default action (e.g. double
- // clicking on a listbox)
- virtual void OnDefaultAction(wxControl * WXUNUSED(initiatingItem)) { }
-#endif // WXWIN_COMPATIBILITY
-
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
- // caret manipulation (old MSW only functions, see wxCaret class for the
- // new API)
- void CreateCaret(int w, int h);
- void CreateCaret(const wxBitmap *bitmap);
- void DestroyCaret();
- void ShowCaret(bool show);
- void SetCaretPos(int x, int y);
- void GetCaretPos(int *x, int *y) const;
-#endif // wxUSE_CARET
-
// Native resource loading (implemented in src/msw/nativdlg.cpp)
// FIXME: should they really be all virtual?
wxWindowMac* GetWindowChild1(wxWindowID id);
// MSW only: TRUE if this control is part of the main control
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
- #if WXWIN_COMPATIBILITY
- wxObject *GetChild(int number) const;
- virtual void MSWDeviceToLogical(float *x, float *y) const;
-#endif // WXWIN_COMPATIBILITY
-
// Setup background and foreground colours correctly
virtual void SetupColours();
-
-#if WXWIN_COMPATIBILITY
- void SetShowing(bool show) { (void)Show(show); }
- bool IsUserEnabled() const { return IsEnabled(); }
-#endif // WXWIN_COMPATIBILITY
-
public:
static bool MacGetWindowFromPoint( const wxPoint &point , wxWindowMac** outWin ) ;
virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ;
Insert(0u, itemid, text, help, isCheckable);
}
-#if WXWIN_COMPATIBILITY
- bool Enabled(int itemid) const { return IsEnabled(itemid); }
- bool Checked(int itemid) const { return IsChecked(itemid); }
-
- wxMenuItem* FindItemForId(int itemId, wxMenu **itemMenu) const
- { return FindItem(itemId, itemMenu); }
-
- wxList& GetItems() const { return (wxList &)m_items; }
-#endif // WXWIN_COMPATIBILITY
-
protected:
// virtuals to override in derived classes
// ---------------------------------------
// don't want menu bars to accept the focus by tabbing to them
virtual bool AcceptsFocusFromKeyboard() const { return FALSE; }
- // compatibility only: these functions are deprecated, use the new ones
- // instead
-#if WXWIN_COMPATIBILITY
- bool Enabled(int itemid) const { return IsEnabled(itemid); }
- bool Checked(int itemid) const { return IsChecked(itemid); }
-
- wxMenuItem* FindMenuItemById(int itemid) const
- { return FindItem(itemid); }
- wxMenuItem* FindItemForId(int itemid, wxMenu **menu = NULL) const
- { return FindItem(itemid, menu); }
-#endif // WXWIN_COMPATIBILITY
-
protected:
// the list of all our menus
wxMenuList m_menus;
// accessors
bool Ok() const { return m_isInit; }
- // Let's remove this inelegant function
-#if WXWIN_COMPATIBILITY
- void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
-#endif
-
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
// Accept files for dragging
virtual void DragAcceptFiles(bool accept);
-#if WXWIN_COMPATIBILITY
- // event handlers
- // Handle a control command
- virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
-
- // Override to define new behaviour for default action (e.g. double
- // clicking on a listbox)
- virtual void OnDefaultAction(wxControl * WXUNUSED(initiatingItem)) { }
-#endif // WXWIN_COMPATIBILITY
-
virtual WXWidget GetHandle() const { return m_wnd; }
void SetMGLwindow_t(struct window_t *wnd);
public:
wxDialog();
-#if WXWIN_COMPATIBILITY_2
- // Constructor with a modal flag, but no window id - the old convention
- wxDialog(wxWindow *parent,
- const wxString& title, bool modal,
- int x = -1, int y= -1, int width = 500, int height = 500,
- long style = wxDEFAULT_DIALOG_STYLE,
- const wxString& name = wxDialogNameStr)
- {
- long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
- Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
- }
-#endif
-
// Constructor with no modal flag - the new convention.
wxDialog(wxWindow *parent, wxWindowID id,
const wxString& title,
wxDEPRECATED( void SetQuality(int quality) );
#endif // WXWIN_COMPATIBILITY_2_4
-#if WXWIN_COMPATIBILITY_2
- void SetOk(bool isOk);
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
-#if wxUSE_PALETTE
- wxPalette *GetColourMap() const { return GetPalette(); }
- void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
-#endif // wxUSE_PALETTE
-#endif // WXWIN_COMPATIBILITY
-
// implementation only from now on
// -------------------------------
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
-#if WXWIN_COMPATIBILITY
- wxBitmap *GetBitmap() const { return (wxBitmap *) &GetBitmapLabel(); }
-#endif
-
// Implementation
virtual void SetDefault();
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
// accessors
bool Ok() const {return m_isInit; }
- // Let's remove this inelegant function
-#if WXWIN_COMPATIBILITY
- void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
-#endif
-
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-#if WXWIN_COMPATIBILITY
- virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
- wxColour* GetButtonColour() const { return NULL; }
-
- virtual void SetLabelFont(const wxFont& font);
- virtual void SetButtonFont(const wxFont& font);
- wxFont& GetLabelFont() const;
- wxFont& GetButtonFont() const;
-#endif // WXWIN_COMPATIBILITY
-
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const;
DECLARE_EVENT_TABLE()
};
-
-#if WXWIN_COMPATIBILITY
- 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); }
- inline void wxControl::SetButtonFont(const wxFont& font) { SetFont(font); }
-#endif // WXWIN_COMPATIBILITY
-
#endif
// _WX_CONTROL_H_
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
- // Backward compatibility
-#if WXWIN_COMPATIBILITY
- void SetButtonColour(const wxColour& col) { SetForegroundColour(col); }
-#endif
-
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
protected:
m_width = m_height = m_depth = 0;
m_handle = 0;
-
-#if WXWIN_COMPATIBILITY_2
- m_ok = FALSE;
-#endif // WXWIN_COMPATIBILITY_2
}
// accessors
WXHICON m_hIcon;
WXHCURSOR m_hCursor;
};
-
- // this filed is redundant and using it is error prone but keep it for
- // backwards compatibility
-#if WXWIN_COMPATIBILITY_2
- void SetOk() { m_ok = m_handle != 0; }
-
- bool m_ok;
-#endif // WXWIN_COMPATIBILITY_2
};
// ----------------------------------------------------------------------------
virtual void SetLabelTop( size_t pos, const wxString& label );
virtual wxString GetLabelTop( size_t pos ) const;
- // compatibility: these functions are deprecated
-#if WXWIN_COMPATIBILITY
- void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
- wxEvtHandler *GetEventHandler() { return m_eventHandler; }
-
- bool Enabled(int id) const { return IsEnabled(id); }
- bool Checked(int id) const { return IsChecked(id); }
-#endif // WXWIN_COMPATIBILITY
-
// implementation from now on
WXHMENU Create();
virtual void Detach();
// common part of all ctors
void Init();
-#if WXWIN_COMPATIBILITY
- wxEvtHandler *m_eventHandler;
-#endif // WXWIN_COMPATIBILITY
-
wxArrayString m_titles;
WXHMENU m_hMenu;
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
bool refresh = TRUE);
-#if WXWIN_COMPATIBILITY
- // Backward compatibility
- int GetValue() const { return GetThumbPosition(); }
- void SetValue(int viewStart) { SetThumbPosition(viewStart); }
- void GetValues(int *viewStart, int *viewLength, int *objectLength,
- int *pageLength) const ;
- int GetViewLength() const { return m_viewSize; }
- int GetObjectLength() const { return m_objectSize; }
-
- void SetPageSize(int pageLength);
- void SetObjectLength(int objectLength);
- void SetViewLength(int viewLength);
-#endif
-
void Command(wxCommandEvent& event);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
-#if WXWIN_COMPATIBILITY
- // Backward compatibility: generate an old-style scroll command
- void OnScroll(wxScrollEvent& event);
-#endif // WXWIN_COMPATIBILITY
-
protected:
int m_pageSize;
int m_viewSize;
int m_objectSize;
- DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar)
};
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 1.68 API:
-// Level 0: no backward compatibility, all new features
-// Level 1: some extra methods are defined for compatibility.
-//
-// Default is 0.
-//
-// Recommended setting: 0 (in fact the compatibility code is now very minimal
-// so there is little advantage to setting it to 1.
-#define WXWIN_COMPATIBILITY 0
-
-// This setting determines the compatibility with 2.0 API: set it to 1 to
-// enable it
-//
-// Default is 0.
-//
-// Recommended setting: 0 (please update your code instead!)
-#define WXWIN_COMPATIBILITY_2 0
-
// This setting determines the compatibility with 2.2 API: set it to 1 to
// enable it but please consider updating your code instead.
//
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 1.68 API:
-// Level 0: no backward compatibility, all new features
-// Level 1: some extra methods are defined for compatibility.
-//
-// Default is 0.
-//
-// Recommended setting: 0 (in fact the compatibility code is now very minimal
-// so there is little advantage to setting it to 1.
-#define WXWIN_COMPATIBILITY 0
-
-// This setting determines the compatibility with 2.0 API: set it to 1 to
-// enable it
-//
-// Default is 0.
-//
-// Recommended setting: 0 (please update your code instead!)
-#define WXWIN_COMPATIBILITY_2 0
-
// This setting determines the compatibility with 2.0 API: set it to 1 to
// enable it
//
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 1.68 API:
-// Level 0: no backward compatibility, all new features
-// Level 1: some extra methods are defined for compatibility.
-//
-// Default is 0.
-//
-// Recommended setting: 0 (in fact the compatibility code is now very minimal
-// so there is little advantage to setting it to 1.
-#define WXWIN_COMPATIBILITY 0
-
-// This setting determines the compatibility with 2.0 API: set it to 1 to
-// enable it
-//
-// Default is 0.
-//
-// Recommended setting: 0 (please update your code instead!)
-#define WXWIN_COMPATIBILITY_2 0
-
// This setting determines the compatibility with 2.2 API: set it to 1 to
// enable it but please consider updating your code instead.
//
wxDEPRECATED( void SetTransparent(bool t = TRUE) );
#endif // WXWIN_COMPATIBILITY_2_4
-#if WXWIN_COMPATIBILITY
- // Set/get scroll attributes
- virtual void SetScrollRange(int orient, int range, bool refresh = TRUE);
- virtual void SetScrollPage(int orient, int page, bool refresh = TRUE);
- virtual int OldGetScrollRange(int orient) const;
- virtual int GetScrollPage(int orient) const;
-
- // event handlers
- // Handle a control command
- virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
-
- // Override to define new behaviour for default action (e.g. double
- // clicking on a listbox)
- virtual void OnDefaultAction(wxControl * WXUNUSED(initiatingItem)) { }
-#endif // WXWIN_COMPATIBILITY
-
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
- // caret manipulation (old MSW only functions, see wxCaret class for the
- // new API)
- void CreateCaret(int w, int h);
- void CreateCaret(const wxBitmap *bitmap);
- void DestroyCaret();
- void ShowCaret(bool show);
- void SetCaretPos(int x, int y);
- void GetCaretPos(int *x, int *y) const;
-#endif // wxUSE_CARET
-
#ifndef __WXUNIVERSAL__
// Native resource loading (implemented in src/msw/nativdlg.cpp)
// FIXME: should they really be all virtual?
virtual bool MSWCommand(WXUINT param, WXWORD id);
-#if WXWIN_COMPATIBILITY
- wxObject *GetChild(int number) const;
- virtual void MSWDeviceToLogical(float *x, float *y) const;
-#endif // WXWIN_COMPATIBILITY
-
#ifndef __WXUNIVERSAL__
// Create an appropriate wxWindow from a HWND
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
WXWPARAM wParam,
WXLPARAM lParam);
-#if WXWIN_COMPATIBILITY
- void SetShowing(bool show) { (void)Show(show); }
- bool IsUserEnabled() const { return IsEnabled(); }
-#endif // WXWIN_COMPATIBILITY
-
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event);
inline bool operator!=(const wxBitmap& rBitmap) const
{ return m_refData != rBitmap.m_refData; }
-#if WXWIN_COMPATIBILITY_2
- void SetOk(bool bIsOk);
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
- inline wxPalette* GetColourMap() const
- { return GetPalette(); }
-
- inline void SetColourMap(wxPalette* pCmap)
- { SetPalette(*pCmap); };
-
-#endif // WXWIN_COMPATIBILITY
-
// Implementation
public:
inline void SetHBITMAP(WXHBITMAP hBmp)
SetBitmapLabel(rBitmap);
}
-#if WXWIN_COMPATIBILITY
- wxBitmap* GetBitmap(void) const
- {
- return (wxBitmap *)&m_buttonBitmap;
- }
-#endif
-
//
// Implementation
//
//
bool Ok(void) const {return m_bIsInit; }
- //
- // Let's remove this inelegant function
- //
-#if WXWIN_COMPATIBILITY
- void Get( unsigned char* pRed
- ,unsigned char* pGreen
- ,unsigned char* pBlue
- ) const;
-#endif
-
unsigned char Red(void) const { return m_cRed; }
unsigned char Green(void) const { return m_cGreen; }
unsigned char Blue(void) const { return m_cBlue; }
,WXLPARAM lParam
);
-#if WXWIN_COMPATIBILITY
- virtual void SetButtonColour(const wxColour& WXUNUSED(rCol)) { }
- wxColour* GetButtonColour(void) const { return NULL; }
-
- inline virtual void SetLabelFont(const wxFont& rFont);
- inline virtual void SetButtonFont(const wxFont& rFont);
- inline wxFont& GetLabelFont(void) const;
- inline wxFont& GetButtonFont(void) const;
-#endif // WXWIN_COMPATIBILITY
-
public:
//
// For controls like radiobuttons which are really composite
DECLARE_EVENT_TABLE()
}; // end of wxControl
-#if WXWIN_COMPATIBILITY
- 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); }
- inline void wxControl::SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
-#endif // WXWIN_COMPATIBILITY
-
#endif // _WX_CONTROL_H_
m_nWidth = m_nHeight = m_nDepth = 0;
m_hHandle = 0;
-
-#if WXWIN_COMPATIBILITY_2
- m_bOk = FALSE;
-#endif // WXWIN_COMPATIBILITY_2
}
// accessors
WXHCURSOR m_hCursor;
};
- // this filed is redundant and using it is error prone but keep it for
- // backwards compatibility
-#if WXWIN_COMPATIBILITY_2
- void SetOk() { m_bOk = m_hHandle != 0; }
-
- bool m_bOk;
-#endif // WXWIN_COMPATIBILITY_2
UINT m_uId;
};
);
virtual wxString GetLabelTop(size_t nPos) const;
- //
- // Compatibility: these functions are deprecated
- //
-#if WXWIN_COMPATIBILITY
- void SetEventHandler(wxEvtHandler* pHandler) { m_pEventHandler = pHandler; }
- wxEvtHandler* GetEventHandler(void) { return m_pEventHandler; }
- bool Enabled(int nId) const { return IsEnabled(nId); }
- bool Checked(int nId) const { return IsChecked(nId); }
-#endif // WXWIN_COMPATIBILITY
-
//
// Implementation from now on
//
//
void Init(void);
-#if WXWIN_COMPATIBILITY
- wxEvtHandler* m_pEventHandler;
-#endif // WXWIN_COMPATIBILITY
-
wxArrayString m_titles;
WXHMENU m_hMenu;
// Accept files for dragging
virtual void DragAcceptFiles(bool bAccept);
-#if WXWIN_COMPATIBILITY
- // Set/get scroll attributes
- virtual void SetScrollRange( int nOrient
- ,int nRange
- ,bool bRefresh = TRUE
- );
- virtual void SetScrollPage( int nOrient
- ,int nPage
- ,bool bRefresh = TRUE
- );
- virtual int OldGetScrollRange(int nOrient) const;
- virtual int GetScrollPage(int nOrient) const;
-
- //
- // event handlers
- //
- // Handle a control command
- virtual void OnCommand( wxWindow& rWin
- ,wxCommandEvent& rEvent
- );
-
- // Override to define new behaviour for default action (e.g. double
- // clicking on a listbox)
- virtual void OnDefaultAction(wxControl* WXUNUSED(pInitiatingItem)) { }
-#endif // WXWIN_COMPATIBILITY
-
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
- void CreateCaret( int nWidth
- ,int nHeight
- );
- void CreateCaret(const wxBitmap* pBitmap);
- void DestroyCaret(void);
- void ShowCaret(bool bShow);
- void SetCaretPos( int nX
- ,int nY
- );
- void GetCaretPos( int* pX
- ,int* pY
- ) const;
-#endif // wxUSE_CARET
-
#ifndef __WXUNIVERSAL__
// Native resource loading (implemented in src/os2/nativdlg.cpp)
// FIXME: should they really be all virtual?
,WXWORD nId
);
-#if WXWIN_COMPATIBILITY
- wxObject* GetChild(int nNumber) const;
- virtual void OS2DeviceToLogical( float* pfX
- ,float* pfY
- ) const;
-#endif // WXWIN_COMPATIBILITY
-
#ifndef __WXUNIVERSAL__
// Create an appropriate wxWindow from a HWND
virtual wxWindow* CreateWindowFromHWND( wxWindow* pParent
,WXLPARAM lParam
);
-#if WXWIN_COMPATIBILITY
- void SetShowing(bool bShow) { (void)Show(show); }
- bool IsUserEnabled(void) const { return IsEnabled(); }
-#endif // WXWIN_COMPATIBILITY
-
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
const wxString& wildcard = wxEmptyString,
bool details = FALSE);
-#if WXWIN_COMPATIBILITY_2
- // deprecated
- wxList *GetList(const wxString& wildcard, bool details = FALSE);
-#endif // WXWIN_COMPATIBILITY_2
-
protected:
// this executes a simple ftp command with the given argument and returns
// TRUE if it its return code starts with '2'
typedef int wxSocketFlags;
-#if WXWIN_COMPATIBILITY
- typedef wxSocketType wxSockType;
- typedef wxSocketFlags wxSockFlags;
-#endif // WXWIN_COMPATIBILITY
-
// --------------------------------------------------------------------------
// wxSocketBase
{
DECLARE_CLASS(wxSocketBase)
-public:
-
-#if WXWIN_COMPATIBILITY
- enum
- {
- NONE = wxSOCKET_NONE,
- NOWAIT = wxSOCKET_NOWAIT,
- WAITALL = wxSOCKET_WAITALL,
- SPEED = wxSOCKET_BLOCK
- };
-
- enum
- {
- SOCK_UNINIT = wxSOCKET_UNINIT,
- SOCK_CLIENT = wxSOCKET_CLIENT,
- SOCK_SERVER = wxSOCKET_SERVER,
- SOCK_INTERNAL = wxSOCKET_BASE,
- SOCK_DATAGRAM = wxSOCKET_DATAGRAM
- };
-
- typedef void (*wxSockCbk)(wxSocketBase& sock, wxSocketNotify evt, char *cdata);
-#endif // WXWIN_COMPATIBILITY
-
public:
// Public interface
static bool Initialize();
static void Shutdown();
- // callbacks are deprecated, use events instead
-#if WXWIN_COMPATIBILITY
- wxSockCbk Callback(wxSockCbk cbk_);
- char *CallbackData(char *data);
-#endif // WXWIN_COMPATIBILITY
-
// Implementation from now on
// --------------------------
// the initialization count, GSocket is initialized if > 0
static size_t m_countInit;
- // callbacks are deprecated, use events instead
-#if WXWIN_COMPATIBILITY
- wxSockCbk m_cbk; // callback
- char *m_cdata; // callback data
-#endif // WXWIN_COMPATIBILITY
-
DECLARE_NO_COPY_CLASS(wxSocketBase)
};
wxSocketBase *GetSocket() const { return (wxSocketBase *) GetEventObject(); }
void *GetClientData() const { return m_clientData; }
- // backwards compatibility
-#if WXWIN_COMPATIBILITY_2
- wxSocketNotify SocketEvent() const { return m_event; }
- wxSocketBase *Socket() const { return (wxSocketBase *) GetEventObject(); }
-#endif // WXWIN_COMPATIBILITY_2
-
virtual wxEvent *Clone() const { return new wxSocketEvent(*this); }
public:
// more deprecated functions
// -------------------------
-#if WXWIN_COMPATIBILITY
- void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); }
- long GetDefaultWidth() const { return m_defaultWidth; }
- long GetDefaultHeight() const { return m_defaultHeight; }
- int GetDefaultButtonWidth() const { return (int) GetDefaultButtonSize().x; };
- int GetDefaultButtonHeight() const { return (int) GetDefaultButtonSize().y; };
- virtual void SetDefaultSize(const wxSize& size) { SetToolBitmapSize(size); }
- virtual wxSize GetDefaultSize() const { return GetToolBitmapSize(); }
- virtual wxSize GetDefaultButtonSize() const { return GetToolSize(); }
-#endif // WXWIN_COMPATIBILITY
-
// use GetToolMargins() instead
wxSize GetMargins() const { return GetToolMargins(); }
// do the window-specific processing after processing the update event
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ;
- // obsolete functions
-#if WXWIN_COMPATIBILITY
- bool Modified() const { return IsModified(); }
-#endif
-
protected:
// the name of the last file loaded with LoadFile() which will be used by
// SaveFile() by default
// return TRUE if the timer is one shot
bool IsOneShot() const { return m_oneShot; }
-#if WXWIN_COMPATIBILITY_2
- // deprecated functions
- int Interval() const { return GetInterval(); };
- bool OneShot() const { return IsOneShot(); }
-#endif // WXWIN_COMPATIBILITY_2
-
protected:
// common part of all ctors
void Init() { m_oneShot = FALSE; m_milli = 0; }
// operation is successful.)
virtual bool SetShape(const wxRegion& WXUNUSED(region)) { return FALSE; }
- // old functions, use the new ones instead!
-#if WXWIN_COMPATIBILITY_2
- bool Iconized() const { return IsIconized(); }
-#endif // WXWIN_COMPATIBILITY_2
-
// implementation only from now on
// -------------------------------
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 1.68 API:
-// Level 0: no backward compatibility, all new features
-// Level 1: some extra methods are defined for compatibility.
-//
-// Default is 0.
-//
-// Recommended setting: 0 (in fact the compatibility code is now very minimal
-// so there is little advantage to setting it to 1.
-#define WXWIN_COMPATIBILITY 0
-
-// This setting determines the compatibility with 2.0 API: set it to 1 to
-// enable it
-//
-// Default is 0.
-//
-// Recommended setting: 0 (please update your code instead!)
-#define WXWIN_COMPATIBILITY_2 0
-
// This setting determines the compatibility with 2.0 API: set it to 1 to
// enable it
//
WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s);
#endif
-#if WXWIN_COMPATIBILITY_2
-// Matches string one within string two regardless of case
-WXDLLIMPEXP_BASE bool StringMatch(const wxChar *one, const wxChar *two, bool subString = TRUE, bool exact = FALSE);
-#endif
-
// A shorter way of using strcmp
#define wxStringEq(s1, s2) (s1 && s2 && (wxStrcmp(s1, s2) == 0))
// Generate a unique ID
WXDLLEXPORT long wxNewId();
-#if !defined(NewId) && defined(WXWIN_COMPATIBILITY)
- #define NewId wxNewId
-#endif
// Ensure subsequent IDs don't clash with this one
WXDLLEXPORT void wxRegisterId(long id);
-#if !defined(RegisterId) && defined(WXWIN_COMPATIBILITY)
- #define RegisterId wxRegisterId
-#endif
// Return the current ID
WXDLLEXPORT long wxGetCurrentId();
wxAccessible* GetOrCreateAccessible() ;
#endif
- // backward compatibility
- // ----------------------
-#if WXWIN_COMPATIBILITY
- bool Enabled() const { return IsEnabled(); }
-
- void SetButtonFont(const wxFont& font) { SetFont(font); }
- void SetLabelFont(const wxFont& font) { SetFont(font); }
- wxFont& GetLabelFont() { return GetFont(); };
- wxFont& GetButtonFont() { return GetFont(); };
-#endif // WXWIN_COMPATIBILITY
-
// implementation
// --------------
* Use Apple Ieee-double converter
*/
#define wxUSE_APPLE_IEEE 0
-/*
- * Compatibility with 2.0 API.
- */
-#define WXWIN_COMPATIBILITY_2 0
/*
* Compatibility with 2.2 API
*/
bool wxControl::ProcessCommand(wxCommandEvent& event)
{
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(*this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
-
return GetEventHandler()->ProcessEvent(event);
}
// MT-FIXME
static int s_lastUsedEventType = wxEVT_FIRST;
-#if WXWIN_COMPATIBILITY_2
- // check that we don't overlap with the user-defined types: if it does
- // happen, the best solution is probably to update the existing code to
- // use wxNewEventType() instead of wxEVT_USER_FIRST
- //
- // due to the uncertainty
- wxASSERT_MSG( s_lastUsedEventType < wxEVT_USER_FIRST - 1,
- _T("possible event type conflict") );
-#endif // WXWIN_COMPATIBILITY_2
-
return s_lastUsedEventType++;
}
return m_clientData;
}
-
-#if WXWIN_COMPATIBILITY
-bool wxEvtHandler::OnClose()
-{
- if (GetNextHandler())
- return GetNextHandler()->OnClose();
- else
- return FALSE;
-}
-#endif // WXWIN_COMPATIBILITY
-
#endif // wxUSE_BASE
#if wxUSE_GUI
return filesize;
}
-
-#if WXWIN_COMPATIBILITY_2
-// deprecated
-wxList *wxFTP::GetList(const wxString& wildcard, bool details)
-{
- wxSocketBase *sock = GetPort();
- if (!sock)
- return NULL;
- wxList *file_list = new wxList;
- wxString line;
- // NLST : List of Filenames (including Directory's !)
- // LIST : depending on BS of FTP-Server
- // - Unix : result like "ls" command
- // - Windows : like "dir" command
- // - others : ?
- if (!details)
- line = _T("NLST"); // Default
- else
- line = _T("LIST");
- if (!wildcard.IsNull())
- line += wildcard;
- if (!CheckCommand(line, '1'))
- {
- delete sock;
- delete file_list;
- return NULL;
- }
- while (GetLine(sock, line) == wxPROTO_NOERR)
- {
- file_list->Append((wxObject *)(new wxString(line)));
- }
- if (!CheckResult('2'))
- {
- delete sock;
- file_list->DeleteContents(TRUE);
- delete file_list;
- return NULL;
- }
- return file_list;
-}
-#endif // WXWIN_COMPATIBILITY_2
-
#endif // wxUSE_PROTOCOL_FTP
return AreSatisfied();
}
-/*
- * Main constrained layout algorithm. Look at all the child
- * windows, and their constraints (if any).
- * The idea is to keep iterating through the constraints
- * until all left, right, bottom and top edges, and widths and heights,
- * are known (or no change occurs and we've failed to resolve all
- * constraints).
- *
- * If the user has not specified a dimension or edge, it will be
- * be calculated from the other known values. E.g. If we know
- * the right hand edge and the left hand edge, we now know the width.
- * The snag here is that this means we must specify absolute dimensions
- * twice (in constructor and in constraint), if we wish to use the
- * constraint notation to just set the position, for example.
- * Otherwise, if we only set ONE edge and no dimension, it would never
- * find the other edge.
- *
- * Algorithm:
-
- Mark all constraints as not done.
-
- iterations = 0;
- until no change or iterations >= max iterations
- For each child:
- {
- Calculate all constraints
- }
- iterations ++;
-
- For each child
- Set each calculated position and size
-
- */
-
-#if WXWIN_COMPATIBILITY
-bool wxOldDoLayout(wxWindowBase *win)
-{
- // Make sure this isn't called recursively from below
- static wxList doneSoFar;
-
- if (doneSoFar.Member(win))
- return TRUE;
-
- doneSoFar.Append(win);
-
- wxNode *node = win->GetChildren().First();
- while (node)
- {
- wxWindowBase *child = (wxWindowBase *)node->Data();
- wxLayoutConstraints *constr = child->GetConstraints();
- if (constr)
- {
- constr->left.SetDone(FALSE);
- constr->top.SetDone(FALSE);
- constr->right.SetDone(FALSE);
- constr->bottom.SetDone(FALSE);
- constr->width.SetDone(FALSE);
- constr->height.SetDone(FALSE);
- constr->centreX.SetDone(FALSE);
- constr->centreY.SetDone(FALSE);
- }
- node = node->Next();
- }
- int noIterations = 0;
- int maxIterations = 500;
- int noChanges = 1;
-
- while ((noChanges > 0) && (noIterations < maxIterations))
- {
- noChanges = 0;
- wxNode *node = win->GetChildren().First();
- while (node)
- {
- wxWindowBase *child = (wxWindowBase *)node->Data();
- wxLayoutConstraints *constr = child->GetConstraints();
- if (constr)
- {
- int tempNoChanges = 0;
- (void)constr->SatisfyConstraints(child, &tempNoChanges);
- noChanges += tempNoChanges;
- }
- node = node->Next();
- }
- noIterations ++;
- }
-/*
- // Would be nice to have a test here to see _which_ constraint(s)
- // failed, so we can print a specific diagnostic message.
- if (noFailures > 0)
- {
- wxDebugMsg(_("wxWindowBase::Layout() failed.\n"));
- }
-*/
- // Now set the sizes and positions of the children, and
- // recursively call Layout().
- node = win->GetChildren().First();
- while (node)
- {
- wxWindowBase *child = (wxWindowBase *)node->Data();
- wxLayoutConstraints *constr = child->GetConstraints();
- if (constr && constr->left.GetDone() && constr->right.GetDone() &&
- constr->width.GetDone() && constr->height.GetDone())
- {
- int x = constr->left.GetValue();
- int y = constr->top.GetValue();
- int w = constr->width.GetValue();
- int h = constr->height.GetValue();
-
- // If we don't want to resize this window, just move it...
- if ((constr->width.GetRelationship() != wxAsIs) ||
- (constr->height.GetRelationship() != wxAsIs))
- {
- // _Should_ call Layout() recursively.
- child->SetSize(x, y, w, h);
- }
- else
- {
- child->Move(x, y);
- }
- }
- else
- child->Layout();
- node = node->Next();
- }
- doneSoFar.DeleteObject(win);
-
- return TRUE;
-}
-#endif // WXWIN_COMPATIBILITY
-
#endif // wxUSE_CONSTRAINTS
wxSocketEventFlags m_eventmask;
bool m_notify;
void *m_clientData;
-#if WXWIN_COMPATIBILITY
- wxSocketBase::wxSockCbk m_cbk;
- char *m_cdata;
-#endif // WXWIN_COMPATIBILITY
public:
wxSocketState() : wxObject() {}
m_clientData = NULL;
m_notify = FALSE;
m_eventmask = 0;
-#if WXWIN_COMPATIBILITY
- m_cbk = NULL;
- m_cdata = NULL;
-#endif // WXWIN_COMPATIBILITY
if ( !IsInitialized() )
{
state->m_notify = m_notify;
state->m_eventmask = m_eventmask;
state->m_clientData = m_clientData;
-#if WXWIN_COMPATIBILITY
- state->m_cbk = m_cbk;
- state->m_cdata = m_cdata;
-#endif // WXWIN_COMPATIBILITY
m_states.Append(state);
}
m_notify = state->m_notify;
m_eventmask = state->m_eventmask;
m_clientData = state->m_clientData;
-#if WXWIN_COMPATIBILITY
- m_cbk = state->m_cbk;
- m_cdata = state->m_cdata;
-#endif // WXWIN_COMPATIBILITY
-
+
m_states.Erase(node);
delete state;
}
}
-// --------------------------------------------------------------------------
-// Callbacks (now obsolete - use events instead)
-// --------------------------------------------------------------------------
-
-#if WXWIN_COMPATIBILITY
-
-wxSocketBase::wxSockCbk wxSocketBase::Callback(wxSockCbk cbk_)
-{
- wxSockCbk old_cbk = cbk_;
-
- m_cbk = cbk_;
- return old_cbk;
-}
-
-char *wxSocketBase::CallbackData(char *data)
-{
- char *old_data = m_cdata;
-
- m_cdata = data;
- return old_data;
-}
-
-#endif // WXWIN_COMPATIBILITY
-
// --------------------------------------------------------------------------
// Event handling
// --------------------------------------------------------------------------
m_handler->AddPendingEvent(event);
}
-
-#if WXWIN_COMPATIBILITY
- if (m_cbk)
- m_cbk(*this, notification, m_cdata);
-#endif // WXWIN_COMPATIBILITY
}
}
{
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
-#if WXWIN_COMPATIBILITY
- event.SetForce(force);
-#endif // WXWIN_COMPATIBILITY
event.SetCanVeto(!force);
// return FALSE if window wasn't closed because the application vetoed the
return res;
}
-#if WXWIN_COMPATIBILITY_2
-// Overloaded for backward compatibility
-wxString wxGetSingleChoice( const wxString& message,
- const wxString& caption,
- int n, wxChar *choices[],
- wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
- strings[i] = choices[i];
- }
- wxString ans(wxGetSingleChoice(message, caption, n, (const wxString *)strings, parent,
- x, y, centre, width, height));
- delete[] strings;
- return ans;
-}
-#endif // WXWIN_COMPATIBILITY_2
-
int wxGetSingleChoiceIndex( const wxString& message,
const wxString& caption,
int n, const wxString *choices,
return res;
}
-#if WXWIN_COMPATIBILITY_2
-// Overloaded for backward compatibility
-int wxGetSingleChoiceIndex( const wxString& message,
- const wxString& caption,
- int n, wxChar *choices[],
- wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- for ( int i = 0; i < n; i++)
- strings[i] = choices[i];
- int ans = wxGetSingleChoiceIndex(message, caption, n, (const wxString *)strings, parent,
- x, y, centre, width, height);
- delete[] strings;
- return ans;
-}
-#endif // WXWIN_COMPATIBILITY_2
-
void *wxGetSingleChoiceData( const wxString& message,
const wxString& caption,
int n, const wxString *choices,
return res;
}
-#if WXWIN_COMPATIBILITY_2
-// Overloaded for backward compatibility
-void *wxGetSingleChoiceData( const wxString& message,
- const wxString& caption,
- int n, wxChar *choices[],
- void **client_data,
- wxWindow *parent,
- int x, int y, bool centre, int width, int height )
-{
- wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
- strings[i] = choices[i];
- }
- void *data = wxGetSingleChoiceData(message, caption,
- n, (const wxString *)strings,
- client_data, parent,
- x, y, centre, width, height);
- delete[] strings;
- return data;
-}
-#endif // WXWIN_COMPATIBILITY_2
-
size_t wxGetMultipleChoices(wxArrayInt& selections,
const wxString& message,
const wxString& caption,
Create(parent, message, caption, n, choices, clientData, style);
}
-#if WXWIN_COMPATIBILITY_2
-
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
- const wxString& message,
- const wxString& caption,
- const wxStringList& choices,
- char **clientData,
- long style,
- const wxPoint& WXUNUSED(pos))
-{
- Create(parent, message, caption, choices, clientData, style);
-}
-
-bool wxSingleChoiceDialog::Create(wxWindow *parent,
- const wxString& message,
- const wxString& caption,
- const wxStringList& choices,
- char **clientData,
- long style,
- const wxPoint& pos)
-{
- wxString *strings = new wxString[choices.Number()];
- int i;
- for ( i = 0; i < choices.Number(); i++)
- {
- strings[i] = (char *)choices.Nth(i)->Data();
- }
- bool ans = Create(parent, message, caption, choices.Number(), strings, clientData, style, pos);
- delete[] strings;
- return ans;
-}
-
-#endif // WXWIN_COMPATIBILITY_2
-
bool wxSingleChoiceDialog::Create( wxWindow *parent,
const wxString& message,
const wxString& caption,
#endif // __WXMSW__
-#if WXWIN_COMPATIBILITY
-
-void wxGenericScrolledWindow::GetScrollUnitsPerPage (int *x_page, int *y_page) const
-{
- *x_page = GetScrollPageSize(wxHORIZONTAL);
- *y_page = GetScrollPageSize(wxVERTICAL);
-}
-
-void wxGenericScrolledWindow::CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const
-{
- if ( xx )
- *xx = (float)(x + m_xScrollPosition * m_xScrollPixelsPerLine);
- if ( yy )
- *yy = (float)(y + m_yScrollPosition * m_yScrollPixelsPerLine);
-}
-
-#endif // WXWIN_COMPATIBILITY
-
#endif // !wxGTK
// vi:sts=4:sw=4:et
m_macVerticalBorder = 0 ;
m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK;
-#if WXWIN_COMPATIBILITY
- m_callback = 0;
-#endif // WXWIN_COMPATIBILITY
if ( wxMacLiveScrollbarActionUPP == NULL )
{
bool wxControl::ProcessCommand (wxCommandEvent & event)
{
- // Tries:
- // 1) A callback function (to become obsolete)
- // 2) OnCommand, starting at this window and working up parent hierarchy
- // 3) OnCommand then calls ProcessEvent to search the event tables.
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
- {
- return GetEventHandler()->ProcessEvent(event);
- }
+ // Tries:
+ // 1) OnCommand, starting at this window and working up parent hierarchy
+ // 2) OnCommand then calls ProcessEvent to search the event tables.
+ return GetEventHandler()->ProcessEvent(event);
}
// ------------------------
{
bool processed = FALSE;
-#if WXWIN_COMPATIBILITY
- // Try a callback
- if (m_callback)
- {
- (void)(*(m_callback))(*this, event);
- processed = TRUE;
- }
-#endif WXWIN_COMPATIBILITY
-
// Try the menu's event handler
if ( !processed && GetEventHandler())
{
}
}
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
-// ---------------------------------------------------------------------------
-// Caret manipulation
-// ---------------------------------------------------------------------------
-
-void wxWindowMac::CreateCaret(int w, int h)
-{
- SetCaret(new wxCaret(this, w, h));
-}
-
-void wxWindowMac::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
-{
- wxFAIL_MSG("not implemented");
-}
-
-void wxWindowMac::ShowCaret(bool show)
-{
- wxCHECK_RET( m_caret, "no caret to show" );
-
- m_caret->Show(show);
-}
-
-void wxWindowMac::DestroyCaret()
-{
- SetCaret(NULL);
-}
-
-void wxWindowMac::SetCaretPos(int x, int y)
-{
- wxCHECK_RET( m_caret, "no caret to move" );
-
- m_caret->Move(x, y);
-}
-
-void wxWindowMac::GetCaretPos(int *x, int *y) const
-{
- wxCHECK_RET( m_caret, "no caret to get position of" );
-
- m_caret->GetPosition(x, y);
-}
-#endif // wxUSE_CARET
-
wxWindowMac *wxGetActiveWindow()
{
// actually this is a windows-only concept
return gFocusWindow ;
}
-#if WXWIN_COMPATIBILITY
-// If nothing defined for this, try the parent.
-// E.g. we may be a button loaded from a resource, with no callback function
-// defined.
-void wxWindowMac::OnCommand(wxWindowMac& win, wxCommandEvent& event)
-{
- if ( GetEventHandler()->ProcessEvent(event) )
- return;
- if ( m_parent )
- m_parent->GetEventHandler()->OnCommand(win, event);
-}
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
-wxObject* wxWindowMac::GetChild(int number) const
-{
- // Return a pointer to the Nth object in the Panel
- wxNode *node = GetChildren().GetFirst();
- int n = number;
- while (node && n--)
- node = node->GetNext();
- if ( node )
- {
- wxObject *obj = (wxObject *)node->GetData();
- return(obj);
- }
- else
- return NULL;
-}
-#endif // WXWIN_COMPATIBILITY
-
void wxWindowMac::OnSetFocus(wxFocusEvent& event)
{
// panel wants to track the window which was the last to have focus in it,
m_macVerticalBorder = 0 ;
m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK;
-#if WXWIN_COMPATIBILITY
- m_callback = 0;
-#endif // WXWIN_COMPATIBILITY
if ( wxMacLiveScrollbarActionUPP == NULL )
{
bool wxControl::ProcessCommand (wxCommandEvent & event)
{
- // Tries:
- // 1) A callback function (to become obsolete)
- // 2) OnCommand, starting at this window and working up parent hierarchy
- // 3) OnCommand then calls ProcessEvent to search the event tables.
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
- {
- return GetEventHandler()->ProcessEvent(event);
- }
+ // Tries:
+ // 1) OnCommand, starting at this window and working up parent hierarchy
+ // 2) OnCommand then calls ProcessEvent to search the event tables.
+ return GetEventHandler()->ProcessEvent(event);
}
// ------------------------
{
bool processed = FALSE;
-#if WXWIN_COMPATIBILITY
- // Try a callback
- if (m_callback)
- {
- (void)(*(m_callback))(*this, event);
- processed = TRUE;
- }
-#endif WXWIN_COMPATIBILITY
-
// Try the menu's event handler
if ( !processed && GetEventHandler())
{
}
}
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
-// ---------------------------------------------------------------------------
-// Caret manipulation
-// ---------------------------------------------------------------------------
-
-void wxWindowMac::CreateCaret(int w, int h)
-{
- SetCaret(new wxCaret(this, w, h));
-}
-
-void wxWindowMac::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
-{
- wxFAIL_MSG("not implemented");
-}
-
-void wxWindowMac::ShowCaret(bool show)
-{
- wxCHECK_RET( m_caret, "no caret to show" );
-
- m_caret->Show(show);
-}
-
-void wxWindowMac::DestroyCaret()
-{
- SetCaret(NULL);
-}
-
-void wxWindowMac::SetCaretPos(int x, int y)
-{
- wxCHECK_RET( m_caret, "no caret to move" );
-
- m_caret->Move(x, y);
-}
-
-void wxWindowMac::GetCaretPos(int *x, int *y) const
-{
- wxCHECK_RET( m_caret, "no caret to get position of" );
-
- m_caret->GetPosition(x, y);
-}
-#endif // wxUSE_CARET
-
wxWindowMac *wxGetActiveWindow()
{
// actually this is a windows-only concept
return gFocusWindow ;
}
-#if WXWIN_COMPATIBILITY
-// If nothing defined for this, try the parent.
-// E.g. we may be a button loaded from a resource, with no callback function
-// defined.
-void wxWindowMac::OnCommand(wxWindowMac& win, wxCommandEvent& event)
-{
- if ( GetEventHandler()->ProcessEvent(event) )
- return;
- if ( m_parent )
- m_parent->GetEventHandler()->OnCommand(win, event);
-}
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
-wxObject* wxWindowMac::GetChild(int number) const
-{
- // Return a pointer to the Nth object in the Panel
- wxNode *node = GetChildren().GetFirst();
- int n = number;
- while (node && n--)
- node = node->GetNext();
- if ( node )
- {
- wxObject *obj = (wxObject *)node->GetData();
- return(obj);
- }
- else
- return NULL;
-}
-#endif // WXWIN_COMPATIBILITY
-
void wxWindowMac::OnSetFocus(wxFocusEvent& event)
{
// panel wants to track the window which was the last to have focus in it,
m_blue = b;
m_isInit = TRUE;
}
-
-// Obsolete
-#if WXWIN_COMPATIBILITY
-void wxColour::Get(unsigned char *r, unsigned char *g, unsigned char *b) const
-{
- *r = m_red;
- *g = m_green;
- *b = m_blue;
-}
-#endif
-
EVT_setMousePos(x, y);
}
-#if WXWIN_COMPATIBILITY
-// If nothing defined for this, try the parent.
-// E.g. we may be a button loaded from a resource, with no callback function
-// defined.
-void wxWindowMGL::OnCommand(wxWindow& win, wxCommandEvent& event)
-{
- if ( GetEventHandler()->ProcessEvent(event) )
- return;
- if ( m_parent )
- m_parent->GetEventHandler()->OnCommand(win, event);
-}
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
-wxObject* wxWindowMGL::GetChild(int number) const
-{
- // Return a pointer to the Nth object in the Panel
- wxNode *node = GetChildren().First();
- int n = number;
- while (node && n--)
- node = node->Next();
- if ( node )
- {
- wxObject *obj = (wxObject *)node->Data();
- return(obj);
- }
- else
- return NULL;
-}
-#endif // WXWIN_COMPATIBILITY
-
// Set this window to be the child of 'parent'.
bool wxWindowMGL::Reparent(wxWindowBase *parent)
{
dc.GetTextExtent(string, x, y, descent, externalLeading, (wxFont*)theFont);
}
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
-// ---------------------------------------------------------------------------
-// Caret manipulation
-// ---------------------------------------------------------------------------
-
-void wxWindowMGL::CreateCaret(int w, int h)
-{
- SetCaret(new wxCaret(this, w, h));
-}
-
-void wxWindowMGL::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
-{
- wxFAIL_MSG("not implemented");
-}
-
-void wxWindowMGL::ShowCaret(bool show)
-{
- wxCHECK_RET( m_caret, "no caret to show" );
-
- m_caret->Show(show);
-}
-
-void wxWindowMGL::DestroyCaret()
-{
- SetCaret(NULL);
-}
-
-void wxWindowMGL::SetCaretPos(int x, int y)
-{
- wxCHECK_RET( m_caret, "no caret to move" );
-
- m_caret->Move(x, y);
-}
-
-void wxWindowMGL::GetCaretPos(int *x, int *y) const
-{
- wxCHECK_RET( m_caret, "no caret to get position of" );
-
- m_caret->GetPosition(x, y);
-}
-#endif // wxUSE_CARET
-
// ---------------------------------------------------------------------------
// painting
m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK;
-#if WXWIN_COMPATIBILITY
- m_callback = 0;
-#endif // WXWIN_COMPATIBILITY
-
m_inSetValue = FALSE;
}
bool wxControl::ProcessCommand(wxCommandEvent & event)
{
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
-
return GetEventHandler()->ProcessEvent(event);
}
// delete the old one now as we don't need it any more
::DeleteObject(iconInfo.hbmMask);
-#if WXWIN_COMPATIBILITY_2
- refData->m_ok = TRUE;
-#endif // WXWIN_COMPATIBILITY_2
-
return TRUE;
#else
return FALSE;
refData->m_hBitmap = (WXHBITMAP)hbitmap;
-#if WXWIN_COMPATIBILITY_2
- refData->m_ok = TRUE;
-#endif // WXWIN_COMPATIBILITY_2
-
return TRUE;
#else // Win32
return CopyFromIconOrCursor(icon);
SetHBITMAP((WXHBITMAP)hbmp);
-#if WXWIN_COMPATIBILITY_2
- GetBitmapData()->m_ok = hbmp != 0;
-#endif // WXWIN_COMPATIBILITY_2
-
return Ok();
}
SetPalette(image.GetPalette());
#endif // wxUSE_PALETTE
-#if WXWIN_COMPATIBILITY_2
- // check the wxBitmap object
- GetBitmapData()->SetOk();
-#endif // WXWIN_COMPATIBILITY_2
-
return TRUE;
}
// validate this object
SetHBITMAP((WXHBITMAP)hbitmap);
-#if WXWIN_COMPATIBILITY_2
- m_refData->m_ok = TRUE;
-#endif // WXWIN_COMPATIBILITY_2
-
// finally also set the mask if we have one
if ( image.HasMask() )
{
GetBitmapData()->SetMask(mask);
}
-#if WXWIN_COMPATIBILITY_2
-
-void wxBitmap::SetOk(bool isOk)
-{
- EnsureHasData();
-
- GetBitmapData()->m_ok = isOk;
-}
-
-#endif // WXWIN_COMPATIBILITY_2
-
#if WXWIN_COMPATIBILITY_2_4
void wxBitmap::SetQuality(int WXUNUSED(quality))
wxBM->SetWidth(bm.bmWidth);
wxBM->SetHeight(bm.bmHeight);
wxBM->SetDepth(bm.bmPlanes);
-#if WXWIN_COMPATIBILITY_2
- wxBM->SetOk(TRUE);
-#endif // WXWIN_COMPATIBILITY_2
retval = wxBM;
break;
}
m_isInit = TRUE;
m_pixel = PALETTERGB (m_red, m_green, m_blue);
}
-
-// Obsolete
-#if WXWIN_COMPATIBILITY
-void wxColour::Get (unsigned char *r, unsigned char *g, unsigned char *b) const
-{
- *r = m_red;
- *g = m_green;
- *b = m_blue;
-}
-#endif
-
// Item members
wxControl::wxControl()
{
-#if WXWIN_COMPATIBILITY
- m_callback = 0;
-#endif // WXWIN_COMPATIBILITY
}
wxControl::~wxControl()
bool wxControl::ProcessCommand(wxCommandEvent& event)
{
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(*this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
-
return GetEventHandler()->ProcessEvent(event);
}
if ( hcursor )
{
m_refData = new wxCursorRefData(hcursor, true /* delete it later */);
-
-#if WXWIN_COMPATIBILITY_2
- ((wxCursorRefData *)m_refData)->SetOk();
-#endif // WXWIN_COMPATIBILITY_2
}
}
pagesize( long , 1)
*/
-BEGIN_EVENT_TABLE(wxScrollBar, wxControl)
-#if WXWIN_COMPATIBILITY
- EVT_SCROLL(wxScrollBar::OnScroll)
-#endif
-END_EVENT_TABLE()
-
// Scrollbar
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
}
-/* From the WIN32 documentation:
-In version 4.0 or later, the maximum value that a scroll bar can report
-(that is, the maximum scrolling position) depends on the page size.
-If the scroll bar has a page size greater than one, the maximum scrolling position
-is less than the maximum range value. You can use the following formula to calculate
-the maximum scrolling position:
-
-MaxScrollPos = MaxRangeValue - (PageSize - 1)
-*/
-
-#if WXWIN_COMPATIBILITY
-void wxScrollBar::SetPageSize(int pageLength)
-{
- m_pageSize = pageLength;
-
-#if defined(__WIN95__)
- SCROLLINFO info;
- info.cbSize = sizeof(SCROLLINFO);
- info.nPage = pageLength;
- info.fMask = SIF_PAGE ;
-
- ::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, TRUE);
-#endif
-}
-
-void wxScrollBar::SetObjectLength(int objectLength)
-{
- m_objectSize = objectLength;
-
- // The range (number of scroll steps) is the
- // object length minus the view size.
- int range = wxMax((objectLength - m_viewSize), 0) ;
-
-#if defined(__WIN95__)
- // Try to adjust the range to cope with page size > 1
- // (see comment for SetPageLength)
- if ( m_pageSize > 1 )
- {
- range += (m_pageSize - 1);
- }
-
- SCROLLINFO info;
- info.cbSize = sizeof(SCROLLINFO);
- info.nPage = 0;
- info.nMin = 0;
- info.nMax = range;
- info.nPos = 0;
- info.fMask = SIF_RANGE ;
-
- ::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, TRUE);
-#else
- ::SetScrollRange((HWND)m_hWnd, SB_CTL, 0, range, TRUE);
-#endif
-}
-
-void wxScrollBar::SetViewLength(int viewLength)
-{
- m_viewSize = viewLength;
-}
-
-void wxScrollBar::GetValues(int *viewStart, int *viewLength, int *objectLength,
- int *pageLength) const
-{
- *viewStart = ::GetScrollPos((HWND)m_hWnd, SB_CTL);
- *viewLength = m_viewSize;
- *objectLength = m_objectSize;
- *pageLength = m_pageSize;
-}
-#endif
-
WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
{
ProcessCommand(event);
}
-#if WXWIN_COMPATIBILITY
-// Backward compatibility
-void wxScrollBar::OnScroll(wxScrollEvent& event)
-{
- wxEventType oldEvent = event.GetEventType();
- event.SetEventType( wxEVT_COMMAND_SCROLLBAR_UPDATED );
- if ( !GetEventHandler()->ProcessEvent(event) )
- {
- event.SetEventType( oldEvent );
- if (!GetParent()->GetEventHandler()->ProcessEvent(event))
- event.Skip();
- }
-}
-#endif
-
#endif // wxUSE_SCROLLBAR
}
}
-#if WXWIN_COMPATIBILITY
-void wxWindowMSW::MSWDeviceToLogical (float *x, float *y) const
-{
-}
-#endif // WXWIN_COMPATIBILITY
-
// ---------------------------------------------------------------------------
// scrolling stuff
// ---------------------------------------------------------------------------
return orient == wxHORIZONTAL ? SB_HORZ : SB_VERT;
}
-#if WXWIN_COMPATIBILITY
-void wxWindowMSW::SetScrollRange(int orient, int range, bool refresh)
-{
- int range1 = range;
-
- // Try to adjust the range to cope with page size > 1
- // - a Windows API quirk
- int pageSize = GetScrollPage(orient);
- if ( pageSize > 1 && range > 0)
- {
- range1 += (pageSize - 1);
- }
-
- WinStruct<SCROLLINFO> info;
- info.nPage = pageSize; // Have to set this, or scrollbar goes awry
- info.nMin = 0;
- info.nMax = range1;
- info.fMask = SIF_RANGE | SIF_PAGE;
-
- HWND hWnd = GetHwnd();
- if ( hWnd )
- ::SetScrollInfo(hWnd, wxDirToWinStyle(orient), &info, refresh);
-}
-
-void wxWindowMSW::SetScrollPage(int orient, int page, bool refresh)
-{
- WinStruct<SCROLLINFO> info;
- info.nPage = page;
- info.fMask = SIF_PAGE;
-
- HWND hWnd = GetHwnd();
- if ( hWnd )
- ::SetScrollInfo(hWnd, wxDirToWinStyle(orient), &info, refresh);
-}
-
-int wxWindowMSW::GetScrollPage(int orient) const
-{
- return orient == wxHORIZONTAL ? m_xThumbSize : m_yThumbSize;
-}
-
-#endif // WXWIN_COMPATIBILITY
-
inline int GetScrollPosition(HWND hWnd, int wOrient)
{
#ifdef __WXMICROWIN__
return style;
}
-#if WXWIN_COMPATIBILITY
-// If nothing defined for this, try the parent.
-// E.g. we may be a button loaded from a resource, with no callback function
-// defined.
-void wxWindowMSW::OnCommand(wxWindow& win, wxCommandEvent& event)
-{
- if ( GetEventHandler()->ProcessEvent(event) )
- return;
- if ( m_parent )
- m_parent->GetEventHandler()->OnCommand(win, event);
-}
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
-wxObject* wxWindowMSW::GetChild(int number) const
-{
- // Return a pointer to the Nth object in the Panel
- wxNode *node = GetChildren().First();
- int n = number;
- while (node && n--)
- node = node->Next();
- if ( node )
- {
- wxObject *obj = (wxObject *)node->Data();
- return(obj);
- }
- else
- return NULL;
-}
-#endif // WXWIN_COMPATIBILITY
-
// Setup background and foreground colours correctly
void wxWindowMSW::SetupColours()
{
*externalLeading = tm.tmExternalLeading;
}
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
-// ---------------------------------------------------------------------------
-// Caret manipulation
-// ---------------------------------------------------------------------------
-
-void wxWindowMSW::CreateCaret(int w, int h)
-{
- SetCaret(new wxCaret(this, w, h));
-}
-
-void wxWindowMSW::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
-{
- wxFAIL_MSG("not implemented");
-}
-
-void wxWindowMSW::ShowCaret(bool show)
-{
- wxCHECK_RET( m_caret, "no caret to show" );
-
- m_caret->Show(show);
-}
-
-void wxWindowMSW::DestroyCaret()
-{
- SetCaret(NULL);
-}
-
-void wxWindowMSW::SetCaretPos(int x, int y)
-{
- wxCHECK_RET( m_caret, "no caret to move" );
-
- m_caret->Move(x, y);
-}
-
-void wxWindowMSW::GetCaretPos(int *x, int *y) const
-{
- wxCHECK_RET( m_caret, "no caret to get position of" );
-
- m_caret->GetPosition(x, y);
-}
-#endif // wxUSE_CARET
-
// ---------------------------------------------------------------------------
// popup menu
// ---------------------------------------------------------------------------
}
SetHBITMAP((WXHBITMAP)hBmp);
-#if WXWIN_COMPATIBILITY_2
- GetBitmapData()->m_bOk = hBmp != 0;
-#endif // WXWIN_COMPATIBILITY_2
-
return Ok();
} // end of wxBitmap::Create
GetBitmapData()->m_nQuality = nQ;
} // end of wxBitmap::SetQuality
-#if WXWIN_COMPATIBILITY_2
-void wxBitmap::SetOk(
- bool bOk
-)
-{
- EnsureHasData();
-
- GetBitmapData()->m_bOk = bOk;
-} // end of wxBitmap::SetOk
-#endif // WXWIN_COMPATIBILITY_2
-
void wxBitmap::SetPalette(
const wxPalette& rPalette
)
m_bIsInit = TRUE;
m_vPixel = OS2RGB (m_cRed, m_cGreen, m_cBlue);
} // end of wxColour::Set
-
-//
-// Obsolete
-//
-#if WXWIN_COMPATIBILITY
-void wxColour::Get (
- unsigned char* pRed
-, unsigned char* pGreen
-, unsigned char* pBlue
-) const
-{
- *Red = m_cRed;
- *Green = m_cGreen;
- *Blue = m_cBlue;
-} // end of wxColour::Get
-#endif
-
// Item members
wxControl::wxControl()
{
-
-#if WXWIN_COMPATIBILITY
- m_callback = 0;
-#endif // WXWIN_COMPATIBILITY
} // end of wxControl::wxControl
bool wxControl::Create(
bool wxControl::ProcessCommand(wxCommandEvent& event)
{
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
-
return GetEventHandler()->ProcessEvent(event);
}
::WinSetPointerPos(HWND_DESKTOP, (LONG)nX, (LONG)(nY));
} // end of wxWindowOS2::WarpPointer
-#if WXWIN_COMPATIBILITY
-void wxWindowOS2::OS2DeviceToLogical (float *x, float *y) const
-{
-}
-#endif // WXWIN_COMPATIBILITY
// ---------------------------------------------------------------------------
// scrolling stuff
// ---------------------------------------------------------------------------
-#if WXWIN_COMPATIBILITY
-void wxWindowOS2::SetScrollRange(
- int nOrient
-, int nRange
-, bool bRefresh
-)
-{
- int nRange1 = nRange;
- int nPageSize = GetScrollPage(nOrient);
-
- if (nPpageSize > 1 && nRange > 0)
- {
- nRange1 += (nPageSize - 1);
- }
-
- if (nOrient == wxHORIZONTAL)
- {
- ::WinSendMsg(m_hWndScrollBarHorz, SBM_SETSCROLLBAR, (MPARAM)0, MPFROM2SHORT(0, (SHORT)nRange1));
- ::WinSendMsg(m_hWndScrollBarHorz, SBM_SETTHUMBSIZE, MPFROM2SHORT((SHORT)nThumbVisible, (SHORT)nRange1), (MPARAM)0);
- }
- else
- {
- ::WinSendMsg(m_hWndScrollBarVert, SBM_SETSCROLLBAR, (MPARAM)0, MPFROM2SHORT(0, (SHORT)nRange1));
- ::WinSendMsg(m_hWndScrollBarVert, SBM_SETTHUMBSIZE, MPFROM2SHORT((SHORT)nThumbVisible, (SHORT)nRange1), (MPARAM)0);
- }
-} // end of wxWindowOS2::SetScrollRange
-
-void wxWindowOS2::SetScrollPage(
- int nOrient
-, int nPage
-, bool bRefresh
-)
-{
- if (nOrient == wxHORIZONTAL )
- m_nXThumbSize = nPage;
- else
- m_nYThumbSize = nPage;
-} // end of wxWindowOS2::SetScrollPage
-
-int wxWindowOS2::OldGetScrollRange(
- int nOrient
-) const
-{
- MRESULT mRc;
- HWND hWnd = GetHwnd();
-
- if (hWnd)
- {
- mRc = WinSendMsg(hWnd, SBM_QUERYRANGE, (MPARAM)0L, (MPARAM)0L);
- return(SHORT2FROMMR(mRc));
- }
- return 0;
-} // end of wxWindowOS2::OldGetScrollRange
-
-int wxWindowOS2::GetScrollPage(
- int nOrient
-) const
-{
- if (nOrient == wxHORIZONTAL)
- return m_nXThumbSize;
- else
- return m_nYThumbSize;
-} // end of wxWindowOS2::GetScrollPage
-#endif // WXWIN_COMPATIBILITY
-
int wxWindowOS2::GetScrollPos(
int nOrient
) const
return dwStyle;
} // end of wxWindowOS2::Determine3DEffects
-#if WXWIN_COMPATIBILITY
-void wxWindowOS2::OnCommand(
- wxWindow& rWin
-, wxCommandEvent& rEvent
-)
-{
- if (GetEventHandler()->ProcessEvent(rEvent))
- return;
- if (m_parent)
- m_parent->GetEventHandler()->OnCommand( rWin
- ,rEvent
- );
-} // end of wxWindowOS2::OnCommand
-
-wxObject* wxWindowOS2::GetChild(
- int nNumber
-) const
-{
- //
- // Return a pointer to the Nth object in the Panel
- //
- wxNode* pNode = GetChildren().First();
- int n = nNumber;
-
- while (pNode && n--)
- pNode = pNode->Next();
- if (pNode)
- {
- wxObject* pObj = (wxObject*)pNode->Data();
- return(pObj);
- }
- else
- return NULL;
-} // end of wxWindowOS2::GetChild
-
-#endif // WXWIN_COMPATIBILITY
-
//
// Setup background and foreground colours correctly
//
return hWnd != NULL;
} // end of wxWindowOS2::IsMouseInWindow
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
-// ---------------------------------------------------------------------------
-// Caret manipulation
-// ---------------------------------------------------------------------------
-
-void wxWindowOS2::CreateCaret(
- int nWidth
-, int nHeight
-)
-{
- SetCaret(new wxCaret( this
- ,nWidth
- ,nHeight
- ));
-} // end of wxWindowOS2::CreateCaret
-
-void wxWindowOS2::CreateCaret(
- const wxBitmap* pBitmap
-)
-{
- wxFAIL_MSG("not implemented");
-} // end of wxWindowOS2::CreateCaret
-
-void wxWindowOS2::ShowCaret(
- bool bShow
-)
-{
- wxCHECK_RET( m_caret, "no caret to show" );
-
- m_caret->Show(bShow);
-} // end of wxWindowOS2::ShowCaret
-
-void wxWindowOS2::DestroyCaret()
-{
- SetCaret(NULL);
-} // end of wxWindowOS2::DestroyCaret
-
-void wxWindowOS2::SetCaretPos(
- int nX
-, int nY)
-{
- wxCHECK_RET( m_caret, "no caret to move" );
-
- m_caret->Move( nX
- ,nY
- );
-} // end of wxWindowOS2::SetCaretPos
-
-void wxWindowOS2::GetCaretPos(
- int* pX
-, int* pY
-) const
-{
- wxCHECK_RET( m_caret, "no caret to get position of" );
-
- m_caret->GetPosition( pX
- ,pY
- );
-} // end of wxWindowOS2::GetCaretPos
-
-#endif //wxUSE_CARET
// ---------------------------------------------------------------------------
// popup menu