Changes in behaviour which may result in compilation errors
-----------------------------------------------------------
+- WXWIN_COMPATIBILITY_2_4 doesn't exist any more, please update your code if
+ you still relied on features deprecated since version 2.4
+
Deprecated methods and their replacements
-----------------------------------------
// allows us to abstract the differences behind the common façade
wxAppTraits *GetTraits();
- // the functions below shouldn't be used now that we have wxAppTraits
-#if WXWIN_COMPATIBILITY_2_4
-
-#if wxUSE_LOG
- // override this function to create default log target of arbitrary
- // user-defined class (default implementation creates a wxLogGui
- // object) -- this log object is used by default by all wxLogXXX()
- // functions.
- wxDEPRECATED( virtual wxLog *CreateLogTarget() );
-#endif // wxUSE_LOG
-
- // similar to CreateLogTarget() but for the global wxMessageOutput
- // object
- wxDEPRECATED( virtual wxMessageOutput *CreateMessageOutput() );
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// event processing functions
// --------------------------
// options of the library and abort if it doesn't
static bool CheckBuildOptions(const char *optionsSignature,
const char *componentName);
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( static bool CheckBuildOptions(const wxBuildOptions& buildOptions) );
-#endif
// implementation only from now on
// -------------------------------
return Item(Count() - 1);
}
- // return a wxString[], useful for the controls which
- // take one in their ctor. You must delete[] it yourself
- // once you are done with it. Will return NULL if the
- // ArrayString was empty.
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( wxString* GetStringArray() const );
-#endif
// item management
// Search the element in the array, starting from the beginning if
// remove first item matching this value
void Remove(const wxChar *sz);
// remove item by index
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( void Remove(size_t nIndex, size_t nRemove = 1) );
-#endif
void RemoveAt(size_t nIndex, size_t nRemove = 1);
// sorting
#endif
// WXWIN_COMPATIBILITY macros affect presence of virtual functions
-#if WXWIN_COMPATIBILITY_2_4
- #define __WX_BO_WXWIN_COMPAT_2_4 ",compatible with 2.4"
-#else
- #define __WX_BO_WXWIN_COMPAT_2_4
-#endif
#if WXWIN_COMPATIBILITY_2_6
#define __WX_BO_WXWIN_COMPAT_2_6 ",compatible with 2.6"
#else
#define __WX_BO_WXWIN_COMPAT_2_6
#endif
+#if WXWIN_COMPATIBILITY_2_8
+ #define __WX_BO_WXWIN_COMPAT_2_8 ",compatible with 2.8"
+#else
+ #define __WX_BO_WXWIN_COMPAT_2_8
+#endif
// deriving wxWin containers from STL ones changes them completely:
#if wxUSE_STL
" (" __WX_BO_DEBUG "," __WX_BO_UNICODE \
__WX_BO_COMPILER \
__WX_BO_STL \
- __WX_BO_WXWIN_COMPAT_2_4 __WX_BO_WXWIN_COMPAT_2_6 \
+ __WX_BO_WXWIN_COMPAT_2_6 __WX_BO_WXWIN_COMPAT_2_8 \
")"
} gs_buildOptionsCheck;
-#if WXWIN_COMPATIBILITY_2_4
-
-// ----------------------------------------------------------------------------
-// wxBuildOptions
-// ----------------------------------------------------------------------------
-
-// NB: Don't use this class in new code, it relies on the ctor being always
-// inlined. WX_BUILD_OPTIONS_SIGNATURE always works.
-class wxBuildOptions
-{
-public:
- // the ctor must be inline to get the compilation settings of the code
- // which included this header
- wxBuildOptions() : m_signature(WX_BUILD_OPTIONS_SIGNATURE) {}
-
-private:
- const char *m_signature;
-
- // actually only CheckBuildOptions() should be our friend but well...
- friend class wxAppConsole;
-};
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
#endif // _WX_BUILD_H_
check consistency of the settings
*/
-#if WXWIN_COMPATIBILITY_2_4
-# if !WXWIN_COMPATIBILITY_2_6
+#if WXWIN_COMPATIBILITY_2_6
+# if !WXWIN_COMPATIBILITY_2_8
# ifdef wxABORT_ON_CONFIG_ERROR
-# error "2.4.X compatibility requires 2.6.X compatibility"
+# error "2.6.X compatibility requires 2.8.X compatibility"
# else
-# undef WXWIN_COMPATIBILITY_2_6
-# define WXWIN_COMPATIBILITY_2_6 1
+# undef WXWIN_COMPATIBILITY_2_8
+# define WXWIN_COMPATIBILITY_2_8 1
# endif
# endif
-#endif /* WXWIN_COMPATIBILITY_2_4 */
+#endif /* WXWIN_COMPATIBILITY_2_6 */
#if wxUSE_ARCHIVE_STREAMS
# if !wxUSE_DATETIME
void SetPrivData( char *privData, int len );
-#if WXWIN_COMPATIBILITY_2_4
- // PostScript-specific data
- wxString GetPrinterCommand() const;
- wxString GetPrinterOptions() const;
- wxString GetPreviewCommand() const;
- wxString GetFontMetricPath() const;
- double GetPrinterScaleX() const;
- double GetPrinterScaleY() const;
- long GetPrinterTranslateX() const;
- long GetPrinterTranslateY() const;
-
- void SetPrinterCommand(const wxString& command);
- void SetPrinterOptions(const wxString& options);
- void SetPreviewCommand(const wxString& command);
- void SetFontMetricPath(const wxString& path);
- void SetPrinterScaleX(double x);
- void SetPrinterScaleY(double y);
- void SetPrinterScaling(double x, double y);
- void SetPrinterTranslateX(long x);
- void SetPrinterTranslateY(long y);
- void SetPrinterTranslation(long x, long y);
-#endif
-
// Convert between wxPrintData and native data
void ConvertToNative();
void ConvertFromNative();
bool GetSelection() const { return m_printSelection; };
bool GetCollate() const { return m_printCollate; };
bool GetPrintToFile() const { return m_printToFile; };
-#if WXWIN_COMPATIBILITY_2_4
- bool GetSetupDialog() const { return m_printSetupDialog; };
-#endif
+
void SetFromPage(int v) { m_printFromPage = v; };
void SetToPage(int v) { m_printToPage = v; };
void SetMinPage(int v) { m_printMinPage = v; };
void SetSelection(bool flag) { m_printSelection = flag; };
void SetCollate(bool flag) { m_printCollate = flag; };
void SetPrintToFile(bool flag) { m_printToFile = flag; };
-#if WXWIN_COMPATIBILITY_2_4
- void SetSetupDialog(bool flag) { m_printSetupDialog = flag; };
-#endif
+
void EnablePrintToFile(bool flag) { m_printEnablePrintToFile = flag; };
void EnableSelection(bool flag) { m_printEnableSelection = flag; };
void EnablePageNumbers(bool flag) { m_printEnablePageNumbers = flag; };
bool m_printEnablePageNumbers;
bool m_printEnableHelp;
bool m_printEnablePrintToFile;
-#if WXWIN_COMPATIBILITY_2_4
- bool m_printSetupDialog;
-#endif
wxPrintData m_printData;
private:
const wxString &qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
const wxString &tblPath=wxEmptyString);
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED(
- wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
- const wxChar *qryTblName, bool qryOnly,
- const wxString &tblPath)
- );
-#endif // WXWIN_COMPATIBILITY_2_4
-
virtual ~wxDbTable();
bool Open(bool checkPrivileges=false, bool checkTableExists=true);
virtual int GetLogicalFunction() const { return m_logicalFunction; }
virtual void SetLogicalFunction(int function) = 0;
-#if WXWIN_COMPATIBILITY_2_4
- virtual void SetOptimization(bool WXUNUSED(opt)) { }
- virtual bool GetOptimization() { return false; }
-#endif
-
// bounding box
// ------------
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) = 0;
-#if WXWIN_COMPATIBILITY_2_4
- // this was only for confusing people, use DoGetClippingBox only
- virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
- wxCoord *w, wxCoord *h)
- { DoGetClippingBox(x, y, w, h); }
-#endif
-
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const
{
m_propagationLevel = propagationLevel;
}
-#if WXWIN_COMPATIBILITY_2_4
-public:
-#else
protected:
-#endif
wxObject* m_eventObject;
wxEventType m_eventType;
long m_timeStamp;
// backwards compatibility as it is new
int m_propagationLevel;
-#if WXWIN_COMPATIBILITY_2_4
-public:
-#else
protected:
-#endif
bool m_skipped;
bool m_isCommandEvent;
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
*/
-#if WXWIN_COMPATIBILITY_2_4
-// Backwards compatibility for wxCommandEvent::m_commandString, will lead to compilation errors in some cases of usage
-class WXDLLIMPEXP_CORE wxCommandEvent;
-
-class WXDLLIMPEXP_CORE wxCommandEventStringHelper
-{
-public:
- wxCommandEventStringHelper(wxCommandEvent * evt)
- : m_evt(evt)
- { }
-
- void operator=(const wxString &str);
- operator wxString();
- const wxChar* c_str() const;
-
-private:
- wxCommandEvent* m_evt;
-};
-#endif
-
class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent
{
public:
wxCommandEvent(const wxCommandEvent& event)
: wxEvent(event),
-#if WXWIN_COMPATIBILITY_2_4
- m_commandString(this),
-#endif
m_cmdString(event.m_cmdString),
m_commandInt(event.m_commandInt),
m_extraLong(event.m_extraLong),
virtual wxEvent *Clone() const { return new wxCommandEvent(*this); }
-#if WXWIN_COMPATIBILITY_2_4
-public:
- wxCommandEventStringHelper m_commandString;
-#else
protected:
-#endif
wxString m_cmdString; // String event argument
int m_commandInt;
long m_extraLong; // Additional information (e.g. select/deselect)
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent)
};
-#if WXWIN_COMPATIBILITY_2_4
-inline void wxCommandEventStringHelper::operator=(const wxString &str)
-{
- m_evt->SetString(str);
-}
-
-inline wxCommandEventStringHelper::operator wxString()
-{
- return m_evt->GetString();
-}
-
-inline const wxChar* wxCommandEventStringHelper::c_str() const
-{
- return m_evt->GetString().c_str();
-}
-#endif
-
// this class adds a possibility to react (from the user) code to a control
// notification: allow or veto the operation being reported.
class WXDLLIMPEXP_CORE wxNotifyEvent : public wxCommandEvent
virtual wxEvent *Clone() const { return new wxScrollWinEvent(*this); }
-#if WXWIN_COMPATIBILITY_2_4
-public:
-#else
protected:
-#endif
int m_commandInt;
long m_extraLong;
virtual wxEvent *Clone() const { return new wxMoveEvent(*this); }
-#if WXWIN_COMPATIBILITY_2_4
-public:
-#else
protected:
-#endif
wxPoint m_pos;
wxRect m_rect;
virtual wxEvent *Clone() const { return new wxEraseEvent(*this); }
-#if WXWIN_COMPATIBILITY_2_4
-public:
-#else
protected:
-#endif
wxDC *m_dc;
private:
class WXDLLIMPEXP_CORE wxJoystickEvent : public wxEvent
{
-#if WXWIN_COMPATIBILITY_2_4
-public:
-#else
protected:
-#endif
wxPoint m_pos;
int m_zPosition;
int m_buttonChange; // Which button changed?
typedef void (wxEvtHandler::*wxMouseCaptureLostEventFunction)(wxMouseCaptureLostEvent&);
typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&);
-// these typedefs don't have the same name structure as the others, keep for
-// backwards compatibility only
-#if WXWIN_COMPATIBILITY_2_4
- typedef wxSysColourChangedEventFunction wxSysColourChangedFunction;
- typedef wxDisplayChangedEventFunction wxDisplayChangedFunction;
-#endif // WXWIN_COMPATIBILITY_2_4
-
#define wxCommandEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func)
#define EVT_JOY_MOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_MOVE, wxJoystickEventHandler(func))
#define EVT_JOY_ZMOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_ZMOVE, wxJoystickEventHandler(func))
-// These are obsolete, see _BUTTON_ events
-#if WXWIN_COMPATIBILITY_2_4
- #define EVT_JOY_DOWN(func) EVT_JOY_BUTTON_DOWN(func)
- #define EVT_JOY_UP(func) EVT_JOY_BUTTON_UP(func)
-#endif // WXWIN_COMPATIBILITY_2_4
-
// All joystick events
#define EVT_JOYSTICK_EVENTS(func) \
EVT_JOY_BUTTON_DOWN(func) \
wxOPEN = wxFD_OPEN,
wxSAVE = wxFD_SAVE,
wxOVERWRITE_PROMPT = wxFD_OVERWRITE_PROMPT,
-#if WXWIN_COMPATIBILITY_2_4
- wxHIDE_READONLY = 0x0008,
-#endif
wxFILE_MUST_EXIST = wxFD_FILE_MUST_EXIST,
wxMULTIPLE = wxFD_MULTIPLE,
wxCHANGE_DIR = wxFD_CHANGE_DIR
// Utility functions
-#if WXWIN_COMPATIBILITY_2_4
- // Parses the wildCard, returning the number of filters.
- // Returns 0 if none or if there's a problem,
- // The arrays will contain an equal number of items found before the error.
- // wildCard is in the form:
- // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
- wxDEPRECATED( static int ParseWildcard(const wxString& wildCard,
- wxArrayString& descriptions,
- wxArrayString& filters) );
-#endif // WXWIN_COMPATIBILITY_2_4
-
#if WXWIN_COMPATIBILITY_2_6
wxDEPRECATED( long GetStyle() const );
// Helper
virtual void SetupSections();
-#if WXWIN_COMPATIBILITY_2_4
- // Parse the filter into an array of filters and an array of descriptions
- virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions);
-#endif // WXWIN_COMPATIBILITY_2_4
-
// Find the child that matches the first part of 'path'.
// E.g. if a child path is "/usr" and 'path' is "/usr/include"
// then the child for /usr is returned.
virtual ~wxTabView();
inline int GetNumberOfLayers() const { return m_layers.GetCount(); }
-#if WXWIN_COMPATIBILITY_2_4
- inline wxList& GetLayers() { return *(wxList *)&m_layers; }
-#else
inline wxTabLayerList& GetLayers() { return m_layers; }
-#endif
inline void SetWindow(wxWindow* wnd) { m_window = wnd; }
inline wxWindow* GetWindow(void) const { return m_window; }
void Edit( const wxTreeItemId& item ) { EditLabel(item); }
#endif // WXWIN_COMPATIBILITY_2_6
-#if WXWIN_COMPATIBILITY_2_4
- // deprecated functions: use Set/GetItemImage directly
- wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
- wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
-
- // use the versions taking wxTreeItemIdValue cookies (note that
- // GetNextChild() is not inside wxDEPRECATED on purpose, as otherwise we
- // get twice as many warnings without any added benefit: it is always used
- // with GetFirstChild() anyhow)
- wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item,
- long& cookie) const );
- wxTreeItemId GetNextChild(const wxTreeItemId& item,
- long& cookie) const;
-#endif // WXWIN_COMPATIBILITY_2_4
-
// implementation only from now on
// overridden base class virtuals
#include "wx/defs.h"
-#if !wxUSE_STL && WXWIN_COMPATIBILITY_2_4
- #define wxUSE_OLD_HASH_TABLE 1
-#else
- #define wxUSE_OLD_HASH_TABLE 0
-#endif
+#define wxUSE_OLD_HASH_TABLE 0
#if !wxUSE_STL
#include "wx/object.h"
#if wxUSE_OLD_HASH_TABLE
#include "wx/list.h"
#endif
-#if WXWIN_COMPATIBILITY_2_4
- #include "wx/dynarray.h"
-#endif
// the default size of the hash
#define wxHASH_SIZE_DEFAULT (1000)
#endif // wxUSE_OLD_HASH_TABLE
-#if !wxUSE_STL
-
-#if WXWIN_COMPATIBILITY_2_4
-
-// ----------------------------------------------------------------------------
-// a hash table which stores longs
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE wxHashTableLong : public wxObject
-{
-public:
- wxHashTableLong(size_t size = wxHASH_SIZE_DEFAULT)
- { Init(size); }
- virtual ~wxHashTableLong();
-
- void Create(size_t size = wxHASH_SIZE_DEFAULT);
- void Destroy();
-
- size_t GetSize() const { return m_hashSize; }
- size_t GetCount() const { return m_count; }
-
- void Put(long key, long value);
- long Get(long key) const;
- long Delete(long key);
-
-protected:
- void Init(size_t size);
-
-private:
- wxArrayLong **m_values,
- **m_keys;
-
- // the size of array above
- size_t m_hashSize;
-
- // the total number of elements in the hash
- size_t m_count;
-
- // not implemented yet
- DECLARE_NO_COPY_CLASS(wxHashTableLong)
-};
-
-// ----------------------------------------------------------------------------
-// wxStringHashTable: a hash table which indexes strings with longs
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE wxStringHashTable : public wxObject
-{
-public:
- wxStringHashTable(size_t sizeTable = wxHASH_SIZE_DEFAULT);
- virtual ~wxStringHashTable();
-
- // add a string associated with this key to the table
- void Put(long key, const wxString& value);
-
- // get the string from the key: if not found, an empty string is returned
- // and the wasFound is set to false if not NULL
- wxString Get(long key, bool *wasFound = NULL) const;
-
- // remove the item, returning true if the item was found and deleted
- bool Delete(long key) const;
-
- // clean up
- void Destroy();
-
-private:
- wxArrayLong **m_keys;
- wxArrayString **m_values;
-
- // the size of array above
- size_t m_hashSize;
-
- DECLARE_NO_COPY_CLASS(wxStringHashTable)
-};
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
-#endif // !wxUSE_STL
-
// ----------------------------------------------------------------------------
// for compatibility only
// ----------------------------------------------------------------------------
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxHtmlHelpDataItem, wxHtmlHelpDataItems,
WXDLLIMPEXP_HTML);
-#if WXWIN_COMPATIBILITY_2_4
-// old interface to contents and index:
-struct wxHtmlContentsItem
-{
- wxHtmlContentsItem();
- wxHtmlContentsItem(const wxHtmlHelpDataItem& d);
- wxHtmlContentsItem& operator=(const wxHtmlContentsItem& d);
- ~wxHtmlContentsItem();
-
- int m_Level;
- int m_ID;
- wxChar *m_Name;
- wxChar *m_Page;
- wxHtmlBookRecord *m_Book;
-
- // returns full filename of m_Page, i.e. with book's basePath prepended
- wxString GetFullPath() const { return m_Book->GetFullPath(m_Page); }
-
-private:
- bool m_autofree;
-};
-#endif
-
//------------------------------------------------------------------------------
// wxHtmlSearchEngine
const wxString& GetName() { return m_Name; }
const wxHtmlHelpDataItem *GetCurItem() const { return m_CurItem; }
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( wxHtmlContentsItem* GetContentsItem() );
-#endif
private:
wxHtmlHelpData* m_Data;
const wxHtmlHelpDataItems& GetContentsArray() const { return m_contents; }
const wxHtmlHelpDataItems& GetIndexArray() const { return m_index; }
-#if WXWIN_COMPATIBILITY_2_4
- // deprecated interface, new interface is arrays-based (see above)
- wxDEPRECATED( wxHtmlContentsItem* GetContents() );
- wxDEPRECATED( int GetContentsCnt() );
- wxDEPRECATED( wxHtmlContentsItem* GetIndex() );
- wxDEPRECATED( int GetIndexCnt() );
-#endif
-
protected:
wxString m_tempPath;
wxHtmlHelpDataItems m_contents; // list of all available books and pages
wxHtmlHelpDataItems m_index; // list of index itesm
-#if WXWIN_COMPATIBILITY_2_4
- // deprecated data structures, set only if GetContents(), GetIndex()
- // called
- wxHtmlContentsItem* m_cacheContents;
- wxHtmlContentsItem* m_cacheIndex;
-private:
- void CleanCompatibilityData();
-#endif
-
protected:
// Imports .hhp files (MS HTML Help Workshop)
bool LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
const wxMouseEvent& event);
virtual wxHtmlCell* GetFirstChild() const { return m_Cells; }
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( wxHtmlCell* GetFirstCell() const );
-#endif
+
// returns last child cell:
wxHtmlCell* GetLastChild() const { return m_LastCell; }
DECLARE_NO_COPY_CLASS(wxHtmlContainerCell)
};
-#if WXWIN_COMPATIBILITY_2_4
-inline wxHtmlCell* wxHtmlContainerCell::GetFirstCell() const
- { return GetFirstChild(); }
-#endif
-
-
// ---------------------------------------------------------------------------
#define wxIMAGE_OPTION_CUR_HOTSPOT_X wxT("HotSpotX")
#define wxIMAGE_OPTION_CUR_HOTSPOT_Y wxT("HotSpotY")
-#if WXWIN_COMPATIBILITY_2_4
- // Do not use these macros, they are deprecated
- #define wxBMP_FORMAT wxIMAGE_OPTION_BMP_FORMAT
- #define wxCUR_HOTSPOT_X wxIMAGE_OPTION_CUR_HOTSPOT_X
- #define wxCUR_HOTSPOT_Y wxIMAGE_OPTION_CUR_HOTSPOT_Y
-#endif
-
enum
{
#else // if !wxUSE_STL
-// due to circular header dependencies this function has to be declared here
-// (normally it's found in utils.h which includes itself list.h...)
-#if WXWIN_COMPATIBILITY_2_4
-extern WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s);
-#endif
// undef it to get rid of old, deprecated functions
#define wxLIST_COMPATIBILITY
DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT, 703)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM, 704)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, 705)
-#if WXWIN_COMPATIBILITY_2_4
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_GET_INFO, 706)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_SET_INFO, 707)
-#endif
+
DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED, 708)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED, 709)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN, 710)
#define EVT_LIST_CACHE_HINT(id, fn) wx__DECLARE_LISTEVT(CACHE_HINT, id, fn)
-#if WXWIN_COMPATIBILITY_2_4
-#define EVT_LIST_GET_INFO(id, fn) wx__DECLARE_LISTEVT(GET_INFO, id, fn)
-#define EVT_LIST_SET_INFO(id, fn) wx__DECLARE_LISTEVT(SET_INFO, id, fn)
-#endif
-
#endif
// _WX_LISTCTRL_H_BASE_
virtual bool OnExceptionInMainLoop();
#endif // wxUSE_EXCEPTIONS
- // deprecated functions, use wxEventLoop directly instead
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( void DoMessage(WXMSG *pMsg) );
- wxDEPRECATED( bool DoMessage() );
- wxDEPRECATED( bool ProcessMessage(WXMSG* pMsg) );
-#endif // WXWIN_COMPATIBILITY_2_4
-
protected:
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
bool HasAlpha() const;
void UseAlpha();
-#if WXWIN_COMPATIBILITY_2_4
- // these functions do nothing and are only there for backwards
- // compatibility
- wxDEPRECATED( int GetQuality() const );
- wxDEPRECATED( void SetQuality(int quality) );
-#endif // WXWIN_COMPATIBILITY_2_4
-
// implementation only from now on
// -------------------------------
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 2.4 API: set it to 1 to
-// enable it but please consider updating your code instead.
-//
-// Default is 0
-//
-// Recommended setting: 0 (please update your code)
-#define WXWIN_COMPATIBILITY_2_4 0
-
// This setting determines the compatibility with 2.6 API: set it to 0 to
// flag all cases of using deprecated functions.
//
bool RemoveIcon(void);
bool PopupMenu(wxMenu *menu); //, int x, int y);
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( bool IsOK() const );
-
-// Overridables
- virtual void OnMouseMove(wxEvent&);
- virtual void OnLButtonDown(wxEvent&);
- virtual void OnLButtonUp(wxEvent&);
- virtual void OnRButtonDown(wxEvent&);
- virtual void OnRButtonUp(wxEvent&);
- virtual void OnLButtonDClick(wxEvent&);
- virtual void OnRButtonDClick(wxEvent&);
-#endif
-
// Implementation
protected:
friend class wxTaskBarIconWindow;
wxIcon m_icon;
wxString m_strTooltip;
-#if WXWIN_COMPATIBILITY_2_4
- // non-virtual default event handlers to forward events to the virtuals
- void _OnMouseMove(wxTaskBarIconEvent&);
- void _OnLButtonDown(wxTaskBarIconEvent&);
- void _OnLButtonUp(wxTaskBarIconEvent&);
- void _OnRButtonDown(wxTaskBarIconEvent&);
- void _OnRButtonUp(wxTaskBarIconEvent&);
- void _OnLButtonDClick(wxTaskBarIconEvent&);
- void _OnRButtonDClick(wxTaskBarIconEvent&);
-
- DECLARE_EVENT_TABLE()
-#endif
};
-#if WXWIN_COMPATIBILITY_2_4
-inline bool wxTaskBarIcon::IsOK() const { return IsOk(); }
-#endif
-
#endif
// _TASKBAR_H_
wxRect& rect,
bool textOnly = false) const;
- // deprecated
- // ----------
-
-#if WXWIN_COMPATIBILITY_2_4
- // these methods are deprecated and will be removed in future versions of
- // wxWidgets, they're here for compatibility only, don't use them in new
- // code (the comments indicate why these methods are now useless and how to
- // replace them)
-
- // use Expand, Collapse, CollapseAndReset or Toggle
- wxDEPRECATED( void ExpandItem(const wxTreeItemId& item, int action) );
-
- // use Set/GetImageList and Set/GetStateImageList
- // Use base class GetImageList()
- wxDEPRECATED( void SetImageList(wxImageList *imageList, int) );
-
- // use Set/GetItemImage directly
- wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
- wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
-
- // use the versions taking wxTreeItemIdValue cookies
- wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item,
- long& cookie) const );
- wxDEPRECATED( wxTreeItemId GetNextChild(const wxTreeItemId& item,
- long& cookie) const );
-#endif // WXWIN_COMPATIBILITY_2_4
-
-
// implementation
// --------------
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 2.4 API: set it to 1 to
-// enable it but please consider updating your code instead.
-//
-// Default is 0
-//
-// Recommended setting: 0 (please update your code)
-#define WXWIN_COMPATIBILITY_2_4 0
-
// This setting determines the compatibility with 2.6 API: set it to 0 to
// flag all cases of using deprecated functions.
//
// constants
// ---------------------------------------------------------------------------
-#if WXWIN_COMPATIBILITY_2_4
-// they're unused by wxWidgets...
-enum
-{
- wxKEY_SHIFT = 1,
- wxKEY_CTRL = 2
-};
-#endif
-
// ---------------------------------------------------------------------------
// wxWindow declaration for MSW
// ---------------------------------------------------------------------------
// Accept files for dragging
virtual void DragAcceptFiles(bool accept);
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( bool GetUseCtl3D() const );
- wxDEPRECATED( bool GetTransparentBackground() const );
- wxDEPRECATED( void SetTransparent(bool t = true) );
-#endif // WXWIN_COMPATIBILITY_2_4
-
#ifndef __WXUNIVERSAL__
// Native resource loading (implemented in src/msw/nativdlg.cpp)
// FIXME: should they really be all virtual?
// inline functions
// ----------------------------------------------------------------------------
-#if WXWIN_COMPATIBILITY_2_4
-
-inline bool wxWindowMSW::GetUseCtl3D() const { return false; }
-inline bool wxWindowMSW::GetTransparentBackground() const { return false; }
-inline void wxWindowMSW::SetTransparent(bool WXUNUSED(t)) { }
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
#include "wx/hash.h"
// pseudo-template HWND <-> wxWindow hash table
-#if WXWIN_COMPATIBILITY_2_4
-WX_DECLARE_HASH(wxWindow, wxWindowList, wxWinHashTable);
-#else
WX_DECLARE_HASH(wxWindowMSW, wxWindowList, wxWinHashTable);
-#endif
extern wxWinHashTable *wxWinHandleHash;
extern WXDLLEXPORT_DATA(const wxChar) wxNotebookNameStr[];
-#if WXWIN_COMPATIBILITY_2_4
- #define wxNOTEBOOK_NAME wxNotebookNameStr
-#endif
-
// ----------------------------------------------------------------------------
// wxNotebookBase: define wxNotebook interface
// ----------------------------------------------------------------------------
( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) );
}
-#if WXWIN_COMPATIBILITY_2_4
- // Initializes parent pointers and hash table for fast searching.
- wxDEPRECATED( static void InitializeClasses() );
- // Cleans up hash table used for fast searching.
- wxDEPRECATED( static void CleanUpClasses() );
-#endif
-
public:
const wxChar *m_className;
int m_objectSize;
WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name);
-#if WXWIN_COMPATIBILITY_2_4
-inline void wxClassInfo::InitializeClasses() {}
-inline void wxClassInfo::CleanUpClasses() {}
-#endif
-
// ----------------------------------------------------------------------------
// Dynamic class macros
// ----------------------------------------------------------------------------
#include "wx/os2/palette.h"
#endif
-#if WXWIN_COMPATIBILITY_2_4
- #define wxColorMap wxPalette
- #define wxColourMap wxPalette
-#endif
-
#endif // wxUSE_PALETTE
#endif
}
- // deprecated functions
- // --------------------
-
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( int GetNumberOfRowsOrCols() const );
- wxDEPRECATED( void SetNumberOfRowsOrCols(int n) );
-#endif // WXWIN_COMPATIBILITY_2_4
-
protected:
wxRadioBoxBase()
{
// Value
static wxSystemScreenType ms_screen;
-#if WXWIN_COMPATIBILITY_2_4
- // the backwards compatible versions of wxSystemSettingsNative functions,
- // don't use these methods in the new code!
- wxDEPRECATED(static wxColour GetSystemColour(int index));
- wxDEPRECATED(static wxFont GetSystemFont(int index));
- wxDEPRECATED(static int GetSystemMetric(int index));
-#endif
};
#endif
// compatibility settings
// ----------------------------------------------------------------------------
-// This setting determines the compatibility with 2.4 API: set it to 1 to
-// enable it but please consider updating your code instead.
-//
-// Default is 0
-//
-// Recommended setting: 0 (please update your code)
-#define WXWIN_COMPATIBILITY_2_4 0
-
// This setting determines the compatibility with 2.6 API: set it to 0 to
// flag all cases of using deprecated functions.
//
#endif // wxUSE_BUTTON
-#if WXWIN_COMPATIBILITY_2_4
-// NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
-// don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
-
-// ----------------------------------------------------------------------------
-// wxBookCtrlSizer
-// ----------------------------------------------------------------------------
-
-#if wxUSE_BOOKCTRL
-
-// this sizer works with wxNotebook/wxListbook/... and sizes the control to
-// fit its pages
-class WXDLLEXPORT wxBookCtrlBase;
-
-class WXDLLEXPORT wxBookCtrlSizer : public wxSizer
-{
-public:
-#if WXWIN_COMPATIBILITY_2_6
- wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase *bookctrl) );
-#endif // WXWIN_COMPATIBILITY_2_6
-
- wxBookCtrlBase *GetControl() const { return m_bookctrl; }
-
- virtual void RecalcSizes();
- virtual wxSize CalcMin();
-
-protected:
- // this protected ctor lets us mark the real one above as deprecated
- // and still have warning-free build of the library itself:
- wxBookCtrlSizer() {}
-
- wxBookCtrlBase *m_bookctrl;
-
-private:
- DECLARE_CLASS(wxBookCtrlSizer)
- DECLARE_NO_COPY_CLASS(wxBookCtrlSizer)
-};
-
-
-#if wxUSE_NOTEBOOK
-
-// before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
-// compatibility
-class WXDLLEXPORT wxNotebook;
-
-class WXDLLEXPORT wxNotebookSizer : public wxBookCtrlSizer
-{
-public:
-#if WXWIN_COMPATIBILITY_2_6
- wxDEPRECATED( wxNotebookSizer(wxNotebook *nb) );
-#endif // WXWIN_COMPATIBILITY_2_6
-
- wxNotebook *GetNotebook() const { return (wxNotebook *)m_bookctrl; }
-
-private:
- DECLARE_CLASS(wxNotebookSizer)
- DECLARE_NO_COPY_CLASS(wxNotebookSizer)
-};
-
-#endif // wxUSE_NOTEBOOK
-
-#endif // wxUSE_BOOKCTRL
-
-#endif // WXWIN_COMPATIBILITY_2_4
// ----------------------------------------------------------------------------
// inline functions implementation
#include "wx/univ/slider.h"
#elif defined(__WXMSW__)
#include "wx/msw/slider95.h"
- #if WXWIN_COMPATIBILITY_2_4
- #define wxSlider95 wxSlider
- #endif
#elif defined(__WXMOTIF__)
#include "wx/motif/slider.h"
#elif defined(__WXGTK20__)
_T("sound can only be looped asynchronously") );
return DoPlay(flags);
}
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( bool Play(bool async, bool looped = false) const );
-#endif
// Plays sound from filename:
static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC);
return snd.IsOk() ? snd.Play(flags) : false;
}
-#if WXWIN_COMPATIBILITY_2_4
-inline bool wxSoundBase::Play(bool async, bool looped) const
-{
- unsigned flags = 0;
- if (async) flags |= wxSOUND_ASYNC;
- if (looped) flags |= wxSOUND_LOOP | wxSOUND_ASYNC;
- return DoPlay(flags);
-}
-#endif
-
#endif // wxUSE_SOUND
#endif // _WX_SOUND_H_BASE_
wxString WXDLLIMPEXP_BASE operator+(const wxChar *psz, const wxString& string);
-// define wxArrayString, for compatibility
-#if WXWIN_COMPATIBILITY_2_4 && !wxUSE_STL
- #include "wx/arrstr.h"
-#endif
-
#if wxUSE_STL
// return an empty wxString (not very useful with wxUSE_STL == 1)
inline const wxString wxGetEmptyString() { return wxString(); }
#define wxHAS_TEXT_WINDOW_STREAM 0
#endif
-#if WXWIN_COMPATIBILITY_2_4 && !wxHAS_TEXT_WINDOW_STREAM
- // define old flag if one could use it somewhere
- #define NO_TEXT_WINDOW_STREAM
-#endif
-
class WXDLLEXPORT wxTextCtrl;
class WXDLLEXPORT wxTextCtrlBase;
#include "wx/generic/textdlgg.h"
-#if WXWIN_COMPATIBILITY_2_4
- // for wxGetNumberFromUser()
- #include "wx/numdlg.h"
-#endif // WXWIN_COMPATIBILITY_2_4
-
#endif // _WX_TEXTDLG_H_BASE_
// invalidate the item
void Unset() { m_pItem = 0; }
-#if WXWIN_COMPATIBILITY_2_4
- // deprecated: only for compatibility, don't work on 64 bit archs
- wxTreeItemId(long item) { m_pItem = wxUIntToPtr(item); }
- operator long() const { return (long)wxPtrToUInt(m_pItem); }
-#else // !WXWIN_COMPATIBILITY_2_4
operator bool() const { return IsOk(); }
-#endif // WXWIN_COMPATIBILITY_2_4/!WXWIN_COMPATIBILITY_2_4
wxTreeItemIdValue m_pItem;
};
void SetProxy(const wxString& url_proxy);
#endif // wxUSE_PROTOCOL_HTTP
-#if WXWIN_COMPATIBILITY_2_4
- //Use the proper wxURI accessors instead
- wxDEPRECATED( wxString GetProtocolName() const );
- wxDEPRECATED( wxString GetHostName() const );
- wxDEPRECATED( wxString GetPath() const );
-
- //Use wxURI instead - this does not work that well
- wxDEPRECATED( static wxString ConvertToValidURI(
- const wxString& uri,
- const wxChar* delims = wxT(";/?:@&=+$,")
- ) );
-
- //Use wxURI::Unescape instead
- wxDEPRECATED( static wxString ConvertFromURI(const wxString& uri) );
-#endif
-
protected:
static wxProtoInfo *ms_protocols;
// String functions (deprecated, use wxString)
// ----------------------------------------------------------------------------
-// Make a copy of this string using 'new'
-#if WXWIN_COMPATIBILITY_2_4
-wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s) );
-#endif
-
// A shorter way of using strcmp
#define wxStringEq(s1, s2) (s1 && s2 && (wxStrcmp(s1, s2) == 0))
// Various conversions
// ----------------------------------------------------------------------------
-// these functions are deprecated, use wxString methods instead!
-#if WXWIN_COMPATIBILITY_2_4
-
-extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxFloatToStringStr;
-extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxDoubleToStringStr;
-
-wxDEPRECATED( WXDLLIMPEXP_BASE void StringToFloat(const wxChar *s, float *number) );
-wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* FloatToString(float number, const wxChar *fmt = wxFloatToStringStr) );
-wxDEPRECATED( WXDLLIMPEXP_BASE void StringToDouble(const wxChar *s, double *number) );
-wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* DoubleToString(double number, const wxChar *fmt = wxDoubleToStringStr) );
-wxDEPRECATED( WXDLLIMPEXP_BASE void StringToInt(const wxChar *s, int *number) );
-wxDEPRECATED( WXDLLIMPEXP_BASE void StringToLong(const wxChar *s, long *number) );
-wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* IntToString(int number) );
-wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* LongToString(long number) );
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// Convert 2-digit hex number to decimal
WXDLLIMPEXP_BASE int wxHexToDec(const wxString& buf);
inline long GetStyle() const { return m_validatorStyle; }
inline void SetStyle(long style) { m_validatorStyle = style; }
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( void SetIncludeList(const wxStringList& list) );
- wxDEPRECATED( wxStringList& GetIncludeList() );
-
- wxDEPRECATED( void SetExcludeList(const wxStringList& list) );
- wxDEPRECATED( wxStringList& GetExcludeList() );
-
- wxDEPRECATED( bool IsInCharIncludeList(const wxString& val) );
- wxDEPRECATED( bool IsNotInCharExcludeList(const wxString& val) );
-#endif
void SetIncludes(const wxArrayString& includes) { m_includes = includes; }
inline wxArrayString& GetIncludes() { return m_includes; }
protected:
long m_validatorStyle;
wxString * m_stringValue;
-#if WXWIN_COMPATIBILITY_2_4
- wxStringList m_includeList;
- wxStringList m_excludeList;
-#endif
wxArrayString m_includes;
wxArrayString m_excludes;
wxObject* GetWxObjectPtr() const;
-#if WXWIN_COMPATIBILITY_2_4
- wxDEPRECATED( wxVariant(const wxStringList& val, const wxString& name = wxEmptyString) );
- wxDEPRECATED( bool operator== (const wxStringList& value) const );
- wxDEPRECATED( bool operator!= (const wxStringList& value) const );
- wxDEPRECATED( void operator= (const wxStringList& value) );
- wxDEPRECATED( wxStringList& GetStringList() const );
-#endif
-
// ------------------------------
// list operations
// ------------------------------
Backward compatibility macros. Do *NOT* use, they may disappear in future
versions of the XRC library!
------------------------------------------------------------------------- */
-#if WXWIN_COMPATIBILITY_2_4
- #define ADD_STYLE XRC_ADD_STYLE
- #define wxTheXmlResource wxXmlResource::Get()
- #define XMLID XRCID
- #define XMLCTRL XRCCTRL
- #define GetXMLID GetXRCID
-#endif
#endif // wxUSE_XRC
// gets the streaming callback from this class or any superclass
wxObjectStreamingCallback GetStreamingCallback() const ;
-#if WXWIN_COMPATIBILITY_2_4
- // Initializes parent pointers and hash table for fast searching.
- wxDEPRECATED( static void InitializeClasses() );
- // Cleans up hash table used for fast searching.
- wxDEPRECATED( static void CleanUpClasses() );
-#endif
static void CleanUp();
// returns the first property
// Flags
enum {
-#if WXWIN_COMPATIBILITY_2_4
- wxZLIB_24COMPATIBLE = 4, // read v2.4.x data without error
-#endif
wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
wxZLIB_ZLIB = 1, // zlib header and checksum
wxZLIB_GZIP = 2, // gzip header and checksum, requires zlib 1.2.1+
unsigned char *m_z_buffer;
struct z_stream_s *m_inflate;
wxFileOffset m_pos;
-#if WXWIN_COMPATIBILITY_2_4
- bool m_24compatibilty;
-#endif
DECLARE_NO_COPY_CLASS(wxZlibInputStream)
};
return m_traits;
}
-// we must implement CreateXXX() in wxApp itself for backwards compatibility
-#if WXWIN_COMPATIBILITY_2_4
-
-#if wxUSE_LOG
-
-wxLog *wxAppConsole::CreateLogTarget()
-{
- wxAppTraits *traits = GetTraits();
- return traits ? traits->CreateLogTarget() : NULL;
-}
-
-#endif // wxUSE_LOG
-
-wxMessageOutput *wxAppConsole::CreateMessageOutput()
-{
- wxAppTraits *traits = GetTraits();
- return traits ? traits->CreateMessageOutput() : NULL;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// ----------------------------------------------------------------------------
// event processing
// ----------------------------------------------------------------------------
#endif // __WXDEBUG__
-#if WXWIN_COMPATIBILITY_2_4
-
-bool wxAppConsole::CheckBuildOptions(const wxBuildOptions& buildOptions)
-{
- return CheckBuildOptions(buildOptions.m_signature, "your program");
-}
-
-#endif
-
// ============================================================================
// other classes implementations
// ============================================================================
return m_nativeData->Ok();
}
-// What should happen here? wxPostScriptPrintNativeData is not
-// defined unless all this is true on MSW.
-#if WXWIN_COMPATIBILITY_2_4 && wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
-
-#include "wx/generic/prntdlgg.h"
-
-#if wxUSE_POSTSCRIPT
- #define WXUNUSED_WITHOUT_PS(name) name
-#else
- #define WXUNUSED_WITHOUT_PS(name) WXUNUSED(name)
-#endif
-
-wxString wxPrintData::GetPrinterCommand() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterCommand();
-#endif
- return wxEmptyString;
-}
-
-wxString wxPrintData::GetPrinterOptions() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterOptions();
-#endif
- return wxEmptyString;
-}
-
-wxString wxPrintData::GetPreviewCommand() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPreviewCommand();
-#endif
- return wxEmptyString;
-}
-
-wxString wxPrintData::GetFontMetricPath() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetFontMetricPath();
-#endif
- return wxEmptyString;
-}
-
-double wxPrintData::GetPrinterScaleX() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterScaleX();
-#endif
- return 1.0;
-}
-
-double wxPrintData::GetPrinterScaleY() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterScaleY();
-#endif
- return 1.0;
-}
-
-long wxPrintData::GetPrinterTranslateX() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterTranslateX();
-#endif
- return 0;
-}
-
-long wxPrintData::GetPrinterTranslateY() const
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterTranslateY();
-#endif
- return 0;
-}
-
-void wxPrintData::SetPrinterCommand(const wxString& WXUNUSED_WITHOUT_PS(command))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterCommand( command );
-#endif
-}
-
-void wxPrintData::SetPrinterOptions(const wxString& WXUNUSED_WITHOUT_PS(options))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterOptions( options );
-#endif
-}
-
-void wxPrintData::SetPreviewCommand(const wxString& WXUNUSED_WITHOUT_PS(command))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPreviewCommand( command );
-#endif
-}
-
-void wxPrintData::SetFontMetricPath(const wxString& WXUNUSED_WITHOUT_PS(path))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetFontMetricPath( path );
-#endif
-}
-
-void wxPrintData::SetPrinterScaleX(double WXUNUSED_WITHOUT_PS(x))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaleX( x );
-#endif
-}
-
-void wxPrintData::SetPrinterScaleY(double WXUNUSED_WITHOUT_PS(y))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaleY( y );
-#endif
-}
-
-void wxPrintData::SetPrinterScaling(double WXUNUSED_WITHOUT_PS(x), double WXUNUSED_WITHOUT_PS(y))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaling( x, y );
-#endif
-}
-
-void wxPrintData::SetPrinterTranslateX(long WXUNUSED_WITHOUT_PS(x))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslateX( x );
-#endif
-}
-
-void wxPrintData::SetPrinterTranslateY(long WXUNUSED_WITHOUT_PS(y))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslateY( y );
-#endif
-}
-
-void wxPrintData::SetPrinterTranslation(long WXUNUSED_WITHOUT_PS(x), long WXUNUSED_WITHOUT_PS(y))
-{
-#if wxUSE_POSTSCRIPT
- if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
- ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslation( x, y );
-#endif
-}
-#endif
-
// ----------------------------------------------------------------------------
// Print dialog data
// ----------------------------------------------------------------------------
m_printEnablePrintToFile = ! factory->HasOwnPrintToFile();
m_printEnableHelp = false;
-#if WXWIN_COMPATIBILITY_2_4
- m_printSetupDialog = false;
-#endif
}
wxPrintDialogData::wxPrintDialogData(const wxPrintDialogData& dialogData)
m_printEnablePageNumbers = true;
m_printEnablePrintToFile = true;
m_printEnableHelp = false;
-#if WXWIN_COMPATIBILITY_2_4
- m_printSetupDialog = false;
-#endif
m_printData = printData;
}
m_printEnablePageNumbers = data.m_printEnablePageNumbers;
m_printEnableHelp = data.m_printEnableHelp;
m_printEnablePrintToFile = data.m_printEnablePrintToFile;
-#if WXWIN_COMPATIBILITY_2_4
- m_printSetupDialog = data.m_printSetupDialog;
-#endif
m_printData = data.m_printData;
}
} // wxDbTable::wxDbTable()
-/***** DEPRECATED: use wxDbTable::wxDbTable() format above *****/
-#if WXWIN_COMPATIBILITY_2_4
-wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
- const wxChar *qryTblName, bool qryOnly, const wxString &tblPath)
-{
- wxString tempQryTblName;
- tempQryTblName = qryTblName;
- if (!initialize(pwxDb, tblName, numColumns, tempQryTblName, qryOnly, tblPath))
- cleanup();
-} // wxDbTable::wxDbTable()
-#endif // WXWIN_COMPATIBILITY_2_4
-
-
/********** wxDbTable::~wxDbTable() **********/
wxDbTable::~wxDbTable()
{
wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
: wxEvent(theId, commandType)
-#if WXWIN_COMPATIBILITY_2_4
- , m_commandString(this)
-#endif
{
m_clientData = (char *) NULL;
m_clientObject = (wxClientData *) NULL;
return true;
}
-#if WXWIN_COMPATIBILITY_2_4
-// Parses the filterStr, returning the number of filters.
-// Returns 0 if none or if there's a problem.
-// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg"
-int wxFileDialogBase::ParseWildcard(const wxString& filterStr,
- wxArrayString& descriptions,
- wxArrayString& filters)
-{
- return ::wxParseCommonDialogsFilter(filterStr, descriptions, filters);
-}
-#endif // WXWIN_COMPATIBILITY_2_4
-
#if WXWIN_COMPATIBILITY_2_6
long wxFileDialogBase::GetStyle() const
{
return node;
}
-#if WXWIN_COMPATIBILITY_2_4
-
-// ----------------------------------------------------------------------------
-// wxHashTableLong
-// ----------------------------------------------------------------------------
-
-wxHashTableLong::~wxHashTableLong()
-{
- Destroy();
-}
-
-void wxHashTableLong::Init(size_t size)
-{
- m_hashSize = size;
- m_values = new wxArrayLong *[size];
- m_keys = new wxArrayLong *[size];
-
- for ( size_t n = 0; n < m_hashSize; n++ )
- {
- m_values[n] =
- m_keys[n] = (wxArrayLong *)NULL;
- }
-
- m_count = 0;
-}
-
-void wxHashTableLong::Create(size_t size)
-{
- Init(size);
-}
-
-void wxHashTableLong::Destroy()
-{
- for ( size_t n = 0; n < m_hashSize; n++ )
- {
- delete m_values[n];
- delete m_keys[n];
- }
-
- delete [] m_values;
- delete [] m_keys;
- m_hashSize = 0;
- m_count = 0;
-}
-
-void wxHashTableLong::Put(long key, long value)
-{
- wxCHECK_RET( m_hashSize, _T("must call Create() first") );
-
- size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
-
- if ( !m_keys[slot] )
- {
- m_keys[slot] = new wxArrayLong;
- m_values[slot] = new wxArrayLong;
- }
-
- m_keys[slot]->Add(key);
- m_values[slot]->Add(value);
-
- m_count++;
-}
-
-long wxHashTableLong::Get(long key) const
-{
- wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") );
-
- size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
-
- wxArrayLong *keys = m_keys[slot];
- if ( keys )
- {
- size_t count = keys->GetCount();
- for ( size_t n = 0; n < count; n++ )
- {
- if ( keys->Item(n) == key )
- {
- return m_values[slot]->Item(n);
- }
- }
- }
-
- return wxNOT_FOUND;
-}
-
-long wxHashTableLong::Delete(long key)
-{
- wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") );
-
- size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
-
- wxArrayLong *keys = m_keys[slot];
- if ( keys )
- {
- size_t count = keys->GetCount();
- for ( size_t n = 0; n < count; n++ )
- {
- if ( keys->Item(n) == key )
- {
- long val = m_values[slot]->Item(n);
-
- keys->RemoveAt(n);
- m_values[slot]->RemoveAt(n);
-
- m_count--;
-
- return val;
- }
- }
- }
-
- return wxNOT_FOUND;
-}
-
-// ----------------------------------------------------------------------------
-// wxStringHashTable: more efficient than storing strings in a list
-// ----------------------------------------------------------------------------
-
-wxStringHashTable::wxStringHashTable(size_t sizeTable)
-{
- m_keys = new wxArrayLong *[sizeTable];
- m_values = new wxArrayString *[sizeTable];
-
- m_hashSize = sizeTable;
- for ( size_t n = 0; n < m_hashSize; n++ )
- {
- m_values[n] = (wxArrayString *)NULL;
- m_keys[n] = (wxArrayLong *)NULL;
- }
-}
-
-wxStringHashTable::~wxStringHashTable()
-{
- Destroy();
-}
-
-void wxStringHashTable::Destroy()
-{
- for ( size_t n = 0; n < m_hashSize; n++ )
- {
- delete m_values[n];
- delete m_keys[n];
- }
-
- delete [] m_values;
- delete [] m_keys;
- m_hashSize = 0;
-}
-
-void wxStringHashTable::Put(long key, const wxString& value)
-{
- wxCHECK_RET( m_hashSize, _T("must call Create() first") );
-
- size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
-
- if ( !m_keys[slot] )
- {
- m_keys[slot] = new wxArrayLong;
- m_values[slot] = new wxArrayString;
- }
-
- m_keys[slot]->Add(key);
- m_values[slot]->Add(value);
-}
-
-wxString wxStringHashTable::Get(long key, bool *wasFound) const
-{
- wxCHECK_MSG( m_hashSize, wxEmptyString, _T("must call Create() first") );
-
- size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
-
- wxArrayLong *keys = m_keys[slot];
- if ( keys )
- {
- size_t count = keys->GetCount();
- for ( size_t n = 0; n < count; n++ )
- {
- if ( keys->Item(n) == key )
- {
- if ( wasFound )
- *wasFound = true;
-
- return m_values[slot]->Item(n);
- }
- }
- }
-
- if ( wasFound )
- *wasFound = false;
-
- return wxEmptyString;
-}
-
-bool wxStringHashTable::Delete(long key) const
-{
- wxCHECK_MSG( m_hashSize, false, _T("must call Create() first") );
-
- size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
-
- wxArrayLong *keys = m_keys[slot];
- if ( keys )
- {
- size_t count = keys->GetCount();
- for ( size_t n = 0; n < count; n++ )
- {
- if ( keys->Item(n) == key )
- {
- keys->RemoveAt(n);
- m_values[slot]->RemoveAt(n);
- return true;
- }
- }
- }
-
- return false;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// ----------------------------------------------------------------------------
// old not type safe wxHashTable
// ----------------------------------------------------------------------------
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)
-#if WXWIN_COMPATIBILITY_2_4
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_GET_INFO)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_SET_INFO)
-#endif
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN)
#endif // wxUSE_HELP
-#if WXWIN_COMPATIBILITY_2_4
-
-// these functions are deprecated and don't do anything
-int wxRadioBoxBase::GetNumberOfRowsOrCols() const
-{
- return 1;
-}
-
-void wxRadioBoxBase::SetNumberOfRowsOrCols(int WXUNUSED(n))
-{
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
#endif // wxUSE_RADIOBOX
{
ms_screen = screen;
}
-
-#if WXWIN_COMPATIBILITY_2_4
-
-wxColour wxSystemSettings::GetSystemColour(int index)
-{
- return GetColour((wxSystemColour)index);
-}
-
-wxFont wxSystemSettings::GetSystemFont(int index)
-{
- return GetFont((wxSystemFont)index);
-}
-
-int wxSystemSettings::GetSystemMetric(int index)
-{
- return GetMetric((wxSystemMetric)index);
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
#include "wx/listimpl.cpp"
-#if WXWIN_COMPATIBILITY_2_4
- #include "wx/notebook.h"
-#endif
//---------------------------------------------------------------------------
}
#endif // wxUSE_BUTTON
-
-#if WXWIN_COMPATIBILITY_2_4
-
-// ----------------------------------------------------------------------------
-// wxNotebookSizer
-// ----------------------------------------------------------------------------
-
-#if wxUSE_BOOKCTRL
-IMPLEMENT_CLASS(wxBookCtrlSizer, wxSizer)
-#if wxUSE_NOTEBOOK
-IMPLEMENT_CLASS(wxNotebookSizer, wxBookCtrlSizer)
-#endif // wxUSE_NOTEBOOK
-#endif // wxUSE_BOOKCTRL
-
-#if wxUSE_BOOKCTRL
-
-#if WXWIN_COMPATIBILITY_2_6
-
-wxBookCtrlSizer::wxBookCtrlSizer(wxBookCtrlBase *bookctrl)
- : m_bookctrl(bookctrl)
-{
- wxASSERT_MSG( bookctrl, wxT("wxBookCtrlSizer needs a control") );
-}
-
-#endif // WXWIN_COMPATIBILITY_2_6
-
-void wxBookCtrlSizer::RecalcSizes()
-{
- m_bookctrl->SetSize( m_position.x, m_position.y, m_size.x, m_size.y );
-}
-
-wxSize wxBookCtrlSizer::CalcMin()
-{
- wxSize sizeBorder = m_bookctrl->CalcSizeFromPage(wxSize(0,0));
-
- sizeBorder.x += 5;
- sizeBorder.y += 5;
-
- if ( m_bookctrl->GetPageCount() == 0 )
- {
- return wxSize(sizeBorder.x + 10, sizeBorder.y + 10);
- }
-
- int maxX = 0;
- int maxY = 0;
-
- wxWindowList::compatibility_iterator
- node = m_bookctrl->GetChildren().GetFirst();
- while (node)
- {
- wxWindow *item = node->GetData();
- wxSizer *itemsizer = item->GetSizer();
-
- if (itemsizer)
- {
- wxSize subsize( itemsizer->CalcMin() );
-
- if (subsize.x > maxX)
- maxX = subsize.x;
- if (subsize.y > maxY)
- maxY = subsize.y;
- }
-
- node = node->GetNext();
- }
-
- return wxSize( maxX, maxY ) + sizeBorder;
-}
-
-#if wxUSE_NOTEBOOK
-
-#if WXWIN_COMPATIBILITY_2_6
-
-wxNotebookSizer::wxNotebookSizer(wxNotebook *nb)
-{
- wxASSERT_MSG( nb, wxT("wxNotebookSizer needs a control") );
- m_bookctrl = nb;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_6
-
-#endif // wxUSE_NOTEBOOOK
-#endif // wxUSE_BOOKCTRL
-
-#endif // WXWIN_COMPATIBILITY_2_4
}
}
-#if WXWIN_COMPATIBILITY_2_4
-
-// return a wxString[] as required for some control ctors.
-wxString* wxArrayString::GetStringArray() const
-{
- wxString *array = 0;
-
- if( m_nCount > 0 )
- {
- array = new wxString[m_nCount];
- for( size_t i = 0; i < m_nCount; i++ )
- array[i] = m_pItems[i];
- }
-
- return array;
-}
-
-void wxArrayString::Remove(size_t nIndex, size_t nRemove)
-{
- RemoveAt(nIndex, nRemove);
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// searches the array for an item (forward or backwards)
int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const
{
#endif // wxUSE_SOCKETS
-// ---------------------------------------------------------------------------
-//
-// wxURL Compatibility
-//
-// ---------------------------------------------------------------------------
-
-#if WXWIN_COMPATIBILITY_2_4
-
-#include "wx/url.h"
-
-wxString wxURL::GetProtocolName() const
-{
- return m_scheme;
-}
-
-wxString wxURL::GetHostName() const
-{
- return m_server;
-}
-
-wxString wxURL::GetPath() const
-{
- return m_path;
-}
-
-//Note that this old code really doesn't convert to a URI that well and looks
-//more like a dirty hack than anything else...
-
-wxString wxURL::ConvertToValidURI(const wxString& uri, const wxChar* delims)
-{
- wxString out_str;
- wxString hexa_code;
- size_t i;
-
- for (i = 0; i < uri.Len(); i++)
- {
- wxChar c = uri.GetChar(i);
-
- if (c == wxT(' '))
- {
- // GRG, Apr/2000: changed to "%20" instead of '+'
-
- out_str += wxT("%20");
- }
- else
- {
- // GRG, Apr/2000: modified according to the URI definition (RFC 2396)
- //
- // - Alphanumeric characters are never escaped
- // - Unreserved marks are never escaped
- // - Delimiters must be escaped if they appear within a component
- // but not if they are used to separate components. Here we have
- // no clear way to distinguish between these two cases, so they
- // are escaped unless they are passed in the 'delims' parameter
- // (allowed delimiters).
-
- static const wxChar marks[] = wxT("-_.!~*()'");
-
- if ( !wxIsalnum(c) && !wxStrchr(marks, c) && !wxStrchr(delims, c) )
- {
- hexa_code.Printf(wxT("%%%02X"), c);
- out_str += hexa_code;
- }
- else
- {
- out_str += c;
- }
- }
- }
-
- return out_str;
-}
-
-wxString wxURL::ConvertFromURI(const wxString& uri)
-{
- return wxURI::Unescape(uri);
-}
-
-#endif //WXWIN_COMPATIBILITY_2_4
#endif // wxUSE_URL
// implementation
// ============================================================================
-#if WXWIN_COMPATIBILITY_2_4
-
-wxChar *
-copystring (const wxChar *s)
-{
- if (s == NULL) s = wxEmptyString;
- size_t len = wxStrlen (s) + 1;
-
- wxChar *news = new wxChar[len];
- memcpy (news, s, len * sizeof(wxChar)); // Should be the fastest
-
- return news;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
-// ----------------------------------------------------------------------------
-// String <-> Number conversions (deprecated)
-// ----------------------------------------------------------------------------
-
-#if WXWIN_COMPATIBILITY_2_4
-
-WXDLLIMPEXP_DATA_BASE(const wxChar *) wxFloatToStringStr = wxT("%.2f");
-WXDLLIMPEXP_DATA_BASE(const wxChar *) wxDoubleToStringStr = wxT("%.2f");
-
-void
-StringToFloat (const wxChar *s, float *number)
-{
- if (s && *s && number)
- *number = (float) wxStrtod (s, (wxChar **) NULL);
-}
-
-void
-StringToDouble (const wxChar *s, double *number)
-{
- if (s && *s && number)
- *number = wxStrtod (s, (wxChar **) NULL);
-}
-
-wxChar *
-FloatToString (float number, const wxChar *fmt)
-{
- static wxChar buf[256];
-
- wxSprintf (buf, fmt, number);
- return buf;
-}
-
-wxChar *
-DoubleToString (double number, const wxChar *fmt)
-{
- static wxChar buf[256];
-
- wxSprintf (buf, fmt, number);
- return buf;
-}
-
-void
-StringToInt (const wxChar *s, int *number)
-{
- if (s && *s && number)
- *number = (int) wxStrtol (s, (wxChar **) NULL, 10);
-}
-
-void
-StringToLong (const wxChar *s, long *number)
-{
- if (s && *s && number)
- *number = wxStrtol (s, (wxChar **) NULL, 10);
-}
-
-wxChar *
-IntToString (int number)
-{
- static wxChar buf[20];
-
- wxSprintf (buf, wxT("%d"), number);
- return buf;
-}
-
-wxChar *
-LongToString (long number)
-{
- static wxChar buf[20];
-
- wxSprintf (buf, wxT("%ld"), number);
- return buf;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// Array used in DecToHex conversion routine.
static wxChar hexArray[] = wxT("0123456789ABCDEF");
return true;
}
-#if WXWIN_COMPATIBILITY_2_4
-
-inline void wxCopyStringListToArrayString(wxArrayString& to, const wxStringList& from)
-{
- to.Clear();
-
- for ( wxStringList::compatibility_iterator pNode = from.GetFirst();
- pNode;
- pNode = pNode->GetNext() )
- {
- to.Add(pNode->GetData());
- }
-}
-
-inline void wxCopyArrayStringToStringList(wxStringList& to, const wxArrayString& from)
-{
- to.Clear();
-
- for(size_t i = 0; i < from.GetCount(); ++i)
- to.Add(from[i]);
-}
-
-wxStringList& wxTextValidator::GetIncludeList()
-{
- wxCopyArrayStringToStringList(m_includeList, m_includes);
- return m_includeList;
-}
-
-wxStringList& wxTextValidator::GetExcludeList()
-{
- wxCopyArrayStringToStringList(m_excludeList, m_excludes);
- return m_excludeList;
-}
-
-void wxTextValidator::SetIncludeList(const wxStringList& list)
-{
- wxCopyStringListToArrayString(m_includes, list);
-}
-
-void wxTextValidator::SetExcludeList(const wxStringList& list)
-{
- wxCopyStringListToArrayString(m_excludes, list);
-}
-
-bool wxTextValidator::IsInCharIncludeList(const wxString& val)
-{
- return IsInCharIncludes(val);
-}
-
-bool wxTextValidator::IsNotInCharExcludeList(const wxString& val)
-{
- return IsNotInCharExcludes(val);
-}
-
-#endif //compat 2.4
-
-
bool wxTextValidator::IsInCharIncludes(const wxString& val)
{
size_t i;
}
}
-#if WXWIN_COMPATIBILITY_2_4
-
-// ----------------------------------------------------------------------------
-// wxVariantDataStringList
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE wxVariantDataStringList: public wxVariantData
-{
-DECLARE_DYNAMIC_CLASS(wxVariantDataStringList)
-public:
- wxVariantDataStringList() {}
- wxVariantDataStringList(const wxStringList& list) { m_value = list; }
-
- wxStringList& GetValue() const { return (wxStringList&) m_value; }
- void SetValue(const wxStringList& value);
-
- virtual bool Eq(wxVariantData& data) const;
-#if wxUSE_STD_IOSTREAM
- virtual bool Write(wxSTD ostream& str) const;
-#endif
- virtual bool Write(wxString& str) const;
-#if wxUSE_STD_IOSTREAM
- virtual bool Read(wxSTD istream& str);
-#endif
- virtual bool Read(wxString& str);
- virtual wxString GetType() const { return wxT("stringlist"); };
-
-protected:
- wxStringList m_value;
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxVariantDataStringList, wxVariantData)
-
-void wxVariantDataStringList::SetValue(const wxStringList& value)
-{
- m_value = value;
-}
-
-bool wxVariantDataStringList::Eq(wxVariantData& data) const
-{
- wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") );
-
- wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
- wxStringList::compatibility_iterator node1 = m_value.GetFirst();
- wxStringList::compatibility_iterator node2 = listData.GetValue().GetFirst();
- while (node1 && node2)
- {
- wxString str1 ( node1->GetData() );
- wxString str2 ( node2->GetData() );
- if (str1 != str2)
- return false;
- node1 = node1->GetNext();
- node2 = node2->GetNext();
- }
- if (node1 || node2) return false;
- return true;
-}
-
-#if wxUSE_STD_IOSTREAM
-bool wxVariantDataStringList::Write(wxSTD ostream& str) const
-{
- wxString s;
- Write(s);
- str << (const char*) s.mb_str();
- return true;
-}
-#endif
-
-bool wxVariantDataStringList::Write(wxString& str) const
-{
- str.Empty();
- wxStringList::compatibility_iterator node = m_value.GetFirst();
- while (node)
- {
- const wxChar* s = node->GetData();
- if (node != m_value.GetFirst())
- str += wxT(" ");
- str += s;
- node = node->GetNext();
- }
-
- return true;
-}
-
-#if wxUSE_STD_IOSTREAM
-bool wxVariantDataStringList::Read(wxSTD istream& WXUNUSED(str))
-{
- wxFAIL_MSG(wxT("Unimplemented"));
- // TODO
- return false;
-}
-#endif
-
-bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
-{
- wxFAIL_MSG(wxT("Unimplemented"));
- // TODO
- return false;
-}
-
-#endif //2.4 compat
-
-#if WXWIN_COMPATIBILITY_2_4
-
-wxVariant::wxVariant(const wxStringList& val, const wxString& name)
-{
- m_data = new wxVariantDataStringList(val);
- m_name = name;
-}
-
-bool wxVariant::operator== (const wxStringList& value) const
-{
- wxASSERT_MSG( (GetType() == wxT("stringlist")), wxT("Invalid type for == operator") );
-
- wxVariantDataStringList other(value);
- return (GetData()->Eq(other));
-}
-
-bool wxVariant::operator!= (const wxStringList& value) const
-{
- wxASSERT_MSG( (GetType() == wxT("stringlist")), wxT("Invalid type for == operator") );
-
- wxVariantDataStringList other(value);
- return !(GetData()->Eq(other));
-}
-
-void wxVariant::operator= (const wxStringList& value)
-{
- if (GetType() == wxT("stringlist") &&
- m_data->GetRefCount() == 1)
- {
- ((wxVariantDataStringList*)GetData())->SetValue(value);
- }
- else
- {
- UnRef();
- m_data = new wxVariantDataStringList(value);
- }
-}
-
-// wxVariant
-
-wxStringList& wxVariant::GetStringList() const
-{
- wxASSERT( (GetType() == wxT("stringlist")) );
-
- return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue();
-}
-
-#endif
-
// Treat a list variant as an array
wxVariant wxVariant::operator[] (size_t idx) const
{
-#if WXWIN_COMPATIBILITY_2_4
- wxASSERT_MSG( (GetType() == wxT("list") || GetType() == wxT("stringlist")), wxT("Invalid type for array operator") );
-#else
wxASSERT_MSG( GetType() == wxT("list"), wxT("Invalid type for array operator") );
-#endif
if (GetType() == wxT("list"))
{
wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
}
-#if WXWIN_COMPATIBILITY_2_4
- else if (GetType() == wxT("stringlist"))
- {
- wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
- wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") );
-
- wxString str( (const wxChar*) (data->GetValue().Item(idx)->GetData()) );
- wxVariant variant( str );
- return variant;
- }
-#endif
return wxNullVariant;
}
// Return the number of elements in a list
size_t wxVariant::GetCount() const
{
-#if WXWIN_COMPATIBILITY_2_4
- wxASSERT_MSG( (GetType() == wxT("list") || GetType() == wxT("stringlist")), wxT("Invalid type for GetCount()") );
-#else
wxASSERT_MSG( GetType() == wxT("list"), wxT("Invalid type for GetCount()") );
-#endif
if (GetType() == wxT("list"))
{
wxVariantDataList* data = (wxVariantDataList*) m_data;
return data->GetValue().GetCount();
}
-#if WXWIN_COMPATIBILITY_2_4
- else if (GetType() == wxT("stringlist"))
- {
- wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
- return data->GetValue().GetCount();
- }
-#endif
return 0;
}
m_z_size = ZSTREAM_BUFFER_SIZE;
m_pos = 0;
-#if WXWIN_COMPATIBILITY_2_4
- // treat compatibility mode as auto
- m_24compatibilty = flags == wxZLIB_24COMPATIBLE;
- if (m_24compatibilty)
- flags = wxZLIB_AUTO;
-#endif
-
// if gzip is asked for but not supported...
if ((flags == wxZLIB_GZIP || flags == wxZLIB_AUTO) && !CanHandleGZip()) {
if (flags == wxZLIB_AUTO) {
// by the parent strean,
m_lasterror = wxSTREAM_READ_ERROR;
if (m_parent_i_stream->Eof())
-#if WXWIN_COMPATIBILITY_2_4
- if (m_24compatibilty)
- m_lasterror = wxSTREAM_EOF;
- else
-#endif
wxLogError(_("Can't read inflate stream: unexpected EOF in underlying stream."));
break;
return false;
}
-#if WXWIN_COMPATIBILITY_2_4
-// Parses the global filter, returning the number of filters.
-// Returns 0 if none or if there's a problem.
-// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg"
-int wxGenericDirCtrl::ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions)
-{
- return wxParseCommonDialogsFilter(filterStr, descriptions, filters );
-}
-#endif // WXWIN_COMPATIBILITY_2_4
void wxGenericDirCtrl::DoResize()
{
}
}
-#if WXWIN_COMPATIBILITY_2_4
-
-wxTreeItemId wxGenericTreeCtrl::GetFirstChild(const wxTreeItemId& item,
- long& cookie) const
-{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
-
- cookie = 0;
- return GetNextChild(item, cookie);
-}
-
-wxTreeItemId wxGenericTreeCtrl::GetNextChild(const wxTreeItemId& item,
- long& cookie) const
-{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
-
- wxArrayGenericTreeItems& children = ((wxGenericTreeItem*) item.m_pItem)->GetChildren();
- if ( (size_t)cookie < children.Count() )
- {
- return children.Item((size_t)cookie++);
- }
- else
- {
- // there are no more of them
- return wxTreeItemId();
- }
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
wxTreeItemId wxGenericTreeCtrl::GetLastChild(const wxTreeItemId& item) const
{
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
#endif
}
-#if WXWIN_COMPATIBILITY_2_4
-
-int wxGenericTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const
-{
- return GetItemImage(item, wxTreeItemIcon_Selected);
-}
-
-void wxGenericTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
-{
- SetItemImage(item, image, wxTreeItemIcon_Selected);
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
void wxGenericTreeCtrl::DoDirtyProcessing()
{
if (m_freezeCount)
wxHtmlHelpData::wxHtmlHelpData()
{
-#if WXWIN_COMPATIBILITY_2_4
- m_cacheContents = NULL;
- m_cacheIndex = NULL;
-#endif
}
wxHtmlHelpData::~wxHtmlHelpData()
{
-#if WXWIN_COMPATIBILITY_2_4
- CleanCompatibilityData();
-#endif
}
bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
title, contents, index, start, fsys.GetPath());
delete fi;
-#if WXWIN_COMPATIBILITY_2_4
- CleanCompatibilityData();
-#endif
-
return rtval;
}
return wxEmptyString;
}
-#if WXWIN_COMPATIBILITY_2_4
-wxHtmlContentsItem::wxHtmlContentsItem()
- : m_Level(0), m_ID(wxID_ANY), m_Name(NULL), m_Page(NULL), m_Book(NULL),
- m_autofree(false)
-{
-}
-
-wxHtmlContentsItem::wxHtmlContentsItem(const wxHtmlHelpDataItem& d)
-{
- m_autofree = true;
- m_Level = d.level;
- m_ID = d.id;
- m_Name = wxStrdup(d.name.c_str());
- m_Page = wxStrdup(d.page.c_str());
- m_Book = d.book;
-}
-
-wxHtmlContentsItem& wxHtmlContentsItem::operator=(const wxHtmlContentsItem& d)
-{
- if (m_autofree)
- {
- free(m_Name);
- free(m_Page);
- }
- m_autofree = true;
- m_Level = d.m_Level;
- m_ID = d.m_ID;
- m_Name = d.m_Name ? wxStrdup(d.m_Name) : NULL;
- m_Page = d.m_Page ? wxStrdup(d.m_Page) : NULL;
- m_Book = d.m_Book;
- return *this;
-}
-
-wxHtmlContentsItem::~wxHtmlContentsItem()
-{
- if (m_autofree)
- {
- free(m_Name);
- free(m_Page);
- }
-}
-
-wxHtmlContentsItem* wxHtmlHelpData::GetContents()
-{
- if (!m_cacheContents && !m_contents.empty())
- {
- size_t len = m_contents.size();
- m_cacheContents = new wxHtmlContentsItem[len];
- for (size_t i = 0; i < len; i++)
- m_cacheContents[i] = m_contents[i];
- }
- return m_cacheContents;
-}
-
-int wxHtmlHelpData::GetContentsCnt()
-{
- return m_contents.size();
-}
-
-wxHtmlContentsItem* wxHtmlHelpData::GetIndex()
-{
- if (!m_cacheContents && !m_index.empty())
- {
- size_t len = m_index.size();
- m_cacheContents = new wxHtmlContentsItem[len];
- for (size_t i = 0; i < len; i++)
- m_cacheContents[i] = m_index[i];
- }
- return m_cacheContents;
-}
-
-int wxHtmlHelpData::GetIndexCnt()
-{
- return m_index.size();
-}
-
-void wxHtmlHelpData::CleanCompatibilityData()
-{
- delete[] m_cacheContents;
- m_cacheContents = NULL;
- delete[] m_cacheIndex;
- m_cacheIndex = NULL;
-}
-#endif // WXWIN_COMPATIBILITY_2_4
//----------------------------------------------------------------------------------
// wxHtmlSearchStatus functions
m_Active = (m_CurIndex < m_MaxIndex);
}
-#if WXWIN_COMPATIBILITY_2_4
-wxHtmlContentsItem* wxHtmlSearchStatus::GetContentsItem()
-{
- static wxHtmlContentsItem it;
- it = wxHtmlContentsItem(*m_CurItem);
- return ⁢
-}
-#endif
-
bool wxHtmlSearchStatus::Search()
{
wxFSFile *file;
}
#endif // wxUSE_EXCEPTIONS
-
-// ----------------------------------------------------------------------------
-// deprecated event loop functions
-// ----------------------------------------------------------------------------
-
-#if WXWIN_COMPATIBILITY_2_4
-
-void wxApp::DoMessage(WXMSG *pMsg)
-{
- wxEventLoop *evtLoop = wxEventLoop::GetActive();
- if ( evtLoop )
- evtLoop->ProcessMessage(pMsg);
-}
-
-bool wxApp::DoMessage()
-{
- wxEventLoop *evtLoop = wxEventLoop::GetActive();
- return evtLoop ? evtLoop->Dispatch() : false;
-}
-
-bool wxApp::ProcessMessage(WXMSG* pMsg)
-{
- wxEventLoop *evtLoop = wxEventLoop::GetActive();
- return evtLoop && evtLoop->PreProcessMessage(pMsg);
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
#endif
-#if WXWIN_COMPATIBILITY_2_4
-
-int wxBitmap::GetQuality() const
-{
- return 0;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
void wxBitmap::UseAlpha()
{
if ( GetBitmapData() )
GetBitmapData()->SetMask(mask);
}
-#if WXWIN_COMPATIBILITY_2_4
-
-void wxBitmap::SetQuality(int WXUNUSED(quality))
-{
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
// ----------------------------------------------------------------------------
// raw bitmap access support
// ----------------------------------------------------------------------------
*fileNameBuffer = wxT('\0');
*titleBuffer = wxT('\0');
-#if WXWIN_COMPATIBILITY_2_4
- long msw_flags = 0;
- if ( HasFdFlag(wxHIDE_READONLY) || HasFdFlag(wxFD_SAVE) )
- msw_flags |= OFN_HIDEREADONLY;
-#else
long msw_flags = OFN_HIDEREADONLY;
-#endif
if ( HasFdFlag(wxFD_FILE_MUST_EXIST) )
msw_flags |= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
wxDeleteInternalData(this, iItem);
break;
-#if WXWIN_COMPATIBILITY_2_4
- case LVN_SETDISPINFO:
- {
- eventType = wxEVT_COMMAND_LIST_SET_INFO;
- LV_DISPINFO *info = (LV_DISPINFO *)lParam;
- wxConvertFromMSWListItem(GetHwnd(), event.m_item, info->item);
- }
- break;
-#endif
-
case LVN_INSERTITEM:
eventType = wxEVT_COMMAND_LIST_INSERT_ITEM;
event.m_itemIndex = iItem;
pd->Flags |= PD_PAGENUMS;
if ( data.GetEnableHelp() )
pd->Flags |= PD_SHOWHELP;
-#if WXWIN_COMPATIBILITY_2_4
- if ( data.GetSetupDialog() )
- pd->Flags |= PD_PRINTSETUP;
-#endif
return true;
}
data.EnableSelection( ((pd->Flags & PD_NOSELECTION) != PD_NOSELECTION) );
data.EnablePageNumbers( ((pd->Flags & PD_NOPAGENUMS) != PD_NOPAGENUMS) );
data.EnableHelp( ((pd->Flags & PD_SHOWHELP) == PD_SHOWHELP) );
-#if WXWIN_COMPATIBILITY_2_4
- data.SetSetupDialog( ((pd->Flags & PD_PRINTSETUP) == PD_PRINTSETUP) );
-#endif
+
return true;
}
UINT gs_msgTaskbar = 0;
UINT gs_msgRestartTaskbar = 0;
-#if WXWIN_COMPATIBILITY_2_4
-BEGIN_EVENT_TABLE(wxTaskBarIcon, wxTaskBarIconBase)
- EVT_TASKBAR_MOVE (wxTaskBarIcon::_OnMouseMove)
- EVT_TASKBAR_LEFT_DOWN (wxTaskBarIcon::_OnLButtonDown)
- EVT_TASKBAR_LEFT_UP (wxTaskBarIcon::_OnLButtonUp)
- EVT_TASKBAR_RIGHT_DOWN (wxTaskBarIcon::_OnRButtonDown)
- EVT_TASKBAR_RIGHT_UP (wxTaskBarIcon::_OnRButtonUp)
- EVT_TASKBAR_LEFT_DCLICK (wxTaskBarIcon::_OnLButtonDClick)
- EVT_TASKBAR_RIGHT_DCLICK (wxTaskBarIcon::_OnRButtonDClick)
-END_EVENT_TABLE()
-#endif
-
IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler)
return rval;
}
-#if WXWIN_COMPATIBILITY_2_4
-// Overridables
-void wxTaskBarIcon::OnMouseMove(wxEvent& e) { e.Skip(); }
-void wxTaskBarIcon::OnLButtonDown(wxEvent& e) { e.Skip(); }
-void wxTaskBarIcon::OnLButtonUp(wxEvent& e) { e.Skip(); }
-void wxTaskBarIcon::OnRButtonDown(wxEvent& e) { e.Skip(); }
-void wxTaskBarIcon::OnRButtonUp(wxEvent& e) { e.Skip(); }
-void wxTaskBarIcon::OnLButtonDClick(wxEvent& e) { e.Skip(); }
-void wxTaskBarIcon::OnRButtonDClick(wxEvent& e) { e.Skip(); }
-
-void wxTaskBarIcon::_OnMouseMove(wxTaskBarIconEvent& e)
- { OnMouseMove(e); }
-void wxTaskBarIcon::_OnLButtonDown(wxTaskBarIconEvent& e)
- { OnLButtonDown(e); }
-void wxTaskBarIcon::_OnLButtonUp(wxTaskBarIconEvent& e)
- { OnLButtonUp(e); }
-void wxTaskBarIcon::_OnRButtonDown(wxTaskBarIconEvent& e)
- { OnRButtonDown(e); }
-void wxTaskBarIcon::_OnRButtonUp(wxTaskBarIconEvent& e)
- { OnRButtonUp(e); }
-void wxTaskBarIcon::_OnLButtonDClick(wxTaskBarIconEvent& e)
- { OnLButtonDClick(e); }
-void wxTaskBarIcon::_OnRButtonDClick(wxTaskBarIconEvent& e)
- { OnRButtonDClick(e); }
-#endif
-
void wxTaskBarIcon::RegisterWindowMessages()
{
static bool s_registered = false;
return item;
}
-#if WXWIN_COMPATIBILITY_2_4
-
-wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item,
- long& cookie) const
-{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
-
- cookie = (long)TreeView_GetChild(GetHwnd(), HITEM(item));
-
- return wxTreeItemId((void *)cookie);
-}
-
-wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& WXUNUSED(item),
- long& cookie) const
-{
- wxTreeItemId fromCookie((void *)cookie);
-
- HTREEITEM hitem = HITEM(fromCookie);
-
- hitem = TreeView_GetNextSibling(GetHwnd(), hitem);
-
- wxTreeItemId item(hitem);
-
- cookie = (long)item.m_pItem;
-
- return item;
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const
{
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
return wxTreeItemId(id);
}
-// for compatibility only
-#if WXWIN_COMPATIBILITY_2_4
-
-void wxTreeCtrl::SetImageList(wxImageList *imageList, int)
-{
- SetImageList(imageList);
-}
-
-int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const
-{
- return GetItemImage(item, wxTreeItemIcon_Selected);
-}
-
-void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
-{
- SetItemImage(item, image, wxTreeItemIcon_Selected);
-}
-
-#endif // WXWIN_COMPATIBILITY_2_4
-
wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text,
int image, int selectedImage,
wxTreeItemData *data)
DoExpand(item, TVE_TOGGLE);
}
-#if WXWIN_COMPATIBILITY_2_4
-
-void wxTreeCtrl::ExpandItem(const wxTreeItemId& item, int action)
-{
- DoExpand(item, action);
-}
-
-#endif
-
void wxTreeCtrl::Unselect()
{
wxASSERT_MSG( !(m_windowStyle & wxTR_MULTIPLE),
wxObject *wxCheckListBoxXmlHandler::DoCreateResource()
{
- if (m_class == wxT("wxCheckListBox")
-#if WXWIN_COMPATIBILITY_2_4
- || m_class == wxT("wxCheckList")
-#endif
- )
+ if (m_class == wxT("wxCheckListBox"))
{
-#if WXWIN_COMPATIBILITY_2_4
- if (m_class == wxT("wxCheckList"))
- wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead."));
-#endif
// need to build the list of strings from children
m_insideBox = true;
CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));
bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node)
{
return (IsOfClass(node, wxT("wxCheckListBox")) ||
-#if WXWIN_COMPATIBILITY_2_4
- IsOfClass(node, wxT("wxCheckList")) ||
-#endif
(m_insideBox && node->GetName() == wxT("item")));
}