forked from KolibriOS/kolibrios
Update boxlib example:
Add progressbar git-svn-id: svn://kolibrios.org@8110 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1c69f15cea
commit
a26092c937
@ -1,4 +1,4 @@
|
|||||||
// BOXLIB EXAMPLE (scrollbar)
|
// BOXLIB EXAMPLE (scrollbar, progressbar)
|
||||||
// Writed by maxcodehack
|
// Writed by maxcodehack
|
||||||
#include <kos32sys1.h>
|
#include <kos32sys1.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -19,12 +19,14 @@
|
|||||||
|
|
||||||
char* title = "Boxlib example";
|
char* title = "Boxlib example";
|
||||||
int win_bg_color = 0x858585;
|
int win_bg_color = 0x858585;
|
||||||
scrollbar scroll = {15, WIN_W - 26, WIN_H - 29, 0, 0, 2, 115, 15, 0,0x707070,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
|
scrollbar scroll = {15, WIN_W - 26, WIN_H - 29, 0, 0, 2, 215, 15, 0,0x707070,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
|
||||||
|
progressbar pg = {0, 10, 10, 270, 35, 1, 0, 200, 0xB4B4B4, 0x2728FF, 0xA9A9A9};
|
||||||
|
|
||||||
void draw_window(){
|
void draw_window(){
|
||||||
begin_draw();
|
begin_draw();
|
||||||
sys_create_window(215,100,WIN_W,WIN_H,title,win_bg_color,0x34);
|
sys_create_window(215,100,WIN_W,WIN_H,title,win_bg_color,0x34);
|
||||||
scrollbar_v_draw(&scroll);
|
scrollbar_v_draw(&scroll);
|
||||||
|
progressbar_draw(&pg);
|
||||||
end_draw();
|
end_draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +68,8 @@ int main()
|
|||||||
break;
|
break;
|
||||||
case evMouse:
|
case evMouse:
|
||||||
scrollbar_v_mouse(&scroll);
|
scrollbar_v_mouse(&scroll);
|
||||||
|
pg.value = scroll.position;
|
||||||
|
progressbar_draw(&pg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user