ide/CodeEditor: Customizable color scheme support
[sdk] / ide / src / panels / CallStackView.ec
index fda432f..8f0e3c3 100644 (file)
@@ -15,43 +15,41 @@ class CallStackView : Window
    anchor = Anchor { left = 0, right = 0.2, top = 0 };
    size.h = 200;
 
-   virtual void OnGotoLine(char * line);
-   virtual void OnSelectFrame(int lineNumber);
+   virtual void OnSelectFrame(int frameIndex);
    virtual void OnToggleBreakpoint();
 
    bool moved, logging;
    FindDialog findDialog { master = this, editBox = editBox, isModal = true, autoCreate = false, text = $"Find" };
-   
+
    EditBox editBox
    {
       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)
       {
-         OnGotoLine(editBox.line.text);
+         int frameIndex = -1;
          if(strcmp(editBox.line.text, "..."))
-         {
-            int lineNumber = atoi(editBox.line.text);
-            OnSelectFrame(lineNumber);
-         }
-         return true;
+            frameIndex = atoi(editBox.line.text);
+         OnSelectFrame(frameIndex);
+         return false;
       }
 
       bool NotifyKeyDown(EditBox editBox, Key key, unichar ch)
       {
          if(key == enter || key == keyPadEnter)
          {
-            OnGotoLine(editBox.line.text);
+            int frameIndex = -1;
             if(strcmp(editBox.line.text, "..."))
-            {
-               int lineNumber = atoi(editBox.line.text);
-               OnSelectFrame(lineNumber);
-            }
+               frameIndex = atoi(editBox.line.text);
+            OnSelectFrame(frameIndex);
             return false;
          }
          if(key == f9)
@@ -75,7 +73,7 @@ class CallStackView : Window
 
    Menu editMenu { menu, $"Edit", e };
    MenuItem item;
-   
+
    MenuItem copyItem
    {
       editMenu, $"Copy", c, ctrlC;
@@ -93,17 +91,17 @@ class CallStackView : Window
    bool MenuEditFind(MenuItem selection, Modifiers mods)
    {
       int64 id = selection.id;
-      char * searchString = findDialog.searchString;
+      const char * searchString = findDialog.searchString;
       if(id != 2 && searchString[0])
       {
-         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, (bool)id);
+         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, id != 0);
          return true;
       }
       findDialog.Create();
       return true;
    }
 
-   void Logf(char * format, ...)
+   void Logf(const char * format, ...)
    {
       char string[MAX_F_STRING*10];
       va_list args;
@@ -114,17 +112,12 @@ class CallStackView : Window
 
       Log(string);
    }
-   void LogSprintf(char * entry)
-   {
-      char string[MAX_F_STRING];
-      sprintf(string, entry);
-      Log(string);
-   }
-   void LogRaw(char * entry)
+
+   void LogRaw(const char * entry)
    {
       Log(entry);
    }
-   void Log(char * string)
+   void Log(const char * string)
    {
       EditLine line1;
       EditLine line2;
@@ -158,6 +151,7 @@ class CallStackView : Window
    void Show()
    {
       visible = true;
+      ide.RepositionWindows(false);
       Activate();
    }
 }