borderStyle = sizable;
background = { 224, 224, 224 };
hasClose = true;
- text = "Breakpoints";
+ text = $"Breakpoints";
clientSize = Size { 206, 624 };
//anchor = Anchor { left = 0.8, top = 200, right = 0, bottom = 200 };
//size = { 150 };
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 = colorScheme.viewsBackground;
+ foreground = colorScheme.viewsText;
+ selectionColor = colorScheme.selectionColor;
+ selectionText = colorScheme.selectionText;
+ */
bool NotifyChanged(ListBox listBox, DataRow row)
{
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);
- listBox.DeleteRow(null);
+ ide.workspace.RemoveBreakpoint((Breakpoint)(intptr)row.tag);
+ // This is already done by Workspace::RemoveBreakpoint!
+ // listBox.DeleteRow(null);
}
}
else if(listBox.currentField == ignoreField || listBox.currentField == levelField)
{
TrimLSpaces(string, string);
TrimRSpaces(string, string);
- //value = atoi(string);
+ value = atoi(string);
}
+ else if(listBox.currentField == levelField)
+ value = -1;
//str[0] = '\0';
//sprintf(str, "%d", value);
//listBox.StopEditing(true);
//row.SetData(listBox.currentField, str);
+ if((listBox.currentField == ignoreField && value < 1) ||
+ (listBox.currentField == levelField && value < 0))
+ row.SetData(listBox.currentField, null);
+ if(listBox.currentField == levelField && value == 0)
+ row.SetData(listBox.currentField, "0");
if(listBox.currentField == ignoreField)
ide.workspace.ChangeBreakpointIgnore(row, value);
else if(listBox.currentField == levelField)
}
return true;
}
-
+
bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
{
if((SmartKey)key == enter)
if(row && (SmartKey)key == del)
{
listBox.StopEditing(true);
- ide.workspace.RemoveBreakpoint((Breakpoint)row.tag);
+ ide.workspace.RemoveBreakpoint((Breakpoint)(intptr)row.tag);
}
return true;
}
return true;
}
};
-
- DataField locationField { "char *", true, width = 180, header = "Location" };
- DataField ignoreField { "char *", true, width = 72, header = "Ignore Count" };
- DataField levelField { "char *", true, width = 50, header = "Hit Level" };
- DataField conditionField { "char *", true, width = 130, header = "Condition" };
-
+
+ // 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" };
+ DataField hitsField { "int" , false, width = 28, header = $"Hits" };
+ DataField breaksField { "int" , false, width = 46, header = $"Breaks" };
+ 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);
+ listBox.AddField(hitsField);
+ listBox.AddField(breaksField);
listBox.AddField(ignoreField);
listBox.AddField(levelField);
listBox.AddField(conditionField);
return true;
}
- bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
- {
- if(active)
- ide.RepositionWindows(false);
- return true;
- }
-
bool OnClose(bool parentClosing)
{
visible = false;
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);
void Show()
{
visible = true;
+ ide.RepositionWindows(false);
Activate();
}
void AddBreakpoint(Breakpoint bp)
{
- char string[32];
DataRow row = listBox.AddRow();
- row.tag = (int)bp;
+ row.tag = (int64)(intptr)bp;
bp.row = row;
UpdateBreakpoint(row);
ide.callStackView.Update(null);
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;
- sprintf(string, "%d", bp.ignore);
+ if(bp.ignore == 0)
+ string[0] = '\0';
+ else
+ sprintf(string, "%d", bp.ignore);
row.SetData(ignoreField, string);
if(bp.level == -1)
string[0] = '\0';
row.SetData(conditionField, bp.condition.expression);
else
row.SetData(conditionField, null);
+ row.SetData(hitsField, bp.hits);
+ row.SetData(breaksField, bp.breaks);
}
}
-
+
void Clear()
{
listBox.Clear();