New package: codeblocks
codeblocks: add patch file for wxWidgets 3.1.6 and disable compiler
This commit is contained in:
parent
bab797febb
commit
dd3c9ea480
|
@ -183,6 +183,10 @@ PACKAGES+=" rsync"
|
|||
# Needed by megacmd
|
||||
PACKAGES+=" wget"
|
||||
|
||||
# Needed by codeblocks
|
||||
PACKAGES+=" libwxgtk3.0-gtk3-dev"
|
||||
PACKAGES+=" libgtk-3-dev"
|
||||
|
||||
# Needed by packages in unstable repository.
|
||||
PACKAGES+=" comerr-dev"
|
||||
PACKAGES+=" docbook-to-man"
|
||||
|
|
|
@ -0,0 +1,205 @@
|
|||
------------------------------------------------------------------------
|
||||
r11938 | mortenmacfly | 2020-01-05 00:41:53 +0900 (Sun, 05 Jan 2020) | 1 line
|
||||
|
||||
* applied patch #805: Flashing icons in Windows' taskbar while starting C::B. Thanks Miguel Gimenez.
|
||||
------------------------------------------------------------------------
|
||||
Index: src/include/compiler.h
|
||||
===================================================================
|
||||
--- src/include/compiler.h (revision 11937)
|
||||
+++ src/include/compiler.h (revision 11938)
|
||||
@@ -100,12 +100,12 @@
|
||||
}
|
||||
RegExStruct& operator=(const RegExStruct &obj)
|
||||
{
|
||||
- desc=obj.desc;
|
||||
- lt=obj.lt;
|
||||
- regex=obj.regex;
|
||||
- regexCompiled=false;
|
||||
- filename=obj.filename;
|
||||
- line=obj.line;
|
||||
+ desc = obj.desc;
|
||||
+ lt = obj.lt;
|
||||
+ regex = obj.regex;
|
||||
+ regexCompiled = false;
|
||||
+ filename = obj.filename;
|
||||
+ line = obj.line;
|
||||
memcpy(msg, obj.msg, sizeof(msg));
|
||||
|
||||
return *this;
|
||||
@@ -404,6 +404,9 @@
|
||||
// keeps a copy of current settings (works only the first time it's called)
|
||||
void MirrorCurrentSettings();
|
||||
|
||||
+ // execute without creating taskbar icon
|
||||
+ long Execute(const wxString& cmd, wxArrayString& output);
|
||||
+
|
||||
// set the following members in your class
|
||||
wxString m_Name;
|
||||
wxString m_MasterPath;
|
||||
Index: src/plugins/compilergcc/compilerMINGW.cpp
|
||||
===================================================================
|
||||
--- src/plugins/compilergcc/compilerMINGW.cpp (revision 11937)
|
||||
+++ src/plugins/compilergcc/compilerMINGW.cpp (revision 11938)
|
||||
@@ -173,7 +173,7 @@
|
||||
{
|
||||
// Manager::Get()->GetLogManager()->DebugLog(_T("Compiler detection for compiler ID: '") + GetID() + _T("' (parent ID= '") + GetParentID() + _T("')"));
|
||||
|
||||
- wxArrayString output, errors;
|
||||
+ wxArrayString output;
|
||||
wxString sep = wxFileName::GetPathSeparator();
|
||||
wxString master_path = m_MasterPath;
|
||||
wxString compiler_exe = m_Programs.C;
|
||||
@@ -223,16 +223,7 @@
|
||||
|
||||
// Manager::Get()->GetLogManager()->DebugLog(_T("Compiler version detection: Issuing command: ") + gcc_command);
|
||||
|
||||
- int flags = wxEXEC_SYNC;
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
|
||||
- // that occurs from time to time on wx3
|
||||
- flags |= wxEXEC_NOEVENTS;
|
||||
-#else
|
||||
- flags |= wxEXEC_NODISABLE;
|
||||
-#endif
|
||||
- long result = wxExecute(gcc_command + _T(" --version"), output, errors, flags );
|
||||
- if(result != 0)
|
||||
+ if ( Execute(gcc_command + _T(" --version"), output) != 0 )
|
||||
{
|
||||
// Manager::Get()->GetLogManager()->DebugLog(_T("Compiler version detection: Error executing command."));
|
||||
}
|
||||
Index: src/sdk/compiler.cpp
|
||||
===================================================================
|
||||
--- src/sdk/compiler.cpp (revision 11937)
|
||||
+++ src/sdk/compiler.cpp (revision 11938)
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "compilerfactory.h"
|
||||
|
||||
#include <wx/intl.h>
|
||||
+ #include <wx/process.h>
|
||||
#include <wx/regex.h>
|
||||
+ #include <wx/txtstrm.h>
|
||||
#endif
|
||||
|
||||
#include "compilercommandgenerator.h"
|
||||
@@ -28,7 +30,6 @@
|
||||
#include <wx/filefn.h>
|
||||
#include <wx/xml/xml.h>
|
||||
|
||||
-
|
||||
// static
|
||||
wxArrayString Compiler::m_CompilerIDs; // map to guarantee unique IDs
|
||||
|
||||
@@ -1229,18 +1230,7 @@
|
||||
|
||||
long ret = -1;
|
||||
if ( !cmd[0].IsEmpty() ) // should never be empty
|
||||
- {
|
||||
- int flags = wxEXEC_SYNC;
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
- // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
|
||||
- // that occurs from time to time on wx3
|
||||
- flags |= wxEXEC_NOEVENTS;
|
||||
- #else
|
||||
- flags |= wxEXEC_NODISABLE;
|
||||
- #endif
|
||||
- wxLogNull logNo; // do not warn if execution fails
|
||||
- ret = wxExecute(GetStringFromArray(cmd, wxT(" "), false), cmd, flags);
|
||||
- }
|
||||
+ ret = Execute(GetStringFromArray(cmd, wxT(" "), false), cmd);
|
||||
|
||||
if (ret != 0) // execution failed
|
||||
val = (node->GetAttribute(wxT("default"), wxEmptyString) == wxT("true"));
|
||||
@@ -1284,3 +1274,93 @@
|
||||
ret = m_Programs.MAKE;
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+#ifdef __WXMSW__
|
||||
+
|
||||
+// In MSW calling wxExecute in synchronous mode while the main window is not visible makes
|
||||
+// the system show a C::B icon in the taskbar. When this is made repeatedly (as in compiler
|
||||
+// loading) the result is a stream of flashing icons.
|
||||
+// However, wxExecute in asynchronous mode does not do this. The caveat is that we must wait
|
||||
+// in a loop for the end of the task and extract the command output in a separate step.
|
||||
+
|
||||
+// This auxiliary class is needed for detecting the end of the task and retrieving the ouput.
|
||||
+// OnTerminate() will be called when the task ends with the return code of the task, and then
|
||||
+// the task output can be retrieved (as a stream).
|
||||
+
|
||||
+class ExecProcess : public wxProcess
|
||||
+{
|
||||
+ public:
|
||||
+ ExecProcess(cb_unused wxEvtHandler *parent = NULL, cb_unused int id = -1)
|
||||
+ {
|
||||
+ m_status = 0;
|
||||
+ }
|
||||
+
|
||||
+ long GetStatus() const {return m_status;}
|
||||
+ wxSemaphore &GetSemaphore() {return m_semaphore;}
|
||||
+ void OnTerminate(cb_unused int pid, int status)
|
||||
+ {
|
||||
+ m_status = status;
|
||||
+ m_semaphore.Post();
|
||||
+ }
|
||||
+
|
||||
+ protected:
|
||||
+ long m_status;
|
||||
+ wxSemaphore m_semaphore;
|
||||
+};
|
||||
+
|
||||
+// Emulates wxExecute() in synchronous mode using asynchronous mode
|
||||
+
|
||||
+long Compiler::Execute(const wxString &cmd, wxArrayString &output)
|
||||
+{
|
||||
+ wxLogNull logNo; // do not warn if execution fails
|
||||
+
|
||||
+ output.Clear();
|
||||
+
|
||||
+ ExecProcess process;
|
||||
+ process.Redirect(); // capture task input/output streams
|
||||
+
|
||||
+ // wxExecute in asynchronous mode returns 0 if execution failed.
|
||||
+ // Return -1 emulating the behaviour of wxExecute in synchronous mode
|
||||
+ if ( !wxExecute(cmd, wxEXEC_ASYNC, &process) )
|
||||
+ return -1;
|
||||
+
|
||||
+ // Wait for the end of the task
|
||||
+ for (;;)
|
||||
+ {
|
||||
+ Manager::Yield(); // needed for semaphore update
|
||||
+ if (process.GetSemaphore().WaitTimeout(25) == wxSEMA_NO_ERROR)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ // Loads the wxArrayString with the task output (returned in a wxInputStream)
|
||||
+ wxInputStream *inputStream = process.GetInputStream();
|
||||
+ wxTextInputStream text(*inputStream);
|
||||
+#if wxCHECK_VERSION(3, 0, 0)
|
||||
+ while (!text.GetInputStream().Eof())
|
||||
+#else
|
||||
+ while (!inputStream->Eof())
|
||||
+#endif
|
||||
+ {
|
||||
+ output.Add(text.ReadLine());
|
||||
+ }
|
||||
+
|
||||
+ // Return task exit code emulating the behaviour of wxExecute in synchronous mode
|
||||
+ return process.GetStatus();
|
||||
+}
|
||||
+
|
||||
+#else // __WXMSW__
|
||||
+
|
||||
+long Compiler::Execute(const wxString &cmd, wxArrayString &output)
|
||||
+{
|
||||
+ wxLogNull logNo; // do not warn if execution fails
|
||||
+ int flags = wxEXEC_SYNC;
|
||||
+ #if wxCHECK_VERSION(3, 0, 0)
|
||||
+ // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
|
||||
+ // that occurs from time to time on wx3
|
||||
+ flags |= wxEXEC_NOEVENTS;
|
||||
+ #else
|
||||
+ flags |= wxEXEC_NODISABLE;
|
||||
+ #endif
|
||||
+ return wxExecute(cmd, output, flags);
|
||||
+}
|
||||
+#endif // __WXMSW__
|
|
@ -0,0 +1,39 @@
|
|||
------------------------------------------------------------------------
|
||||
r11991 | fuscated | 2020-03-23 05:02:49 +0900 (Mon, 23 Mar 2020) | 8 lines
|
||||
|
||||
- build: Fixes to make it compile when using wx-master
|
||||
|
||||
> Paint events aren't no longer allowed to be created. We've used this in a
|
||||
single place in the code. I'm not sure what is the idea behind this,
|
||||
probably to redraw something. For now I'm removing it and we'll see if
|
||||
something breaks.
|
||||
> The second change is the removal of a c-tor in wxPGWindowList, I've
|
||||
replaced it with the non-generic two parameter one.
|
||||
------------------------------------------------------------------------
|
||||
Index: src/src/main.cpp
|
||||
===================================================================
|
||||
--- src/src/main.cpp (revision 11990)
|
||||
+++ src/src/main.cpp (revision 11991)
|
||||
@@ -2680,8 +2680,6 @@
|
||||
else
|
||||
{
|
||||
wxBusyCursor useless;
|
||||
- wxPaintEvent e;
|
||||
- ProcessEvent(e);
|
||||
for (unsigned int i = 0; i < files.GetCount(); ++i)
|
||||
success &= OpenGeneric(files[i]);
|
||||
}
|
||||
Index: src/src/watchesdlg.cpp
|
||||
===================================================================
|
||||
--- src/src/watchesdlg.cpp (revision 11990)
|
||||
+++ src/src/watchesdlg.cpp (revision 11991)
|
||||
@@ -103,8 +103,7 @@
|
||||
cb_unused const wxPoint& pos,
|
||||
cb_unused const wxSize& sz) const override
|
||||
{
|
||||
- wxPGWindowList const list;
|
||||
- return list;
|
||||
+ return wxPGWindowList(nullptr, nullptr);
|
||||
}
|
||||
void UpdateControl(cb_unused wxPGProperty* property, cb_unused wxWindow* ctrl) const override {}
|
||||
bool OnEvent(cb_unused wxPropertyGrid* propgrid, cb_unused wxPGProperty* property,
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,77 @@
|
|||
------------------------------------------------------------------------
|
||||
r12281 | mortenmacfly | 2020-12-29 18:51:54 +0900 (Tue, 29 Dec 2020) | 1 line
|
||||
|
||||
* updated AUTHORS file and about dialog to better reflect current developers/contribters
|
||||
------------------------------------------------------------------------
|
||||
Index: AUTHORS
|
||||
===================================================================
|
||||
--- AUTHORS (revision 12280)
|
||||
+++ AUTHORS (revision 12281)
|
||||
@@ -12,6 +12,8 @@
|
||||
Daniel Anselmi : Developer
|
||||
Yuanhui Zhang : Developer
|
||||
Damien Moore : Developer
|
||||
+Micah Ng : Developer
|
||||
+BlueHazzard : Developer
|
||||
Ricardo Garcia : All-hands person
|
||||
Paul A. Jimenez : Help and AStyle plugins
|
||||
Thomas Lorblanches : CodeStat and Profiler plugins
|
||||
@@ -20,13 +22,16 @@
|
||||
Pecan Heber : Keybinder, BrowseTracker, DragScroll
|
||||
CodeSnippets plugins
|
||||
Arto Jonsson : CodeSnippets plugin (passed on to Pecan)
|
||||
-Mario Cupelli : User's manual
|
||||
+Darius Markauskas : Fortran support
|
||||
+Mario Cupelli : Compiler support for embedded systems
|
||||
+ User's manual
|
||||
+Jonas Zinn : Misc. wxSmith AddOns and plugins
|
||||
+Mirai Computing : cbp2make tool
|
||||
Anders F Bjoerklund : wxMac compatibility
|
||||
|
||||
Contributors (in no special order):
|
||||
-----------------------------------
|
||||
Daniel Orb : RPM spec file and packages
|
||||
-Mario Cupelli : Compiler support for embedded systems
|
||||
byo,elvstone, me22 : Conversion to Unicode
|
||||
pasgui : Providing Ubuntu nightly packages
|
||||
Hakki Dogusan : DigitalMars compiler support
|
||||
@@ -37,6 +42,10 @@
|
||||
Sylvain Prat : Initial MSVC workspace and project importers
|
||||
Chris Raschko : Design of the 3D logo for Code::Blocks
|
||||
J.A. Ortega : 3D Icon based on the above
|
||||
+Alexandr Efremo : Providing OpenSuSe packages
|
||||
+Huki : Misc. Code-Completion improvements
|
||||
+stahta01 : Misc. patches for several enhancements
|
||||
+Miguel Gimenez : Misc. patches for several enhancements
|
||||
|
||||
All contributors that provided patches.
|
||||
|
||||
Index: src/src/dlgabout.cpp
|
||||
===================================================================
|
||||
--- src/src/dlgabout.cpp (revision 12280)
|
||||
+++ src/src/dlgabout.cpp (revision 12281)
|
||||
@@ -84,6 +84,7 @@
|
||||
txtDescription->SetValue(description);
|
||||
|
||||
wxTextCtrl *txtThanksTo = XRCCTRL(*this, "txtThanksTo", wxTextCtrl);
|
||||
+ // Note: Keep this is sync with the AUTHORS file in SVN.
|
||||
txtThanksTo->SetValue(_(
|
||||
"Developers:\n"
|
||||
"--------------\n"
|
||||
@@ -100,6 +101,7 @@
|
||||
"Yuanhui Zhang : Developer\n"
|
||||
"Damien Moore : Developer\n"
|
||||
"Micah Ng : Developer\n"
|
||||
+ "BlueHazzard : Developer\n"
|
||||
"Ricardo Garcia : All-hands person\n"
|
||||
"Paul A. Jimenez : Help and AStyle plugins\n"
|
||||
"Thomas Lorblanches : CodeStat and Profiler plugins\n"
|
||||
@@ -131,7 +133,7 @@
|
||||
"Alexandr Efremo : Providing OpenSuSe packages\n"
|
||||
"Huki : Misc. Code-Completion improvements\n"
|
||||
"stahta01 : Misc. patches for several enhancements\n"
|
||||
- "BlueHazzard : Misc. patches for several enhancements\n"
|
||||
+ "Miguel Gimenez : Misc. patches for several enhancements\n"
|
||||
"\n"
|
||||
"All contributors that provided patches.\n"
|
||||
"The wxWidgets project (http://www.wxwidgets.org).\n"
|
|
@ -0,0 +1,64 @@
|
|||
------------------------------------------------------------------------
|
||||
r12305 | fuscated | 2021-03-17 08:28:35 +0900 (Wed, 17 Mar 2021) | 9 lines
|
||||
|
||||
* UI: Add display info in the Help -> About -> Information dialog
|
||||
|
||||
> There are many reports of people having trouble with either multi monitor
|
||||
setups or HiDPI setups. It would be a lot easier if they could gather
|
||||
the information form one single place.
|
||||
> Note0: The scaling factors are based on the scaling factors of the About
|
||||
dialog. In a system which supports monitors with different PPIs it might
|
||||
report the incorrect value.
|
||||
> Note1: wxGetDisplayPPI is also some global and not per display.
|
||||
------------------------------------------------------------------------
|
||||
Index: src/src/dlgabout.cpp
|
||||
===================================================================
|
||||
--- src/src/dlgabout.cpp (revision 12304)
|
||||
+++ src/src/dlgabout.cpp (revision 12305)
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/dcmemory.h> // wxMemoryDC
|
||||
+#include <wx/display.h>
|
||||
#include <wx/statbmp.h>
|
||||
|
||||
#include "appglobals.h"
|
||||
@@ -164,10 +165,38 @@
|
||||
items.push_back({_("Version"), appglobals::AppActualVersion});
|
||||
items.push_back({_("SDK Version"), appglobals::AppSDKVersion});
|
||||
items.push_back({_("Scintilla Version"), scintillaStr});
|
||||
+
|
||||
items.push_back({_("Author"), _("The Code::Blocks Team")});
|
||||
items.push_back({_("E-mail"), appglobals::AppContactEmail});
|
||||
items.push_back({_("Website"), appglobals::AppUrl});
|
||||
|
||||
+ items.push_back({_("Scaling factor"), wxString::Format("%f", GetContentScaleFactor())});
|
||||
+ items.push_back({_("Detected scaling factor"),
|
||||
+ wxString::Format("%f", cbGetActualContentScaleFactor(*this))});
|
||||
+ const wxSize displayPPI = wxGetDisplayPPI();
|
||||
+ items.push_back({_("Display PPI"), wxString::Format("%dx%d", displayPPI.x, displayPPI.y)});
|
||||
+
|
||||
+ unsigned displays = wxDisplay::GetCount();
|
||||
+ items.push_back({_("Display count"), wxString::Format("%u", displays)});
|
||||
+
|
||||
+ for (unsigned ii = 0; ii < displays; ++ii)
|
||||
+ {
|
||||
+ wxDisplay display(ii);
|
||||
+
|
||||
+ Item item;
|
||||
+ item.name = wxString::Format(_("Display %u"), ii);
|
||||
+
|
||||
+ const wxString &name = display.GetName();
|
||||
+ if (!name.empty())
|
||||
+ item.name += " (" + name + ")";
|
||||
+
|
||||
+ const wxRect geometry = display.GetGeometry();
|
||||
+ item.value= wxString::Format(_("XY=[%d,%d]; Size=[%d,%d]; %s"), geometry.GetLeft(),
|
||||
+ geometry.GetTop(), geometry.GetWidth(), geometry.GetHeight(),
|
||||
+ (display.IsPrimary() ? _("Primary") : wxString()));
|
||||
+ items.push_back(item);
|
||||
+ }
|
||||
+
|
||||
int maxNameLength = 0;
|
||||
for (const Item &item : items)
|
||||
{
|
|
@ -0,0 +1,48 @@
|
|||
------------------------------------------------------------------------
|
||||
r12312 | mortenmacfly | 2021-04-03 14:14:39 +0900 (Sat, 03 Apr 2021) | 1 line
|
||||
|
||||
* applied patch #1079 Don't call wxChoice::GetString() with wxNOT_FOUND (thanks Miguel Gimenez)
|
||||
------------------------------------------------------------------------
|
||||
Index: src/plugins/contrib/FileManager/FileExplorerUpdater.cpp
|
||||
===================================================================
|
||||
--- src/plugins/contrib/FileManager/FileExplorerUpdater.cpp (revision 12311)
|
||||
+++ src/plugins/contrib/FileManager/FileExplorerUpdater.cpp (revision 12312)
|
||||
@@ -150,10 +150,16 @@
|
||||
m_path=wxString(m_fe->GetFullPath(ti).c_str());
|
||||
m_wildcard=wxString(m_fe->m_WildCards->GetValue().c_str());
|
||||
m_vcs_type=wxString(m_fe->m_VCS_Type->GetLabel().c_str());
|
||||
- m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str());
|
||||
+ const int selection = m_fe->m_VCS_Control->GetSelection();
|
||||
+ if (selection == wxNOT_FOUND)
|
||||
+ m_vcs_commit_string.clear();
|
||||
+ else
|
||||
+ m_vcs_commit_string = wxString(m_fe->m_VCS_Control->GetString(selection).c_str());
|
||||
+
|
||||
m_vcs_changes_only = m_fe->m_VCS_ChangesOnly->IsChecked();
|
||||
- if (m_vcs_type != wxEmptyString)
|
||||
+ if (!m_vcs_type.empty())
|
||||
m_repo_path=wxString(m_fe->GetRootFolder().c_str());
|
||||
+
|
||||
GetTreeState(ti);
|
||||
if (Create()==wxTHREAD_NO_ERROR)
|
||||
{
|
||||
@@ -1262,11 +1268,17 @@
|
||||
m_source_path=wxString(source_path.c_str());
|
||||
m_destination_path=wxString(destination_path.c_str());
|
||||
m_vcs_type=wxString(m_fe->m_VCS_Type->GetLabel().c_str());
|
||||
- m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str());
|
||||
+ const int selection = m_fe->m_VCS_Control->GetSelection();
|
||||
+ if (selection == wxNOT_FOUND)
|
||||
+ m_vcs_commit_string.clear();
|
||||
+ else
|
||||
+ m_vcs_commit_string = wxString(m_fe->m_VCS_Control->GetString(selection).c_str());
|
||||
+
|
||||
m_vcs_op = wxString(op.c_str());
|
||||
m_vcs_comp_commit = wxString(comp_commit.c_str());
|
||||
- if (m_vcs_type != wxEmptyString)
|
||||
+ if (!m_vcs_type.empty())
|
||||
m_repo_path=wxString(m_fe->GetRootFolder().c_str());
|
||||
+
|
||||
if (Create()==wxTHREAD_NO_ERROR)
|
||||
{
|
||||
SetPriority(20);
|
|
@ -0,0 +1,24 @@
|
|||
------------------------------------------------------------------------
|
||||
r12511 | fuscated | 2021-08-15 20:51:11 +0900 (Sun, 15 Aug 2021) | 7 lines
|
||||
|
||||
* SDK: Fix a regex in the MacroManager to work with the PCRE2 regex engine used by wx3.1.6 (ticket #1120)
|
||||
|
||||
> This regex is totally bonkers. I don't know what its purpose is, but it
|
||||
is mighty strange. There is a group at the beginning which tries to match
|
||||
non-$ or start of the string. At the end there is code to match ' ', '/'
|
||||
or '\'. The braces could be mismatched - ${var) works perfectly fine.
|
||||
> The fix is - we want to match '\', so we need to escape it.
|
||||
------------------------------------------------------------------------
|
||||
Index: src/sdk/macrosmanager.cpp
|
||||
===================================================================
|
||||
--- src/sdk/macrosmanager.cpp (revision 12510)
|
||||
+++ src/sdk/macrosmanager.cpp (revision 12511)
|
||||
@@ -80,7 +80,7 @@
|
||||
m_Plugins = UnixFilename(ConfigManager::GetPluginsFolder());
|
||||
m_DataPath = UnixFilename(ConfigManager::GetDataFolder());
|
||||
ClearProjectKeys();
|
||||
- m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[)} /\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE);
|
||||
+ m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[\\)} /\\\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE);
|
||||
m_RE_DOS.Compile(_T("([^%]|^)(%(#?[A-Za-z_0-9.]+)%)"), wxRE_EXTENDED | wxRE_NEWLINE);
|
||||
m_RE_IfSp.Compile(_T("(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE);
|
||||
m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE);
|
|
@ -0,0 +1,21 @@
|
|||
------------------------------------------------------------------------
|
||||
r12532 | ollydbg | 2021-10-06 23:29:21 +0900 (Wed, 06 Oct 2021) | 4 lines
|
||||
|
||||
* Fix CCManager compilation with C++17(apply patch #1142, thanks Miguel Gimenez)
|
||||
|
||||
See details in: https://sourceforge.net/p/codeblocks/tickets/1142/
|
||||
and forum discussion: https://forums.codeblocks.org/index.php/topic,24643.0.html
|
||||
------------------------------------------------------------------------
|
||||
Index: src/include/ccmanager.h
|
||||
===================================================================
|
||||
--- src/include/ccmanager.h (revision 12531)
|
||||
+++ src/include/ccmanager.h (revision 12532)
|
||||
@@ -44,7 +44,7 @@
|
||||
* list or the doxygen popup, the scroll event is instead sent there (and skipped for the editor
|
||||
* window).
|
||||
*/
|
||||
-class DLLIMPORT CCManager : public Mgr<CCManager>, wxEvtHandler
|
||||
+class DLLIMPORT CCManager : public Mgr<CCManager>, public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
friend class Mgr<CCManager>;
|
|
@ -0,0 +1,719 @@
|
|||
------------------------------------------------------------------------
|
||||
r12578 | wh11204 | 2021-12-14 17:57:56 +0900 (Tue, 14 Dec 2021) | 15 lines
|
||||
|
||||
- Remove code for wxWidgets < 3.0.0 (part I).
|
||||
Includes:
|
||||
src\include\cbart_provider.h
|
||||
src\include\cbauibook.h
|
||||
src\include\globals.h
|
||||
src\include\logmanager.h
|
||||
src\include\scrollingdialog.h
|
||||
src\plugins\debuggergdb\debuggergdb.cpp
|
||||
src\plugins\debuggergdb\gdb_commands.h
|
||||
src\sdk\base64.cpp
|
||||
src\sdk\cbauibook.cpp
|
||||
src\sdk\crc32.cpp
|
||||
src\sdk\editorcolourset.cpp
|
||||
src\sdk\editorlexerloader.cpp
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/include/scrollingdialog.h
|
||||
===================================================================
|
||||
--- src/include/scrollingdialog.h (revision 12577)
|
||||
+++ src/include/scrollingdialog.h (revision 12578)
|
||||
@@ -30,140 +30,11 @@
|
||||
class wxButton;
|
||||
class wxScrolledWindow;
|
||||
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
-class wxDialogLayoutAdapter: public wxObject
|
||||
-{
|
||||
- DECLARE_CLASS(wxDialogLayoutAdapter)
|
||||
-public:
|
||||
- wxDialogLayoutAdapter() {}
|
||||
-
|
||||
- /// Override this function to indicate that adaptation should be done
|
||||
- virtual bool CanDoLayoutAdaptation(wxDialogHelper* dialog) = 0;
|
||||
-
|
||||
- /// Override this function to do the adaptation
|
||||
- virtual bool DoLayoutAdaptation(wxDialogHelper* dialog) = 0;
|
||||
-};
|
||||
-
|
||||
/*!
|
||||
- * Standard adapter. Does scrolling adaptation for paged and regular dialogs.
|
||||
- *
|
||||
- */
|
||||
-
|
||||
-class wxStandardDialogLayoutAdapter: public wxDialogLayoutAdapter
|
||||
-{
|
||||
- DECLARE_CLASS(wxStandardDialogLayoutAdapter)
|
||||
-public:
|
||||
- wxStandardDialogLayoutAdapter() {}
|
||||
-
|
||||
-// Overrides
|
||||
-
|
||||
- /// Indicate that adaptation should be done
|
||||
- bool CanDoLayoutAdaptation(wxDialogHelper* dialog) override;
|
||||
-
|
||||
- /// Do layout adaptation
|
||||
- bool DoLayoutAdaptation(wxDialogHelper* dialog) override;
|
||||
-
|
||||
-// Implementation
|
||||
-
|
||||
- /// Find a standard or horizontal box sizer
|
||||
- virtual wxSizer* FindButtonSizer(bool stdButtonSizer, wxDialogHelper* dialog, wxSizer* sizer, int& retBorder, int accumlatedBorder = 0);
|
||||
-
|
||||
- /// Check if this sizer contains standard buttons, and so can be repositioned in the dialog
|
||||
- virtual bool IsOrdinaryButtonSizer(wxDialogHelper* dialog, wxBoxSizer* sizer);
|
||||
-
|
||||
- /// Check if this is a standard button
|
||||
- virtual bool IsStandardButton(wxDialogHelper* dialog, wxButton* button);
|
||||
-
|
||||
- /// Find 'loose' main buttons in the existing layout and add them to the standard dialog sizer
|
||||
- virtual bool FindLooseButtons(wxDialogHelper* dialog, wxStdDialogButtonSizer* buttonSizer, wxSizer* sizer, int& count);
|
||||
-
|
||||
- /// Reparent the controls to the scrolled window, except those in buttonSizer
|
||||
- virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
|
||||
-
|
||||
- /// A function to fit the dialog around its contents, and then adjust for screen size.
|
||||
- /// If scrolled windows are passed, scrolling is enabled in the required orientation(s).
|
||||
- virtual bool FitWithScrolling(wxDialog* dialog, wxScrolledWindow* scrolledWindow);
|
||||
- virtual bool FitWithScrolling(wxDialog* dialog, wxWindowList& windows);
|
||||
-
|
||||
- /// Find whether scrolling will be necessary for the dialog, returning wxVERTICAL, wxHORIZONTAL or both
|
||||
- virtual int MustScroll(wxDialog* dialog, wxSize& windowSize, wxSize& displaySize);
|
||||
-};
|
||||
-
|
||||
-/*!
|
||||
- * A base class for dialogs that have adaptation. In wxWidgets 3.0, this will not
|
||||
- * be needed since the new functionality will be implemented in wxDialogBase.
|
||||
- */
|
||||
-
|
||||
-class wxDialogHelper
|
||||
-{
|
||||
-public:
|
||||
-
|
||||
- wxDialogHelper(wxDialog* dialog = NULL) { Init(); m_dialog = dialog; }
|
||||
- virtual ~wxDialogHelper() {}
|
||||
-
|
||||
- void Init();
|
||||
-
|
||||
- void SetDialog(wxDialog* dialog) { m_dialog = dialog; }
|
||||
- wxDialog* GetDialog() const { return m_dialog; }
|
||||
-
|
||||
- /// Do the adaptation
|
||||
- virtual bool DoLayoutAdaptation();
|
||||
-
|
||||
- /// Can we do the adaptation?
|
||||
- virtual bool CanDoLayoutAdaptation();
|
||||
-
|
||||
- /// Returns a content window if there is one
|
||||
- virtual wxWindow* GetContentWindow() const { return NULL; }
|
||||
-
|
||||
- /// Add an id to the list of custom button identifiers that should be in the button sizer
|
||||
- void AddButtonId(wxWindowID id) { m_buttonIds.Add((int) id); }
|
||||
- wxArrayInt& GetButtonIds() { return m_buttonIds; }
|
||||
-
|
||||
- /// Is this id in the custom button id array?
|
||||
- bool IsUserButtonId(wxWindowID id) { return (m_buttonIds.Index((int) id) != wxNOT_FOUND); }
|
||||
-
|
||||
-// ACCESSORS
|
||||
-
|
||||
- /// Level of adaptation, from none (Level 0) to full (Level 3). To disable adaptation,
|
||||
- /// set level 0, for example in your dialog constructor. You might
|
||||
- /// do this if you know that you are displaying on a large screen and you don't want the
|
||||
- /// dialog changed.
|
||||
- void SetLayoutAdaptationLevel(int level) { m_layoutAdaptationLevel = level; }
|
||||
-
|
||||
- /// Get level of adaptation
|
||||
- int GetLayoutAdaptationLevel() const { return m_layoutAdaptationLevel; }
|
||||
-
|
||||
- /// Returns true if the adaptation has been done
|
||||
- void SetLayoutAdaptationDone(bool adaptationDone) { m_layoutLayoutAdaptationDone = adaptationDone; }
|
||||
- bool GetLayoutAdaptationDone() const { return m_layoutLayoutAdaptationDone; }
|
||||
-
|
||||
- /// Set layout adapter class, returning old adapter
|
||||
- static wxDialogLayoutAdapter* SetLayoutAdapter(wxDialogLayoutAdapter* adapter);
|
||||
- static wxDialogLayoutAdapter* GetLayoutAdapter() { return sm_layoutAdapter; }
|
||||
-
|
||||
- /// Global switch for layout adaptation
|
||||
- static bool GetLayoutAdaptation() { return sm_layoutAdaptation; }
|
||||
- static void SetLayoutAdaptation(bool enable) { sm_layoutAdaptation = enable; }
|
||||
-
|
||||
-protected:
|
||||
-
|
||||
- wxDialog* m_dialog;
|
||||
- bool m_layoutLayoutAdaptationDone;
|
||||
- wxArrayInt m_buttonIds;
|
||||
- int m_layoutAdaptationLevel;
|
||||
- static wxDialogLayoutAdapter* sm_layoutAdapter;
|
||||
- static bool sm_layoutAdaptation;
|
||||
-};
|
||||
-#endif //#if !wxCHECK_VERSION(3, 0, 0)
|
||||
-
|
||||
-/*!
|
||||
* A class that makes its content scroll if necessary
|
||||
*/
|
||||
|
||||
class DLLIMPORT wxScrollingDialog: public wxDialog
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- , public wxDialogHelper
|
||||
-#endif
|
||||
{
|
||||
DECLARE_CLASS(wxScrollingDialog)
|
||||
public:
|
||||
@@ -170,11 +41,7 @@
|
||||
|
||||
wxScrollingDialog()
|
||||
{
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- Init();
|
||||
-#else
|
||||
SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
|
||||
-#endif
|
||||
}
|
||||
wxScrollingDialog(wxWindow *parent,
|
||||
int id = wxID_ANY,
|
||||
@@ -184,30 +51,9 @@
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = _("dialogBox"))
|
||||
{
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- Init();
|
||||
-#else
|
||||
SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
|
||||
-#endif
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- bool Create(wxWindow *parent,
|
||||
- int id = wxID_ANY,
|
||||
- const wxString& title = wxEmptyString,
|
||||
- const wxPoint& pos = wxDefaultPosition,
|
||||
- const wxSize& size = wxDefaultSize,
|
||||
- long style = wxDEFAULT_DIALOG_STYLE,
|
||||
- const wxString& name = _("dialogBox"));
|
||||
-
|
||||
- void Init();
|
||||
-
|
||||
- /// Override Show to rejig the control and sizer hierarchy if necessary
|
||||
- bool Show(bool show = true) override;
|
||||
-
|
||||
- /// Override ShowModal to rejig the control and sizer hierarchy if necessary
|
||||
- int ShowModal() override;
|
||||
-#endif
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -215,19 +61,11 @@
|
||||
*/
|
||||
|
||||
class wxScrollingPropertySheetDialog : public wxPropertySheetDialog
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- , public wxDialogHelper
|
||||
-#endif
|
||||
-
|
||||
{
|
||||
public:
|
||||
wxScrollingPropertySheetDialog() : wxPropertySheetDialog()
|
||||
{
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- Init();
|
||||
-#else
|
||||
SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
|
||||
-#endif
|
||||
}
|
||||
|
||||
wxScrollingPropertySheetDialog(wxWindow* parent, wxWindowID id,
|
||||
@@ -237,32 +75,10 @@
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
{
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- Init();
|
||||
-#else
|
||||
SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
|
||||
-#endif
|
||||
Create(parent, id, title, pos, sz, style, name);
|
||||
}
|
||||
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
-//// Accessors
|
||||
-
|
||||
- /// Returns the content window
|
||||
- wxWindow* GetContentWindow() const override;
|
||||
-
|
||||
-/// Operations
|
||||
-
|
||||
- /// Override Show to rejig the control and sizer hierarchy if necessary
|
||||
- bool Show(bool show = true) override;
|
||||
-
|
||||
- /// Override ShowModal to rejig the control and sizer hierarchy if necessary
|
||||
- int ShowModal() override;
|
||||
-
|
||||
-private:
|
||||
- void Init();
|
||||
-#endif
|
||||
-
|
||||
protected:
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollingPropertySheetDialog)
|
||||
Index: src/sdk/base64.cpp
|
||||
===================================================================
|
||||
--- src/sdk/base64.cpp (revision 12577)
|
||||
+++ src/sdk/base64.cpp (revision 12578)
|
||||
@@ -22,9 +22,7 @@
|
||||
|
||||
#include "base64.h"
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
#include <wx/unichar.h>
|
||||
-#endif
|
||||
|
||||
const wxChar fillchar = '=';
|
||||
|
||||
@@ -105,11 +103,7 @@
|
||||
c1 = cvt.Find(data[i]);
|
||||
wxASSERT_MSG(c1 >= 0, _T("invalid base64 input"));
|
||||
c = (c << 2) | ((c1 >> 4) & 0x3);
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
ret.Append(static_cast<wxUniChar>(c), 1);
|
||||
- #else
|
||||
- ret.Append(c, 1);
|
||||
- #endif
|
||||
if (++i < len)
|
||||
{
|
||||
c = data[i];
|
||||
@@ -116,18 +110,10 @@
|
||||
if ((char)fillchar == c)
|
||||
break;
|
||||
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
c = cvt.Find(static_cast<wxUniChar>(c));
|
||||
- #else
|
||||
- c = cvt.Find(c);
|
||||
- #endif
|
||||
wxASSERT_MSG(c >= 0, _T("invalid base64 input"));
|
||||
c1 = ((c1 << 4) & 0xf0) | ((c >> 2) & 0xf);
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
ret.Append(static_cast<wxUniChar>(c1), 1);
|
||||
- #else
|
||||
- ret.Append(c1, 1);
|
||||
- #endif
|
||||
}
|
||||
|
||||
if (++i < len)
|
||||
@@ -136,18 +122,10 @@
|
||||
if ((char)fillchar == c1)
|
||||
break;
|
||||
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
c1 = cvt.Find(static_cast<wxUniChar>(c1));
|
||||
- #else
|
||||
- c1 = cvt.Find(c1);
|
||||
- #endif
|
||||
wxASSERT_MSG(c1 >= 0, _T("invalid base64 input"));
|
||||
c = ((c << 6) & 0xc0) | c1;
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
ret.Append(static_cast<wxUniChar>(c), 1);
|
||||
- #else
|
||||
- ret.Append(c, 1);
|
||||
- #endif
|
||||
}
|
||||
}
|
||||
|
||||
Index: src/include/cbart_provider.h
|
||||
===================================================================
|
||||
--- src/include/cbart_provider.h (revision 12577)
|
||||
+++ src/include/cbart_provider.h (revision 12578)
|
||||
@@ -34,17 +34,13 @@
|
||||
wxString m_prefix;
|
||||
|
||||
struct StringHash
|
||||
- {
|
||||
- size_t operator()(const wxString& s) const
|
||||
- {
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- return std::hash<std::wstring>()(s.ToStdWstring());
|
||||
-#else
|
||||
- return std::hash<std::wstring>()(s.wc_str());
|
||||
-#endif // wxCHECK_VERSION
|
||||
- }
|
||||
- };
|
||||
-
|
||||
+ {
|
||||
+ size_t operator()(const wxString& s) const
|
||||
+ {
|
||||
+ return std::hash<std::wstring>()(s.ToStdWstring());
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
struct Data
|
||||
{
|
||||
Data() : hasFormatting(false) {}
|
||||
Index: src/include/cbauibook.h
|
||||
===================================================================
|
||||
--- src/include/cbauibook.h (revision 12577)
|
||||
+++ src/include/cbauibook.h (revision 12578)
|
||||
@@ -78,25 +78,6 @@
|
||||
* \return int the visible position
|
||||
*/
|
||||
int GetTabPositionFromIndex(int index);
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- /** \brief Set a tab tooltip
|
||||
- *
|
||||
- * Sets the tooltip for the tab belonging to win.
|
||||
- * Starts the dwell timer and the stopwatch if it is not already done.
|
||||
- * \param idx the index of the pane that belongs to the tab
|
||||
- * \param text the tooltip
|
||||
- * @remarks Uses the name of the wxWindow to store the message
|
||||
- * \return bool true if tooltip was updated
|
||||
- */
|
||||
- bool SetPageToolTip(size_t idx, const wxString & text );
|
||||
- /** \brief Get a tab tooltip
|
||||
- *
|
||||
- * Returns the tooltip for the tab label of the page.
|
||||
- * @remarks Uses the name of the wxWindow to store the message
|
||||
- * \return wxString the tooltip of the page with the given index
|
||||
- */
|
||||
- wxString GetPageToolTip(size_t idx );
|
||||
-#endif // !wxCHECK_VERSION(3, 0, 0)
|
||||
/** \brief Minmize free horizontal page
|
||||
*
|
||||
* Moves the active tab of all tabCtrl's to the rightmost place,
|
||||
@@ -205,25 +186,12 @@
|
||||
* \param event
|
||||
* @remarks Works not reliable, due to OS/wxWidgets-limitations
|
||||
*/
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
void OnNavigationKeyNotebook(wxNavigationKeyEvent& event);
|
||||
-#else
|
||||
- void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
-#endif // wxCHECK_VERSION(3, 0, 0)
|
||||
/** \brief OnIdle
|
||||
*
|
||||
* \param event unused
|
||||
*/
|
||||
void OnIdle(cb_unused wxIdleEvent& event);
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- /** \brief Catch mousemotion-events
|
||||
- *
|
||||
- * Needed for the backport of tabtooltip from wx2.9
|
||||
- *
|
||||
- * \param event holds the wxTabCtrl, that sends the event
|
||||
- */
|
||||
- void OnMotion(wxMouseEvent& event);
|
||||
-#endif // !wxCHECK_VERSION(3, 0, 0)
|
||||
/** \brief Catch doubleclick-events from wxTabCtrl
|
||||
*
|
||||
* Sends cbEVT_CBAUIBOOK_LEFT_DCLICK, if doubleclick was on a tab,
|
||||
@@ -318,15 +286,6 @@
|
||||
*/
|
||||
long m_LastId;
|
||||
#endif // __WXMSW__
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- /** \brief If false, tooltips are not shown
|
||||
- *
|
||||
- * Needed to only show tooltips, if they have been explicitely set.
|
||||
- * We store the tooltip-text in the tabs name, without this flag, we
|
||||
- * get the wxWidgets default-names as tooltips.
|
||||
- */
|
||||
- bool m_HasToolTip;
|
||||
-#endif // !wxCHECK_VERSION(3, 0, 0)
|
||||
/** \brief If true, zoom for all editors
|
||||
* is set in next OnIdle-call
|
||||
*/
|
||||
Index: src/include/globals.h
|
||||
===================================================================
|
||||
--- src/include/globals.h (revision 12577)
|
||||
+++ src/include/globals.h (revision 12578)
|
||||
@@ -441,11 +441,7 @@
|
||||
const wxSize& size = wxSize(300, 300),
|
||||
const wxArrayInt& initialSelection = wxArrayInt());
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
extern DLLIMPORT const char *cbGetTextFromUserPromptStr;
|
||||
-#else
|
||||
-extern DLLIMPORT const wxChar *cbGetTextFromUserPromptStr;
|
||||
-#endif // wxCHECK_VERSION
|
||||
|
||||
extern DLLIMPORT wxString cbGetTextFromUser(const wxString &message,
|
||||
const wxString &caption = cbGetTextFromUserPromptStr,
|
||||
Index: src/include/logmanager.h
|
||||
===================================================================
|
||||
--- src/include/logmanager.h (revision 12577)
|
||||
+++ src/include/logmanager.h (revision 12578)
|
||||
@@ -21,7 +21,7 @@
|
||||
{
|
||||
va_list arg_list;
|
||||
va_start(arg_list, msg);
|
||||
-#if wxCHECK_VERSION(3, 0, 0) && wxUSE_UNICODE
|
||||
+#if wxUSE_UNICODE
|
||||
// in wx >= 3.0 unicode-build (default) we need the %ls here, or the strings get
|
||||
// cut after the first character
|
||||
::temp_string = msg;
|
||||
@@ -38,7 +38,7 @@
|
||||
{
|
||||
va_list arg_list;
|
||||
va_start(arg_list, msg);
|
||||
-#if wxCHECK_VERSION(2,9,0) && wxUSE_UNICODE
|
||||
+#if wxUSE_UNICODE
|
||||
// in wx >= 2.9 unicode-build (default) we need the %ls here, or the strings get
|
||||
// cut after the first character
|
||||
::temp_string = msg;
|
||||
Index: src/plugins/debuggergdb/debuggergdb.cpp
|
||||
===================================================================
|
||||
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 12577)
|
||||
+++ src/plugins/debuggergdb/debuggergdb.cpp (revision 12578)
|
||||
@@ -554,7 +554,6 @@
|
||||
const wxString &cwd)
|
||||
{
|
||||
wxString shell = GetShellString();
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
wxExecuteEnv execEnv;
|
||||
execEnv.cwd = cwd;
|
||||
// Read the current environment variables and then make changes to them.
|
||||
@@ -565,15 +564,6 @@
|
||||
execEnv.env["SHELL"] = shell;
|
||||
}
|
||||
return wxExecute(cmd, wxEXEC_ASYNC, process, &execEnv);
|
||||
-#else
|
||||
- if (!shell.empty())
|
||||
- {
|
||||
- Log(wxString::Format(wxT("Setting SHELL to '%s'"), shell.wx_str()));
|
||||
- wxSetEnv(wxT("SHELL"), shell);
|
||||
- }
|
||||
- (void)cwd;
|
||||
- return wxExecute(cmd, wxEXEC_ASYNC, process);
|
||||
-#endif // !wxCHECK_VERSION(3, 0, 0)
|
||||
}
|
||||
|
||||
int DebuggerGDB::LaunchProcess(const wxString& cmd, const wxString& cwd)
|
||||
Index: src/plugins/debuggergdb/gdb_commands.h
|
||||
===================================================================
|
||||
--- src/plugins/debuggergdb/gdb_commands.h (revision 12577)
|
||||
+++ src/plugins/debuggergdb/gdb_commands.h (revision 12578)
|
||||
@@ -63,11 +63,7 @@
|
||||
|
||||
while (count < sizeof(T) * 2) // be sure we don't keep adding more to ret
|
||||
{
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
switch (str[pos].GetValue())
|
||||
- #else
|
||||
- switch (str[pos])
|
||||
- #endif
|
||||
{
|
||||
case _T('0'):
|
||||
case _T('1'):
|
||||
Index: src/sdk/cbauibook.cpp
|
||||
===================================================================
|
||||
--- src/sdk/cbauibook.cpp (revision 12577)
|
||||
+++ src/sdk/cbauibook.cpp (revision 12578)
|
||||
@@ -37,11 +37,7 @@
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(cbAuiNotebook, wxAuiNotebook)
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
EVT_NAVIGATION_KEY(cbAuiNotebook::OnNavigationKeyNotebook)
|
||||
-#else
|
||||
- EVT_NAVIGATION_KEY(cbAuiNotebook::OnNavigationKey)
|
||||
-#endif
|
||||
EVT_IDLE(cbAuiNotebook::OnIdle)
|
||||
EVT_AUINOTEBOOK_DRAG_DONE(wxID_ANY, cbAuiNotebook::OnDragDone)
|
||||
END_EVENT_TABLE()
|
||||
@@ -52,9 +48,6 @@
|
||||
m_LastSelected(wxNOT_FOUND),
|
||||
m_LastId(0),
|
||||
#endif
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- m_HasToolTip(false),
|
||||
-#endif
|
||||
m_SetZoomOnIdle(false),
|
||||
m_MinimizeFreeSpaceOnIdle(false),
|
||||
m_TabCtrlSize(wxDefaultSize)
|
||||
@@ -64,7 +57,7 @@
|
||||
m_mgr.SetFlags((m_mgr.GetFlags() | wxAUI_MGR_VENETIAN_BLINDS_HINT) & ~wxAUI_MGR_TRANSPARENT_HINT);
|
||||
#endif // #ifdef __WXGTK__
|
||||
ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("app"));
|
||||
-#if defined __WXMSW__ && wxCHECK_VERSION(3, 0, 0)
|
||||
+#if defined __WXMSW__
|
||||
wxToolTip::SetMaxWidth(-1);
|
||||
#endif
|
||||
s_AllowMousewheel = cfg->ReadBool(_T("/environment/tabs_use_mousewheel"),true);
|
||||
@@ -152,10 +145,6 @@
|
||||
{
|
||||
for (size_t i = 0; i < m_TabCtrls.GetCount(); ++i)
|
||||
{
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- m_TabCtrls[i]->Disconnect(wxEVT_MOTION, wxMouseEventHandler(cbAuiNotebook::OnMotion));
|
||||
- m_TabCtrls[i]->Connect(wxEVT_MOTION , wxMouseEventHandler(cbAuiNotebook::OnMotion));
|
||||
-#endif
|
||||
m_TabCtrls[i]->Disconnect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(cbAuiNotebook::OnTabCtrlDblClick));
|
||||
m_TabCtrls[i]->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(cbAuiNotebook::OnTabCtrlDblClick));
|
||||
m_TabCtrls[i]->Disconnect(wxEVT_SIZE, wxSizeEventHandler(cbAuiNotebook::OnResize));
|
||||
@@ -427,57 +416,6 @@
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
-void cbAuiNotebook::OnMotion(wxMouseEvent& event)
|
||||
-{
|
||||
- event.Skip();
|
||||
- wxAuiTabCtrl* tabCtrl = (wxAuiTabCtrl*)event.GetEventObject();
|
||||
- if (!tabCtrl)
|
||||
- return;
|
||||
- cbAuiNotebook* nb = (cbAuiNotebook*)tabCtrl->GetParent();
|
||||
- if (!nb || !nb->m_HasToolTip)
|
||||
- return;
|
||||
-
|
||||
- wxWindow* win = nullptr;
|
||||
- if (event.Moving() && tabCtrl->TabHitTest(event.m_x, event.m_y, &win))
|
||||
- {
|
||||
- if (!win)
|
||||
- {
|
||||
- tabCtrl->UnsetToolTip();
|
||||
- return;
|
||||
- }
|
||||
- wxString text(win->GetName());
|
||||
- // If the text changes, set it else, keep old, to avoid
|
||||
- // 'moving tooltip' effect
|
||||
- wxToolTip* tooltip = tabCtrl->GetToolTip();
|
||||
- if (!tooltip || tooltip->GetTip() != text)
|
||||
- tabCtrl->SetToolTip(text);
|
||||
- }
|
||||
- else
|
||||
- tabCtrl->UnsetToolTip();
|
||||
-}
|
||||
-
|
||||
-bool cbAuiNotebook::SetPageToolTip(size_t idx, const wxString & text)
|
||||
-{
|
||||
- if (!m_HasToolTip)
|
||||
- UpdateTabControlsArray();
|
||||
-
|
||||
- m_HasToolTip = true;
|
||||
- wxWindow* win = GetPage(idx);
|
||||
- if (win && win->GetName() != text)
|
||||
- win->SetName(text);
|
||||
- else
|
||||
- return false;
|
||||
- return true;
|
||||
-}
|
||||
-wxString cbAuiNotebook::GetPageToolTip(size_t idx)
|
||||
-{
|
||||
- wxWindow* win = GetPage(idx);
|
||||
- if (win)
|
||||
- return win->GetName();
|
||||
- return wxEmptyString;
|
||||
-}
|
||||
-#endif
|
||||
void cbAuiNotebook::MinimizeFreeSpace()
|
||||
{
|
||||
if (GetPageCount() < 2)
|
||||
@@ -657,11 +595,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
void cbAuiNotebook::OnNavigationKeyNotebook(wxNavigationKeyEvent& event)
|
||||
-#else
|
||||
-void cbAuiNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
-#endif
|
||||
{
|
||||
// if we change window, we call our own AdvanceSelection
|
||||
if ( event.IsWindowChange() )
|
||||
@@ -668,11 +602,7 @@
|
||||
AdvanceSelection(event.GetDirection());
|
||||
else // otherwise we call the event-handler from the parent-class
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
wxAuiNotebook::OnNavigationKeyNotebook(event);
|
||||
-#else
|
||||
- wxAuiNotebook::OnNavigationKey(event);
|
||||
-#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -726,11 +656,7 @@
|
||||
if (!tabsTmp.empty())
|
||||
tabsTmp += wxT(",");
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
if ((int)page_idx == m_curPage)
|
||||
-#else
|
||||
- if ((int)page_idx == m_curpage)
|
||||
-#endif
|
||||
tabsTmp += wxT("*");
|
||||
else if ((int)p == tabCtrl->GetActivePage())
|
||||
tabsTmp += wxT("+");
|
||||
@@ -886,11 +812,7 @@
|
||||
wxString pane_name = tab_part.BeforeFirst(wxT('='));
|
||||
|
||||
// create a new tab frame
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
m_curPage = -1;
|
||||
-#else
|
||||
- m_curpage = -1;
|
||||
-#endif
|
||||
|
||||
// Get list of tab id's and move them to pane
|
||||
wxString tab_list = tab_part.AfterFirst(wxT('='));
|
||||
@@ -1004,11 +926,7 @@
|
||||
RemoveEmptyTabFrames();
|
||||
|
||||
// Force refresh of selection
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
m_curPage = -1;
|
||||
-#else
|
||||
- m_curpage = -1;
|
||||
-#endif
|
||||
SetSelection(sel_page);
|
||||
|
||||
UpdateTabControlsArray();
|
||||
Index: src/sdk/crc32.cpp
|
||||
===================================================================
|
||||
--- src/sdk/crc32.cpp (revision 12577)
|
||||
+++ src/sdk/crc32.cpp (revision 12578)
|
||||
@@ -78,11 +78,7 @@
|
||||
// Calculate the checksum
|
||||
crc = 0xFFFFFFFFUL;
|
||||
while (text[i])
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
{ crc = (crc>>8) ^ crc_table[ (crc^(text[i++].GetValue())) & 0xFF ]; }
|
||||
- #else
|
||||
- { crc = (crc>>8) ^ crc_table[ (crc^(text[i++])) & 0xFF ]; }
|
||||
- #endif
|
||||
|
||||
crc ^= 0xFFFFFFFFUL ;
|
||||
}
|
||||
Index: src/sdk/editorcolourset.cpp
|
||||
===================================================================
|
||||
--- src/sdk/editorcolourset.cpp (revision 12577)
|
||||
+++ src/sdk/editorcolourset.cpp (revision 12578)
|
||||
@@ -835,11 +835,7 @@
|
||||
wxString tmp(_T(' '), keywords.length()); // faster than using Alloc()
|
||||
|
||||
const wxChar *src = keywords.c_str();
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxStringCharType *dst = const_cast<wxStringCharType*>(tmp.wx_str());
|
||||
- #else
|
||||
- wxChar *dst = (wxChar *) tmp.c_str();
|
||||
- #endif
|
||||
wxChar c;
|
||||
size_t len = 0;
|
||||
|
||||
Index: src/sdk/editorlexerloader.cpp
|
||||
===================================================================
|
||||
--- src/sdk/editorlexerloader.cpp (revision 12577)
|
||||
+++ src/sdk/editorlexerloader.cpp (revision 12578)
|
||||
@@ -229,11 +229,7 @@
|
||||
wxString value(keywords->Attribute("value"), wxConvUTF8);
|
||||
regex.Replace(&value, _T(" "));
|
||||
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
m_pTarget->SetKeywords(language, keyidx, value );
|
||||
- #else
|
||||
- m_pTarget->SetKeywords(language, keyidx, wxString ( value, wxConvUTF8 ) );
|
||||
- #endif
|
||||
}
|
||||
|
||||
keywords = keywords->NextSiblingElement(nodename.mb_str());
|
|
@ -0,0 +1,549 @@
|
|||
------------------------------------------------------------------------
|
||||
r12579 | wh11204 | 2021-12-14 18:27:57 +0900 (Tue, 14 Dec 2021) | 16 lines
|
||||
|
||||
- Remove code for wxWidgets < 3.0.0 (part II).
|
||||
Includes:
|
||||
src/sdk/cbeditor.cpp
|
||||
src/sdk/compiler.cpp
|
||||
src/sdk/configmanager.cpp
|
||||
src/sdk/globals.cpp
|
||||
src/sdk/incremental_select_helper.cpp
|
||||
src/sdk/newfromtemplatedlg.cpp
|
||||
src/sdk/pluginsconfigurationdlg.cpp
|
||||
src/sdk/printing_types.cpp
|
||||
src/sdk/scripting/bindings/sc_globals.cpp
|
||||
src/sdk/toolsmanager.cpp
|
||||
src/sdk/uservarmanager.cpp
|
||||
src/sdk/xtra_res.cpp
|
||||
src/src/app.cpp
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/sdk/incremental_select_helper.cpp
|
||||
===================================================================
|
||||
--- src/sdk/incremental_select_helper.cpp (revision 12578)
|
||||
+++ src/sdk/incremental_select_helper.cpp (revision 12579)
|
||||
@@ -195,10 +195,6 @@
|
||||
FilterItemsFinalize(*m_list, *m_iterator);
|
||||
}
|
||||
|
||||
-#if !wxCHECK_VERSION(3, 0, 0)
|
||||
- typedef int wxStandardID;
|
||||
-#endif
|
||||
-
|
||||
static wxStandardID KeyDownAction(wxKeyEvent& event, int &selected, int selectedMax)
|
||||
{
|
||||
// now, adjust position from key input
|
||||
Index: src/sdk/printing_types.cpp
|
||||
===================================================================
|
||||
--- src/sdk/printing_types.cpp (revision 12578)
|
||||
+++ src/sdk/printing_types.cpp (revision 12579)
|
||||
@@ -28,21 +28,13 @@
|
||||
{
|
||||
g_printer = new wxPrinter;
|
||||
int paperid = Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperid"), wxPAPER_A4 );
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxPrintOrientation paperorientation = static_cast<wxPrintOrientation>( Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperorientation"), wxPORTRAIT ) );
|
||||
- #else
|
||||
- int paperorientation = Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperorientation"), wxPORTRAIT );
|
||||
- #endif
|
||||
wxPrintData* ppd = &(g_printer->GetPrintDialogData().GetPrintData());
|
||||
ppd->SetPaperId((wxPaperSize)paperid);
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
if (paperorientation == wxPORTRAIT)
|
||||
ppd->SetOrientation(wxPORTRAIT);
|
||||
else
|
||||
ppd->SetOrientation(wxLANDSCAPE);
|
||||
- #else
|
||||
- ppd->SetOrientation(paperorientation);
|
||||
- #endif
|
||||
}
|
||||
|
||||
// if (!g_pageSetupData)
|
||||
Index: src/sdk/scripting/bindings/sc_globals.cpp
|
||||
===================================================================
|
||||
--- src/sdk/scripting/bindings/sc_globals.cpp (revision 12578)
|
||||
+++ src/sdk/scripting/bindings/sc_globals.cpp (revision 12579)
|
||||
@@ -303,15 +303,7 @@
|
||||
if (id != wxNOT_FOUND)
|
||||
{
|
||||
wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, id);
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
mbar->GetEventHandler()->ProcessEvent(evt);
|
||||
- #else
|
||||
- if ( !mbar->ProcessEvent(evt) )
|
||||
- {
|
||||
- wxString msg; msg.Printf(_("Calling the menu '%s' with ID %d failed."), menuPath.wx_str(), id);
|
||||
- cbMessageBox(msg, _("Script error"), wxICON_WARNING);
|
||||
- }
|
||||
- #endif
|
||||
// done
|
||||
}
|
||||
break;
|
||||
Index: src/sdk/cbeditor.cpp
|
||||
===================================================================
|
||||
--- src/sdk/cbeditor.cpp (revision 12578)
|
||||
+++ src/sdk/cbeditor.cpp (revision 12579)
|
||||
@@ -1223,13 +1223,13 @@
|
||||
m_pControl2->SetDocPointer(m_pControl->GetDocPointer());
|
||||
|
||||
// on wxGTK > 2.9 we need to thaw before reparent and refreeze the editor here or the whole app stays frozen
|
||||
- #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
|
||||
+ #if defined ( __WXGTK__ )
|
||||
Thaw();
|
||||
#endif
|
||||
// parent both controls under the splitter
|
||||
m_pControl->Reparent(m_pSplitter);
|
||||
m_pControl2->Reparent(m_pSplitter);
|
||||
- #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
|
||||
+ #if defined ( __WXGTK__ )
|
||||
Freeze();
|
||||
#endif
|
||||
|
||||
@@ -1289,12 +1289,12 @@
|
||||
m_pSizer->Detach(m_pSplitter);
|
||||
|
||||
// on wxGTK > 2.9 we need to thaw before reparent and refreeze the editor here or the whole app stays frozen
|
||||
- #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
|
||||
+ #if defined ( __WXGTK__ )
|
||||
Thaw();
|
||||
#endif
|
||||
// parent the left control under this
|
||||
m_pControl->Reparent(this);
|
||||
- #if defined ( __WXGTK__ ) && wxCHECK_VERSION(3, 0, 0)
|
||||
+ #if defined ( __WXGTK__ )
|
||||
Freeze();
|
||||
#endif
|
||||
// add it in the sizer
|
||||
Index: src/sdk/compiler.cpp
|
||||
===================================================================
|
||||
--- src/sdk/compiler.cpp (revision 12578)
|
||||
+++ src/sdk/compiler.cpp (revision 12579)
|
||||
@@ -1537,11 +1537,7 @@
|
||||
// Loads the wxArrayString with the task output (returned in a wxInputStream)
|
||||
wxInputStream *inputStream = process.GetInputStream();
|
||||
wxTextInputStream text(*inputStream);
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
while (!text.GetInputStream().Eof())
|
||||
-#else
|
||||
- while (!inputStream->Eof())
|
||||
-#endif
|
||||
{
|
||||
output.Add(text.ReadLine());
|
||||
}
|
||||
@@ -1556,13 +1552,9 @@
|
||||
{
|
||||
wxLogNull logNo; // do not warn if execution fails
|
||||
int flags = wxEXEC_SYNC;
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
- // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
|
||||
- // that occurs from time to time on wx3
|
||||
- flags |= wxEXEC_NOEVENTS;
|
||||
- #else
|
||||
- flags |= wxEXEC_NODISABLE;
|
||||
- #endif
|
||||
+ // Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
|
||||
+ // that occurs from time to time on wx3
|
||||
+ flags |= wxEXEC_NOEVENTS;
|
||||
return wxExecute(cmd, output, flags);
|
||||
}
|
||||
#endif // __WXMSW__
|
||||
Index: src/sdk/configmanager.cpp
|
||||
===================================================================
|
||||
--- src/sdk/configmanager.cpp (revision 12578)
|
||||
+++ src/sdk/configmanager.cpp (revision 12579)
|
||||
@@ -39,11 +39,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef __WXMAC__
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
#include "wx/osx/core/cfstring.h"
|
||||
-#else
|
||||
-#include "wx/mac/corefoundation/cfstring.h"
|
||||
-#endif
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include <CoreFoundation/CFBundle.h>
|
||||
@@ -124,11 +120,7 @@
|
||||
CFRelease(resourcesURL);
|
||||
CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kCFURLPOSIXPathStyle);
|
||||
CFRelease(absoluteURL);
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
- wxString str = wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
|
||||
- #else
|
||||
- wxString str = wxMacCFStringHolder(cfStrPath).AsString(wxLocale::GetSystemEncoding());
|
||||
- #endif
|
||||
+ wxString str = wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
|
||||
if (!str.Contains(wxString(_T("/Resources"))))
|
||||
return ::DetermineExecutablePath() + _T("/.."); // not a bundle, use relative path
|
||||
return str;
|
||||
@@ -239,9 +231,7 @@
|
||||
wxMessageDialog dlg(Manager::Get()->GetAppWindow(),
|
||||
message + _("\n\nDiscard old config file?"), _("Config file read error"),
|
||||
wxSTAY_ON_TOP|wxCENTRE|wxYES|wxNO|wxNO_DEFAULT|wxICON_ERROR);
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dlg.SetYesNoLabels(_("&Discard"), _("&Close"));
|
||||
-#endif
|
||||
if (dlg.ShowModal() != wxID_YES)
|
||||
cbThrow(message);
|
||||
|
||||
@@ -337,15 +327,8 @@
|
||||
{
|
||||
size_t size = is->GetSize();
|
||||
wxString str;
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxChar* c = wxStringBuffer(str, size);
|
||||
- #else
|
||||
- wxChar* c = str.GetWriteBuf(size);
|
||||
- #endif
|
||||
is->Read(c, size);
|
||||
- #if !wxCHECK_VERSION(3, 0, 0)
|
||||
- str.UngetWriteBuf(size);
|
||||
- #endif
|
||||
|
||||
doc = new TiXmlDocument();
|
||||
|
||||
@@ -493,13 +476,8 @@
|
||||
*/
|
||||
inline void to_upper(wxString& s)
|
||||
{
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxStringCharType *p = const_cast<wxStringCharType*>(s.wx_str());
|
||||
wxStringCharType q;
|
||||
- #else
|
||||
- wxChar *p = (wxChar*) s.c_str();
|
||||
- wxChar q;
|
||||
- #endif
|
||||
size_t len = s.length()+1;
|
||||
for (;--len;++p)
|
||||
{
|
||||
@@ -511,13 +489,8 @@
|
||||
|
||||
inline void to_lower(wxString& s)
|
||||
{
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxStringCharType *p = const_cast<wxStringCharType*>(s.wx_str());
|
||||
wxStringCharType q;
|
||||
- #else
|
||||
- wxChar *p = (wxChar*) s.c_str();
|
||||
- wxChar q;
|
||||
- #endif
|
||||
size_t len = s.length()+1;
|
||||
for (;--len;++p)
|
||||
{
|
||||
@@ -1239,11 +1212,7 @@
|
||||
{
|
||||
while (e->IterateChildren(curr) && (curr = e->IterateChildren(curr)->ToElement()))
|
||||
{
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxUniChar c = cbC2U(curr->Value())[0];
|
||||
- #else
|
||||
- wxChar c = *(cbC2U(curr->Value()));
|
||||
- #endif
|
||||
if (c < _T('A') || c > _T('Z')) // first char must be a letter, uppercase letters are key names
|
||||
ret.Add(cbC2U(curr->Value()));
|
||||
}
|
||||
@@ -1325,11 +1294,7 @@
|
||||
{
|
||||
while (e->IterateChildren(curr) && (curr = e->IterateChildren(curr)->ToElement()))
|
||||
{
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxUniChar c = cbC2U(curr->Value())[0];
|
||||
- #else
|
||||
- wxChar c = *(cbC2U(curr->Value()));
|
||||
- #endif
|
||||
if (c >= _T('A') && c <= _T('Z')) // opposite of the above
|
||||
ret.Add(cbC2U(curr->Value()));
|
||||
}
|
||||
Index: src/sdk/globals.cpp
|
||||
===================================================================
|
||||
--- src/sdk/globals.cpp (revision 12578)
|
||||
+++ src/sdk/globals.cpp (revision 12579)
|
||||
@@ -1186,11 +1186,7 @@
|
||||
|
||||
double cbGetContentScaleFactor(const wxWindow &window)
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
return window.GetContentScaleFactor();
|
||||
-#else
|
||||
- return 1.0;
|
||||
-#endif // wxCHECK_VERSION(3, 0, 0)
|
||||
}
|
||||
|
||||
#ifdef __WXGTK__
|
||||
@@ -1200,7 +1196,6 @@
|
||||
// For other platforms the value returned by GetContentScalingFactor seems adequate.
|
||||
double cbGetActualContentScaleFactor(cb_unused const wxWindow &window)
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
// It is possible to use the window to find a display, but unfortunately this doesn't work well,
|
||||
// because we call this function mostly on windows which haven't been shown. This leads to
|
||||
// warnings in the log about ClientToScreen failures.
|
||||
@@ -1207,24 +1202,6 @@
|
||||
// If there are problems on multi-monitor setups we should think about some other solution. :(
|
||||
const wxSize ppi = wxGetDisplayPPI();
|
||||
return ppi.y / 96.0;
|
||||
-#else // wxCHECK_VERSION(3, 0, 0)
|
||||
- // This code is the simplest version which works in the most common case.
|
||||
- // If people complain that multi-monitor setups behave strangely, this should be revised with
|
||||
- // direct calls to GTK/GDK functions.
|
||||
-
|
||||
- // This function might return bad results for multi screen setups.
|
||||
- const wxSize mm = wxGetDisplaySizeMM();
|
||||
- if (mm.x == 0 || mm.y == 0)
|
||||
- return 1.0;
|
||||
- const wxSize pixels = wxGetDisplaySize();
|
||||
-
|
||||
- const double ppiX = wxRound((pixels.x * inches2mm) / mm.x);
|
||||
- const double ppiY = wxRound((pixels.y * inches2mm) / mm.y);
|
||||
-
|
||||
- // My guess is that smaller scaling factor would look better. Probably it has effect only in
|
||||
- // multi monitor setups where there are monitors with different dpi.
|
||||
- return std::min(ppiX / 96.0, ppiY /96.0);
|
||||
-#endif // wxCHECK_VERSION(3, 0, 0)
|
||||
}
|
||||
#else // __WXGTK__
|
||||
double cbGetActualContentScaleFactor(const wxWindow &window)
|
||||
@@ -1323,11 +1300,7 @@
|
||||
long flags = lc->GetWindowStyleFlag();
|
||||
switch (style)
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
case sisNoIcons: flags = (flags & ~wxLC_MASK_TYPE) | wxLC_LIST; break;
|
||||
-#else
|
||||
- case sisNoIcons: flags = (flags & ~wxLC_MASK_TYPE) | wxLC_SMALL_ICON; break;
|
||||
-#endif
|
||||
default: flags = (flags & ~wxLC_MASK_TYPE) | wxLC_ICON; break;
|
||||
}
|
||||
lc->SetWindowStyleFlag(flags);
|
||||
@@ -1713,11 +1686,7 @@
|
||||
return wxArrayInt();
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
const char* cbGetTextFromUserPromptStr = wxGetTextFromUserPromptStr;
|
||||
-#else
|
||||
-const wxChar* cbGetTextFromUserPromptStr = wxGetTextFromUserPromptStr;
|
||||
-#endif // wxCHECK_VERSION
|
||||
|
||||
wxString cbGetTextFromUser(const wxString& message, const wxString& caption, const wxString& defaultValue,
|
||||
wxWindow *parent, wxCoord x, wxCoord y, bool centre)
|
||||
Index: src/sdk/newfromtemplatedlg.cpp
|
||||
===================================================================
|
||||
--- src/sdk/newfromtemplatedlg.cpp (revision 12578)
|
||||
+++ src/sdk/newfromtemplatedlg.cpp (revision 12579)
|
||||
@@ -195,11 +195,7 @@
|
||||
cat->SetSelection(0);
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
inline int wxCALLBACK SortTemplates(wxIntPtr item1, wxIntPtr item2, cb_unused wxIntPtr sortData)
|
||||
-#else
|
||||
-inline int wxCALLBACK SortTemplates(long item1, long item2, cb_unused long sortData)
|
||||
-#endif
|
||||
{
|
||||
ListItemData* data1 = reinterpret_cast<ListItemData*>(item1);
|
||||
ListItemData* data2 = reinterpret_cast<ListItemData*>(item2);
|
||||
Index: src/sdk/pluginsconfigurationdlg.cpp
|
||||
===================================================================
|
||||
--- src/sdk/pluginsconfigurationdlg.cpp (revision 12578)
|
||||
+++ src/sdk/pluginsconfigurationdlg.cpp (revision 12579)
|
||||
@@ -65,11 +65,7 @@
|
||||
return initialInfo;
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
inline int wxCALLBACK sortByTitle(wxIntPtr item1, wxIntPtr item2, cb_unused wxIntPtr sortData)
|
||||
-#else
|
||||
-inline int wxCALLBACK sortByTitle(long item1, long item2, cb_unused long sortData)
|
||||
-#endif
|
||||
{
|
||||
const PluginElement* elem1 = (const PluginElement*)item1;
|
||||
const PluginElement* elem2 = (const PluginElement*)item2;
|
||||
Index: src/sdk/toolsmanager.cpp
|
||||
===================================================================
|
||||
--- src/sdk/toolsmanager.cpp (revision 12578)
|
||||
+++ src/sdk/toolsmanager.cpp (revision 12579)
|
||||
@@ -129,11 +129,7 @@
|
||||
|
||||
// log info so user can troubleshoot
|
||||
dir = wxGetCwd(); // read in the actual working dir
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
Manager::Get()->GetLogManager()->Log(F(_("Launching tool '%s': %s (in %s)"), tool->GetName().wx_str(), cmdline.wx_str(), dir.wx_str()));
|
||||
- #else
|
||||
- Manager::Get()->GetLogManager()->Log(F(_("Launching tool '%s': %s (in %s)"), tool->GetName().c_str(), cmdline.c_str(), dir.c_str()));
|
||||
- #endif
|
||||
|
||||
bool pipe = true;
|
||||
int flags = wxEXEC_ASYNC;
|
||||
Index: src/sdk/uservarmanager.cpp
|
||||
===================================================================
|
||||
--- src/sdk/uservarmanager.cpp (revision 12578)
|
||||
+++ src/sdk/uservarmanager.cpp (revision 12579)
|
||||
@@ -32,9 +32,7 @@
|
||||
|
||||
#include "annoyingdialog.h"
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
#include <wx/unichar.h>
|
||||
-#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -637,11 +635,7 @@
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < s.length(); ++i)
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
s[i] = wxIsalnum(s.GetChar(i)) ? s.GetChar(i) : wxUniChar('_');
|
||||
-#else
|
||||
- s[i] = wxIsalnum(s.GetChar(i)) ? s.GetChar(i) : _T('_');
|
||||
-#endif
|
||||
|
||||
if (s.GetChar(0) == _T('_'))
|
||||
s.Prepend(_T("set"));
|
||||
Index: src/sdk/xtra_res.cpp
|
||||
===================================================================
|
||||
--- src/sdk/xtra_res.cpp (revision 12578)
|
||||
+++ src/sdk/xtra_res.cpp (revision 12579)
|
||||
@@ -100,11 +100,7 @@
|
||||
return stockArt;
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
const wxString name = GetParamValue(paramNode);
|
||||
-#else
|
||||
- const wxString name = GetParamValue(param);
|
||||
-#endif
|
||||
if (name.empty())
|
||||
return wxArtProvider::GetBitmap(wxT("sdk/missing_icon"), wxART_TOOLBAR, size * scaleFactor);
|
||||
|
||||
@@ -186,19 +182,10 @@
|
||||
if (GetPosition() != wxDefaultPosition)
|
||||
{
|
||||
m_toolbar->AddTool(GetID(),
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
wxEmptyString,
|
||||
- #endif
|
||||
GetCenteredBitmap(_T("bitmap"), bitmapSize, scaleFactor),
|
||||
GetCenteredBitmap(_T("bitmap2"), bitmapSize, scaleFactor),
|
||||
- #if !wxCHECK_VERSION(3, 0, 0)
|
||||
- GetBool(_T("toggle")),
|
||||
- GetPosition().x,
|
||||
- GetPosition().y,
|
||||
- NULL,
|
||||
- #else
|
||||
wxITEM_NORMAL,
|
||||
- #endif
|
||||
GetText(_T("tooltip")),
|
||||
GetText(_T("longhelp")));
|
||||
}
|
||||
@@ -332,15 +319,9 @@
|
||||
//
|
||||
// Don't ask me why... >:-|
|
||||
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
bool istbar = node->GetAttribute(wxT("class"), wxEmptyString).Matches(_T("wxToolBarAddOn"));
|
||||
bool istool = node->GetAttribute(wxT("class"), wxEmptyString).Matches(_T("tool"));
|
||||
bool issep = node->GetAttribute(wxT("class"), wxEmptyString).Matches(_T("separator"));
|
||||
- #else
|
||||
- bool istbar = node->GetPropVal(wxT("class"), wxEmptyString).Matches(_T("wxToolBarAddOn"));
|
||||
- bool istool = node->GetPropVal(wxT("class"), wxEmptyString).Matches(_T("tool"));
|
||||
- bool issep = node->GetPropVal(wxT("class"), wxEmptyString).Matches(_T("separator"));
|
||||
- #endif
|
||||
|
||||
return ((!m_isInside && istbar) ||
|
||||
(m_isInside && istool) ||
|
||||
Index: src/src/app.cpp
|
||||
===================================================================
|
||||
--- src/src/app.cpp (revision 12578)
|
||||
+++ src/src/app.cpp (revision 12579)
|
||||
@@ -94,12 +94,8 @@
|
||||
{
|
||||
public:
|
||||
DDEConnection(MainFrame* frame) : m_Frame(frame) { ; }
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
bool OnExecute(const wxString& topic, const void *data, size_t size,
|
||||
wxIPCFormat format) override;
|
||||
-#else
|
||||
- bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format) override;
|
||||
-#endif
|
||||
bool OnDisconnect() override;
|
||||
private:
|
||||
MainFrame* m_Frame;
|
||||
@@ -110,17 +106,10 @@
|
||||
return topic == DDE_TOPIC ? new DDEConnection(m_Frame) : nullptr;
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
bool DDEConnection::OnExecute(cb_unused const wxString& topic, const void *data, size_t size,
|
||||
wxIPCFormat format)
|
||||
{
|
||||
const wxString strData = wxConnection::GetTextFromData(data, size, format);
|
||||
-#else
|
||||
-bool DDEConnection::OnExecute(cb_unused const wxString& topic, wxChar *data, int size,
|
||||
- wxIPCFormat format)
|
||||
-{
|
||||
- const wxString strData((wxChar*)data);
|
||||
-#endif
|
||||
|
||||
if (strData.StartsWith(_T("[IfExec_Open(\"")))
|
||||
return false; // let Shell Open handle the request as we *know* that we have registered the Shell Open command, too
|
||||
@@ -220,11 +209,7 @@
|
||||
};
|
||||
|
||||
#if wxUSE_CMDLINE_PARSER
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
#define CMD_ENTRY(X) X
|
||||
-#else
|
||||
-#define CMD_ENTRY(X) _T(X)
|
||||
-#endif
|
||||
const wxCmdLineEntryDesc cmdLineDesc[] =
|
||||
{
|
||||
{ wxCMD_LINE_SWITCH, CMD_ENTRY("h"), CMD_ENTRY("help"), CMD_ENTRY("show this help message"),
|
||||
@@ -330,21 +315,10 @@
|
||||
{
|
||||
public:
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
virtual void Output(const wxString &str) override;
|
||||
-#else
|
||||
- #ifdef WX_ATTRIBUTE_PRINTF
|
||||
- virtual void Printf(const wxChar* format, ...) WX_ATTRIBUTE_PRINTF_2;
|
||||
- #else
|
||||
- void Printf(const wxChar* format, ...) override ATTRIBUTE_PRINTF_2;
|
||||
- #endif
|
||||
-#endif // wxCHECK_VERSION
|
||||
};
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
+
|
||||
void cbMessageOutputNull::Output(cb_unused const wxString &str){}
|
||||
-#else
|
||||
-void cbMessageOutputNull::Printf(cb_unused const wxChar* format, ...){}
|
||||
-#endif
|
||||
} // namespace
|
||||
|
||||
IMPLEMENT_APP(CodeBlocksApp) // TODO: This gives a "redundant declaration" warning, though I think it's false. Dig through macro and check.
|
||||
@@ -355,11 +329,7 @@
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#ifdef __WXMAC__
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
#include "wx/osx/core/cfstring.h"
|
||||
-#else
|
||||
-#include "wx/mac/corefoundation/cfstring.h"
|
||||
-#endif
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include <CoreFoundation/CFBundle.h>
|
||||
@@ -374,11 +344,7 @@
|
||||
CFRelease(resourcesURL);
|
||||
CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kCFURLPOSIXPathStyle);
|
||||
CFRelease(absoluteURL);
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
return wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
|
||||
- #else
|
||||
- return wxMacCFStringHolder(cfStrPath).AsString(wxLocale::GetSystemEncoding());
|
||||
- #endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -0,0 +1,959 @@
|
|||
------------------------------------------------------------------------
|
||||
r12580 | wh11204 | 2021-12-15 17:28:41 +0900 (Wed, 15 Dec 2021) | 11 lines
|
||||
|
||||
- Remove code for wxWidgets < 3.0.0 (part III and last).
|
||||
Includes:
|
||||
src/plugins/compilergcc/compileroptionsdlg.cpp
|
||||
src/sdk/templatemanager.cpp
|
||||
src/src/associations.cpp
|
||||
src/src/dlgabout.cpp
|
||||
src/src/main.cpp
|
||||
src/src/notebookstyles.cpp
|
||||
src/src/notebookstyles.h
|
||||
src/src/projectmanagerui.cpp
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/src/notebookstyles.h
|
||||
===================================================================
|
||||
--- src/src/notebookstyles.h (revision 12579)
|
||||
+++ src/src/notebookstyles.h (revision 12580)
|
||||
@@ -8,14 +8,6 @@
|
||||
|
||||
#include "cbauibook.h"
|
||||
|
||||
-#if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
- #define GSocket GLibSocket
|
||||
- #include <gtk/gtk.h>
|
||||
- #undef GSocket
|
||||
- #include <wx/artprov.h>
|
||||
-#endif
|
||||
-
|
||||
-
|
||||
class wxDC;
|
||||
class wxWindow;
|
||||
class wxRect;
|
||||
@@ -53,35 +45,4 @@
|
||||
const wxSize& required_bmp_size) override;
|
||||
};
|
||||
|
||||
-#if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
-class NbStyleGTK : public wxAuiDefaultTabArt
|
||||
-{
|
||||
-public:
|
||||
- NbStyleGTK();
|
||||
-
|
||||
- virtual wxAuiTabArt* Clone();
|
||||
- virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect);
|
||||
- virtual void DrawTab(wxDC& dc,
|
||||
- wxWindow* wnd,
|
||||
- const wxAuiNotebookPage& page,
|
||||
- const wxRect& in_rect,
|
||||
- int close_button_state,
|
||||
- wxRect* out_tab_rect,
|
||||
- wxRect* out_button_rect,
|
||||
- int* x_extent);
|
||||
- void DrawButton(wxDC& dc, wxWindow* wnd, const wxRect& in_rect, int bitmap_id,
|
||||
- int button_state, int orientation, wxRect* out_rect);
|
||||
- int GetBestTabCtrlSize(wxWindow* wnd, const wxAuiNotebookPageArray& pages,
|
||||
- const wxSize& required_bmp_size);
|
||||
- virtual wxSize GetTabSize(wxDC& dc, wxWindow* wnd, const wxString& caption, const wxBitmap& bitmap, bool active,
|
||||
- int close_button_state, int* x_extent);
|
||||
-private:
|
||||
- int m_Xthickness;
|
||||
- int m_Ythickness;
|
||||
- int m_TabHBorder;
|
||||
- int m_TabVBorder;
|
||||
- wxBitmap m_ActiveCloseButton;
|
||||
-};
|
||||
-#endif // #if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
-
|
||||
#endif // NOTEBOOKSTYLES_H
|
||||
Index: src/plugins/compilergcc/compileroptionsdlg.cpp
|
||||
===================================================================
|
||||
--- src/plugins/compilergcc/compileroptionsdlg.cpp (revision 12579)
|
||||
+++ src/plugins/compilergcc/compileroptionsdlg.cpp (revision 12580)
|
||||
@@ -677,13 +677,9 @@
|
||||
wxPGProperty *root = m_FlagsPG->GetRoot();
|
||||
if (root)
|
||||
{
|
||||
- unsigned count = root->GetChildCount();
|
||||
+ const unsigned count = root->GetChildCount();
|
||||
for (unsigned ii = 0; ii < count; ++ii)
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
m_FlagsPG->SortChildren(root->Item(ii), wxPG_RECURSE);
|
||||
-#else
|
||||
- m_FlagsPG->Sort(root->Item(ii));
|
||||
-#endif
|
||||
}
|
||||
m_FlagsPG->Thaw();
|
||||
} // DoFillOptions
|
||||
@@ -2118,11 +2114,7 @@
|
||||
CompilerFactory::SetDefaultCompiler(idx);
|
||||
wxString msg;
|
||||
Compiler* compiler = CompilerFactory::GetDefaultCompiler();
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
- msg.Printf(_("%s is now selected as the default compiler for new projects"), compiler ? compiler->GetName().wx_str() : _("[invalid]").wx_str());
|
||||
- #else
|
||||
- msg.Printf(_("%s is now selected as the default compiler for new projects"), compiler ? compiler->GetName().c_str() : _("[invalid]"));
|
||||
- #endif
|
||||
+ msg.Printf(_("%s is now selected as the default compiler for new projects"), compiler ? compiler->GetName() : _("[invalid]"));
|
||||
cbMessageBox(msg);
|
||||
} // OnSetDefaultCompilerClick
|
||||
|
||||
Index: src/sdk/templatemanager.cpp
|
||||
===================================================================
|
||||
--- src/sdk/templatemanager.cpp (revision 12579)
|
||||
+++ src/sdk/templatemanager.cpp (revision 12580)
|
||||
@@ -186,11 +186,7 @@
|
||||
++count;
|
||||
}
|
||||
else
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
Manager::Get()->GetLogManager()->DebugLog(F(_T("Failed copying %s to %s"), src.wx_str(), dst.wx_str()));
|
||||
- #else
|
||||
- Manager::Get()->GetLogManager()->DebugLog(F(_T("Failed copying %s to %s"), src.c_str(), dst.c_str()));
|
||||
- #endif
|
||||
}
|
||||
if (count != total_count)
|
||||
cbMessageBox(_("Some files could not be loaded with the template..."), _("Error"), wxICON_ERROR);
|
||||
@@ -303,21 +299,13 @@
|
||||
{
|
||||
wxString src = (*it)->file.GetFullPath();
|
||||
wxString dst = templ + (*it)->relativeToCommonTopLevelPath;
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
Manager::Get()->GetLogManager()->DebugLog(F(_T("Copying %s to %s"), src.wx_str(), dst.wx_str()));
|
||||
- #else
|
||||
- Manager::Get()->GetLogManager()->DebugLog(F(_T("Copying %s to %s"), src.c_str(), dst.c_str()));
|
||||
- #endif
|
||||
if (!CreateDirRecursively(dst))
|
||||
Manager::Get()->GetLogManager()->DebugLog(_T("Failed creating directory for ") + dst);
|
||||
if (wxCopyFile(src, dst, true))
|
||||
++count;
|
||||
else
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
Manager::Get()->GetLogManager()->DebugLog(F(_T("Failed copying %s to %s"), src.wx_str(), dst.wx_str()));
|
||||
- #else
|
||||
- Manager::Get()->GetLogManager()->DebugLog(F(_T("Failed copying %s to %s"), src.c_str(), dst.c_str()));
|
||||
- #endif
|
||||
}
|
||||
|
||||
// cbProject doesn't have a GetRelativeToCommonTopLevelPath() function, so we simulate it here
|
||||
Index: src/src/associations.cpp
|
||||
===================================================================
|
||||
--- src/src/associations.cpp (revision 12579)
|
||||
+++ src/src/associations.cpp (revision 12580)
|
||||
@@ -201,11 +201,7 @@
|
||||
if (key.Exists())
|
||||
{
|
||||
wxString s;
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
if (key.QueryValue(wxEmptyString, s) && s.StartsWith(_T("CodeBlocks")))
|
||||
- #else
|
||||
- if (key.QueryValue(NULL, s) && s.StartsWith(_T("CodeBlocks")))
|
||||
- #endif
|
||||
key.DeleteSelf();
|
||||
}
|
||||
|
||||
Index: src/src/dlgabout.cpp
|
||||
===================================================================
|
||||
--- src/src/dlgabout.cpp (revision 12579)
|
||||
+++ src/src/dlgabout.cpp (revision 12580)
|
||||
@@ -20,9 +20,7 @@
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
- #if wxCHECK_VERSION(3, 0, 0)
|
||||
- #include <wx/versioninfo.h>
|
||||
- #endif // wxCHECK_VERSION
|
||||
+ #include <wx/versioninfo.h>
|
||||
|
||||
#include "licenses.h"
|
||||
#include "configmanager.h"
|
||||
@@ -146,15 +144,11 @@
|
||||
wxTextCtrl *txtLicense = XRCCTRL(*this, "txtLicense", wxTextCtrl);
|
||||
txtLicense->SetValue(LICENSE_GPL);
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
const wxVersionInfo scintillaVersion = wxScintilla::GetLibraryVersionInfo();
|
||||
const wxString scintillaStr = wxString::Format(wxT("%d.%d.%d"),
|
||||
scintillaVersion.GetMajor(),
|
||||
scintillaVersion.GetMinor(),
|
||||
scintillaVersion.GetMicro());
|
||||
-#else
|
||||
- const wxString scintillaStr = wxSCINTILLA_VERSION;
|
||||
-#endif // wxCHECK_VERSION
|
||||
|
||||
struct Item
|
||||
{
|
||||
@@ -218,9 +212,7 @@
|
||||
information += wxT(": ") + item.value + wxT("\n");
|
||||
}
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
information += wxT("\n") + wxGetLibraryVersionInfo().GetDescription();
|
||||
-#endif // wxCHECK_VERSION(3, 0, 0)
|
||||
|
||||
wxTextCtrl *txtInformation = XRCCTRL(*this, "txtInformation", wxTextCtrl);
|
||||
txtInformation->SetValue(information);
|
||||
Index: src/src/main.cpp
|
||||
===================================================================
|
||||
--- src/src/main.cpp (revision 12579)
|
||||
+++ src/src/main.cpp (revision 12580)
|
||||
@@ -2075,11 +2075,7 @@
|
||||
{
|
||||
if (!items[i]->IsCheckable())
|
||||
continue;
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
items[i]->Check(items[i]->GetItemLabel().IsSameAs(name));
|
||||
-#else
|
||||
- items[i]->Check(items[i]->GetText().IsSameAs(name));
|
||||
-#endif
|
||||
}
|
||||
|
||||
if (!m_LastLayoutIsTemp)
|
||||
@@ -2401,12 +2397,7 @@
|
||||
break;
|
||||
|
||||
default: // default style
|
||||
- #if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
- target->SetArtProvider(new NbStyleGTK());
|
||||
- #else
|
||||
target->SetArtProvider(new wxAuiDefaultTabArt());
|
||||
- #endif
|
||||
- break;
|
||||
}
|
||||
|
||||
target->SetTabCtrlHeight(-1);
|
||||
@@ -4801,13 +4792,9 @@
|
||||
|
||||
if (Manager::Get()->GetEditorManager() && event.GetEditor() == Manager::Get()->GetEditorManager()->GetActiveEditor())
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
// Execute the code to update the status bar outside of the paint event for scintilla.
|
||||
// Executing this function directly in the event handler causes redraw problems on Windows.
|
||||
CallAfter(&MainFrame::DoUpdateStatusBar);
|
||||
-#else
|
||||
- DoUpdateStatusBar();
|
||||
-#endif // defined(__wxMSW__) && wxCHECK_VERSION(3, 0, 0)
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
Index: src/src/notebookstyles.cpp
|
||||
===================================================================
|
||||
--- src/src/notebookstyles.cpp (revision 12579)
|
||||
+++ src/src/notebookstyles.cpp (revision 12580)
|
||||
@@ -13,14 +13,6 @@
|
||||
#include "prep.h"
|
||||
#include "notebookstyles.h"
|
||||
|
||||
-#if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
- #define GSocket GLibSocket
|
||||
- #include <gtk/gtk.h>
|
||||
- #undef GSocket
|
||||
- #include <wx/artprov.h>
|
||||
- #include <wx/renderer.h>
|
||||
-#endif
|
||||
-
|
||||
#include <wx/dc.h>
|
||||
#include <wx/dcclient.h>
|
||||
|
||||
@@ -42,15 +34,9 @@
|
||||
{
|
||||
NbStyleVC71* clone = new NbStyleVC71();
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
clone->SetNormalFont(m_normalFont);
|
||||
clone->SetSelectedFont(m_selectedFont);
|
||||
clone->SetMeasuringFont(m_measuringFont);
|
||||
-#else
|
||||
- clone->SetNormalFont(m_normal_font);
|
||||
- clone->SetSelectedFont(m_selected_font);
|
||||
- clone->SetMeasuringFont(m_measuring_font);
|
||||
-#endif
|
||||
|
||||
return clone;
|
||||
}
|
||||
@@ -75,11 +61,7 @@
|
||||
close_button_state,
|
||||
x_extent);
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
wxCoord tab_height = m_tabCtrlHeight - 3;
|
||||
-#else
|
||||
- wxCoord tab_height = m_tab_ctrl_height - 3;
|
||||
-#endif
|
||||
wxCoord tab_width = tab_size.x;
|
||||
wxCoord tab_x = in_rect.x;
|
||||
wxCoord tab_y = in_rect.y + in_rect.height - tab_height;
|
||||
@@ -166,17 +148,10 @@
|
||||
wxCoord textx;
|
||||
wxCoord texty;
|
||||
if (page.active)
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dc.SetFont(m_selectedFont);
|
||||
-#else
|
||||
- dc.SetFont(m_selected_font);
|
||||
-#endif
|
||||
else
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dc.SetFont(m_normalFont);
|
||||
-#else
|
||||
- dc.SetFont(m_normal_font);
|
||||
-#endif
|
||||
+
|
||||
dc.GetTextExtent(caption, &textx, &texty);
|
||||
// draw tab text
|
||||
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
|
||||
@@ -186,21 +161,12 @@
|
||||
// draw 'x' on tab (if enabled)
|
||||
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
int close_button_width = m_activeCloseBmp.GetWidth();
|
||||
wxBitmap bmp = m_disabledCloseBmp;
|
||||
-#else
|
||||
- int close_button_width = m_active_close_bmp.GetWidth();
|
||||
- wxBitmap bmp = m_disabled_close_bmp;
|
||||
-#endif
|
||||
|
||||
if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
|
||||
(close_button_state == wxAUI_BUTTON_STATE_PRESSED))
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
bmp = m_activeCloseBmp;
|
||||
-#else
|
||||
- bmp = m_active_close_bmp;
|
||||
-#endif
|
||||
|
||||
wxRect rect(tab_x + tab_width - close_button_width - 3,
|
||||
drawn_tab_yoff + (drawn_tab_height / 2) - (bmp.GetHeight() / 2),
|
||||
@@ -227,11 +193,7 @@
|
||||
// m_requested_tabctrl_height = -1;
|
||||
// m_tab_ctrl_height = -1;
|
||||
wxClientDC dc(wnd);
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dc.SetFont(m_measuringFont);
|
||||
-#else
|
||||
- dc.SetFont(m_measuring_font);
|
||||
-#endif
|
||||
int x_ext = 0;
|
||||
wxSize s = GetTabSize(dc, wnd, wxT("ABCDEFGHIj"), wxNullBitmap, true,
|
||||
wxAUI_BUTTON_STATE_HIDDEN, &x_ext);
|
||||
@@ -246,15 +208,9 @@
|
||||
{
|
||||
NbStyleFF2* clone = new NbStyleFF2();
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
clone->SetNormalFont(m_normalFont);
|
||||
clone->SetSelectedFont(m_selectedFont);
|
||||
clone->SetMeasuringFont(m_measuringFont);
|
||||
-#else
|
||||
- clone->SetNormalFont(m_normal_font);
|
||||
- clone->SetSelectedFont(m_selected_font);
|
||||
- clone->SetMeasuringFont(m_measuring_font);
|
||||
-#endif
|
||||
|
||||
return clone;
|
||||
}
|
||||
@@ -272,11 +228,7 @@
|
||||
wxSize tab_size = GetTabSize(dc, wnd, page.caption, page.bitmap,
|
||||
page.active, close_button_state, x_extent);
|
||||
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
wxCoord tab_height = m_tabCtrlHeight - 2;
|
||||
-#else
|
||||
- wxCoord tab_height = m_tab_ctrl_height - 2;
|
||||
-#endif
|
||||
wxCoord tab_width = tab_size.x;
|
||||
wxCoord tab_x = in_rect.x;
|
||||
wxCoord tab_y = in_rect.y + in_rect.height - tab_height;
|
||||
@@ -360,17 +312,10 @@
|
||||
wxCoord textx;
|
||||
wxCoord texty;
|
||||
if (page.active)
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dc.SetFont(m_selectedFont);
|
||||
-#else
|
||||
- dc.SetFont(m_selected_font);
|
||||
-#endif
|
||||
else
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dc.SetFont(m_normalFont);
|
||||
-#else
|
||||
- dc.SetFont(m_normal_font);
|
||||
-#endif
|
||||
+
|
||||
dc.GetTextExtent(caption, &textx, &texty);
|
||||
// draw tab text
|
||||
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
|
||||
@@ -380,21 +325,12 @@
|
||||
// draw 'x' on tab (if enabled)
|
||||
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
int close_button_width = m_activeCloseBmp.GetWidth();
|
||||
wxBitmap bmp = m_disabledCloseBmp;
|
||||
-#else
|
||||
- int close_button_width = m_active_close_bmp.GetWidth();
|
||||
- wxBitmap bmp = m_disabled_close_bmp;
|
||||
-#endif
|
||||
|
||||
if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
|
||||
(close_button_state == wxAUI_BUTTON_STATE_PRESSED))
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
bmp = m_activeCloseBmp;
|
||||
-#else
|
||||
- bmp = m_active_close_bmp;
|
||||
-#endif
|
||||
|
||||
wxRect rect(tab_x + tab_width - close_button_width - 3,
|
||||
drawn_tab_yoff + (drawn_tab_height / 2) - (bmp.GetHeight() / 2),
|
||||
@@ -421,533 +357,9 @@
|
||||
// m_requested_tabctrl_height = -1;
|
||||
// m_tab_ctrl_height = -1;
|
||||
wxClientDC dc(wnd);
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
dc.SetFont(m_measuringFont);
|
||||
-#else
|
||||
- dc.SetFont(m_measuring_font);
|
||||
-#endif
|
||||
int x_ext = 0;
|
||||
wxSize s = GetTabSize(dc, wnd, wxT("ABCDEFGHIj"), wxNullBitmap, true,
|
||||
wxAUI_BUTTON_STATE_HIDDEN, &x_ext);
|
||||
return s.y + 6;
|
||||
}
|
||||
-
|
||||
-#if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
-
|
||||
-namespace
|
||||
-{
|
||||
-
|
||||
-static GtkWidget *g_window = nullptr;
|
||||
-static GtkWidget *g_container = nullptr;
|
||||
-static GtkWidget *g_notebook = nullptr;
|
||||
-static GtkWidget *g_button = nullptr;
|
||||
-static int s_CloseIconSize = 16; // default size
|
||||
-
|
||||
-static void setup_widget_prototype(GtkWidget* widget)
|
||||
-{
|
||||
- if (!g_window)
|
||||
- {
|
||||
- g_window = gtk_window_new(GTK_WINDOW_POPUP);
|
||||
- gtk_widget_realize(g_window);
|
||||
- }
|
||||
- if (!g_container)
|
||||
- {
|
||||
- g_container = gtk_fixed_new();
|
||||
- gtk_container_add(GTK_CONTAINER(g_window), g_container);
|
||||
- }
|
||||
-
|
||||
- gtk_container_add(GTK_CONTAINER(g_container), widget);
|
||||
- gtk_widget_realize(widget);
|
||||
-}
|
||||
-
|
||||
-static GtkStyle * get_style_button()
|
||||
-{
|
||||
- if (!g_button)
|
||||
- {
|
||||
- g_button = gtk_button_new();
|
||||
- setup_widget_prototype(g_button);
|
||||
- }
|
||||
- return gtk_widget_get_style(g_button);
|
||||
-}
|
||||
-
|
||||
-static GtkStyle * get_style_notebook()
|
||||
-{
|
||||
- if (!g_notebook)
|
||||
- {
|
||||
- g_notebook = gtk_notebook_new();
|
||||
- setup_widget_prototype(g_notebook);
|
||||
- }
|
||||
- return gtk_widget_get_style(g_notebook);
|
||||
-}
|
||||
-
|
||||
-}
|
||||
-
|
||||
-NbStyleGTK::NbStyleGTK():
|
||||
- m_Xthickness(0),
|
||||
- m_Ythickness(0),
|
||||
- m_TabHBorder(0),
|
||||
- m_TabVBorder(0)
|
||||
-
|
||||
-{
|
||||
-}
|
||||
-
|
||||
-wxAuiTabArt* NbStyleGTK::Clone()
|
||||
-{
|
||||
- NbStyleGTK* clone = new NbStyleGTK();
|
||||
-
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- clone->SetNormalFont(m_normalFont);
|
||||
- clone->SetSelectedFont(m_normalFont);
|
||||
- clone->SetMeasuringFont(m_normalFont);
|
||||
-#else
|
||||
- clone->SetNormalFont(m_normal_font);
|
||||
- clone->SetSelectedFont(m_normal_font);
|
||||
- clone->SetMeasuringFont(m_normal_font);
|
||||
-#endif
|
||||
-
|
||||
- return clone;
|
||||
-}
|
||||
-
|
||||
-void NbStyleGTK::DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
|
||||
-{
|
||||
- GtkStyle* style_notebook = get_style_notebook();
|
||||
- GtkNotebook* notebook = GTK_NOTEBOOK (g_notebook);
|
||||
-
|
||||
- // if one of the parameters have changed, the height needs to be recalculated, so we force it,
|
||||
- if(m_Xthickness != style_notebook->xthickness ||
|
||||
- m_Ythickness != style_notebook->ythickness ||
|
||||
- m_TabVBorder != notebook->tab_vborder ||
|
||||
- m_TabHBorder != notebook->tab_hborder)
|
||||
- {
|
||||
- m_Xthickness = style_notebook->xthickness;
|
||||
- m_Ythickness = style_notebook->ythickness;
|
||||
- m_TabVBorder = notebook->tab_vborder;
|
||||
- m_TabHBorder = notebook->tab_hborder;
|
||||
- wxAuiNotebook* nb = nullptr;
|
||||
- if(wnd)
|
||||
- nb = (cbAuiNotebook*)wnd->GetParent();
|
||||
- if(nb)
|
||||
- nb->SetTabCtrlHeight(-1);
|
||||
- }
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
|
||||
- GdkWindow* pWin = impldc->GetGDKWindow();
|
||||
-#else
|
||||
- GdkWindow* pWin = dc.GetGDKWindow();
|
||||
-#endif
|
||||
- gtk_style_apply_default_background(style_notebook, pWin, 1, GTK_STATE_NORMAL, nullptr,
|
||||
- rect.x, rect.y, rect.width, rect.height);
|
||||
-}
|
||||
-
|
||||
-void ButtonStateAndShadow(int button_state, GtkStateType &state, GtkShadowType &shadow)
|
||||
-{
|
||||
-
|
||||
- if (button_state & wxAUI_BUTTON_STATE_DISABLED)
|
||||
- {
|
||||
- state = GTK_STATE_INSENSITIVE;
|
||||
- shadow = GTK_SHADOW_ETCHED_IN;
|
||||
- }
|
||||
- else if (button_state & wxAUI_BUTTON_STATE_HOVER)
|
||||
- {
|
||||
- state = GTK_STATE_PRELIGHT;
|
||||
- shadow = GTK_SHADOW_OUT;
|
||||
- }
|
||||
- else if (button_state & wxAUI_BUTTON_STATE_PRESSED)
|
||||
- {
|
||||
- state = GTK_STATE_ACTIVE;
|
||||
- shadow = GTK_SHADOW_IN;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- state = GTK_STATE_NORMAL;
|
||||
- shadow = GTK_SHADOW_OUT;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-wxRect DrawCloseButton(wxDC& dc,
|
||||
- GtkWidget *widget,
|
||||
- int button_state,
|
||||
- wxRect const &in_rect,
|
||||
- int orientation,
|
||||
- GdkRectangle* clipRect)
|
||||
-{
|
||||
- GtkStyle *style_button = get_style_button();
|
||||
- int xthickness = style_button->xthickness;
|
||||
- int ythickness = style_button->ythickness;
|
||||
-
|
||||
- wxBitmap bmp;
|
||||
- bmp.SetPixbuf(gtk_widget_render_icon(widget, GTK_STOCK_CLOSE, GTK_ICON_SIZE_SMALL_TOOLBAR, "tab"));
|
||||
-
|
||||
- if(bmp.GetWidth() != s_CloseIconSize || bmp.GetHeight() != s_CloseIconSize)
|
||||
- {
|
||||
- wxImage img = bmp.ConvertToImage();
|
||||
- img.Rescale(s_CloseIconSize, s_CloseIconSize);
|
||||
- bmp = img;
|
||||
- }
|
||||
-
|
||||
- int button_size = s_CloseIconSize + 2 * xthickness;
|
||||
-
|
||||
- wxRect out_rect;
|
||||
-
|
||||
- if (orientation == wxLEFT)
|
||||
- out_rect.x = in_rect.x - ythickness;
|
||||
- else
|
||||
- out_rect.x = in_rect.x + in_rect.width - button_size - ythickness;
|
||||
-
|
||||
- out_rect.y = in_rect.y + (in_rect.height - button_size) / 2;
|
||||
- out_rect.width = button_size;
|
||||
- out_rect.height = button_size;
|
||||
-
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
|
||||
- GdkWindow* pWin = impldc->GetGDKWindow();
|
||||
-#else
|
||||
- GdkWindow* pWin = dc.GetGDKWindow();
|
||||
-#endif
|
||||
-
|
||||
- if (button_state == wxAUI_BUTTON_STATE_HOVER)
|
||||
- {
|
||||
- gtk_paint_box(style_button, pWin,
|
||||
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, clipRect, widget, "button",
|
||||
- out_rect.x, out_rect.y, out_rect.width, out_rect.height);
|
||||
- }
|
||||
- else if (button_state == wxAUI_BUTTON_STATE_PRESSED)
|
||||
- {
|
||||
- gtk_paint_box(style_button, pWin,
|
||||
- GTK_STATE_ACTIVE, GTK_SHADOW_IN, clipRect, widget, "button",
|
||||
- out_rect.x, out_rect.y, out_rect.width, out_rect.height);
|
||||
- }
|
||||
-
|
||||
-
|
||||
- dc.DrawBitmap(bmp, out_rect.x + xthickness, out_rect.y + ythickness, true);
|
||||
-
|
||||
- return out_rect;
|
||||
-}
|
||||
-
|
||||
-void NbStyleGTK::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& page,
|
||||
- const wxRect& in_rect, int close_button_state, wxRect* out_tab_rect,
|
||||
- wxRect* out_button_rect, int* x_extent)
|
||||
-{
|
||||
- GtkWidget *widget = wnd->GetHandle();
|
||||
- GtkStyle *style_notebook = get_style_notebook();
|
||||
-
|
||||
- wxRect const &window_rect = wnd->GetRect();
|
||||
-
|
||||
- int focus_width = 0;
|
||||
-
|
||||
- gtk_widget_style_get(g_notebook,
|
||||
- "focus-line-width", &focus_width,
|
||||
- NULL);
|
||||
-
|
||||
- int tab_pos;
|
||||
- if (m_flags &wxAUI_NB_BOTTOM)
|
||||
- tab_pos = wxAUI_NB_BOTTOM;
|
||||
- else //if (m_flags & wxAUI_NB_TOP) {}
|
||||
- tab_pos = wxAUI_NB_TOP;
|
||||
-
|
||||
- // TODO: else if (m_flags &wxAUI_NB_LEFT) {}
|
||||
- // TODO: else if (m_flags &wxAUI_NB_RIGHT) {}
|
||||
-
|
||||
- // figure out the size of the tab
|
||||
- wxSize tab_size = GetTabSize(dc, wnd, page.caption, page.bitmap,
|
||||
- page.active, close_button_state, x_extent);
|
||||
-
|
||||
- wxRect tab_rect = in_rect;
|
||||
- tab_rect.width = tab_size.x;
|
||||
- tab_rect.height = tab_size.y;
|
||||
- tab_rect.y += 2 * m_TabHBorder;
|
||||
-
|
||||
- if (page.active)
|
||||
- tab_rect.height += 2 * m_TabHBorder;
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- // if no bitmap is set, we need a tiny correction
|
||||
- if (! page.bitmap.IsOk())
|
||||
- tab_rect.height += 1;
|
||||
-#endif
|
||||
-
|
||||
- int gap_rect_height = 6 * m_TabHBorder;
|
||||
- int gap_rect_x = 1, gap_start = 0, gap_width = 0;
|
||||
- int gap_rect_y = tab_rect.y - gap_rect_height;
|
||||
- int gap_rect_width = window_rect.width;
|
||||
-
|
||||
- switch (tab_pos)
|
||||
- {
|
||||
- case wxAUI_NB_TOP:
|
||||
- tab_rect.y -= 2 * m_TabHBorder;
|
||||
- if (!page.active)
|
||||
- tab_rect.y += 2 * m_TabHBorder;
|
||||
- gap_rect_y = tab_rect.y + tab_rect.height - m_TabHBorder / 2;
|
||||
- // fall through
|
||||
- case wxAUI_NB_BOTTOM:
|
||||
- gap_start = tab_rect.x - m_TabVBorder / 2;
|
||||
- gap_width = tab_rect.width;
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
- tab_rect.y += m_TabHBorder / 2;
|
||||
- gap_rect_y += m_TabHBorder / 2;
|
||||
-
|
||||
- int padding = focus_width + m_TabHBorder;
|
||||
-
|
||||
- int clip_width = tab_rect.width;
|
||||
- if (tab_rect.x + tab_rect.width > in_rect.x + in_rect.width)
|
||||
- clip_width = (in_rect.x + in_rect.width) - tab_rect.x;
|
||||
-
|
||||
- dc.SetClippingRegion(tab_rect.x, tab_rect.y - m_TabVBorder, clip_width, tab_rect.height + m_TabVBorder);
|
||||
-
|
||||
- GdkRectangle area;
|
||||
- area.x = tab_rect.x - m_TabVBorder;
|
||||
- area.y = tab_rect.y - 2 * m_TabHBorder;
|
||||
- area.width = clip_width + m_TabVBorder;
|
||||
- area.height = tab_rect.height + 2 * m_TabHBorder;
|
||||
-
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
|
||||
- GdkWindow* pWin = impldc->GetGDKWindow();
|
||||
-#else
|
||||
- GdkWindow* pWin = dc.GetGDKWindow();
|
||||
-#endif
|
||||
-
|
||||
- if (tab_pos == wxAUI_NB_BOTTOM)
|
||||
- {
|
||||
- if (page.active)
|
||||
- {
|
||||
- gtk_paint_box_gap(style_notebook, pWin, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
||||
- NULL, widget, "notebook",
|
||||
- gap_rect_x, gap_rect_y,
|
||||
- gap_rect_width, gap_rect_height,
|
||||
- GTK_POS_BOTTOM, gap_start , gap_width);
|
||||
- }
|
||||
- gtk_paint_extension(style_notebook, pWin,
|
||||
- page.active ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE, GTK_SHADOW_OUT,
|
||||
- &area, widget, "tab",
|
||||
- tab_rect.x, tab_rect.y,
|
||||
- tab_rect.width, tab_rect.height,
|
||||
- GTK_POS_TOP);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (page.active)
|
||||
- {
|
||||
- gtk_paint_box_gap(style_notebook, pWin, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
||||
- NULL, widget, "notebook",
|
||||
- gap_rect_x, gap_rect_y,
|
||||
- gap_rect_width, gap_rect_height,
|
||||
- GTK_POS_TOP, gap_start , gap_width);
|
||||
- }
|
||||
- gtk_paint_extension(style_notebook, pWin,
|
||||
- page.active ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE, GTK_SHADOW_OUT,
|
||||
- &area, widget, "tab",
|
||||
- tab_rect.x, tab_rect.y,
|
||||
- tab_rect.width, tab_rect.height,
|
||||
- GTK_POS_BOTTOM);
|
||||
- }
|
||||
-
|
||||
- wxCoord textX = tab_rect.x + padding + m_Xthickness;
|
||||
-
|
||||
- int bitmap_offset = 0;
|
||||
- if (page.bitmap.IsOk())
|
||||
- {
|
||||
- bitmap_offset = textX;
|
||||
-
|
||||
- // draw bitmap
|
||||
- int bitmapY = tab_rect.y +(tab_rect.height - page.bitmap.GetHeight()) / 2;
|
||||
- if(!page.active)
|
||||
- {
|
||||
- if (tab_pos == wxAUI_NB_TOP)
|
||||
- bitmapY += m_Ythickness / 2;
|
||||
- else
|
||||
- bitmapY -= m_Ythickness / 2;
|
||||
- }
|
||||
- dc.DrawBitmap(page.bitmap,
|
||||
- bitmap_offset,
|
||||
- bitmapY,
|
||||
- true);
|
||||
-
|
||||
- textX += page.bitmap.GetWidth() + padding;
|
||||
- }
|
||||
-
|
||||
- wxCoord textW, textH, textY;
|
||||
-
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- dc.SetFont(m_normalFont);
|
||||
-#else
|
||||
- dc.SetFont(m_normal_font);
|
||||
-#endif
|
||||
- dc.GetTextExtent(page.caption, &textW, &textH);
|
||||
- textY = tab_rect.y + (tab_rect.height - textH) / 2;
|
||||
- if(!page.active)
|
||||
- {
|
||||
- if (tab_pos == wxAUI_NB_TOP)
|
||||
- textY += m_Ythickness / 2;
|
||||
- else
|
||||
- textY -= m_Ythickness / 2;
|
||||
- }
|
||||
-
|
||||
- // draw tab text
|
||||
- GdkColor text_colour = page.active ? style_notebook->fg[GTK_STATE_NORMAL] : style_notebook->fg[GTK_STATE_ACTIVE];
|
||||
- dc.SetTextForeground(wxColor(text_colour));
|
||||
- GdkRectangle focus_area;
|
||||
-
|
||||
- int padding_focus = padding - focus_width;
|
||||
- focus_area.x = tab_rect.x + padding_focus;
|
||||
- focus_area.y = textY - focus_width;
|
||||
- focus_area.width = tab_rect.width - 2 * padding_focus;
|
||||
- focus_area.height = textH + 2 * focus_width;
|
||||
-
|
||||
- if(page.active && (wnd->FindFocus() == wnd) && focus_area.x <= (area.x + area.width))
|
||||
- {
|
||||
- // clipping seems not to work here, so we we have to recalc the focus-area manually
|
||||
- if((focus_area.x + focus_area.width) > (area.x + area.width))
|
||||
- focus_area.width = area.x + area.width - focus_area.x + focus_width - m_TabVBorder;
|
||||
- gtk_paint_focus (style_notebook, pWin,
|
||||
- GTK_STATE_ACTIVE, NULL, widget, "tab",
|
||||
- focus_area.x, focus_area.y, focus_area.width, focus_area.height);
|
||||
- }
|
||||
-
|
||||
- dc.DrawText(page.caption, textX, textY);
|
||||
-
|
||||
- // draw close-button on tab (if enabled)
|
||||
- if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
|
||||
- {
|
||||
- wxRect rect(tab_rect.x, tab_rect.y, tab_rect.width - m_Xthickness, tab_rect.height);
|
||||
- if(!page.active)
|
||||
- {
|
||||
- if (tab_pos == wxAUI_NB_TOP)
|
||||
- rect.y += m_Ythickness / 2;
|
||||
- else
|
||||
- rect.y -= m_Ythickness / 2;
|
||||
- }
|
||||
- *out_button_rect = DrawCloseButton(dc, widget, close_button_state, rect, wxRIGHT, &area);
|
||||
- }
|
||||
-
|
||||
- tab_rect.width = std::min(tab_rect.width, clip_width);
|
||||
- *out_tab_rect = tab_rect;
|
||||
-
|
||||
- dc.DestroyClippingRegion();
|
||||
-}
|
||||
-
|
||||
-wxRect DrawSimpleArrow(wxDC& dc,
|
||||
- GtkWidget *widget,
|
||||
- int button_state,
|
||||
- wxRect const &in_rect,
|
||||
- int orientation,
|
||||
- GtkArrowType arrow_type)
|
||||
-{
|
||||
- int scroll_arrow_hlength, scroll_arrow_vlength;
|
||||
- gtk_widget_style_get(widget,
|
||||
- "scroll-arrow-hlength", &scroll_arrow_hlength,
|
||||
- "scroll-arrow-vlength", &scroll_arrow_vlength,
|
||||
- NULL);
|
||||
-
|
||||
- GtkStateType state;
|
||||
- GtkShadowType shadow;
|
||||
- ButtonStateAndShadow(button_state, state, shadow);
|
||||
-
|
||||
- wxRect out_rect;
|
||||
-
|
||||
- if (orientation == wxLEFT)
|
||||
- out_rect.x = in_rect.x;
|
||||
- else
|
||||
- out_rect.x = in_rect.x + in_rect.width - scroll_arrow_hlength;
|
||||
- out_rect.y = (in_rect.y + in_rect.height - 3 * get_style_notebook()->ythickness - scroll_arrow_vlength) / 2;
|
||||
- out_rect.width = scroll_arrow_hlength;
|
||||
- out_rect.height = scroll_arrow_vlength;
|
||||
-
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
|
||||
- GdkWindow* pWin = impldc->GetGDKWindow();
|
||||
-#else
|
||||
- GdkWindow* pWin = dc.GetGDKWindow();
|
||||
-#endif
|
||||
- gtk_paint_arrow (get_style_button(), pWin, state, shadow, nullptr, widget, "notebook",
|
||||
- arrow_type, TRUE, out_rect.x, out_rect.y, out_rect.width, out_rect.height);
|
||||
-
|
||||
- return out_rect;
|
||||
-}
|
||||
-
|
||||
-void NbStyleGTK::DrawButton(wxDC& dc, wxWindow* wnd,
|
||||
- const wxRect& in_rect,
|
||||
- int bitmap_id,
|
||||
- int button_state,
|
||||
- int orientation,
|
||||
- wxRect* out_rect)
|
||||
-{
|
||||
- GtkWidget *widget = wnd->GetHandle();
|
||||
- wxRect rect = in_rect;
|
||||
- if (m_flags &wxAUI_NB_BOTTOM)
|
||||
- rect.y += 2 * get_style_button()->ythickness;
|
||||
-
|
||||
- switch (bitmap_id)
|
||||
- {
|
||||
- case wxAUI_BUTTON_CLOSE:
|
||||
- rect.y -= 2 * get_style_button()->ythickness;
|
||||
- rect = DrawCloseButton(dc, widget, button_state, rect, orientation, NULL);
|
||||
- break;
|
||||
-
|
||||
- case wxAUI_BUTTON_LEFT:
|
||||
- rect = DrawSimpleArrow(dc, widget, button_state, rect, orientation, GTK_ARROW_LEFT);
|
||||
- break;
|
||||
-
|
||||
- case wxAUI_BUTTON_RIGHT:
|
||||
- rect = DrawSimpleArrow(dc, widget, button_state, rect, orientation, GTK_ARROW_RIGHT);
|
||||
- break;
|
||||
-
|
||||
- case wxAUI_BUTTON_WINDOWLIST:
|
||||
- {
|
||||
- rect.height -= 4 * get_style_button()->ythickness;
|
||||
- rect.width = rect.height;
|
||||
- rect.x = in_rect.x + in_rect.width - rect.width;
|
||||
-
|
||||
- if (button_state == wxAUI_BUTTON_STATE_HOVER)
|
||||
- wxRendererNative::Get().DrawComboBoxDropButton(wnd, dc, rect, wxCONTROL_CURRENT);
|
||||
- else if (button_state == wxAUI_BUTTON_STATE_PRESSED)
|
||||
- wxRendererNative::Get().DrawComboBoxDropButton(wnd, dc, rect, wxCONTROL_PRESSED);
|
||||
- else
|
||||
- wxRendererNative::Get().DrawDropArrow(wnd, dc, rect);
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- *out_rect = rect;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-int NbStyleGTK::GetBestTabCtrlSize(wxWindow* wnd,
|
||||
- const wxAuiNotebookPageArray& pages,
|
||||
- const wxSize& required_bmp_size)
|
||||
-{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
- SetMeasuringFont(m_normalFont);
|
||||
- SetSelectedFont(m_normalFont);
|
||||
-#else
|
||||
- SetMeasuringFont(m_normal_font);
|
||||
- SetSelectedFont(m_normal_font);
|
||||
-#endif
|
||||
- int tab_height = 3 * get_style_notebook()->ythickness + wxAuiDefaultTabArt::GetBestTabCtrlSize(wnd, pages, required_bmp_size);
|
||||
- return tab_height;
|
||||
-}
|
||||
-
|
||||
-wxSize NbStyleGTK::GetTabSize(wxDC& dc,
|
||||
- wxWindow* wnd,
|
||||
- const wxString& caption,
|
||||
- const wxBitmap& bitmap,
|
||||
- bool active,
|
||||
- int close_button_state,
|
||||
- int* x_extent)
|
||||
-{
|
||||
- wxSize s = wxAuiDefaultTabArt::GetTabSize(dc, wnd, caption, bitmap, active, close_button_state, x_extent);
|
||||
-
|
||||
- int overlap = 0;
|
||||
- gtk_widget_style_get (wnd->GetHandle(),
|
||||
- "focus-line-width", &overlap,
|
||||
- NULL);
|
||||
- *x_extent -= overlap;
|
||||
- return s;
|
||||
-}
|
||||
-
|
||||
-#endif // #if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0)
|
||||
Index: src/src/projectmanagerui.cpp
|
||||
===================================================================
|
||||
--- src/src/projectmanagerui.cpp (revision 12579)
|
||||
+++ src/src/projectmanagerui.cpp (revision 12580)
|
||||
@@ -1875,11 +1875,7 @@
|
||||
{
|
||||
size_t operator()(const wxString& s) const
|
||||
{
|
||||
-#if wxCHECK_VERSION(3, 0, 0)
|
||||
return std::hash<std::wstring>()(s.ToStdWstring());
|
||||
-#else
|
||||
- return std::hash<std::wstring>()(s.wc_str());
|
||||
-#endif // wxCHECK_VERSION
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
------------------------------------------------------------------------
|
||||
r12592 | wh11204 | 2021-12-18 17:13:26 +0900 (Sat, 18 Dec 2021) | 10 lines
|
||||
|
||||
* Fix scale factor detection for wxWidgets >= 3.1.4 (ticket #1132).
|
||||
wxWidgets changed the value returned by wxWindow::GetContentScaleFactor() in 3.1.0. In
|
||||
3.1.4 they restored the pre-3.1.0 behaviour and created a new method GetDPIScaleFactor()
|
||||
returning what GetContentScaleFactor() was returning until then.
|
||||
|
||||
This change broke HiDPI detection when using wxWidgets >= 3.1.4. BTW, it was already broken in
|
||||
32-bit C::B because it was not DPI-aware; this has been fixed in [r12591].
|
||||
|
||||
Update developer list in Thanks section of the About dialog.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/sdk/globals.cpp
|
||||
===================================================================
|
||||
--- src/sdk/globals.cpp (revision 12591)
|
||||
+++ src/sdk/globals.cpp (revision 12592)
|
||||
@@ -1186,7 +1186,11 @@
|
||||
|
||||
double cbGetContentScaleFactor(const wxWindow &window)
|
||||
{
|
||||
+#if wxCHECK_VERSION(3, 1, 4)
|
||||
+ return window.GetDPIScaleFactor();
|
||||
+#else
|
||||
return window.GetContentScaleFactor();
|
||||
+#endif
|
||||
}
|
||||
|
||||
#ifdef __WXGTK__
|
||||
Index: src/src/dlgabout.cpp
|
||||
===================================================================
|
||||
--- src/src/dlgabout.cpp (revision 12591)
|
||||
+++ src/src/dlgabout.cpp (revision 12592)
|
||||
@@ -101,6 +101,7 @@
|
||||
"Damien Moore : Developer\n"
|
||||
"Micah Ng : Developer\n"
|
||||
"BlueHazzard : Developer\n"
|
||||
+ "Miguel Gimenez : Developer\n"
|
||||
"Ricardo Garcia : All-hands person\n"
|
||||
"Paul A. Jimenez : Help and AStyle plugins\n"
|
||||
"Thomas Lorblanches : CodeStat and Profiler plugins\n"
|
||||
@@ -132,7 +133,6 @@
|
||||
"Alexandr Efremo : Providing OpenSuSe packages\n"
|
||||
"Huki : Misc. Code-Completion improvements\n"
|
||||
"stahta01 : Misc. patches for several enhancements\n"
|
||||
- "Miguel Gimenez : Misc. patches for several enhancements\n"
|
||||
"\n"
|
||||
"All contributors that provided patches.\n"
|
||||
"The wxWidgets project (http://www.wxwidgets.org).\n"
|
||||
@@ -171,7 +171,7 @@
|
||||
if (!desktopEnv.empty())
|
||||
items.push_back({_("Desktop environment"), desktopEnv });
|
||||
|
||||
- items.push_back({_("Scaling factor"), wxString::Format("%f", GetContentScaleFactor())});
|
||||
+ items.push_back({_("Scaling factor"), wxString::Format("%f", cbGetContentScaleFactor(*this))});
|
||||
items.push_back({_("Detected scaling factor"),
|
||||
wxString::Format("%f", cbGetActualContentScaleFactor(*this))});
|
||||
const wxSize displayPPI = wxGetDisplayPPI();
|
|
@ -0,0 +1,127 @@
|
|||
------------------------------------------------------------------------
|
||||
r12707 | wh11204 | 2022-02-08 00:55:51 +0900 (Tue, 08 Feb 2022) | 3 lines
|
||||
|
||||
- Fix compilation of notebookstyles.cpp with wxWidgets-master.
|
||||
This change allows testing C::B with the upcoming wx3.1.6.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/src/notebookstyles.cpp
|
||||
===================================================================
|
||||
--- src/src/notebookstyles.cpp (revision 12706)
|
||||
+++ src/src/notebookstyles.cpp (revision 12707)
|
||||
@@ -124,8 +124,16 @@
|
||||
if (page.bitmap.IsOk())
|
||||
{
|
||||
bitmap_offset = tab_x + 8;
|
||||
+ // draw bitmap
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
+ const wxBitmap bmp(page.bitmap.GetBitmapFor(wnd));
|
||||
+ dc.DrawBitmap(bmp,
|
||||
+ bitmap_offset,
|
||||
+ drawn_tab_yoff + (drawn_tab_height/2) - (bmp.GetHeight()/2),
|
||||
+ true);
|
||||
|
||||
- // draw bitmap
|
||||
+ text_offset = bitmap_offset + bmp.GetWidth();
|
||||
+#else
|
||||
dc.DrawBitmap(page.bitmap,
|
||||
bitmap_offset,
|
||||
drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetHeight()/2),
|
||||
@@ -132,6 +140,7 @@
|
||||
true);
|
||||
|
||||
text_offset = bitmap_offset + page.bitmap.GetWidth();
|
||||
+#endif
|
||||
text_offset += 3; // bitmap padding
|
||||
}
|
||||
else
|
||||
@@ -161,13 +170,23 @@
|
||||
// draw 'x' on tab (if enabled)
|
||||
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
|
||||
{
|
||||
- int close_button_width = m_activeCloseBmp.GetWidth();
|
||||
- wxBitmap bmp = m_disabledCloseBmp;
|
||||
+ wxBitmap bmp;
|
||||
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
|
||||
(close_button_state == wxAUI_BUTTON_STATE_PRESSED))
|
||||
+ bmp = m_activeCloseBmp.GetBitmapFor(wnd);
|
||||
+ else
|
||||
+ bmp = m_disabledCloseBmp.GetBitmapFor(wnd);
|
||||
+#else
|
||||
+ if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
|
||||
+ (close_button_state == wxAUI_BUTTON_STATE_PRESSED))
|
||||
bmp = m_activeCloseBmp;
|
||||
+ else
|
||||
+ bmp = m_disabledCloseBmp;
|
||||
+#endif
|
||||
|
||||
+ const int close_button_width = bmp.GetWidth();
|
||||
wxRect rect(tab_x + tab_width - close_button_width - 3,
|
||||
drawn_tab_yoff + (drawn_tab_height / 2) - (bmp.GetHeight() / 2),
|
||||
close_button_width, tab_height);
|
||||
@@ -285,11 +304,20 @@
|
||||
int text_offset = tab_x + 8;
|
||||
|
||||
int bitmap_offset = 0;
|
||||
+
|
||||
if (page.bitmap.IsOk())
|
||||
{
|
||||
bitmap_offset = tab_x + 8;
|
||||
+ // draw bitmap
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
+ const wxBitmap bmp(page.bitmap.GetBitmapFor(wnd));
|
||||
+ dc.DrawBitmap(bmp,
|
||||
+ bitmap_offset,
|
||||
+ drawn_tab_yoff + (drawn_tab_height/2) - (bmp.GetHeight()/2),
|
||||
+ true);
|
||||
|
||||
- // draw bitmap
|
||||
+ text_offset = bitmap_offset + bmp.GetWidth();
|
||||
+#else
|
||||
dc.DrawBitmap(page.bitmap,
|
||||
bitmap_offset,
|
||||
drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetHeight()/2),
|
||||
@@ -296,6 +324,7 @@
|
||||
true);
|
||||
|
||||
text_offset = bitmap_offset + page.bitmap.GetWidth();
|
||||
+#endif
|
||||
text_offset += 3; // bitmap padding
|
||||
}
|
||||
else
|
||||
@@ -303,7 +332,6 @@
|
||||
text_offset = tab_x + 8;
|
||||
}
|
||||
|
||||
-
|
||||
// if the caption is empty, measure some temporary text
|
||||
wxString caption = page.caption;
|
||||
if (caption.empty())
|
||||
@@ -325,13 +353,23 @@
|
||||
// draw 'x' on tab (if enabled)
|
||||
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
|
||||
{
|
||||
- int close_button_width = m_activeCloseBmp.GetWidth();
|
||||
- wxBitmap bmp = m_disabledCloseBmp;
|
||||
+ wxBitmap bmp;
|
||||
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
|
||||
(close_button_state == wxAUI_BUTTON_STATE_PRESSED))
|
||||
+ bmp = m_activeCloseBmp.GetBitmapFor(wnd);
|
||||
+ else
|
||||
+ bmp = m_disabledCloseBmp.GetBitmapFor(wnd);
|
||||
+#else
|
||||
+ if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
|
||||
+ (close_button_state == wxAUI_BUTTON_STATE_PRESSED))
|
||||
bmp = m_activeCloseBmp;
|
||||
+ else
|
||||
+ bmp = m_disabledCloseBmp;
|
||||
+#endif
|
||||
|
||||
+ const int close_button_width = bmp.GetWidth();
|
||||
wxRect rect(tab_x + tab_width - close_button_width - 3,
|
||||
drawn_tab_yoff + (drawn_tab_height / 2) - (bmp.GetHeight() / 2),
|
||||
close_button_width, tab_height);
|
|
@ -0,0 +1,248 @@
|
|||
------------------------------------------------------------------------
|
||||
r12841 | wh11204 | 2022-06-29 21:34:36 +0900 (Wed, 29 Jun 2022) | 4 lines
|
||||
|
||||
* Fix compilation of wx3.1.6 and later with Clang (thanks AndrewCot).
|
||||
See https://forums.codeblocks.org/index.php/topic,25004.msg170429.html#msg170429
|
||||
Also fix some typos in documentation.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/include/cbauibook.h
|
||||
===================================================================
|
||||
--- src/include/cbauibook.h (revision 12840)
|
||||
+++ src/include/cbauibook.h (revision 12841)
|
||||
@@ -57,14 +57,14 @@
|
||||
/** \brief Loads serialized notebook layout
|
||||
* \param layout the serialized layout
|
||||
* \param mergeLayouts try to merge the tab-layouts
|
||||
- * \return bool true if successfull
|
||||
+ * \return bool true if successful
|
||||
*
|
||||
*/
|
||||
bool LoadPerspective(const wxString& layout, bool mergeLayouts = false);
|
||||
- /** \brief Get the tab index from tooltiptext
|
||||
+ /** \brief Get the tab index from tooltip text
|
||||
* \param text the notebooks name
|
||||
* \return int the tab's index
|
||||
- * @remarks We use the name internally to store the tooltip-text. To use it
|
||||
+ * @remarks We use the name internally to store the tooltip text. To use it
|
||||
* in this function, we create a unique string from the relative filename
|
||||
* and the projects title. So it should be unique even after a
|
||||
* restart of C::B.
|
||||
@@ -78,7 +78,7 @@
|
||||
* \return int the visible position
|
||||
*/
|
||||
int GetTabPositionFromIndex(int index);
|
||||
- /** \brief Minmize free horizontal page
|
||||
+ /** \brief Minimize free horizontal page
|
||||
*
|
||||
* Moves the active tab of all tabCtrl's to the rightmost place,
|
||||
* to show as many tabs as possible.
|
||||
@@ -87,21 +87,21 @@
|
||||
/** \brief Delete Page
|
||||
*
|
||||
* Calls the base-class function and after that
|
||||
- * MinmizeFreeSpace(), needed to hook into the close-events.
|
||||
+ * MinimizeFreeSpace(), needed to hook into the close-events.
|
||||
* The system generated close event has to be veto'd, and Close()
|
||||
* has to be called manually, so we can handle it ourselves.
|
||||
* \param The index of the tab to be closed
|
||||
- * \return true if successfull
|
||||
+ * \return true if successful
|
||||
*/
|
||||
bool DeletePage(size_t page) override;
|
||||
/** \brief Remove Page
|
||||
*
|
||||
* Calls the base-class function and after that
|
||||
- * MinmizeFreeSpace(), needed to hook into the close-events.
|
||||
+ * MinimizeFreeSpace(), needed to hook into the close-events.
|
||||
* The system generated close event has to be veto'd, and Close()
|
||||
* has to be called manually, so we can handle it ourselves.
|
||||
* \param The index of the tab to be closed
|
||||
- * \return true if successfull
|
||||
+ * \return true if successful
|
||||
*/
|
||||
bool RemovePage(size_t page) override;
|
||||
/** \brief Move page
|
||||
@@ -109,33 +109,37 @@
|
||||
* Moves the tab containing page to new_idx
|
||||
* \param page The page to move (e.g. cbEditor*)
|
||||
* \param new_idx The index the page should be moved to
|
||||
- * \return true if successfull
|
||||
+ * \return true if successful
|
||||
*/
|
||||
bool MovePage(wxWindow* page, size_t new_idx);
|
||||
/** \brief Add Page
|
||||
*
|
||||
* Calls the base-class function and after that
|
||||
- * MinmizeFreeSpace().
|
||||
+ * MinimizeFreeSpace().
|
||||
* \param page The page to add
|
||||
* \param caption The caption of the page
|
||||
* \param select If true the page gets selected
|
||||
- * \param bitmap The bitmap of the tab
|
||||
- * \return true if successfull
|
||||
+ * \param bitmap The bitmap (or bitmap bundle since wx3.1.6) of the tab
|
||||
+ * \return true if successful
|
||||
*/
|
||||
bool AddPage(wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
+ const wxBitmapBundle& bitmap = wxBitmapBundle());
|
||||
+#else
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
+#endif
|
||||
/** \brief Insert Page
|
||||
*
|
||||
* Calls the base-class function and after that
|
||||
- * MinmizeFreeSpace().
|
||||
+ * MinimizeFreeSpace().
|
||||
* \param page_idx The index where the page should be inserted
|
||||
* \param page The page to add
|
||||
* \param caption The caption of the page
|
||||
* \param select If true the page gets selected
|
||||
* \param bitmap The bitmap of the tab
|
||||
- * \return true if successfull
|
||||
+ * \return true if successful
|
||||
*/
|
||||
bool InsertPage(size_t page_idx,
|
||||
wxWindow* page,
|
||||
@@ -142,11 +146,11 @@
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
- /** \brief Set zoomfactor for builtin editors
|
||||
+ /** \brief Set zoom factor for builtin editors
|
||||
*
|
||||
- * Sets the zoomfactor for all visible builtin
|
||||
+ * Sets the zoom factor for all visible builtin
|
||||
* editors.
|
||||
- * \param zoom zoomfactor to use
|
||||
+ * \param zoom zoom factor to use
|
||||
*/
|
||||
void SetZoom(int zoom);
|
||||
/** \brief Set Focus on the tabCtrl belonging to the active tab
|
||||
@@ -165,7 +169,7 @@
|
||||
/** \brief Create a unique id from the tooltip-text
|
||||
*
|
||||
* Tries to create a unique id from the tooltip.
|
||||
- * Find the projectfile, geet the relative filename and put it
|
||||
+ * Find the projectfile, get the relative filename and put it
|
||||
* together with the projects name.
|
||||
* We use it to save and load the pane layout.
|
||||
* By using the relative filename, it works even if the project
|
||||
@@ -173,7 +177,7 @@
|
||||
* \param text The tooltip text
|
||||
*/
|
||||
wxString UniqueIdFromTooltip(const wxString& text);
|
||||
- /** \brief Minmize free horizontal page of tabCtrl
|
||||
+ /** \brief Minimize free horizontal page of tabCtrl
|
||||
*
|
||||
* Moves the active tab of tabCtrl to the rightmost place,
|
||||
* to show as many tabs as possible.
|
||||
@@ -194,7 +198,7 @@
|
||||
void OnIdle(cb_unused wxIdleEvent& event);
|
||||
/** \brief Catch doubleclick-events from wxTabCtrl
|
||||
*
|
||||
- * Sends cbEVT_CBAUIBOOK_LEFT_DCLICK, if doubleclick was on a tab,
|
||||
+ * Sends cbEVT_CBAUIBOOK_LEFT_DCLICK, if double click was on a tab,
|
||||
* event-Id is the notebook-Id, event-object is the pointer to the window the
|
||||
* tab belongs to.
|
||||
* \param event holds the wxTabCtrl, that sends the event
|
||||
@@ -202,7 +206,7 @@
|
||||
void OnTabCtrlDblClick(wxMouseEvent& event);
|
||||
/** \brief Catch mousewheel-events from wxTabCtrl
|
||||
*
|
||||
- * Sends cbEVT_CBAUIBOOK_MOUSEWHEEL, if doubleclick was on a tab,
|
||||
+ * Sends cbEVT_CBAUIBOOK_MOUSEWHEEL, if double click was on a tab,
|
||||
* event-Id is the notebook-Id, event-object is the pointer to the window the
|
||||
* tab belongs to.
|
||||
* \param event holds the wxTabCtrl, that sends the event
|
||||
@@ -229,7 +233,7 @@
|
||||
* \param event holds the wxTabCtrl, that sends the event
|
||||
*/
|
||||
void OnLeaveTabCtrl(wxMouseEvent& event);
|
||||
- // hack needed on wxMSW, because only focused windows get mousewheel-events
|
||||
+ // hack needed on wxMSW, because only focused windows get mouse wheel-events
|
||||
/** \brief Checks the old focus
|
||||
*
|
||||
* Checks whether the old focused window or one of it's
|
||||
@@ -276,7 +280,7 @@
|
||||
// needed for wxMSW-hack, see above
|
||||
/** \brief Last selected tab
|
||||
*
|
||||
- * Used to determine whether the tab-selection has changed btween mouseenter
|
||||
+ * Used to determine whether the tab-selection has changed between mouseenter
|
||||
* and mouseleave-event.
|
||||
*/
|
||||
int m_LastSelected;
|
||||
@@ -308,7 +312,7 @@
|
||||
* \param use If true tooltips are allowed
|
||||
*/
|
||||
static void UseToolTips(bool use = true);
|
||||
- /** \brief Enable or disable tab-scrolling with mousewheel
|
||||
+ /** \brief Enable or disable tab-scrolling with mouse wheel
|
||||
*
|
||||
* \param allow If true scrolling is allowed
|
||||
*/
|
||||
@@ -316,15 +320,15 @@
|
||||
/** \brief Sets the modifier keys for scrolling
|
||||
*/
|
||||
static void SetModKeys(wxString keys = _T("Strg"));
|
||||
- /** \brief Use modkey to advance through tabs with mousewheel
|
||||
+ /** \brief Use modkey to advance through tabs with mouse wheel
|
||||
*/
|
||||
static void UseModToAdvance(bool use = false);
|
||||
- /** \brief Change direction of tab-advancing with mousewheel
|
||||
+ /** \brief Change direction of tab-advancing with mouse wheel
|
||||
*
|
||||
* \param invert If true advance direction is inverted
|
||||
*/
|
||||
static void InvertAdvanceDirection(bool invert = false);
|
||||
- /** \brief Change direction of tab-moving with mousewheel
|
||||
+ /** \brief Change direction of tab-moving with mouse wheel
|
||||
*
|
||||
* \param invert If true move direction is inverted
|
||||
*/
|
||||
@@ -333,7 +337,7 @@
|
||||
/** \brief Enable or disable tab tooltips
|
||||
*/
|
||||
static bool s_UseTabTooltips;
|
||||
- /** \brief Enable or disable scrolling tabs with mousewheel
|
||||
+ /** \brief Enable or disable scrolling tabs with mouse wheel
|
||||
*/
|
||||
static bool s_AllowMousewheel;
|
||||
/** \brief Holds an array of all existing cbAuiNotebooks
|
||||
@@ -342,13 +346,13 @@
|
||||
/** \brief Holds the modifier keys for scrolling
|
||||
*/
|
||||
static wxString s_modKeys;
|
||||
- /** \brief Use modkey to advance through tabs with mousewheel
|
||||
+ /** \brief Use modkey to advance through tabs with mouse wheel
|
||||
*/
|
||||
static bool s_modToAdvance;
|
||||
- /** \brief Mousewheel move direction: negative => invert
|
||||
+ /** \brief Mouse wheel move direction: negative => invert
|
||||
*/
|
||||
static int s_moveDirection;
|
||||
- /** \brief Mouseweheel advance direction: negative => invert
|
||||
+ /** \brief Mouse wheel advance direction: negative => invert
|
||||
*/
|
||||
static int s_advanceDirection;
|
||||
|
||||
Index: src/sdk/cbauibook.cpp
|
||||
===================================================================
|
||||
--- src/sdk/cbauibook.cpp (revision 12840)
|
||||
+++ src/sdk/cbauibook.cpp (revision 12841)
|
||||
@@ -500,7 +500,11 @@
|
||||
bool cbAuiNotebook::AddPage(wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select,
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
+ const wxBitmapBundle& bitmap)
|
||||
+#else
|
||||
const wxBitmap& bitmap)
|
||||
+#endif
|
||||
{
|
||||
bool result = wxAuiNotebook::AddPage(page, caption, select, bitmap);
|
||||
MinimizeFreeSpace();
|
|
@ -0,0 +1,48 @@
|
|||
------------------------------------------------------------------------
|
||||
r12842 | wh11204 | 2022-06-30 18:36:18 +0900 (Thu, 30 Jun 2022) | 3 lines
|
||||
|
||||
- Complete previous commit, InsertPage() must be fixed too.
|
||||
It appeared in the diff, but I forgot about it when editing.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Index: src/include/cbauibook.h
|
||||
===================================================================
|
||||
--- src/include/cbauibook.h (revision 12841)
|
||||
+++ src/include/cbauibook.h (revision 12842)
|
||||
@@ -138,7 +138,7 @@
|
||||
* \param page The page to add
|
||||
* \param caption The caption of the page
|
||||
* \param select If true the page gets selected
|
||||
- * \param bitmap The bitmap of the tab
|
||||
+ * \param bitmap The bitmap (or bitmap bundle since wx3.1.6) of the tab
|
||||
* \return true if successful
|
||||
*/
|
||||
bool InsertPage(size_t page_idx,
|
||||
@@ -145,7 +145,11 @@
|
||||
wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
+ const wxBitmapBundle& bitmap = wxBitmapBundle());
|
||||
+#else
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
+#endif
|
||||
/** \brief Set zoom factor for builtin editors
|
||||
*
|
||||
* Sets the zoom factor for all visible builtin
|
||||
Index: src/sdk/cbauibook.cpp
|
||||
===================================================================
|
||||
--- src/sdk/cbauibook.cpp (revision 12841)
|
||||
+++ src/sdk/cbauibook.cpp (revision 12842)
|
||||
@@ -515,7 +515,11 @@
|
||||
wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select,
|
||||
+#if wxCHECK_VERSION(3, 1, 6)
|
||||
+ const wxBitmapBundle& bitmap)
|
||||
+#else
|
||||
const wxBitmap& bitmap)
|
||||
+#endif
|
||||
{
|
||||
bool result = wxAuiNotebook::InsertPage(page_idx, page, caption, select, bitmap);
|
||||
MinimizeFreeSpace();
|
|
@ -0,0 +1,43 @@
|
|||
TERMUX_PKG_HOMEPAGE=https://www.codeblocks.org/
|
||||
TERMUX_PKG_DESCRIPTION="Code::Blocks is the Integrated Development Environment (IDE)"
|
||||
TERMUX_PKG_LICENSE="GPL-3.0"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=20.03
|
||||
TERMUX_PKG_SRCURL=https://sourceforge.net/projects/codeblocks/files/Sources/${TERMUX_PKG_VERSION}/codeblocks-${TERMUX_PKG_VERSION}.tar.xz
|
||||
TERMUX_PKG_SHA256=15eeb3e28aea054e1f38b0c7f4671b4d4d1116fd05f63c07aa95a91db89eaac5
|
||||
TERMUX_PKG_DEPENDS="codeblocks-data, glib, gtk3, libc++, wxwidgets, zip"
|
||||
TERMUX_PKG_HOSTBUILD=true
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-contrib-plugins --disable-compiler"
|
||||
|
||||
termux_step_post_get_source() {
|
||||
local f
|
||||
for f in $TERMUX_PKG_BUILDER_DIR/backport-r*.diff; do
|
||||
local b=$(basename "${f}")
|
||||
echo "Applying ${b}"
|
||||
local d="$TERMUX_PKG_BUILDER_DIR/${b#backport-}.diff"
|
||||
if [ -f "${d}" ]; then
|
||||
patch -d $TERMUX_PKG_BUILDER_DIR -o - < "${d}" \
|
||||
| patch --silent -p0
|
||||
else
|
||||
patch --silent -p0 < "${f}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
termux_step_host_build() {
|
||||
"${TERMUX_PKG_SRCDIR}/configure"
|
||||
make -j $TERMUX_MAKE_PROCESSES -C src/base
|
||||
make -j $TERMUX_MAKE_PROCESSES -C src/build_tools
|
||||
}
|
||||
|
||||
termux_step_pre_configure() {
|
||||
sed "s/-lpthread//g" -i configure
|
||||
LDFLAGS+=" $($CC -print-libgcc-file-name)"
|
||||
}
|
||||
|
||||
termux_step_post_configure() {
|
||||
cp -r $TERMUX_PKG_HOSTBUILD_DIR/src/build_tools ./src
|
||||
sed -i 's/ -shared / -Wl,-O1,--as-needed\0/g' ./libtool
|
||||
find . -type f -name Makefile | xargs -n 1 \
|
||||
sed -i "s/-lpthread//g; s/-pthread//g"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
TERMUX_SUBPKG_DESCRIPTION="Platform-independent data for codeblocks"
|
||||
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true
|
||||
TERMUX_SUBPKG_INCLUDE="share/codeblocks/"
|
|
@ -0,0 +1,22 @@
|
|||
--- backport-r12190.diff.orig
|
||||
+++ backport-r12190.diff
|
||||
@@ -2996,15 +2996,15 @@
|
||||
+++ src/src/environmentsettingsdlg.h (revision 12190)
|
||||
@@ -19,8 +19,8 @@
|
||||
{
|
||||
- public:
|
||||
+ public:
|
||||
EnvironmentSettingsDlg(wxWindow* parent, wxAuiDockArt* art);
|
||||
- virtual ~EnvironmentSettingsDlg();
|
||||
- virtual void EndModal(int retCode);
|
||||
+ ~EnvironmentSettingsDlg() override;
|
||||
+ void EndModal(int retCode) override;
|
||||
-
|
||||
- public:
|
||||
- // From cbConfigurationPanelColoursInterface
|
||||
+ protected:
|
||||
+ void OnPageChanging(wxListbookEvent& event);
|
||||
+ void OnPageChanged(wxListbookEvent& event);
|
||||
Index: src/src/examinememorydlg.h
|
||||
===================================================================
|
||||
--- src/src/examinememorydlg.h (revision 12189)
|
|
@ -0,0 +1,22 @@
|
|||
--- a/src/mime/Makefile.am
|
||||
+++ b/src/mime/Makefile.am
|
||||
@@ -20,7 +20,7 @@
|
||||
## Update mime only when system wide installation takes place
|
||||
|
||||
install-data-hook: install-xdgmimeDATA
|
||||
- if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
|
||||
+ if false && [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
|
||||
if which update-mime-database>/dev/null 2>&1; then \
|
||||
update-mime-database $(DESTDIR)$(datadir)/mime; \
|
||||
fi; \
|
||||
--- a/src/mime/Makefile.in
|
||||
+++ b/src/mime/Makefile.in
|
||||
@@ -713,7 +713,7 @@
|
||||
|
||||
|
||||
install-data-hook: install-xdgmimeDATA
|
||||
- if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
|
||||
+ if false && [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
|
||||
if which update-mime-database>/dev/null 2>&1; then \
|
||||
update-mime-database $(DESTDIR)$(datadir)/mime; \
|
||||
fi; \
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/src/sdk/scripting/bindings/sc_wxtypes.cpp b/src/sdk/scripting/bindings/sc_wxtypes.cpp
|
||||
index 33cd09850..9a162bf9a 100644
|
||||
--- a/src/sdk/scripting/bindings/sc_wxtypes.cpp
|
||||
+++ b/src/sdk/scripting/bindings/sc_wxtypes.cpp
|
||||
@@ -389,7 +389,6 @@ namespace ScriptBindings
|
||||
func(&wxFileName::IsDir, "IsDir").
|
||||
func(&wxFileName::MakeAbsolute, "MakeAbsolute").
|
||||
func(&wxFileName::MakeRelativeTo, "MakeRelativeTo").
|
||||
- func(&wxFileName::Normalize, "Normalize").
|
||||
func(&wxFileName::PrependDir, "PrependDir").
|
||||
func(&wxFileName::RemoveDir, "RemoveDir").
|
||||
func(&wxFileName::RemoveLastDir, "RemoveLastDir").
|
||||
|
Loading…
Reference in New Issue