Patch #2337 2008-01-18 11:20

cacolijn

Added ability for user to change colours in log window
Download
2337-Added_ability.patch (30.8 KB)
Category
Application::FeatureAdd
Status
Rejected
Close date
2011-11-22 19:30
Assigned to
mortenmacfly
Index: include/configmanager.h
===================================================================
--- include/configmanager.h    (revision 4832)
+++ include/configmanager.h    (working copy)
@@ -82,7 +82,28 @@
 };
 
 
+// Defaults;
+// Log window
+extern const wxColour defLogColourListStandardFront;
+extern const wxColour defLogColourTextStandardFront;
+extern const wxColour defLogColourTextStandardBack;
+extern const wxColour defLogColourListSuccessFront;
+extern const wxColour defLogColourTextSuccessFront;
+extern const wxColour defLogColourTextSuccessBack;
+extern const wxColour defLogColourListWarningFront;
+extern const wxColour defLogColourTextWarningFront;
+extern const wxColour defLogColourTextWarningBack;
+extern const wxColour defLogColourListErrorFront;
+extern const wxColour defLogColourTextErrorFront;
+extern const wxColour defLogColourTextErrorBack;
+extern const wxColour defLogColourListCriticalFront;
+extern const wxColour defLogColourTextCriticalFront;
+extern const wxColour defLogColourTextCriticalBack;
+extern const wxColour defLogColourListFailureFront;
+extern const wxColour defLogColourTextFailureFront;
+extern const wxColour defLogColourTextFailureBack;
 
+
 /* ------------------------------------------------------------------------------------------------------------------
 *  ConfigManager class
 */
Index: include/loggers.h
===================================================================
--- include/loggers.h    (revision 4832)
+++ include/loggers.h    (working copy)
@@ -54,7 +54,8 @@
     wxString asterisk;
 
     CSS();
-    operator wxString();
+    operator wxString();
+    void UpdateSettings();
 };
 
 class DLLIMPORT HTMLFileLogger : public FileLogger
@@ -66,7 +67,8 @@
 
     virtual void Append(const wxString& msg, Logger::level lv);
     virtual void Open(const wxString& filename);
-    virtual void Close();
+    virtual void Close();
+    virtual void UpdateSettings();
 };
 
 class DLLIMPORT TextCtrlLogger : public Logger
Index: plugins/compilergcc/compilergcc.cpp
===================================================================
--- plugins/compilergcc/compilergcc.cpp    (revision 4832)
+++ plugins/compilergcc/compilergcc.cpp    (working copy)
@@ -123,7 +123,11 @@
 
         style[caption].SetAlignment(wxTEXT_ALIGNMENT_DEFAULT);
         style[caption].SetFont(style[error].GetFont());
-        style[warning].SetTextColour(*wxBLUE);
+        ConfigManager* mcfg = Manager::Get()->GetConfigManager(_T("message_manager"));
+        control->SetForegroundColour(mcfg->ReadColour(_T("/log_colour_text_standard_front"), defLogColourTextStandardFront));
+        control->SetBackgroundColour(mcfg->ReadColour(_T("/log_colour_text_standard_back"), defLogColourTextStandardBack));
+        style[warning].SetTextColour(mcfg->ReadColour(_T("/log_colour_text_warning_front"), defLogColourTextWarningFront));
+        style[warning].SetBackgroundColour(mcfg->ReadColour(_T("/log_colour_text_warning_back"), defLogColourTextWarningBack));
         style[error].SetFont(style[info].GetFont());
     }
 
Index: sdk/configmanager.cpp
===================================================================
--- sdk/configmanager.cpp    (revision 4832)
+++ sdk/configmanager.cpp    (working copy)
@@ -51,6 +51,27 @@
 #include "tinyxml/tinywxuni.h"
 #include <stdlib.h>
 
+// Defaults;
+// Log window
+const wxColour defLogColourListStandardFront = *wxBLACK;
+const wxColour defLogColourTextStandardFront = *wxBLACK;
+const wxColour defLogColourTextStandardBack = *wxWHITE;
+const wxColour defLogColourListSuccessFront = *wxBLUE;
+const wxColour defLogColourTextSuccessFront = *wxBLUE;
+const wxColour defLogColourTextSuccessBack = *wxWHITE;
+const wxColour defLogColourListWarningFront = wxColour(0x00, 0x00, 0xa0);   // navy blue
+const wxColour defLogColourTextWarningFront = *wxBLUE;
+const wxColour defLogColourTextWarningBack = *wxWHITE;
+const wxColour defLogColourListErrorFront = *wxRED;
+const wxColour defLogColourTextErrorFront = *wxRED;
+const wxColour defLogColourTextErrorBack = *wxWHITE;
+const wxColour defLogColourListCriticalFront = wxColour(0x0a, 0x00, 0x00);  // maroon
+const wxColour defLogColourTextCriticalFront = *wxWHITE;
+const wxColour defLogColourTextCriticalBack = *wxRED;
+const wxColour defLogColourListFailureFront = wxColour(0x00, 0x00, 0xa0);   // navy blue
+const wxColour defLogColourTextFailureFront = *wxWHITE;
+const wxColour defLogColourTextFailureBack = *wxRED;
+
 template<> CfgMgrBldr* Mgr<CfgMgrBldr>::instance = 0;
 template<> bool  Mgr<CfgMgrBldr>::isShutdown = false;
 
Index: sdk/loggers.cpp
===================================================================
--- sdk/loggers.cpp    (revision 4832)
+++ sdk/loggers.cpp    (working copy)
@@ -29,12 +29,15 @@
 void TextCtrlLogger::UpdateSettings()
 {
     if (!control)
-        return;
+        return;
+
+    ConfigManager* mcfg = Manager::Get()->GetConfigManager(_T("message_manager"));
+
+    control->SetForegroundColour(mcfg->ReadColour(
download for full patch...
cacolijn 2008-01-18 18:40

Accompanying new png files for the new tab in the environment settings dialog can be found as an attached zip file in the forum post at http://forums.codeblocks.org/index.php/topic,7663.0.html

mortenmacfly 2011-11-22 19:30

Better solution provided.