ide/CodeEditor: Customizable color scheme support
authorJerome St-Louis <jerome@ecere.com>
Thu, 4 Aug 2016 12:56:10 +0000 (08:56 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 4 Aug 2016 12:56:10 +0000 (08:56 -0400)
- Includes 4 built-in color schemes
- Also added Truncate file on opening config files in readWrite mode

12 files changed:
ide/src/IDESettings.ec
ide/src/designer/CodeEditor.ec
ide/src/designer/Sheet.ec
ide/src/dialogs/FontPicker.ec
ide/src/dialogs/GlobalSettingsDialog.ec
ide/src/ide.ec
ide/src/panels/BreakpointsView.ec
ide/src/panels/CallStackView.ec
ide/src/panels/OutputView.ec
ide/src/panels/ThreadsView.ec
ide/src/panels/WatchesView.ec
ide/src/project/ProjectView.ec

index c6aa844..431fcf8 100644 (file)
@@ -4,6 +4,171 @@ public import static "ecere"
 public import "ecere"
 #endif
 
+// *** Color Schemes ***
+class IDEColorScheme
+{
+   String name;
+   SyntaxColorScheme syntaxColors;
+public:
+
+   property const String name
+   {
+      set { delete name; name = CopyString(value); }
+      get { return name; }
+   }
+
+   Color selectionColor;
+   Color selectionText;
+   Color viewsBackground;
+   Color viewsText;
+   Color outputBackground;
+   Color outputText;
+   Color projectViewBackground;
+   Color projectViewText;
+   Color codeEditorBG;
+   Color codeEditorFG;
+   Color marginColor;
+   Color selectedMarginColor;
+   Color lineNumbersColor;
+   Color sheetSelectionColor;
+   Color sheetSelectionText;
+
+   property SyntaxColorScheme syntaxColors
+   {
+      set { delete syntaxColors; syntaxColors = value; if(value) incref value; }
+      get { return syntaxColors; }
+   }
+
+   ~IDEColorScheme()
+   {
+      delete syntaxColors;
+      delete name;
+   }
+}
+
+IDEColorScheme colorScheme;
+
+// Default Color Schemes
+IDEColorScheme darkColorScheme
+{
+   name = "Classic Dark";
+   selectionColor = lightYellow;
+   selectionText = Color { 30, 40, 50 };
+   viewsBackground = Color { 30, 40, 50 };
+   viewsText = lightGray;
+   outputBackground = black;
+   outputText = lime;
+   sheetSelectionColor = Color { 170, 220, 255 };
+   sheetSelectionText = black;
+   projectViewBackground = Color { 30, 40, 50 };
+   projectViewText = lightGray;
+   codeEditorBG = black;
+   codeEditorFG = ivory;
+   marginColor = Color {24, 24, 24};
+   selectedMarginColor = Color {64, 64, 64};
+   lineNumbersColor = Color {160, 160, 160};
+   syntaxColors =
+   {
+      keywordColors = [ skyBlue, skyBlue ];
+      commentColor = Color { 125, 125, 125 };
+      charLiteralColor = Color { 245, 50, 245 };
+      stringLiteralColor = Color { 245, 50, 245 };
+      preprocessorColor = { 120, 220, 140 };
+      numberColor = Color {   0, 192, 192 };
+   };
+};
+
+IDEColorScheme lightColorScheme
+{
+   name = "Classic Light";
+   selectionColor = Color { 10, 36, 106 };
+   selectionText = white;
+   viewsBackground = white;
+   viewsText = black;
+   outputBackground = white;
+   outputText = black;
+   sheetSelectionColor = Color { 170, 220, 255 };
+   sheetSelectionText = black;
+   projectViewBackground = white;
+   projectViewText = black;
+   codeEditorBG = white;
+   codeEditorFG = black;
+   marginColor = Color {230, 230, 230};
+   selectedMarginColor = Color {200, 200, 200};
+   lineNumbersColor = Color {60, 60, 60};
+   syntaxColors =
+   {
+      keywordColors = [ blue, blue ];
+      commentColor = dimGray;
+      charLiteralColor = crimson;
+      stringLiteralColor = crimson;
+      preprocessorColor = green;
+      numberColor = teal;
+   };
+};
+
+IDEColorScheme greenColorScheme
+{
+   name = "Green",
+   selectionColor = 0x00FFFFE0,
+   selectionText = 0x001E2832,
+   viewsBackground = 0x001E2832,
+   viewsText = 0x00D3D3D3,
+   outputBackground = 0x00000000,
+   outputText = 0x0000FF00,
+   projectViewBackground = 0x001E2832,
+   projectViewText = 0x00D3D3D3,
+   codeEditorBG = 0x00000000,
+   codeEditorFG = 0x00FFFFF0,
+   marginColor = 0x001100,
+   selectedMarginColor = 0x002200,
+   lineNumbersColor = 0x00FF00,
+   sheetSelectionColor = 0x00AADCFF,
+   sheetSelectionText = 0x00000000,
+   syntaxColors = {
+      commentColor = 0x008c00,
+      charLiteralColor = 0x89de00,
+      stringLiteralColor = 0x89de00,
+      preprocessorColor = 0x0078DC8C,
+      numberColor = { 8, 237, 141 },
+      keywordColors = [
+         0x00e09d,
+         0x00e09d
+      ]
+   }
+};
+
+IDEColorScheme grayColorScheme
+{
+   name = "Gray & Orange",
+   selectionColor = 0x00FFFFE0,
+   selectionText = 0x001E2832,
+   viewsBackground = 0x001E2832,
+   viewsText = 0x00D3D3D3,
+   outputBackground = 0x00000000,
+   outputText = 0x0000FF00,
+   projectViewBackground = 0x001E2832,
+   projectViewText = 0x00D3D3D3,
+   codeEditorBG = 0x00202020,
+   codeEditorFG = 0x00E2E2E5,
+   marginColor = 0x00303030,
+   selectedMarginColor = 0x00404040,
+   lineNumbersColor = 0x00939395,
+   sheetSelectionColor = 0x00AADCFF,
+   sheetSelectionText = 0x00000000,
+   syntaxColors = {
+      commentColor = 0x005F5F5F,
+      charLiteralColor = 0x0089DE00,
+      stringLiteralColor = 0x00707070,
+      preprocessorColor = 0x00FAF4C6,
+      numberColor = 0x00FF9800,
+      keywordColors = [
+         0x00FF9800,
+         0x00FF9800
+      ]
+   }
+};
+
 define ecpDefaultCommand = "ecp";
 define eccDefaultCommand = "ecc";
 define ecsDefaultCommand = "ecs";
@@ -295,6 +460,7 @@ class IDESettingsContainer : GlobalSettings
    virtual void onLoadCompilerConfigs();
    virtual void onLoadRecentFiles();
    virtual void onLoadRecentProjects();
+   virtual void onLoad();
 
    CompilerConfigs compilerConfigs;
    RecentFiles recentFiles;
@@ -449,9 +615,10 @@ private:
 
       if(OpenAndLock(&newSettingsFileSize))
       {
-         if((double)settingsFileSize - (double)newSettingsFileSize < 2048)
+         //if((double)settingsFileSize - (double)newSettingsFileSize < 2048)
             Load();
-         else
+            onLoad();
+         /*else
          {
             GuiApplication app = ((GuiApplication)__thisModule.application);
             Window w;
@@ -466,7 +633,7 @@ private:
                   "The new settings will not be loaded to prevent loss of your ide settings.\n"
                   "Please check your settings file and make sure to save this IDE's global settings if your settings file has been compromised."
                   }.Create();
-         }
+         }*/
       }
    }
 
