Subversion Repositories Kolibri OS

Rev

Rev 8108 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8108 Rev 8110
Line 1... Line 1...
1
// BOXLIB EXAMPLE (scrollbar)
1
// BOXLIB EXAMPLE (scrollbar, progressbar)
2
// Writed by maxcodehack
2
// Writed by maxcodehack
3
#include 
3
#include 
4
#include 
4
#include 
5
#include 
5
#include 
Line 17... Line 17...
17
#define WIN_W 640
17
#define WIN_W 640
18
#define WIN_H 563
18
#define WIN_H 563
Line 19... Line 19...
19
 
19
 
20
char* title = "Boxlib example";
20
char* title = "Boxlib example";
21
int win_bg_color = 0x858585;
21
int win_bg_color = 0x858585;
-
 
22
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};
Line 22... Line 23...
22
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};
23
progressbar pg = {0, 10, 10, 270, 35, 1, 0, 200, 0xB4B4B4, 0x2728FF, 0xA9A9A9};
23
 
24
 
24
void draw_window(){
25
void draw_window(){
25
        begin_draw(); 
26
        begin_draw(); 
-
 
27
        sys_create_window(215,100,WIN_W,WIN_H,title,win_bg_color,0x34);
26
        sys_create_window(215,100,WIN_W,WIN_H,title,win_bg_color,0x34);
28
        scrollbar_v_draw(&scroll);
27
        scrollbar_v_draw(&scroll);
29
        progressbar_draw(&pg);
Line 28... Line 30...
28
        end_draw();
30
        end_draw();
29
}
31
}
Line 64... Line 66...
64
			case evReDraw:
66
			case evReDraw:
65
				draw_window();
67
				draw_window();
66
				break;
68
				break;
67
			case evMouse:
69
			case evMouse:
68
				scrollbar_v_mouse(&scroll);
70
				scrollbar_v_mouse(&scroll);
-
 
71
				pg.value = scroll.position;
-
 
72
				progressbar_draw(&pg);
69
				break;
73
				break;
70
		}
74
		}
71
	}
75
	}
72
}
76
}