6 class CallStackView : Window
9 borderStyle = sizableDeep;
10 background = { 224, 224, 224 };
15 anchor = Anchor { left = 0, right = 0.2, top = 0 };
18 virtual void OnGotoLine(char * line);
19 virtual void OnSelectFrame(int lineNumber);
20 virtual void OnToggleBreakpoint();
23 FindDialog findDialog { master = this, editBox = editBox, isModal = true, autoCreate = false, text = $"Find" };
27 parent = this, freeCaret = true, autoEmpty = true, multiLine = true, readOnly = true;
28 hasVertScroll = true, hasHorzScroll = true, borderStyle = none;
29 anchor = Anchor { left = 20, top = 0, right = 0, bottom = 0 };
30 background = viewsBackground;
31 foreground = viewsText;
32 selectionColor = selectionColor, selectionText = selectionText;
34 bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
36 OnGotoLine(editBox.line.text);
37 if(strcmp(editBox.line.text, "..."))
39 int lineNumber = atoi(editBox.line.text);
40 OnSelectFrame(lineNumber);
45 bool NotifyKeyDown(EditBox editBox, Key key, unichar ch)
47 if(key == enter || key == keyPadEnter)
49 OnGotoLine(editBox.line.text);
50 if(strcmp(editBox.line.text, "..."))
52 int lineNumber = atoi(editBox.line.text);
53 OnSelectFrame(lineNumber);
65 void OnVScroll(ScrollBarAction action, int position, Key key)
67 if(anchor.left.distance)
69 Box box { 0, 0, anchor.left.distance-1, parent.clientSize.h - 1 };
72 EditBox::OnVScroll(action, position, key);
76 Menu editMenu { menu, $"Edit", e };
81 editMenu, $"Copy", c, ctrlC;
82 bool NotifySelect(MenuItem selection, Modifiers mods)
88 MenuDivider { editMenu };
89 MenuItem { editMenu, $"Find Previous", e, Key { f3, shift = true }, NotifySelect = MenuEditFind, id = 0 };
90 MenuItem { editMenu, $"Find Next", n, f3, NotifySelect = MenuEditFind, id = 1 };
91 MenuItem { editMenu, $"Find", f, ctrlF, NotifySelect = MenuEditFind, id = 2 };
93 bool MenuEditFind(MenuItem selection, Modifiers mods)
95 int64 id = selection.id;
96 char * searchString = findDialog.searchString;
97 if(id != 2 && searchString[0])
99 editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, (bool)id);
106 void Logf(char * format, ...)
108 char string[MAX_F_STRING*10];
110 va_start(args, format);
111 vsnprintf(string, sizeof(string), format, args);
112 string[sizeof(string)-1] = 0;
117 void LogSprintf(char * entry)
119 char string[MAX_F_STRING];
120 sprintf(string, entry);
123 void LogRaw(char * entry)
127 void Log(char * string)
136 editBox.GetSelPos(&line1, &y1, &x1, &line2, &y2, &x2, false);
137 scroll = editBox.scroll;
140 editBox.PutS(string);
141 editBox.Update(null);
144 editBox.scroll = scroll;
145 editBox.SetSelPos(line1, y1, x1, line2, y2, x2);