9a9c6a9d5e3e0f6eff5594ecd61a2222f073be9c.patch 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. From 9a9c6a9d5e3e0f6eff5594ecd61a2222f073be9c Mon Sep 17 00:00:00 2001
  2. From: wh11204 <wh11204@2a5c6006-c6dd-42ca-98ab-0921f2732cef>
  3. Date: Tue, 14 Dec 2021 09:27:57 +0000
  4. Subject: [PATCH] - Remove code for wxWidgets < 3.0.0 (part II). Includes:
  5. src/sdk/cbeditor.cpp src/sdk/compiler.cpp src/sdk/configmanager.cpp
  6. src/sdk/globals.cpp src/sdk/incremental_select_helper.cpp
  7. src/sdk/newfromtemplatedlg.cpp src/sdk/pluginsconfigurationdlg.cpp
  8. src/sdk/printing_types.cpp src/sdk/scripting/bindings/sc_globals.cpp
  9. src/sdk/toolsmanager.cpp src/sdk/uservarmanager.cpp src/sdk/xtra_res.cpp
  10. src/src/app.cpp
  11. git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@12579 2a5c6006-c6dd-42ca-98ab-0921f2732cef
  12. ---
  13. src/sdk/cbeditor.cpp | 8 ++---
  14. src/sdk/compiler.cpp | 14 ++-------
  15. src/sdk/configmanager.cpp | 37 +----------------------
  16. src/sdk/globals.cpp | 31 -------------------
  17. src/sdk/incremental_select_helper.cpp | 4 ---
  18. src/sdk/newfromtemplatedlg.cpp | 4 ---
  19. src/sdk/pluginsconfigurationdlg.cpp | 4 ---
  20. src/sdk/printing_types.cpp | 8 -----
  21. src/sdk/scripting/bindings/sc_globals.cpp | 8 -----
  22. src/sdk/toolsmanager.cpp | 4 ---
  23. src/sdk/uservarmanager.cpp | 6 ----
  24. src/sdk/xtra_res.cpp | 19 ------------
  25. src/src/app.cpp | 36 +---------------------
  26. 13 files changed, 9 insertions(+), 174 deletions(-)
  27. diff --git a/src/sdk/cbeditor.cpp b/src/sdk/cbeditor.cpp
  28. index e0d704bc6..f63f0aca7 100644
  29. --- a/src/sdk/cbeditor.cpp
  30. +++ b/src/sdk/cbeditor.cpp
  31. @@ -1223,13 +1223,13 @@ void cbEditor::Split(cbEditor::SplitType split)
  32. m_pControl2->SetDocPointer(m_pControl->GetDocPointer());
  33. // on wxGTK > 2.9 we need to thaw before reparent and refreeze the editor here or the whole app stays frozen
  34. - #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
  35. + #if defined ( __WXGTK__ )
  36. Thaw();
  37. #endif
  38. // parent both controls under the splitter
  39. m_pControl->Reparent(m_pSplitter);
  40. m_pControl2->Reparent(m_pSplitter);
  41. - #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
  42. + #if defined ( __WXGTK__ )
  43. Freeze();
  44. #endif
  45. @@ -1289,12 +1289,12 @@ void cbEditor::Unsplit()
  46. m_pSizer->Detach(m_pSplitter);
  47. // on wxGTK > 2.9 we need to thaw before reparent and refreeze the editor here or the whole app stays frozen
  48. - #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
  49. + #if defined ( __WXGTK__ )
  50. Thaw();
  51. #endif
  52. // parent the left control under this
  53. m_pControl->Reparent(this);
  54. - #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
  55. + #if defined ( __WXGTK__ )
  56. Freeze();
  57. #endif
  58. // add it in the sizer
  59. diff --git a/src/sdk/compiler.cpp b/src/sdk/compiler.cpp
  60. index 6eb2ff975..ab79812e3 100644
  61. --- a/src/sdk/compiler.cpp
  62. +++ b/src/sdk/compiler.cpp
  63. @@ -1537,11 +1537,7 @@ long Compiler::Execute(const wxString &cmd, wxArrayString &output)
  64. // Loads the wxArrayString with the task output (returned in a wxInputStream)
  65. wxInputStream *inputStream = process.GetInputStream();
  66. wxTextInputStream text(*inputStream);
  67. -#if wxCHECK_VERSION(3, 0, 0)
  68. while (!text.GetInputStream().Eof())
  69. -#else
  70. - while (!inputStream->Eof())
  71. -#endif
  72. {
  73. output.Add(text.ReadLine());
  74. }
  75. @@ -1556,13 +1552,9 @@ long Compiler::Execute(const wxString &cmd, wxArrayString &output)
  76. {
  77. wxLogNull logNo; // do not warn if execution fails
  78. int flags = wxEXEC_SYNC;
  79. - #if wxCHECK_VERSION(3, 0, 0)
  80. - // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
  81. - // that occurs from time to time on wx3
  82. - flags |= wxEXEC_NOEVENTS;
  83. - #else
  84. - flags |= wxEXEC_NODISABLE;
  85. - #endif
  86. + // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
  87. + // that occurs from time to time on wx3
  88. + flags |= wxEXEC_NOEVENTS;
  89. return wxExecute(cmd, output, flags);
  90. }
  91. #endif // __WXMSW__
  92. diff --git a/src/sdk/configmanager.cpp b/src/sdk/configmanager.cpp
  93. index 355a1e183..c352b6ed2 100644
  94. --- a/src/sdk/configmanager.cpp
  95. +++ b/src/sdk/configmanager.cpp
  96. @@ -39,11 +39,7 @@
  97. #endif
  98. #ifdef __WXMAC__
  99. -#if wxCHECK_VERSION(3, 0, 0)
  100. #include "wx/osx/core/cfstring.h"
  101. -#else
  102. -#include "wx/mac/corefoundation/cfstring.h"
  103. -#endif
  104. #include "wx/intl.h"
  105. #include <CoreFoundation/CFBundle.h>
  106. @@ -124,11 +120,7 @@ namespace
  107. CFRelease(resourcesURL);
  108. CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kCFURLPOSIXPathStyle);
  109. CFRelease(absoluteURL);
  110. - #if wxCHECK_VERSION(3, 0, 0)
  111. - wxString str = wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
  112. - #else
  113. - wxString str = wxMacCFStringHolder(cfStrPath).AsString(wxLocale::GetSystemEncoding());
  114. - #endif
  115. + wxString str = wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
  116. if (!str.Contains(wxString(_T("/Resources"))))
  117. return ::DetermineExecutablePath() + _T("/.."); // not a bundle, use relative path
  118. return str;
  119. @@ -239,9 +231,7 @@ static void handleConfigError(TiXmlDocument &doc, const wxString &fileName, cons
  120. wxMessageDialog dlg(Manager::Get()->GetAppWindow(),
  121. message + _("\n\nDiscard old config file?"), _("Config file read error"),
  122. wxSTAY_ON_TOP|wxCENTRE|wxYES|wxNO|wxNO_DEFAULT|wxICON_ERROR);
  123. -#if wxCHECK_VERSION(3, 0, 0)
  124. dlg.SetYesNoLabels(_("&Discard"), _("&Close"));
  125. -#endif
  126. if (dlg.ShowModal() != wxID_YES)
  127. cbThrow(message);
  128. @@ -337,15 +327,8 @@ void CfgMgrBldr::SwitchToR(const wxString& absFileName)
  129. {
  130. size_t size = is->GetSize();
  131. wxString str;
  132. - #if wxCHECK_VERSION(3, 0, 0)
  133. wxChar* c = wxStringBuffer(str, size);
  134. - #else
  135. - wxChar* c = str.GetWriteBuf(size);
  136. - #endif
  137. is->Read(c, size);
  138. - #if !wxCHECK_VERSION(3, 0, 0)
  139. - str.UngetWriteBuf(size);
  140. - #endif
  141. doc = new TiXmlDocument();
  142. @@ -493,13 +476,8 @@ wxString CfgMgrBldr::GetConfigFile() const
  143. */
  144. inline void to_upper(wxString& s)
  145. {
  146. - #if wxCHECK_VERSION(3, 0, 0)
  147. wxStringCharType *p = const_cast<wxStringCharType*>(s.wx_str());
  148. wxStringCharType q;
  149. - #else
  150. - wxChar *p = (wxChar*) s.c_str();
  151. - wxChar q;
  152. - #endif
  153. size_t len = s.length()+1;
  154. for (;--len;++p)
  155. {
  156. @@ -511,13 +489,8 @@ inline void to_upper(wxString& s)
  157. inline void to_lower(wxString& s)
  158. {
  159. - #if wxCHECK_VERSION(3, 0, 0)
  160. wxStringCharType *p = const_cast<wxStringCharType*>(s.wx_str());
  161. wxStringCharType q;
  162. - #else
  163. - wxChar *p = (wxChar*) s.c_str();
  164. - wxChar q;
  165. - #endif
  166. size_t len = s.length()+1;
  167. for (;--len;++p)
  168. {
  169. @@ -1239,11 +1212,7 @@ wxArrayString ConfigManager::EnumerateSubPaths(const wxString& path)
  170. {
  171. while (e->IterateChildren(curr) && (curr = e->IterateChildren(curr)->ToElement()))
  172. {
  173. - #if wxCHECK_VERSION(3, 0, 0)
  174. wxUniChar c = cbC2U(curr->Value())[0];
  175. - #else
  176. - wxChar c = *(cbC2U(curr->Value()));
  177. - #endif
  178. if (c < _T('A') || c > _T('Z')) // first char must be a letter, uppercase letters are key names
  179. ret.Add(cbC2U(curr->Value()));
  180. }
  181. @@ -1325,11 +1294,7 @@ wxArrayString ConfigManager::EnumerateKeys(const wxString& path)
  182. {
  183. while (e->IterateChildren(curr) && (curr = e->IterateChildren(curr)->ToElement()))
  184. {
  185. - #if wxCHECK_VERSION(3, 0, 0)
  186. wxUniChar c = cbC2U(curr->Value())[0];
  187. - #else
  188. - wxChar c = *(cbC2U(curr->Value()));
  189. - #endif
  190. if (c >= _T('A') && c <= _T('Z')) // opposite of the above
  191. ret.Add(cbC2U(curr->Value()));
  192. }
  193. diff --git a/src/sdk/globals.cpp b/src/sdk/globals.cpp
  194. index f1fa40eb2..f05975ab0 100644
  195. --- a/src/sdk/globals.cpp
  196. +++ b/src/sdk/globals.cpp
  197. @@ -1186,11 +1186,7 @@ wxBitmap cbLoadBitmapScaled(const wxString& filename, wxBitmapType bitmapType, d
  198. double cbGetContentScaleFactor(const wxWindow &window)
  199. {
  200. -#if wxCHECK_VERSION(3, 0, 0)
  201. return window.GetContentScaleFactor();
  202. -#else
  203. - return 1.0;
  204. -#endif // wxCHECK_VERSION(3, 0, 0)
  205. }
  206. #ifdef __WXGTK__
  207. @@ -1200,31 +1196,12 @@ double cbGetContentScaleFactor(const wxWindow &window)
  208. // For other platforms the value returned by GetContentScalingFactor seems adequate.
  209. double cbGetActualContentScaleFactor(cb_unused const wxWindow &window)
  210. {
  211. -#if wxCHECK_VERSION(3, 0, 0)
  212. // It is possible to use the window to find a display, but unfortunately this doesn't work well,
  213. // because we call this function mostly on windows which haven't been shown. This leads to
  214. // warnings in the log about ClientToScreen failures.
  215. // If there are problems on multi-monitor setups we should think about some other solution. :(
  216. const wxSize ppi = wxGetDisplayPPI();
  217. return ppi.y / 96.0;
  218. -#else // wxCHECK_VERSION(3, 0, 0)
  219. - // This code is the simplest version which works in the most common case.
  220. - // If people complain that multi-monitor setups behave strangely, this should be revised with
  221. - // direct calls to GTK/GDK functions.
  222. -
  223. - // This function might return bad results for multi screen setups.
  224. - const wxSize mm = wxGetDisplaySizeMM();
  225. - if (mm.x == 0 || mm.y == 0)
  226. - return 1.0;
  227. - const wxSize pixels = wxGetDisplaySize();
  228. -
  229. - const double ppiX = wxRound((pixels.x * inches2mm) / mm.x);
  230. - const double ppiY = wxRound((pixels.y * inches2mm) / mm.y);
  231. -
  232. - // My guess is that smaller scaling factor would look better. Probably it has effect only in
  233. - // multi monitor setups where there are monitors with different dpi.
  234. - return std::min(ppiX / 96.0, ppiY /96.0);
  235. -#endif // wxCHECK_VERSION(3, 0, 0)
  236. }
  237. #else // __WXGTK__
  238. double cbGetActualContentScaleFactor(const wxWindow &window)
  239. @@ -1323,11 +1300,7 @@ void SetSettingsIconsStyle(wxListCtrl* lc, SettingsIconsStyle style)
  240. long flags = lc->GetWindowStyleFlag();
  241. switch (style)
  242. {
  243. -#if wxCHECK_VERSION(3, 0, 0)
  244. case sisNoIcons: flags = (flags & ~wxLC_MASK_TYPE) | wxLC_LIST; break;
  245. -#else
  246. - case sisNoIcons: flags = (flags & ~wxLC_MASK_TYPE) | wxLC_SMALL_ICON; break;
  247. -#endif
  248. default: flags = (flags & ~wxLC_MASK_TYPE) | wxLC_ICON; break;
  249. }
  250. lc->SetWindowStyleFlag(flags);
  251. @@ -1713,11 +1686,7 @@ DLLIMPORT wxArrayInt cbGetMultiChoiceDialog(const wxString& message, const wxStr
  252. return wxArrayInt();
  253. }
  254. -#if wxCHECK_VERSION(3, 0, 0)
  255. const char* cbGetTextFromUserPromptStr = wxGetTextFromUserPromptStr;
  256. -#else
  257. -const wxChar* cbGetTextFromUserPromptStr = wxGetTextFromUserPromptStr;
  258. -#endif // wxCHECK_VERSION
  259. wxString cbGetTextFromUser(const wxString& message, const wxString& caption, const wxString& defaultValue,
  260. wxWindow *parent, wxCoord x, wxCoord y, bool centre)
  261. diff --git a/src/sdk/incremental_select_helper.cpp b/src/sdk/incremental_select_helper.cpp
  262. index ba4d0da97..fdcaf95bd 100644
  263. --- a/src/sdk/incremental_select_helper.cpp
  264. +++ b/src/sdk/incremental_select_helper.cpp
  265. @@ -195,10 +195,6 @@ void IncrementalSelectHandler::FilterItems()
  266. FilterItemsFinalize(*m_list, *m_iterator);
  267. }
  268. -#if !wxCHECK_VERSION(3, 0, 0)
  269. - typedef int wxStandardID;
  270. -#endif
  271. -
  272. static wxStandardID KeyDownAction(wxKeyEvent& event, int &selected, int selectedMax)
  273. {
  274. // now, adjust position from key input
  275. diff --git a/src/sdk/newfromtemplatedlg.cpp b/src/sdk/newfromtemplatedlg.cpp
  276. index 8776dcc30..ee65504c3 100644
  277. --- a/src/sdk/newfromtemplatedlg.cpp
  278. +++ b/src/sdk/newfromtemplatedlg.cpp
  279. @@ -195,11 +195,7 @@ void NewFromTemplateDlg::BuildCategoriesFor(TemplateOutputType otype, wxChoice*
  280. cat->SetSelection(0);
  281. }
  282. -#if wxCHECK_VERSION(3, 0, 0)
  283. inline int wxCALLBACK SortTemplates(wxIntPtr item1, wxIntPtr item2, cb_unused wxIntPtr sortData)
  284. -#else
  285. -inline int wxCALLBACK SortTemplates(long item1, long item2, cb_unused long sortData)
  286. -#endif
  287. {
  288. ListItemData* data1 = reinterpret_cast<ListItemData*>(item1);
  289. ListItemData* data2 = reinterpret_cast<ListItemData*>(item2);
  290. diff --git a/src/sdk/pluginsconfigurationdlg.cpp b/src/sdk/pluginsconfigurationdlg.cpp
  291. index e3949590f..fedb6b845 100644
  292. --- a/src/sdk/pluginsconfigurationdlg.cpp
  293. +++ b/src/sdk/pluginsconfigurationdlg.cpp
  294. @@ -65,11 +65,7 @@ static wxString GetInitialInfo()
  295. return initialInfo;
  296. }
  297. -#if wxCHECK_VERSION(3, 0, 0)
  298. inline int wxCALLBACK sortByTitle(wxIntPtr item1, wxIntPtr item2, cb_unused wxIntPtr sortData)
  299. -#else
  300. -inline int wxCALLBACK sortByTitle(long item1, long item2, cb_unused long sortData)
  301. -#endif
  302. {
  303. const PluginElement* elem1 = (const PluginElement*)item1;
  304. const PluginElement* elem2 = (const PluginElement*)item2;
  305. diff --git a/src/sdk/printing_types.cpp b/src/sdk/printing_types.cpp
  306. index 8b62f7983..1cd00a55d 100644
  307. --- a/src/sdk/printing_types.cpp
  308. +++ b/src/sdk/printing_types.cpp
  309. @@ -28,21 +28,13 @@ void InitPrinting()
  310. {
  311. g_printer = new wxPrinter;
  312. int paperid = Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperid"), wxPAPER_A4 );
  313. - #if wxCHECK_VERSION(3, 0, 0)
  314. wxPrintOrientation paperorientation = static_cast<wxPrintOrientation>( Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperorientation"), wxPORTRAIT ) );
  315. - #else
  316. - int paperorientation = Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperorientation"), wxPORTRAIT );
  317. - #endif
  318. wxPrintData* ppd = &(g_printer->GetPrintDialogData().GetPrintData());
  319. ppd->SetPaperId((wxPaperSize)paperid);
  320. - #if wxCHECK_VERSION(3, 0, 0)
  321. if (paperorientation == wxPORTRAIT)
  322. ppd->SetOrientation(wxPORTRAIT);
  323. else
  324. ppd->SetOrientation(wxLANDSCAPE);
  325. - #else
  326. - ppd->SetOrientation(paperorientation);
  327. - #endif
  328. }
  329. // if (!g_pageSetupData)
  330. diff --git a/src/sdk/scripting/bindings/sc_globals.cpp b/src/sdk/scripting/bindings/sc_globals.cpp
  331. index 3b29eb452..b08dd010e 100644
  332. --- a/src/sdk/scripting/bindings/sc_globals.cpp
  333. +++ b/src/sdk/scripting/bindings/sc_globals.cpp
  334. @@ -303,15 +303,7 @@ namespace ScriptBindings
  335. if (id != wxNOT_FOUND)
  336. {
  337. wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, id);
  338. - #if wxCHECK_VERSION(3, 0, 0)
  339. mbar->GetEventHandler()->ProcessEvent(evt);
  340. - #else
  341. - if ( !mbar->ProcessEvent(evt) )
  342. - {
  343. - wxString msg; msg.Printf(_("Calling the menu '%s' with ID %d failed."), menuPath.wx_str(), id);
  344. - cbMessageBox(msg, _("Script error"), wxICON_WARNING);
  345. - }
  346. - #endif
  347. // done
  348. }
  349. break;
  350. diff --git a/src/sdk/toolsmanager.cpp b/src/sdk/toolsmanager.cpp
  351. index 86ec3e206..bd128893b 100644
  352. --- a/src/sdk/toolsmanager.cpp
  353. +++ b/src/sdk/toolsmanager.cpp
  354. @@ -129,11 +129,7 @@ bool ToolsManager::Execute(const cbTool* tool)
  355. // log info so user can troubleshoot
  356. dir = wxGetCwd(); // read in the actual working dir
  357. - #if wxCHECK_VERSION(3, 0, 0)
  358. Manager::Get()->GetLogManager()->Log(F(_("Launching tool '%s': %s (in %s)"), tool->GetName().wx_str(), cmdline.wx_str(), dir.wx_str()));
  359. - #else
  360. - Manager::Get()->GetLogManager()->Log(F(_("Launching tool '%s': %s (in %s)"), tool->GetName().c_str(), cmdline.c_str(), dir.c_str()));
  361. - #endif
  362. bool pipe = true;
  363. int flags = wxEXEC_ASYNC;
  364. diff --git a/src/sdk/uservarmanager.cpp b/src/sdk/uservarmanager.cpp
  365. index fa1118f40..ee21a10eb 100644
  366. --- a/src/sdk/uservarmanager.cpp
  367. +++ b/src/sdk/uservarmanager.cpp
  368. @@ -32,9 +32,7 @@
  369. #include "annoyingdialog.h"
  370. -#if wxCHECK_VERSION(3, 0, 0)
  371. #include <wx/unichar.h>
  372. -#endif
  373. #include <ctype.h>
  374. @@ -637,11 +635,7 @@ void UsrGlblMgrEditDialog::Sanitise(wxString& s)
  375. }
  376. for (unsigned int i = 0; i < s.length(); ++i)
  377. -#if wxCHECK_VERSION(3, 0, 0)
  378. s[i] = wxIsalnum(s.GetChar(i)) ? s.GetChar(i) : wxUniChar('_');
  379. -#else
  380. - s[i] = wxIsalnum(s.GetChar(i)) ? s.GetChar(i) : _T('_');
  381. -#endif
  382. if (s.GetChar(0) == _T('_'))
  383. s.Prepend(_T("set"));
  384. diff --git a/src/sdk/xtra_res.cpp b/src/sdk/xtra_res.cpp
  385. index 1efe04276..aa7f2ed2b 100644
  386. --- a/src/sdk/xtra_res.cpp
  387. +++ b/src/sdk/xtra_res.cpp
  388. @@ -100,11 +100,7 @@ wxBitmap wxToolBarAddOnXmlHandler::GetCenteredBitmap(const wxString& param, wxSi
  389. return stockArt;
  390. }
  391. -#if wxCHECK_VERSION(3, 0, 0)
  392. const wxString name = GetParamValue(paramNode);
  393. -#else
  394. - const wxString name = GetParamValue(param);
  395. -#endif
  396. if (name.empty())
  397. return wxArtProvider::GetBitmap(wxT("sdk/missing_icon"), wxART_TOOLBAR, size * scaleFactor);
  398. @@ -186,19 +182,10 @@ wxObject *wxToolBarAddOnXmlHandler::DoCreateResource()
  399. if (GetPosition() != wxDefaultPosition)
  400. {
  401. m_toolbar->AddTool(GetID(),
  402. - #if wxCHECK_VERSION(3, 0, 0)
  403. wxEmptyString,
  404. - #endif
  405. GetCenteredBitmap(_T("bitmap"), bitmapSize, scaleFactor),
  406. GetCenteredBitmap(_T("bitmap2"), bitmapSize, scaleFactor),
  407. - #if !wxCHECK_VERSION(3, 0, 0)
  408. - GetBool(_T("toggle")),
  409. - GetPosition().x,
  410. - GetPosition().y,
  411. - NULL,
  412. - #else
  413. wxITEM_NORMAL,
  414. - #endif
  415. GetText(_T("tooltip")),
  416. GetText(_T("longhelp")));
  417. }
  418. @@ -332,15 +319,9 @@ bool wxToolBarAddOnXmlHandler::CanHandle(wxXmlNode *node)
  419. //
  420. // Don't ask me why... >:-|
  421. - #if wxCHECK_VERSION(3, 0, 0)
  422. bool istbar = node->GetAttribute(wxT("class"), wxEmptyString).Matches(_T("wxToolBarAddOn"));
  423. bool istool = node->GetAttribute(wxT("class"), wxEmptyString).Matches(_T("tool"));
  424. bool issep = node->GetAttribute(wxT("class"), wxEmptyString).Matches(_T("separator"));
  425. - #else
  426. - bool istbar = node->GetPropVal(wxT("class"), wxEmptyString).Matches(_T("wxToolBarAddOn"));
  427. - bool istool = node->GetPropVal(wxT("class"), wxEmptyString).Matches(_T("tool"));
  428. - bool issep = node->GetPropVal(wxT("class"), wxEmptyString).Matches(_T("separator"));
  429. - #endif
  430. return ((!m_isInside && istbar) ||
  431. (m_isInside && istool) ||