Ability to change sort column with the mouse by

clicking column titles (click again to invert order).
Also, add a consolidated IO kbyte/s column.
This commit is contained in:
Hisham Muhammad
2008-03-14 18:50:49 +00:00
parent fa6f919059
commit 2338ad5820
6 changed files with 102 additions and 78 deletions

View File

@ -286,7 +286,7 @@ RichString ProcessList_printHeader(ProcessList* this) {
RichString_initVal(out);
ProcessField* fields = this->fields;
for (int i = 0; fields[i]; i++) {
char* field = Process_printField(fields[i]);
char* field = Process_fieldTitles[fields[i]];
if (this->sortKey == fields[i])
RichString_append(&out, CRT_colors[PANEL_HIGHLIGHT_FOCUS], field);
else
@ -816,3 +816,17 @@ void ProcessList_scan(ProcessList* this) {
}
}
ProcessField ProcessList_keyAt(ProcessList* this, int at) {
int x = 0;
ProcessField* fields = this->fields;
ProcessField field;
for (int i = 0; (field = fields[i]); i++) {
int len = strlen(Process_fieldTitles[field]);
if (at >= x && at <= x + len) {
return field;
}
x += len;
}
return COMM;
}