ide/Debugger, CallStackView: Fixed long standing callstack woes
[sdk] / ide / src / panels / CallStackView.ec
index bf859b1..a65f843 100644 (file)
@@ -15,8 +15,7 @@ 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;
@@ -33,25 +32,21 @@ class CallStackView : Window
 
       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)
@@ -92,11 +87,11 @@ class CallStackView : Window
 
    bool MenuEditFind(MenuItem selection, Modifiers mods)
    {
-      int id = selection.id;
+      int64 id = selection.id;
       char * searchString = findDialog.searchString;
       if(id != 2 && searchString[0])
       {
-         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, id);
+         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, (bool)id);
          return true;
       }
       findDialog.Create();
@@ -107,9 +102,9 @@ class CallStackView : Window
    {
       char string[MAX_F_STRING*10];
       va_list args;
-      string[sizeof(string)-1] = 0;
       va_start(args, format);
       vsnprintf(string, sizeof(string), format, args);
+      string[sizeof(string)-1] = 0;
       va_end(args);
 
       Log(string);
@@ -158,6 +153,7 @@ class CallStackView : Window
    void Show()
    {
       visible = true;
+      ide.RepositionWindows(false);
       Activate();
    }
 }