30 static const char*
TYPENAME() {
return "ListBoxCell"; }
44 static const char*
TYPENAME() {
return "ListBoxItem"; }
68 static const char*
TYPENAME() {
return "ListBoxColumn"; }
90 if (sort_column == -1) {
91 switch (sort_criteria) {
106 else if (sort_column >= 0 &&
110 switch (sort_criteria) {
137 if (sort_column == -1) {
138 switch (sort_criteria) {
153 else if (sort_column >= 0 &&
157 switch (sort_criteria) {
184 if (sort_column == -1) {
185 switch (sort_criteria) {
200 else if (sort_column >= 0 &&
204 switch (sort_criteria) {
225 static int old_cursor;
230 :
ScrollWindow(p->GetScreen(), ax, ay, aw, ah, aid, 0, p)
244 sprintf_s(buf,
"ListBox %d",
id);
263 sprintf_s(buf,
"ListBox %d",
id);
280 Rect item_rect = ctrl_rect;
296 for (
int column = 0; column <= max_column; column++) {
303 Rect title_rect = item_rect;
309 DT_CENTER|DT_SINGLELINE);
311 item_rect.
x += item_rect.
w;
314 item_rect.
y += item_rect.
h;
322 while (++iter && item_rect.
y < h) {
328 item_rect.
x = ctrl_rect.
x;
331 if (item_rect.
y + item_rect.
h > h) {
332 item_rect.
h = h - item_rect.
y - 1;
350 FillRect(item_rect, item_color * 0.25);
356 Rect text_rect = item_rect;
375 item_rect.
x += item_rect.
w + 2;
387 FillRect(item_rect, item_color * 0.25);
398 Rect text_rect = item_rect;
439 int usable_width =
rect.
w;
455 c->
width = usable_width - used;
483 if (index >= 0 && index <
items.
size()) {
491 return items[index]->data;
498 if (index >= 0 && index <
items.
size()) {
499 items[index]->data = data;
506 return items[index]->image;
513 if (index >= 0 && index <
items.
size()) {
514 items[index]->image = img;
521 return items[index]->color;
528 if (index >= 0 && index <
items.
size()) {
529 items[index]->color = c;
539 if (index >= 0 && index <
items.
size()) {
543 if (column >= 0 && column < item->subitems.size())
544 return item->
subitems[column]->text;
557 if (index >= 0 && index <
items.
size()) {
579 if (index >= 0 && index <
items.
size()) {
583 if (column >= 0 && column < item->subitems.size())
584 return item->
subitems[column]->data;
597 if (index >= 0 && index <
items.
size()) {
608 item->
subitems[column]->data = data;
619 if (index >= 0 && index <
items.
size()) {
623 if (column >= 0 && column < item->subitems.size())
624 return item->
subitems[column]->image;
637 if (index >= 0 && index <
items.
size()) {
648 item->
subitems[column]->image = img;
754 if (index >= 0 && index <
items.
size()) {
755 if (
items[index]->selected)
782 column->
title = title;
783 column->
width = width;
784 column->
align = align;
863 columns[index]->use_color =
true;
872 c =
items[index]->color;
875 if (
columns[column]->use_color)
889 if (
multiselect != nNewValue && (nNewValue == 0 || nNewValue == 1)) {
946 return items[index]->selected;
953 if (index >= 0 && index <
items.
size()) {
957 if (
items[index]->selected != bNewValue) {
958 items[index]->selected = bNewValue;
999 if (
items[i]->selected)
1020 if (col_index >= 0 && col_index <=
columns.
size())
1098 static bool preselected =
false;
1108 int x_scroll_bar =
rect.
w;
1117 int next_col_start = 0;
1121 for (column = 0; column < max_column; column++) {
1136 sort_criteria = -sort_criteria;
1202 if (mouse_x < 0 || mouse_x >
rect.
w || mouse_y < 0 || mouse_y >
rect.
h) {
1213 else if (preselected) {
1263 if (vk == VK_DOWN) {
1274 else if (vk == VK_UP) {
1311 for (
int i = 0; i < drag_source->
NumItems(); i++) {
1316 for (
int c = 1; c < max_col; c++) {