Rev 6470 | Rev 6589 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6470 | Rev 6482 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | uint32_t work_size; |
31 | uint32_t work_size; |
32 | uint32_t all_redraw; |
32 | uint32_t all_redraw; |
33 | uint32_t ar_offset; |
33 | uint32_t ar_offset; |
34 | } scrollbar; |
34 | } scrollbar; |
Line 35... | Line 35... | ||
35 | 35 | ||
36 | scrollbar* kolibri_new_scrollbar(uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area, |
36 | inline scrollbar* kolibri_scrollbar(scrollbar* sb, uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area, |
37 | uint32_t cur_area, uint32_t position, uint32_t back_color, uint32_t front_color, uint32_t line_color) |
37 | uint32_t cur_area, uint32_t position, uint32_t back_color, uint32_t front_color, uint32_t line_color) |
38 | { |
38 | { |
Line 39... | Line 39... | ||
39 | scrollbar *sb = (scrollbar *)calloc(1, sizeof(scrollbar)); |
39 | memset(sb, 0, sizeof(scrollbar)); |
40 | 40 | ||
41 | sb->x_w = x_w; |
41 | sb->x_w = x_w; |
42 | sb->y_h = y_h; |
42 | sb->y_h = y_h; |
43 | sb->btn_height = btn_height; |
43 | sb->btn_height = btn_height; |
44 | sb->type = 1; |
44 | sb->type = 1; |
45 | sb->max_area = max_area; |
45 | sb->max_area = max_area; |
46 | sb->cur_area = cur_area; |
46 | sb->cur_area = cur_area; |
47 | sb->position = position; |
47 | sb->position = position; |
48 | sb->line_color = 0; //line_color; // 0 |
48 | sb->line_color = line_color; |
49 | sb->back_color = 0xeeeeee; // back_color; // 0xeeeeee |
49 | sb->back_color = back_color; // 0xeeeeee |
50 | sb->front_color = 0xbbddff; //front_color; // 0xbbddff |
50 | sb->front_color = front_color; // 0xbbddff |
51 | sb->ar_offset = max_area / 30; // temporary step 3% |
51 | sb->ar_offset = max_area / 30; // temporary step 3% |
52 | sb->all_redraw = 1; |
52 | sb->all_redraw = 1; |
Line -... | Line 53... | ||
- | 53 | return sb; |
|
- | 54 | }; |
|
- | 55 | ||
53 | return sb; |
56 | inline scrollbar* kolibri_new_scrollbar(uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area, |
- | 57 | uint32_t cur_area, uint32_t position, uint32_t back_color, uint32_t front_color, uint32_t line_color) |
|
- | 58 | { |
|
- | 59 | scrollbar *sb = (scrollbar *)malloc(sizeof(scrollbar)); |
|
- | 60 | ||
- | 61 | return kolibri_scrollbar(sb, x_w, y_h, btn_height, max_area, cur_area, position, back_color, front_color, line_color); |
|
- | 62 | }; |
|
- | 63 | ||
- | 64 | inline scrollbar* kolibri_scrollbar_def(scrollbar* sb, uint32_t x_w, uint32_t y_h, uint32_t max_area, uint32_t cur_area, uint32_t position) |
|
- | 65 | { |
|
- | 66 | return kolibri_scrollbar(sb, x_w, y_h, 15, max_area, cur_area, position, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, kolibri_color_table.color_work_button_text); |
|
- | 67 | }; |
|
- | 68 | ||
- | 69 | inline scrollbar* kolibri_new_scrollbar_def(uint32_t x_w, uint32_t y_h, uint32_t max_area, uint32_t cur_area, uint32_t position) |
|
- | 70 | { |
|
- | 71 | return kolibri_new_scrollbar(x_w, y_h, 15, max_area, cur_area, position, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, kolibri_color_table.color_work_button_text); |
|
- | 72 | }; |
|
- | 73 | ||
- | 74 | inline void gui_add_scrollbar_h(kolibri_window *wnd, scrollbar* sb) |
|
- | 75 | { |
|
- | 76 | kolibri_window_add_element(wnd, KOLIBRI_SCROLL_BAR_H, sb); |
|
- | 77 | } |
|
- | 78 | ||
- | 79 | inline void gui_add_scrollbar_v(kolibri_window *wnd, scrollbar* sb) |
|
Line 54... | Line 80... | ||
54 | }; |
80 | { |
55 | 81 | kolibri_window_add_element(wnd, KOLIBRI_SCROLL_BAR_V, sb); |
|
56 | //use_optionbox_driver |
82 | } |
57 | 83 |