@@ -538,6 +705,30 @@ private:
          data.ManagePortablePaths(moduleLocation, true);
       data.ForcePathSeparatorStyle(true);
 
+      if(!data.colorSchemes || !data.colorSchemes.count)
+      {
+         if(!data.colorSchemes) data.colorSchemes = { };
+
+         data.colorSchemes.Add(darkColorScheme);   incref darkColorScheme;
+         data.colorSchemes.Add(lightColorScheme);  incref lightColorScheme;
+         data.colorSchemes.Add(greenColorScheme);  incref greenColorScheme;
+         data.colorSchemes.Add(grayColorScheme);   incref grayColorScheme;
+      }
+      if(data.activeColorScheme)
+      {
+         colorScheme = null;
+         for(cs : data.colorSchemes; cs.name && !strcmp(cs.name, data.activeColorScheme))
+         {
+            colorScheme = cs;
+            break;
+         }
+      }
+      if(!colorScheme)
+      {
+         colorScheme = data.colorSchemes[0];
+         data.activeColorScheme = colorScheme.name;
+      }
+
       // Import from previous ecereIDE settings
       if(oldConfig)
       {
@@ -712,7 +903,11 @@ class SafeFile
          {
             for(c = 0; c < 10 && !(locked = sf.file.Lock(lockType, 0, 0, false)); c++) Sleep(0.01);
             if(locked)
+            {
+               sf.file.Truncate(0);
+               sf.file.Seek(0, start);
                result = sf;
+            }
             else if(mode == write)
                PrintLn($"warning: SafeFile::open: unable to obtain exclusive lock on temporary file for writing: ", sf.tmp);
             else
@@ -896,6 +1091,29 @@ public:
    float codeEditorFontSize;
    bool showFixedPitchFontsOnly;
 
+   property Array<IDEColorScheme> colorSchemes
+   {
+      set
+      {
+         if(colorSchemes && colorSchemes._refCount < 2)
+            colorSchemes.Free();
+         delete colorSchemes;
+         colorSchemes = value;
+         incref colorSchemes;
+      }
+      get { return colorSchemes; }
+   }
+
+   property const String activeColorScheme
+   {
+      set
+      {
+         delete activeColorScheme;
+         activeColorScheme = CopyString(value);
+      }
+      get { return activeColorScheme; }
+   }
+
 private:
    CompilerConfigs compilerConfigs { };
    char * docDir;
@@ -909,8 +1127,12 @@ private:
    RecentFiles recentFiles { };
    RecentWorkspaces recentProjects { };
 
+   Array<IDEColorScheme> colorSchemes;
+
    String codeEditorFont;
 
+   String activeColorScheme;
+
    showFixedPitchFontsOnly = true;
    codeEditorFontSize = 12;
    codeEditorFont = CopyString("Courier New");
@@ -934,6 +1156,9 @@ private:
       delete displayDriver;
 
       delete codeEditorFont;
+
+      colorSchemes.Free();
+      delete activeColorScheme;
    }
 
    void ForcePathSeparatorStyle(bool unixStyle)
index 8656bd2..e7970ba 100644 (file)
@@ -1,68 +1,5 @@
 import "ide"
 
-// *** Color Schemes ***
-
-// *** The Old Color Scheme that was causing me auras and ophtalmic migraines -- Uncomment at your own risk! ***
-/*
-FontResource panelFont { $"Courier New", 10 };
-FontResource codeFont { $"Courier New", 10 };
-Color selectionColor = Color { 10, 36, 106 };
-Color selectionText = white;
-Color viewsBackground = white;
-Color viewsText = black;
-Color outputBackground = white;
-Color outputText = black;
-Color projectViewBackground = white;
-Color projectViewText = black;
-Color codeEditorBG = white;
-Color codeEditorFG = black;
-Color marginColor = Color {230, 230, 230};
-Color selectedMarginColor = Color {200, 200, 200};
-Color lineNumbersColor = Color {60, 60, 60};
-SyntaxColorScheme colorScheme
-{
-   keywordColors = [ blue, blue ];
-   commentColor = dimGray;
-   charLiteralColor = crimson;
-   stringLiteralColor = crimson;
-   preprocessorColor = green;
-   numberColor = teal;
-};
-*/
-
-// The new nice dark scheme -- so peaceful on my brain
-
-FontResource panelFont { $"Courier New", 10 };
-FontResource codeFont { $"Courier New", 10 };
-/*
-FontResource panelFont { $"Consolas", 12 };
-FontResource codeFont { $"Consolas", 12 };
-*/
-Color selectionColor = lightYellow;
-Color selectionText = Color { 30, 40, 50 };
-Color viewsBackground = Color { 30, 40, 50 };
-Color viewsText = lightGray;
-Color outputBackground = black;
-Color outputText = lime;
-Color projectViewBackground = Color { 30, 40, 50 };
-Color projectViewText = lightGray;
-Color codeEditorBG = black;
-Color codeEditorFG = ivory;
-Color marginColor = Color {24, 24, 24};
-Color selectedMarginColor = Color {64, 64, 64};
-Color lineNumbersColor = Color {160, 160, 160};
-SyntaxColorScheme colorScheme
-{
-   keywordColors = [ skyBlue, skyBlue ];
-   commentColor = Color { 125, 125, 125 };
-   charLiteralColor = Color { 245, 50, 245 };
-   stringLiteralColor = Color { 245, 50, 245 };
-   preprocessorColor = { 120, 220, 140 };
-   numberColor = Color {   0, 192, 192 };
-};
-
-// *********************
-
 import "findCtx"
 import "findExp"
 import "findParams"
@@ -695,7 +632,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
 
 class CodeEditor : Window
 {
-   background = marginColor;
+   background = colorScheme.marginColor;
    borderStyle = sizableDeep;
    hasMaximize = true;
    hasMinimize = true;
@@ -892,8 +829,8 @@ class CodeEditor : Window
       freeCaret = ideSettings.useFreeCaret, caretFollowsScrolling = ideSettings.caretFollowsScrolling,
       tabKey = true, smartHome = true;
       tabSelection = true, /*maxLineSize = 65536, */parent = this, hasHorzScroll = true, hasVertScroll = true;
-      selectionColor = selectionColor, selectionText = selectionText,
-      background = codeEditorBG, foreground = codeEditorFG, syntaxColorScheme = colorScheme,
+      selectionColor = colorScheme.selectionColor, selectionText = colorScheme.selectionText,
+      background = colorScheme.codeEditorBG, foreground = colorScheme.codeEditorFG, syntaxColorScheme = colorScheme.syntaxColors,
       font = font, borderStyle = none;
       anchor = Anchor { left = 0, right = 0, top = 0, bottom = 0 };
 
@@ -2377,7 +2314,7 @@ class CodeEditor : Window
    void OnRedraw(Surface surface)
    {
       // Line Numbers
-      surface.SetBackground(marginColor);
+      surface.SetBackground(colorScheme.marginColor);
       surface.Area(0, 0, editBox.anchor.left.distance, clientSize.h - 1);
       if(ideSettings.showLineNumbers)
       {
@@ -2393,15 +2330,15 @@ class CodeEditor : Window
          currentLineNumber = editBox.scroll.y / spaceH + 1;
          sprintf(lineFormat, " %%%du", maxLineNumberLength);
 
-         surface.SetForeground(lineNumbersColor);
+         surface.SetForeground(colorScheme.lineNumbersColor);
          for(i = 0; i < editBox.clientSize.h - 4; i += spaceH)
          {
             // Highlight current line
             if(editBox.lineNumber == currentLineNumber - 1)
             {
-               surface.SetBackground(selectedMarginColor);
+               surface.SetBackground(colorScheme.selectedMarginColor);
                surface.Area(0, i, editBox.anchor.left.distance, i+spaceH-1);
-               surface.SetBackground(marginColor);
+               surface.SetBackground(colorScheme.marginColor);
             }
             sprintf(lineText, lineFormat, currentLineNumber);
             if(currentLineNumber <= editBox.numLines)
index 68ac48a..a677e66 100644 (file)
@@ -271,9 +271,6 @@ void SetProperty(Property prop, Instance object, DataValue value)
    }
 }
 
-static define sheetSelectionColor = Color { 170, 220, 255 };
-static define sheetSelectionText = black;
-
 class Sheet : Window
 {
    text = $"Sheet";
@@ -456,10 +453,12 @@ class Sheet : Window
    {
       this, anchor = { left = 0, right = 0, top = 50, bottom = 25 };
       hasVertScroll = true, alwaysEdit = true, collapseControl = true, resizable = true;
-      background = viewsBackground;
-      foreground = viewsText;
-      selectionText = sheetSelectionText;
-      selectionColor = sheetSelectionColor;
+      /*
+      background = colorScheme.viewsBackground;
+      foreground = colorScheme.viewsText;
+      selectionText = colorScheme.sheetSelectionText;
+      selectionColor = colorScheme.sheetSelectionColor;
+      */
 
       bool NotifySelect(ListBox control, DataRow row, Modifiers keyFlags)
       {
@@ -491,8 +490,10 @@ class Sheet : Window
    {
       this, anchor = { left = 0, right = 0, top = 50, bottom = 25 };
       hasVertScroll = true;
-      background = viewsBackground;
-      foreground = viewsText;
+      /*
+      background = colorScheme.viewsBackground;
+      foreground = colorScheme.viewsText;
+      */
       // alwaysEdit = true;
       // resizable = true;
 
@@ -1649,14 +1650,14 @@ public:
             if(eClass_IsDerived(editData._class, class(DropBox)))
             {
                DropBox db = (DropBox)editData;
-               db.selectionColor = sheetSelectionColor;
-               db.selectionText = viewsBackground;
+               db.selectionColor = colorScheme.sheetSelectionColor;
+               db.selectionText = colorScheme.viewsBackground;
             }
             else if(eClass_IsDerived(editData._class, class(EditBox)))
             {
                EditBox eb = (EditBox)editData;
-               eb.selectionColor = sheetSelectionColor;
-               eb.selectionText = viewsBackground;
+               eb.selectionColor = colorScheme.sheetSelectionColor;
+               eb.selectionText = colorScheme.viewsBackground;
             }
          }
       }
index edbcf37..b3d160b 100644 (file)
@@ -1,15 +1,5 @@
 import "ide"
 
-SyntaxColorScheme colorScheme
-{
-   keywordColors = [ skyBlue, skyBlue ];
-   commentColor = Color { 125, 125, 125 };
-   charLiteralColor = Color { 245, 50, 245 };
-   stringLiteralColor = Color { 245, 50, 245 };
-   preprocessorColor = { 120, 220, 140 };
-   numberColor = Color {   0, 192, 192 };
-};
-
 Array<float> sizes { [ 6, 7, 8.25f, 9, 10, 10.5f, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 30, 32, 36, 40, 44, 48, 54, 60, 66, 72, 80, 88, 96 ] };
 
 Array<const String> fonts
@@ -88,6 +78,8 @@ class FontPicker : Window
       get { return curFont.faceName; }
    }
 
+   IDEColorScheme colorScheme;
+
    FontResource curFont { "Consolas", 12};
    DataField dfSize { class(float) };
    DropBox dbSize
@@ -137,12 +129,6 @@ class FontPicker : Window
       freeCaret = true;
 
       syntaxHighlighting = true;
-      syntaxColorScheme = colorScheme;
-
-      foreground = ivory;
-      selectionText = Color { 30, 40, 50 };
-      background = black;
-      selectionColor = lightYellow;
       multiLine = true;
       contents = sampleText;
    };
@@ -210,6 +196,16 @@ class FontPicker : Window
       fontResources.RemoveAll();
    }
 
+   void SelectColorScheme(IDEColorScheme colorScheme)
+   {
+      this.colorScheme = colorScheme;
+      sample.syntaxColorScheme = colorScheme.syntaxColors;
+      sample.selectionColor = colorScheme.selectionColor;
+      sample.selectionText = colorScheme.selectionText,
+      sample.background = colorScheme.codeEditorBG;
+      sample.foreground = colorScheme.codeEditorFG;
+   }
+
    bool OnCreate()
    {
       Map<String, FontInfo> fonts = ListAvailableFonts();
@@ -217,6 +213,14 @@ class FontPicker : Window
       float fontSize;
       bool fixedPitchOnly = ideSettings.showFixedPitchFontsOnly;
 
+      colorScheme = ::colorScheme;
+
+      sample.syntaxColorScheme = colorScheme.syntaxColors;
+      sample.selectionColor = colorScheme.selectionColor;
+      sample.selectionText = colorScheme.selectionText,
+      sample.background = colorScheme.codeEditorBG;
+      sample.foreground = colorScheme.codeEditorFG;
+
       curFont.faceName = ideSettings.codeEditorFont;
       curFont.size = fontSize = ideSettings.codeEditorFontSize;
 
index 8efa976..9302ad9 100644 (file)
@@ -76,14 +76,26 @@ class GlobalSettingsDialog : Window
                      editorTab.showLineNumbers.checked != ideSettings.showLineNumbers ||
                      editorTab.caretFollowsScrolling.checked != ideSettings.caretFollowsScrolling ||
                      editorTab.fontPicker.fontSize != ideSettings.codeEditorFontSize ||
-                     editorTab.fontPicker.faceName.OnCompare(ideSettings.codeEditorFont)
+                     editorTab.fontPicker.faceName.OnCompare(ideSettings.codeEditorFont) ||
+                     editorTab.dbColorSchemes.currentRow.string.OnCompare(ideSettings.activeColorScheme)
                      )
                {
+                  DataRow csRow = editorTab.dbColorSchemes.currentRow;
                   ideSettings.useFreeCaret = editorTab.useFreeCaret.checked;
                   ideSettings.showLineNumbers = editorTab.showLineNumbers.checked;
                   ideSettings.caretFollowsScrolling = editorTab.caretFollowsScrolling.checked;
                   ideSettings.codeEditorFont = editorTab.fontPicker.faceName;
                   ideSettings.codeEditorFontSize = editorTab.fontPicker.fontSize;
+                  if(csRow && csRow.string)
+                  {
+                     ideSettings.activeColorScheme = csRow.string;
+                     for(cs : ideSettings.colorSchemes; cs.name && !strcmp(cs.name, csRow.string))
+                     {
+                        colorScheme = cs;
+                        ide.ApplyColorScheme(colorScheme);
+                        break;
+                     }
+                  }
 
                   ide.ApplyFont(ideSettings.codeEditorFont, ideSettings.codeEditorFontSize);
 
@@ -241,6 +253,41 @@ class EditorTab : GlobalSettingsSubTab
    background = formColor;
    text = $"Editor";
 
+   bool OnCreate()
+   {
+      dbColorSchemes.Clear();
+
+      for(s : ideSettings.colorSchemes)
+      {
+         DataRow row = dbColorSchemes.AddString(s.name);
+         if(!strcmp(s.name, ideSettings.activeColorScheme))
+            dbColorSchemes.currentRow = row;
+      }
+      return true;
+   }
+
+   Label lblColorSchemes { this, anchor = { top = 92, right = 126 }, labeledWindow = dbColorSchemes };
+   DropBox dbColorSchemes
+   {
+      this, text = $"Color Scheme: ", anchor = { top = 92, right = 16 }, size = { 100, 22 };
+
+      bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
+      {
+         if(row)
+         {
+            IDEColorScheme colorScheme = null;
+            for(cs : ideSettings.colorSchemes; cs.name && !strcmp(cs.name, row.string))
+            {
+               colorScheme = cs;
+               break;
+            }
+            fontPicker.SelectColorScheme(colorScheme);
+            modifiedDocument = true;
+         }
+         return true;
+      }
+   };
+
    Button useFreeCaret
    {
       this, text = $"Move code editor caret freely past end of line", position = { 16, 58 }, isCheckbox = true;
index d19f88f..815c3b0 100644 (file)
@@ -61,6 +61,9 @@ define pathListSep = ":";
 
 IDEConfigHolder ideConfig { };
 
+FontResource panelFont { $"Courier New", 10 };
+FontResource codeFont { $"Courier New", 10 };
+
 IDESettings ideSettings;
 
 IDESettingsContainer settingsContainer
@@ -71,6 +74,7 @@ IDESettingsContainer settingsContainer
    void onLoadCompilerConfigs()     { ide.UpdateCompilerConfigs(true); }
    void onLoadRecentFiles()         { ide.updateRecentFilesMenu(); }
    void onLoadRecentProjects()      { ide.updateRecentProjectsMenu(); }
+   void onLoad()                    { ide.ApplyColorScheme(colorScheme); ide.ApplyFont(ideSettings.codeEditorFont, ideSettings.codeEditorFontSize); }
 };
 
 define maxPathLen = 65 * MAX_LOCATION;
@@ -480,6 +484,75 @@ class IDEWorkSpace : Window
 #endif
    }
 
+   void ApplyColorScheme(IDEColorScheme cs)
+   {
+      CodeEditor ce;
+
+      colorScheme = cs;
+
+      for(ce = (CodeEditor)firstChild; ce; ce = (CodeEditor)ce.next)
+         if(ce._class == class(CodeEditor))
+         {
+            EditBox eb = ce.editBox;
+            ce.background = cs.marginColor;
+            eb.selectionColor = cs.selectionColor;
+            eb.selectionText = cs.selectionText;
+            eb.background = cs.codeEditorBG;
+            eb.foreground = cs.codeEditorFG;
+            eb.syntaxColorScheme = cs.syntaxColors;
+         }
+
+      if(projectView)
+      {
+         projectView.fileList.background = cs.projectViewBackground;
+         projectView.fileList.foreground = cs.projectViewText;
+         projectView.fileList.selectionColor = cs.selectionColor;
+         projectView.fileList.selectionText = cs.selectionText;
+      }
+
+      sheet.properties.background = cs.viewsBackground;
+      sheet.properties.foreground = cs.viewsText;
+      sheet.properties.selectionText = cs.sheetSelectionText;
+      sheet.properties.selectionColor = cs.sheetSelectionColor;
+      sheet.methods.background = cs.viewsBackground;
+      sheet.methods.foreground = cs.viewsText;
+
+      threadsView.editBox.background = cs.viewsBackground;
+      threadsView.editBox.foreground = cs.viewsText;
+      threadsView.editBox.selectionColor = cs.selectionColor;
+      threadsView.editBox.selectionText = cs.selectionText;
+
+      callStackView.editBox.background = cs.viewsBackground;
+      callStackView.editBox.foreground = cs.viewsText;
+      callStackView.editBox.selectionColor = cs.selectionColor;
+      callStackView.editBox.selectionText = cs.selectionText;
+
+      watchesView.listBox.background = cs.viewsBackground;
+      watchesView.listBox.foreground = cs.viewsText;
+      watchesView.listBox.selectionColor = cs.selectionColor;
+      watchesView.listBox.selectionText = cs.selectionText;
+
+      breakpointsView.listBox.background = cs.viewsBackground;
+      breakpointsView.listBox.foreground = cs.viewsText;
+      breakpointsView.listBox.selectionColor = cs.selectionColor;
+      breakpointsView.listBox.selectionText = cs.selectionText;
+
+      outputView.buildBox.background = cs.outputBackground;
+      outputView.buildBox.foreground = cs.outputText;
+      outputView.buildBox.selectionColor = cs.selectionColor;
+      outputView.buildBox.selectionText = cs.selectionText;
+
+      outputView.debugBox.background = cs.outputBackground;
+      outputView.debugBox.foreground = cs.outputText;
+      outputView.debugBox.selectionColor = cs.selectionColor;
+      outputView.debugBox.selectionText = cs.selectionText;
+
+      outputView.findBox.background = cs.outputBackground;
+      outputView.findBox.foreground = cs.outputText;
+      outputView.findBox.selectionColor = cs.selectionColor;
+      outputView.findBox.selectionText = cs.selectionText;
+   }
+
    ProjectView projectView;
 
    OutputView outputView
@@ -3726,6 +3799,7 @@ class IDEApp : GuiApplication
       }
 
       ide.ApplyFont(ideSettings.codeEditorFont, ideSettings.codeEditorFontSize);
+      ide.ApplyColorScheme(colorScheme);
 
       ideConfig.compilers.read(settingsContainer);
       ideConfig.recentFiles.read(settingsContainer);
index 26af474..6ac7bc5 100644 (file)
@@ -19,10 +19,12 @@ class BreakpointsView : Window
    {
       parent = this, resizable = true, hasHeader = true, alwaysEdit = true, collapseControl = true, size = { 206, 624 };
       anchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 }; //visible = true
-
-      background = viewsBackground;
-      foreground = viewsText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      /*
+      background = colorScheme.viewsBackground;
+      foreground = colorScheme.viewsText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyChanged(ListBox listBox, DataRow row)
       {
index 407dd72..8f0e3c3 100644 (file)
@@ -26,9 +26,12 @@ class CallStackView : Window
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true, readOnly = true;
       hasVertScroll = true, hasHorzScroll = true, borderStyle = none;
       anchor = Anchor { left = 20, top = 0, right = 0, bottom = 0 };
-      background = viewsBackground;
-      foreground = viewsText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      /*
+      background = colorScheme.viewsBackground;
+      foreground = colorScheme.viewsText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
       {
index 01da983..db7e1a3 100644 (file)
@@ -121,10 +121,13 @@ class OutputView : Window
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true;
       readOnly = true, hasVertScroll = true, hasHorzScroll = true;
       anchor = Anchor { left = 0, right = 0, top = 23, bottom = 0 };
+      /*
       font = { panelFont.faceName, panelFont.size, panelFont.bold, panelFont.italic };
-      background = outputBackground;
-      foreground = outputText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      background = colorScheme.outputBackground;
+      foreground = colorScheme.outputText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
       {
@@ -148,10 +151,13 @@ class OutputView : Window
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true;
       readOnly = true, hasVertScroll = true, hasHorzScroll = true, visible = false;
       anchor = Anchor { left = 0, right = 0, top = 23, bottom = 0 };
+      /*
       font = { panelFont.faceName, panelFont.size, panelFont.bold, panelFont.italic };
-      background = outputBackground;
-      foreground = outputText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      background = colorScheme.outputBackground;
+      foreground = colorScheme.outputText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
       {
@@ -175,10 +181,13 @@ class OutputView : Window
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true;
       readOnly = true, hasVertScroll = true, hasHorzScroll = true, visible = false;
       anchor = Anchor { left = 0, right = 0, top = 23, bottom = 0 };
+      /*
       font = { panelFont.faceName, panelFont.size, panelFont.bold, panelFont.italic };
-      background = outputBackground;
-      foreground = outputText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      background = colorScheme.outputBackground;
+      foreground = colorScheme.outputText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
       {
@@ -204,9 +213,10 @@ class OutputView : Window
       readOnly = true, hasVertScroll = true, hasHorzScroll = true, visible = false;
       anchor = Anchor { left = 0, right = 0, top = 23, bottom = 0 };
       font = { panelFont.faceName, panelFont.size, panelFont.bold, panelFont.italic };
-      background = outputBackground;
-      foreground = outputText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      background = colorScheme.outputBackground;
+      foreground = colorScheme.outputText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
    };
 #endif
 
index 92a058a..24a95ac 100644 (file)
@@ -50,9 +50,12 @@ class ThreadsView : Window
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true, readOnly = true;
       hasVertScroll = true, hasHorzScroll = true, borderStyle = none;
       anchor = { left = 20, right = 0, top = 0, bottom = 0 };
-      background = viewsBackground;
-      foreground = viewsText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      /*
+      background = colorScheme.viewsBackground;
+      foreground = colorScheme.viewsText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
       {
index f03fa6d..f421c2a 100644 (file)
@@ -16,9 +16,12 @@ class WatchesView : Window
    {
       parent = this, hasHeader = true, hasVertScroll = true, alwaysEdit = true, collapseControl = true, resizable = true;
       anchor = Anchor { left = 0, right = 0, top = 0, bottom = 0 };
-      background = viewsBackground;
-      foreground = viewsText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      /*
+      background = colorScheme.viewsBackground;
+      foreground = colorScheme.viewsText;
+      selectionColor = colorScheme.selectionColor;
+      selectionText = colorScheme.selectionText;
+      */
 
       bool NotifyChanged(ListBox listBox, DataRow row)
       {
index c66acd3..e217a07 100644 (file)
@@ -242,9 +242,9 @@ class ProjectView : Window
       borderStyle = deep, parent = this, collapseControl = true, treeBranches = true;
       anchor = Anchor { left = 0, right = 0, top = 0 , bottom = 0 };
 
-      background = projectViewBackground;
-      foreground = projectViewText;
-      selectionColor = selectionColor, selectionText = selectionText;
+      background = colorScheme.projectViewBackground;
+      foreground = colorScheme.projectViewText;
+      selectionColor = colorScheme.selectionColor, selectionText = colorScheme.selectionText;
       stippleColor = skyBlue;
 
       bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)