8035dfdff321754819f79e3165401aa59bd8c7f7.patch 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. From 8035dfdff321754819f79e3165401aa59bd8c7f7 Mon Sep 17 00:00:00 2001
  2. From: wh11204 <wh11204@2a5c6006-c6dd-42ca-98ab-0921f2732cef>
  3. Date: Tue, 14 Dec 2021 08:57:56 +0000
  4. Subject: [PATCH] - Remove code for wxWidgets < 3.0.0 (part I). Includes:
  5. src\include\cbart_provider.h src\include\cbauibook.h
  6. src\include\globals.h src\include\logmanager.h
  7. src\include\scrollingdialog.h src\plugins\debuggergdb\debuggergdb.cpp
  8. src\plugins\debuggergdb\gdb_commands.h src\sdk\base64.cpp
  9. src\sdk\cbauibook.cpp src\sdk\crc32.cpp src\sdk\editorcolourset.cpp
  10. src\sdk\editorlexerloader.cpp
  11. git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@12578 2a5c6006-c6dd-42ca-98ab-0921f2732cef
  12. ---
  13. src/include/cbart_provider.h | 18 +--
  14. src/include/cbauibook.h | 41 ------
  15. src/include/globals.h | 4 -
  16. src/include/logmanager.h | 4 +-
  17. src/include/scrollingdialog.h | 184 ------------------------
  18. src/plugins/debuggergdb/debuggergdb.cpp | 10 --
  19. src/plugins/debuggergdb/gdb_commands.h | 4 -
  20. src/sdk/base64.cpp | 22 ---
  21. src/sdk/cbauibook.cpp | 84 +----------
  22. src/sdk/crc32.cpp | 4 -
  23. src/sdk/editorcolourset.cpp | 4 -
  24. src/sdk/editorlexerloader.cpp | 4 -
  25. 12 files changed, 10 insertions(+), 373 deletions(-)
  26. diff --git a/src/include/cbart_provider.h b/src/include/cbart_provider.h
  27. index ed04be85f..272b6d6b5 100644
  28. --- a/src/include/cbart_provider.h
  29. +++ b/src/include/cbart_provider.h
  30. @@ -34,17 +34,13 @@ class DLLIMPORT cbArtProvider : public wxArtProvider
  31. wxString m_prefix;
  32. struct StringHash
  33. - {
  34. - size_t operator()(const wxString& s) const
  35. - {
  36. -#if wxCHECK_VERSION(3, 0, 0)
  37. - return std::hash<std::wstring>()(s.ToStdWstring());
  38. -#else
  39. - return std::hash<std::wstring>()(s.wc_str());
  40. -#endif // wxCHECK_VERSION
  41. - }
  42. - };
  43. -
  44. + {
  45. + size_t operator()(const wxString& s) const
  46. + {
  47. + return std::hash<std::wstring>()(s.ToStdWstring());
  48. + }
  49. + };
  50. +
  51. struct Data
  52. {
  53. Data() : hasFormatting(false) {}
  54. diff --git a/src/include/cbauibook.h b/src/include/cbauibook.h
  55. index d0bf79a3a..4e90a65e5 100644
  56. --- a/src/include/cbauibook.h
  57. +++ b/src/include/cbauibook.h
  58. @@ -78,25 +78,6 @@ class DLLIMPORT cbAuiNotebook : public wxAuiNotebook
  59. * \return int the visible position
  60. */
  61. int GetTabPositionFromIndex(int index);
  62. -#if !wxCHECK_VERSION(3, 0, 0)
  63. - /** \brief Set a tab tooltip
  64. - *
  65. - * Sets the tooltip for the tab belonging to win.
  66. - * Starts the dwell timer and the stopwatch if it is not already done.
  67. - * \param idx the index of the pane that belongs to the tab
  68. - * \param text the tooltip
  69. - * @remarks Uses the name of the wxWindow to store the message
  70. - * \return bool true if tooltip was updated
  71. - */
  72. - bool SetPageToolTip(size_t idx, const wxString & text );
  73. - /** \brief Get a tab tooltip
  74. - *
  75. - * Returns the tooltip for the tab label of the page.
  76. - * @remarks Uses the name of the wxWindow to store the message
  77. - * \return wxString the tooltip of the page with the given index
  78. - */
  79. - wxString GetPageToolTip(size_t idx );
  80. -#endif // !wxCHECK_VERSION(3, 0, 0)
  81. /** \brief Minmize free horizontal page
  82. *
  83. * Moves the active tab of all tabCtrl's to the rightmost place,
  84. @@ -205,25 +186,12 @@ class DLLIMPORT cbAuiNotebook : public wxAuiNotebook
  85. * \param event
  86. * @remarks Works not reliable, due to OS/wxWidgets-limitations
  87. */
  88. -#if wxCHECK_VERSION(3, 0, 0)
  89. void OnNavigationKeyNotebook(wxNavigationKeyEvent& event);
  90. -#else
  91. - void OnNavigationKey(wxNavigationKeyEvent& event);
  92. -#endif // wxCHECK_VERSION(3, 0, 0)
  93. /** \brief OnIdle
  94. *
  95. * \param event unused
  96. */
  97. void OnIdle(cb_unused wxIdleEvent& event);
  98. -#if !wxCHECK_VERSION(3, 0, 0)
  99. - /** \brief Catch mousemotion-events
  100. - *
  101. - * Needed for the backport of tabtooltip from wx2.9
  102. - *
  103. - * \param event holds the wxTabCtrl, that sends the event
  104. - */
  105. - void OnMotion(wxMouseEvent& event);
  106. -#endif // !wxCHECK_VERSION(3, 0, 0)
  107. /** \brief Catch doubleclick-events from wxTabCtrl
  108. *
  109. * Sends cbEVT_CBAUIBOOK_LEFT_DCLICK, if doubleclick was on a tab,
  110. @@ -318,15 +286,6 @@ class DLLIMPORT cbAuiNotebook : public wxAuiNotebook
  111. */
  112. long m_LastId;
  113. #endif // __WXMSW__
  114. -#if !wxCHECK_VERSION(3, 0, 0)
  115. - /** \brief If false, tooltips are not shown
  116. - *
  117. - * Needed to only show tooltips, if they have been explicitely set.
  118. - * We store the tooltip-text in the tabs name, without this flag, we
  119. - * get the wxWidgets default-names as tooltips.
  120. - */
  121. - bool m_HasToolTip;
  122. -#endif // !wxCHECK_VERSION(3, 0, 0)
  123. /** \brief If true, zoom for all editors
  124. * is set in next OnIdle-call
  125. */
  126. diff --git a/src/include/globals.h b/src/include/globals.h
  127. index c2924cb7f..f5086b643 100644
  128. --- a/src/include/globals.h
  129. +++ b/src/include/globals.h
  130. @@ -441,11 +441,7 @@ extern DLLIMPORT wxArrayInt cbGetMultiChoiceDialog(const wxString& message, cons
  131. const wxSize& size = wxSize(300, 300),
  132. const wxArrayInt& initialSelection = wxArrayInt());
  133. -#if wxCHECK_VERSION(3, 0, 0)
  134. extern DLLIMPORT const char *cbGetTextFromUserPromptStr;
  135. -#else
  136. -extern DLLIMPORT const wxChar *cbGetTextFromUserPromptStr;
  137. -#endif // wxCHECK_VERSION
  138. extern DLLIMPORT wxString cbGetTextFromUser(const wxString &message,
  139. const wxString &caption = cbGetTextFromUserPromptStr,
  140. diff --git a/src/include/logmanager.h b/src/include/logmanager.h
  141. index 704698f27..29af5fe24 100644
  142. --- a/src/include/logmanager.h
  143. +++ b/src/include/logmanager.h
  144. @@ -21,7 +21,7 @@
  145. {
  146. va_list arg_list;
  147. va_start(arg_list, msg);
  148. -#if wxCHECK_VERSION(3, 0, 0) && wxUSE_UNICODE
  149. +#if wxUSE_UNICODE
  150. // in wx >= 3.0 unicode-build (default) we need the %ls here, or the strings get
  151. // cut after the first character
  152. ::temp_string = msg;
  153. @@ -38,7 +38,7 @@
  154. {
  155. va_list arg_list;
  156. va_start(arg_list, msg);
  157. -#if wxCHECK_VERSION(2,9,0) && wxUSE_UNICODE
  158. +#if wxUSE_UNICODE
  159. // in wx >= 2.9 unicode-build (default) we need the %ls here, or the strings get
  160. // cut after the first character
  161. ::temp_string = msg;
  162. diff --git a/src/include/scrollingdialog.h b/src/include/scrollingdialog.h
  163. index 06f3a1b60..17173f970 100644
  164. --- a/src/include/scrollingdialog.h
  165. +++ b/src/include/scrollingdialog.h
  166. @@ -30,151 +30,18 @@ class wxBoxSizer;
  167. class wxButton;
  168. class wxScrolledWindow;
  169. -#if !wxCHECK_VERSION(3, 0, 0)
  170. -class wxDialogLayoutAdapter: public wxObject
  171. -{
  172. - DECLARE_CLASS(wxDialogLayoutAdapter)
  173. -public:
  174. - wxDialogLayoutAdapter() {}
  175. -
  176. - /// Override this function to indicate that adaptation should be done
  177. - virtual bool CanDoLayoutAdaptation(wxDialogHelper* dialog) = 0;
  178. -
  179. - /// Override this function to do the adaptation
  180. - virtual bool DoLayoutAdaptation(wxDialogHelper* dialog) = 0;
  181. -};
  182. -
  183. -/*!
  184. - * Standard adapter. Does scrolling adaptation for paged and regular dialogs.
  185. - *
  186. - */
  187. -
  188. -class wxStandardDialogLayoutAdapter: public wxDialogLayoutAdapter
  189. -{
  190. - DECLARE_CLASS(wxStandardDialogLayoutAdapter)
  191. -public:
  192. - wxStandardDialogLayoutAdapter() {}
  193. -
  194. -// Overrides
  195. -
  196. - /// Indicate that adaptation should be done
  197. - bool CanDoLayoutAdaptation(wxDialogHelper* dialog) override;
  198. -
  199. - /// Do layout adaptation
  200. - bool DoLayoutAdaptation(wxDialogHelper* dialog) override;
  201. -
  202. -// Implementation
  203. -
  204. - /// Find a standard or horizontal box sizer
  205. - virtual wxSizer* FindButtonSizer(bool stdButtonSizer, wxDialogHelper* dialog, wxSizer* sizer, int& retBorder, int accumlatedBorder = 0);
  206. -
  207. - /// Check if this sizer contains standard buttons, and so can be repositioned in the dialog
  208. - virtual bool IsOrdinaryButtonSizer(wxDialogHelper* dialog, wxBoxSizer* sizer);
  209. -
  210. - /// Check if this is a standard button
  211. - virtual bool IsStandardButton(wxDialogHelper* dialog, wxButton* button);
  212. -
  213. - /// Find 'loose' main buttons in the existing layout and add them to the standard dialog sizer
  214. - virtual bool FindLooseButtons(wxDialogHelper* dialog, wxStdDialogButtonSizer* buttonSizer, wxSizer* sizer, int& count);
  215. -
  216. - /// Reparent the controls to the scrolled window, except those in buttonSizer
  217. - virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
  218. -
  219. - /// A function to fit the dialog around its contents, and then adjust for screen size.
  220. - /// If scrolled windows are passed, scrolling is enabled in the required orientation(s).
  221. - virtual bool FitWithScrolling(wxDialog* dialog, wxScrolledWindow* scrolledWindow);
  222. - virtual bool FitWithScrolling(wxDialog* dialog, wxWindowList& windows);
  223. -
  224. - /// Find whether scrolling will be necessary for the dialog, returning wxVERTICAL, wxHORIZONTAL or both
  225. - virtual int MustScroll(wxDialog* dialog, wxSize& windowSize, wxSize& displaySize);
  226. -};
  227. -
  228. -/*!
  229. - * A base class for dialogs that have adaptation. In wxWidgets 3.0, this will not
  230. - * be needed since the new functionality will be implemented in wxDialogBase.
  231. - */
  232. -
  233. -class wxDialogHelper
  234. -{
  235. -public:
  236. -
  237. - wxDialogHelper(wxDialog* dialog = NULL) { Init(); m_dialog = dialog; }
  238. - virtual ~wxDialogHelper() {}
  239. -
  240. - void Init();
  241. -
  242. - void SetDialog(wxDialog* dialog) { m_dialog = dialog; }
  243. - wxDialog* GetDialog() const { return m_dialog; }
  244. -
  245. - /// Do the adaptation
  246. - virtual bool DoLayoutAdaptation();
  247. -
  248. - /// Can we do the adaptation?
  249. - virtual bool CanDoLayoutAdaptation();
  250. -
  251. - /// Returns a content window if there is one
  252. - virtual wxWindow* GetContentWindow() const { return NULL; }
  253. -
  254. - /// Add an id to the list of custom button identifiers that should be in the button sizer
  255. - void AddButtonId(wxWindowID id) { m_buttonIds.Add((int) id); }
  256. - wxArrayInt& GetButtonIds() { return m_buttonIds; }
  257. -
  258. - /// Is this id in the custom button id array?
  259. - bool IsUserButtonId(wxWindowID id) { return (m_buttonIds.Index((int) id) != wxNOT_FOUND); }
  260. -
  261. -// ACCESSORS
  262. -
  263. - /// Level of adaptation, from none (Level 0) to full (Level 3). To disable adaptation,
  264. - /// set level 0, for example in your dialog constructor. You might
  265. - /// do this if you know that you are displaying on a large screen and you don't want the
  266. - /// dialog changed.
  267. - void SetLayoutAdaptationLevel(int level) { m_layoutAdaptationLevel = level; }
  268. -
  269. - /// Get level of adaptation
  270. - int GetLayoutAdaptationLevel() const { return m_layoutAdaptationLevel; }
  271. -
  272. - /// Returns true if the adaptation has been done
  273. - void SetLayoutAdaptationDone(bool adaptationDone) { m_layoutLayoutAdaptationDone = adaptationDone; }
  274. - bool GetLayoutAdaptationDone() const { return m_layoutLayoutAdaptationDone; }
  275. -
  276. - /// Set layout adapter class, returning old adapter
  277. - static wxDialogLayoutAdapter* SetLayoutAdapter(wxDialogLayoutAdapter* adapter);
  278. - static wxDialogLayoutAdapter* GetLayoutAdapter() { return sm_layoutAdapter; }
  279. -
  280. - /// Global switch for layout adaptation
  281. - static bool GetLayoutAdaptation() { return sm_layoutAdaptation; }
  282. - static void SetLayoutAdaptation(bool enable) { sm_layoutAdaptation = enable; }
  283. -
  284. -protected:
  285. -
  286. - wxDialog* m_dialog;
  287. - bool m_layoutLayoutAdaptationDone;
  288. - wxArrayInt m_buttonIds;
  289. - int m_layoutAdaptationLevel;
  290. - static wxDialogLayoutAdapter* sm_layoutAdapter;
  291. - static bool sm_layoutAdaptation;
  292. -};
  293. -#endif //#if !wxCHECK_VERSION(3, 0, 0)
  294. -
  295. /*!
  296. * A class that makes its content scroll if necessary
  297. */
  298. class DLLIMPORT wxScrollingDialog: public wxDialog
  299. -#if !wxCHECK_VERSION(3, 0, 0)
  300. - , public wxDialogHelper
  301. -#endif
  302. {
  303. DECLARE_CLASS(wxScrollingDialog)
  304. public:
  305. wxScrollingDialog()
  306. {
  307. -#if !wxCHECK_VERSION(3, 0, 0)
  308. - Init();
  309. -#else
  310. SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
  311. -#endif
  312. }
  313. wxScrollingDialog(wxWindow *parent,
  314. int id = wxID_ANY,
  315. @@ -184,30 +51,9 @@ class DLLIMPORT wxScrollingDialog: public wxDialog
  316. long style = wxDEFAULT_DIALOG_STYLE,
  317. const wxString& name = _("dialogBox"))
  318. {
  319. -#if !wxCHECK_VERSION(3, 0, 0)
  320. - Init();
  321. -#else
  322. SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
  323. -#endif
  324. Create(parent, id, title, pos, size, style, name);
  325. }
  326. -#if !wxCHECK_VERSION(3, 0, 0)
  327. - bool Create(wxWindow *parent,
  328. - int id = wxID_ANY,
  329. - const wxString& title = wxEmptyString,
  330. - const wxPoint& pos = wxDefaultPosition,
  331. - const wxSize& size = wxDefaultSize,
  332. - long style = wxDEFAULT_DIALOG_STYLE,
  333. - const wxString& name = _("dialogBox"));
  334. -
  335. - void Init();
  336. -
  337. - /// Override Show to rejig the control and sizer hierarchy if necessary
  338. - bool Show(bool show = true) override;
  339. -
  340. - /// Override ShowModal to rejig the control and sizer hierarchy if necessary
  341. - int ShowModal() override;
  342. -#endif
  343. };
  344. /*!
  345. @@ -215,19 +61,11 @@ class DLLIMPORT wxScrollingDialog: public wxDialog
  346. */
  347. class wxScrollingPropertySheetDialog : public wxPropertySheetDialog
  348. -#if !wxCHECK_VERSION(3, 0, 0)
  349. - , public wxDialogHelper
  350. -#endif
  351. -
  352. {
  353. public:
  354. wxScrollingPropertySheetDialog() : wxPropertySheetDialog()
  355. {
  356. -#if !wxCHECK_VERSION(3, 0, 0)
  357. - Init();
  358. -#else
  359. SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
  360. -#endif
  361. }
  362. wxScrollingPropertySheetDialog(wxWindow* parent, wxWindowID id,
  363. @@ -237,32 +75,10 @@ class wxScrollingPropertySheetDialog : public wxPropertySheetDialog
  364. long style = wxDEFAULT_DIALOG_STYLE,
  365. const wxString& name = wxDialogNameStr)
  366. {
  367. -#if !wxCHECK_VERSION(3, 0, 0)
  368. - Init();
  369. -#else
  370. SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
  371. -#endif
  372. Create(parent, id, title, pos, sz, style, name);
  373. }
  374. -#if !wxCHECK_VERSION(3, 0, 0)
  375. -//// Accessors
  376. -
  377. - /// Returns the content window
  378. - wxWindow* GetContentWindow() const override;
  379. -
  380. -/// Operations
  381. -
  382. - /// Override Show to rejig the control and sizer hierarchy if necessary
  383. - bool Show(bool show = true) override;
  384. -
  385. - /// Override ShowModal to rejig the control and sizer hierarchy if necessary
  386. - int ShowModal() override;
  387. -
  388. -private:
  389. - void Init();
  390. -#endif
  391. -
  392. protected:
  393. DECLARE_DYNAMIC_CLASS(wxScrollingPropertySheetDialog)
  394. diff --git a/src/plugins/debuggergdb/debuggergdb.cpp b/src/plugins/debuggergdb/debuggergdb.cpp
  395. index 4d1dabba5..845de0bb3 100644
  396. --- a/src/plugins/debuggergdb/debuggergdb.cpp
  397. +++ b/src/plugins/debuggergdb/debuggergdb.cpp
  398. @@ -554,7 +554,6 @@ int DebuggerGDB::LaunchProcessWithShell(const wxString &cmd, wxProcess *process,
  399. const wxString &cwd)
  400. {
  401. wxString shell = GetShellString();
  402. -#if wxCHECK_VERSION(3, 0, 0)
  403. wxExecuteEnv execEnv;
  404. execEnv.cwd = cwd;
  405. // Read the current environment variables and then make changes to them.
  406. @@ -565,15 +564,6 @@ int DebuggerGDB::LaunchProcessWithShell(const wxString &cmd, wxProcess *process,
  407. execEnv.env["SHELL"] = shell;
  408. }
  409. return wxExecute(cmd, wxEXEC_ASYNC, process, &execEnv);
  410. -#else
  411. - if (!shell.empty())
  412. - {
  413. - Log(wxString::Format(wxT("Setting SHELL to '%s'"), shell.wx_str()));
  414. - wxSetEnv(wxT("SHELL"), shell);
  415. - }
  416. - (void)cwd;
  417. - return wxExecute(cmd, wxEXEC_ASYNC, process);
  418. -#endif // !wxCHECK_VERSION(3, 0, 0)
  419. }
  420. int DebuggerGDB::LaunchProcess(const wxString& cmd, const wxString& cwd)
  421. diff --git a/src/plugins/debuggergdb/gdb_commands.h b/src/plugins/debuggergdb/gdb_commands.h
  422. index cd564b29c..5a77fbb5e 100644
  423. --- a/src/plugins/debuggergdb/gdb_commands.h
  424. +++ b/src/plugins/debuggergdb/gdb_commands.h
  425. @@ -63,11 +63,7 @@ namespace
  426. while (count < sizeof(T) * 2) // be sure we don't keep adding more to ret
  427. {
  428. - #if wxCHECK_VERSION(3, 0, 0)
  429. switch (str[pos].GetValue())
  430. - #else
  431. - switch (str[pos])
  432. - #endif
  433. {
  434. case _T('0'):
  435. case _T('1'):
  436. diff --git a/src/sdk/base64.cpp b/src/sdk/base64.cpp
  437. index 3837cb55f..c4593f17f 100644
  438. --- a/src/sdk/base64.cpp
  439. +++ b/src/sdk/base64.cpp
  440. @@ -22,9 +22,7 @@
  441. #include "base64.h"
  442. -#if wxCHECK_VERSION(3, 0, 0)
  443. #include <wx/unichar.h>
  444. -#endif
  445. const wxChar fillchar = '=';
  446. @@ -105,29 +103,17 @@ wxString wxBase64::Decode(const wxString& data)
  447. c1 = cvt.Find(data[i]);
  448. wxASSERT_MSG(c1 >= 0, _T("invalid base64 input"));
  449. c = (c << 2) | ((c1 >> 4) & 0x3);
  450. - #if wxCHECK_VERSION(3, 0, 0)
  451. ret.Append(static_cast<wxUniChar>(c), 1);
  452. - #else
  453. - ret.Append(c, 1);
  454. - #endif
  455. if (++i < len)
  456. {
  457. c = data[i];
  458. if ((char)fillchar == c)
  459. break;
  460. - #if wxCHECK_VERSION(3, 0, 0)
  461. c = cvt.Find(static_cast<wxUniChar>(c));
  462. - #else
  463. - c = cvt.Find(c);
  464. - #endif
  465. wxASSERT_MSG(c >= 0, _T("invalid base64 input"));
  466. c1 = ((c1 << 4) & 0xf0) | ((c >> 2) & 0xf);
  467. - #if wxCHECK_VERSION(3, 0, 0)
  468. ret.Append(static_cast<wxUniChar>(c1), 1);
  469. - #else
  470. - ret.Append(c1, 1);
  471. - #endif
  472. }
  473. if (++i < len)
  474. @@ -136,18 +122,10 @@ wxString wxBase64::Decode(const wxString& data)
  475. if ((char)fillchar == c1)
  476. break;
  477. - #if wxCHECK_VERSION(3, 0, 0)
  478. c1 = cvt.Find(static_cast<wxUniChar>(c1));
  479. - #else
  480. - c1 = cvt.Find(c1);
  481. - #endif
  482. wxASSERT_MSG(c1 >= 0, _T("invalid base64 input"));
  483. c = ((c << 6) & 0xc0) | c1;
  484. - #if wxCHECK_VERSION(3, 0, 0)
  485. ret.Append(static_cast<wxUniChar>(c), 1);
  486. - #else
  487. - ret.Append(c, 1);
  488. - #endif
  489. }
  490. }
  491. diff --git a/src/sdk/cbauibook.cpp b/src/sdk/cbauibook.cpp
  492. index b1841b669..ae4776a3d 100644
  493. --- a/src/sdk/cbauibook.cpp
  494. +++ b/src/sdk/cbauibook.cpp
  495. @@ -37,11 +37,7 @@ int cbAuiNotebook::s_moveDirection = 1;
  496. BEGIN_EVENT_TABLE(cbAuiNotebook, wxAuiNotebook)
  497. -#if wxCHECK_VERSION(3, 0, 0)
  498. EVT_NAVIGATION_KEY(cbAuiNotebook::OnNavigationKeyNotebook)
  499. -#else
  500. - EVT_NAVIGATION_KEY(cbAuiNotebook::OnNavigationKey)
  501. -#endif
  502. EVT_IDLE(cbAuiNotebook::OnIdle)
  503. EVT_AUINOTEBOOK_DRAG_DONE(wxID_ANY, cbAuiNotebook::OnDragDone)
  504. END_EVENT_TABLE()
  505. @@ -51,9 +47,6 @@ cbAuiNotebook::cbAuiNotebook(wxWindow* pParent, wxWindowID id, const wxPoint& po
  506. #ifdef __WXMSW__
  507. m_LastSelected(wxNOT_FOUND),
  508. m_LastId(0),
  509. -#endif
  510. -#if !wxCHECK_VERSION(3, 0, 0)
  511. - m_HasToolTip(false),
  512. #endif
  513. m_SetZoomOnIdle(false),
  514. m_MinimizeFreeSpaceOnIdle(false),
  515. @@ -64,7 +57,7 @@ cbAuiNotebook::cbAuiNotebook(wxWindow* pParent, wxWindowID id, const wxPoint& po
  516. m_mgr.SetFlags((m_mgr.GetFlags() | wxAUI_MGR_VENETIAN_BLINDS_HINT) & ~wxAUI_MGR_TRANSPARENT_HINT);
  517. #endif // #ifdef __WXGTK__
  518. ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("app"));
  519. -#if defined __WXMSW__ && wxCHECK_VERSION(3, 0, 0)
  520. +#if defined __WXMSW__
  521. wxToolTip::SetMaxWidth(-1);
  522. #endif
  523. s_AllowMousewheel = cfg->ReadBool(_T("/environment/tabs_use_mousewheel"),true);
  524. @@ -152,10 +145,6 @@ void cbAuiNotebook::ResetTabCtrlEvents()
  525. {
  526. for (size_t i = 0; i < m_TabCtrls.GetCount(); ++i)
  527. {
  528. -#if !wxCHECK_VERSION(3, 0, 0)
  529. - m_TabCtrls[i]->Disconnect(wxEVT_MOTION, wxMouseEventHandler(cbAuiNotebook::OnMotion));
  530. - m_TabCtrls[i]->Connect(wxEVT_MOTION , wxMouseEventHandler(cbAuiNotebook::OnMotion));
  531. -#endif
  532. m_TabCtrls[i]->Disconnect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(cbAuiNotebook::OnTabCtrlDblClick));
  533. m_TabCtrls[i]->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(cbAuiNotebook::OnTabCtrlDblClick));
  534. m_TabCtrls[i]->Disconnect(wxEVT_SIZE, wxSizeEventHandler(cbAuiNotebook::OnResize));
  535. @@ -427,57 +416,6 @@ void cbAuiNotebook::OnResize(wxSizeEvent& event)
  536. event.Skip();
  537. }
  538. -#if !wxCHECK_VERSION(3, 0, 0)
  539. -void cbAuiNotebook::OnMotion(wxMouseEvent& event)
  540. -{
  541. - event.Skip();
  542. - wxAuiTabCtrl* tabCtrl = (wxAuiTabCtrl*)event.GetEventObject();
  543. - if (!tabCtrl)
  544. - return;
  545. - cbAuiNotebook* nb = (cbAuiNotebook*)tabCtrl->GetParent();
  546. - if (!nb || !nb->m_HasToolTip)
  547. - return;
  548. -
  549. - wxWindow* win = nullptr;
  550. - if (event.Moving() && tabCtrl->TabHitTest(event.m_x, event.m_y, &win))
  551. - {
  552. - if (!win)
  553. - {
  554. - tabCtrl->UnsetToolTip();
  555. - return;
  556. - }
  557. - wxString text(win->GetName());
  558. - // If the text changes, set it else, keep old, to avoid
  559. - // 'moving tooltip' effect
  560. - wxToolTip* tooltip = tabCtrl->GetToolTip();
  561. - if (!tooltip || tooltip->GetTip() != text)
  562. - tabCtrl->SetToolTip(text);
  563. - }
  564. - else
  565. - tabCtrl->UnsetToolTip();
  566. -}
  567. -
  568. -bool cbAuiNotebook::SetPageToolTip(size_t idx, const wxString & text)
  569. -{
  570. - if (!m_HasToolTip)
  571. - UpdateTabControlsArray();
  572. -
  573. - m_HasToolTip = true;
  574. - wxWindow* win = GetPage(idx);
  575. - if (win && win->GetName() != text)
  576. - win->SetName(text);
  577. - else
  578. - return false;
  579. - return true;
  580. -}
  581. -wxString cbAuiNotebook::GetPageToolTip(size_t idx)
  582. -{
  583. - wxWindow* win = GetPage(idx);
  584. - if (win)
  585. - return win->GetName();
  586. - return wxEmptyString;
  587. -}
  588. -#endif
  589. void cbAuiNotebook::MinimizeFreeSpace()
  590. {
  591. if (GetPageCount() < 2)
  592. @@ -657,22 +595,14 @@ void cbAuiNotebook::AdvanceSelection(bool forward)
  593. }
  594. }
  595. -#if wxCHECK_VERSION(3, 0, 0)
  596. void cbAuiNotebook::OnNavigationKeyNotebook(wxNavigationKeyEvent& event)
  597. -#else
  598. -void cbAuiNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
  599. -#endif
  600. {
  601. // if we change window, we call our own AdvanceSelection
  602. if ( event.IsWindowChange() )
  603. AdvanceSelection(event.GetDirection());
  604. else // otherwise we call the event-handler from the parent-class
  605. {
  606. -#if wxCHECK_VERSION(3, 0, 0)
  607. wxAuiNotebook::OnNavigationKeyNotebook(event);
  608. -#else
  609. - wxAuiNotebook::OnNavigationKey(event);
  610. -#endif
  611. }
  612. }
  613. @@ -726,11 +656,7 @@ wxString cbAuiNotebook::SavePerspective(const wxString projectTitle)
  614. if (!tabsTmp.empty())
  615. tabsTmp += wxT(",");
  616. -#if wxCHECK_VERSION(3, 0, 0)
  617. if ((int)page_idx == m_curPage)
  618. -#else
  619. - if ((int)page_idx == m_curpage)
  620. -#endif
  621. tabsTmp += wxT("*");
  622. else if ((int)p == tabCtrl->GetActivePage())
  623. tabsTmp += wxT("+");
  624. @@ -886,11 +812,7 @@ bool cbAuiNotebook::LoadPerspective(const wxString& layout, bool mergeLayouts)
  625. wxString pane_name = tab_part.BeforeFirst(wxT('='));
  626. // create a new tab frame
  627. -#if wxCHECK_VERSION(3, 0, 0)
  628. m_curPage = -1;
  629. -#else
  630. - m_curpage = -1;
  631. -#endif
  632. // Get list of tab id's and move them to pane
  633. wxString tab_list = tab_part.AfterFirst(wxT('='));
  634. @@ -1004,11 +926,7 @@ bool cbAuiNotebook::LoadPerspective(const wxString& layout, bool mergeLayouts)
  635. RemoveEmptyTabFrames();
  636. // Force refresh of selection
  637. -#if wxCHECK_VERSION(3, 0, 0)
  638. m_curPage = -1;
  639. -#else
  640. - m_curpage = -1;
  641. -#endif
  642. SetSelection(sel_page);
  643. UpdateTabControlsArray();
  644. diff --git a/src/sdk/crc32.cpp b/src/sdk/crc32.cpp
  645. index 7b387877d..62024d3c0 100644
  646. --- a/src/sdk/crc32.cpp
  647. +++ b/src/sdk/crc32.cpp
  648. @@ -78,11 +78,7 @@ wxUint32 wxCrc32::FromString(const wxString& text)
  649. // Calculate the checksum
  650. crc = 0xFFFFFFFFUL;
  651. while (text[i])
  652. - #if wxCHECK_VERSION(3, 0, 0)
  653. { crc = (crc>>8) ^ crc_table[ (crc^(text[i++].GetValue())) & 0xFF ]; }
  654. - #else
  655. - { crc = (crc>>8) ^ crc_table[ (crc^(text[i++])) & 0xFF ]; }
  656. - #endif
  657. crc ^= 0xFFFFFFFFUL ;
  658. }
  659. diff --git a/src/sdk/editorcolourset.cpp b/src/sdk/editorcolourset.cpp
  660. index e39eb412a..483d6a0e8 100644
  661. --- a/src/sdk/editorcolourset.cpp
  662. +++ b/src/sdk/editorcolourset.cpp
  663. @@ -835,11 +835,7 @@ void EditorColourSet::SetKeywords(HighlightLanguage lang, int idx, const wxStrin
  664. wxString tmp(_T(' '), keywords.length()); // faster than using Alloc()
  665. const wxChar *src = keywords.c_str();
  666. - #if wxCHECK_VERSION(3, 0, 0)
  667. wxStringCharType *dst = const_cast<wxStringCharType*>(tmp.wx_str());
  668. - #else
  669. - wxChar *dst = (wxChar *) tmp.c_str();
  670. - #endif
  671. wxChar c;
  672. size_t len = 0;
  673. diff --git a/src/sdk/editorlexerloader.cpp b/src/sdk/editorlexerloader.cpp
  674. index ee291b734..85e4d7db8 100644
  675. --- a/src/sdk/editorlexerloader.cpp
  676. +++ b/src/sdk/editorlexerloader.cpp
  677. @@ -229,11 +229,7 @@ void EditorLexerLoader::DoSingleKeywordNode(HighlightLanguage language, TiXmlEle
  678. wxString value(keywords->Attribute("value"), wxConvUTF8);
  679. regex.Replace(&value, _T(" "));
  680. - #if wxCHECK_VERSION(3, 0, 0)
  681. m_pTarget->SetKeywords(language, keyidx, value );
  682. - #else
  683. - m_pTarget->SetKeywords(language, keyidx, wxString ( value, wxConvUTF8 ) );
  684. - #endif
  685. }
  686. keywords = keywords->NextSiblingElement(nodename.mb_str());