X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ide%2Fsrc%2Fpanels%2FBreakpointsView.ec;h=6ac7bc526022808b563fd4d3bc88eab1f6f70181;hb=84e623c3cb902d941ac9967bcf91767bae8f128b;hp=d3a060260bee70366f3ca17d3a921dd7dd2058e9;hpb=e4bbca82e67fab0ad29080ec1574fed25825d212;p=sdk diff --git a/ide/src/panels/BreakpointsView.ec b/ide/src/panels/BreakpointsView.ec index d3a0602..6ac7bc5 100644 --- a/ide/src/panels/BreakpointsView.ec +++ b/ide/src/panels/BreakpointsView.ec @@ -14,15 +14,17 @@ class BreakpointsView : Window size.h = 240; bool moved, logging; - + ListBox listBox { 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) { @@ -41,11 +43,11 @@ class BreakpointsView : Window DataRow newRow = listBox.AddRow(); newRow.SetData(locationField, null); } - ide.workspace.ChangeBreakpoint(row, location); + ide.workspace.ChangeBreakpoint(row, location); // TODO make sure passing only unix style path } else { - ide.workspace.RemoveBreakpoint((Breakpoint)row.tag); + ide.workspace.RemoveBreakpoint((Breakpoint)(intptr)row.tag); // This is already done by Workspace::RemoveBreakpoint! // listBox.DeleteRow(null); } @@ -89,7 +91,7 @@ class BreakpointsView : Window } return true; } - + bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch) { if((SmartKey)key == enter) @@ -102,7 +104,7 @@ class BreakpointsView : Window if(row && (SmartKey)key == del) { listBox.StopEditing(true); - ide.workspace.RemoveBreakpoint((Breakpoint)row.tag); + ide.workspace.RemoveBreakpoint((Breakpoint)(intptr)row.tag); } return true; } @@ -113,7 +115,7 @@ class BreakpointsView : Window return true; } }; - + // TODO: set field size based on font and i18n header string // TODO: save column widths to ide settings DataField locationField { "char *", true , width = 220, header = $"Location" }; @@ -122,7 +124,7 @@ class BreakpointsView : Window DataField ignoreField { "char *", true , width = 80, header = $"Ignore Count" }; DataField levelField { "char *", true , width = 74, header = $"Stack Depth" }; DataField conditionField { "char *", true , width = 130, header = $"Condition" }; - + BreakpointsView() { listBox.AddField(locationField); @@ -155,9 +157,9 @@ class BreakpointsView : Window bool error; int lineActive, lineUser; int lineH; - int scrollY = listBox.scroll.y; - int boxH = clientSize.h; - + //int scrollY = listBox.scroll.y; + //int boxH = clientSize.h; + displaySystem.FontExtent(listBox.font.font, " ", 1, null, &lineH); //Window::OnRedraw(surface); ide.debugger.GetCallStackCursorLine(&error, &lineActive, &lineUser); @@ -194,9 +196,8 @@ class BreakpointsView : Window void AddBreakpoint(Breakpoint bp) { - char string[32]; DataRow row = listBox.AddRow(); - row.tag = (int64)bp; + row.tag = (int64)(intptr)bp; bp.row = row; UpdateBreakpoint(row); ide.callStackView.Update(null); @@ -209,15 +210,18 @@ class BreakpointsView : Window ide.callStackView.Update(null); Update(null); } - + void UpdateBreakpoint(DataRow row) { if(row && row.tag) { char string[32]; char * location; - Breakpoint bp = (Breakpoint)row.tag; - location = bp.LocationToString(); + Breakpoint bp = (Breakpoint)(intptr)row.tag; + location = bp.CopyUserLocationString(); +#if defined(__WIN32__) + ChangeCh(location, '/', '\\'); +#endif row.SetData(locationField, location); delete location; if(bp.ignore == 0) @@ -238,7 +242,7 @@ class BreakpointsView : Window row.SetData(breaksField, bp.breaks); } } - + void Clear() { listBox.Clear();