Pass UI_DIALOG& to ui_add_gadget_scrollbar
This commit is contained in:
parent
1d7f2e2ab5
commit
ff039c0c90
|
@ -311,7 +311,7 @@ extern void ui_mega_process();
|
|||
void ui_get_button_size(const grs_font &, const char *text, int &width, int &height);
|
||||
|
||||
__attribute_warn_unused_result
|
||||
std::unique_ptr<UI_GADGET_SCROLLBAR> ui_add_gadget_scrollbar(UI_DIALOG * dlg, short x, short y, short w, short h, int start, int stop, int position, int window_size);
|
||||
std::unique_ptr<UI_GADGET_SCROLLBAR> ui_add_gadget_scrollbar(UI_DIALOG &dlg, short x, short y, short w, short h, int start, int stop, int position, int window_size);
|
||||
extern void ui_draw_scrollbar( UI_DIALOG *dlg, UI_GADGET_SCROLLBAR * scrollbar );
|
||||
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ std::unique_ptr<UI_GADGET_LISTBOX> ui_add_gadget_listbox(UI_DIALOG &dlg, short x
|
|||
listbox->dragging = 0;
|
||||
listbox->selected_item = -1;
|
||||
listbox->moved = 1;
|
||||
listbox->scrollbar = ui_add_gadget_scrollbar(&dlg, x + w + 3, y, 0, h, 0, numitems - i, 0, i);
|
||||
listbox->scrollbar = ui_add_gadget_scrollbar(dlg, x + w + 3, y, 0, h, 0, numitems - i, 0, i);
|
||||
listbox->scrollbar->parent = listbox.get();
|
||||
return listbox;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ void ui_draw_scrollbar( UI_DIALOG *dlg, UI_GADGET_SCROLLBAR * scrollbar )
|
|||
ui_draw_box_out(canvas, 0, scrollbar->fake_position, scrollbar->width - 1, scrollbar->fake_position + scrollbar->fake_size - 1);
|
||||
}
|
||||
|
||||
std::unique_ptr<UI_GADGET_SCROLLBAR> ui_add_gadget_scrollbar(UI_DIALOG * dlg, short x, short y, short w, short h, int start, int stop, int position, int window_size)
|
||||
std::unique_ptr<UI_GADGET_SCROLLBAR> ui_add_gadget_scrollbar(UI_DIALOG &dlg, short x, short y, short w, short h, int start, int stop, int position, int window_size)
|
||||
{
|
||||
int tw;
|
||||
|
||||
|
@ -64,12 +64,12 @@ std::unique_ptr<UI_GADGET_SCROLLBAR> ui_add_gadget_scrollbar(UI_DIALOG * dlg, sh
|
|||
|
||||
if (stop < start ) stop = start;
|
||||
|
||||
auto scrollbar = ui_gadget_add<UI_GADGET_SCROLLBAR>(*dlg, x, y + w, x + w - 1, y + h - w - 1);
|
||||
auto scrollbar = ui_gadget_add<UI_GADGET_SCROLLBAR>(dlg, x, y + w, x + w - 1, y + h - w - 1);
|
||||
|
||||
scrollbar->up_button = ui_add_gadget_button(*dlg, x, y, w, w, up, nullptr);
|
||||
scrollbar->up_button = ui_add_gadget_button(dlg, x, y, w, w, up, nullptr);
|
||||
scrollbar->up_button->parent = scrollbar.get();
|
||||
|
||||
scrollbar->down_button = ui_add_gadget_button(*dlg, x, y+h-w, w, w, down, nullptr);
|
||||
scrollbar->down_button = ui_add_gadget_button(dlg, x, y+h-w, w, w, down, nullptr);
|
||||
scrollbar->down_button->parent = scrollbar.get();
|
||||
|
||||
scrollbar->horz = 0;
|
||||
|
|
Loading…
Reference in a new issue