Subversion Repositories Kolibri OS

Rev

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

Rev 249 Rev 647
Line 1... Line 1...
1
// simple sample by Ghost
1
// simple sample by Ghost
Line 2... Line 2...
2
 
2
 
3
#include "stdio.h"
3
#include 
4
#include "string.h"
4
#include 
Line 5... Line 5...
5
#include "mesys.h"
5
#include 
6
 
6
 
Line 7... Line 7...
7
#define FONT0		0
7
#define FONT0           0
8
#define FONT1		0x10000000
8
#define FONT1           0x10000000
9
 
9
 
10
#define BT_NORMAL	0
10
#define BT_NORMAL       0
Line 11... Line 11...
11
#define BT_DEL		0x80000000
11
#define BT_DEL          0x80000000
Line 12... Line 12...
12
#define BT_HIDE		0x40000000
12
#define BT_HIDE         0x40000000
13
#define BT_NOFRAME	0x20000000
13
#define BT_NOFRAME      0x20000000
14
 
14
 
15
char header[]={" -= C demo programm. Compiled whith meTCC halyavin port =-   "};
15
char header[]={" -= C demo programm. Compiled whith KTCC halyavin and andrew_programmer port =-   "};
Line 26... Line 26...
26
	static int offs = 0;
26
        static int offs = 0;
27
	static int fcolor = 0;
27
        static int fcolor = 0;
28
	static int col = 0;
28
        static int col = 0;
29
	
29
 
Line 30... Line 30...
30
	_msys_window_redraw(1);
30
        _ksys_window_redraw(1);
31
	_msys_draw_window(100, 100, 300, 120, 0xaabbcc, 2, 0x5080d0, 0, 0x5080d0);
31
        _ksys_draw_window(100, 100, 300, 120, 0xaabbcc, 2, 0x5080d0, 0, 0x5080d0);
32
	_msys_write_text(6 - offs, 8, fcolor | FONT0, header, strlen(header));
32
        _ksys_write_text(6 - offs, 8, fcolor | FONT0, header, strlen(header));
33
	_msys_draw_bar(1, 6, 5, 13, 0x05080d0);
33
        _ksys_draw_bar(1, 6, 5, 13, 0x05080d0);
34
	_msys_draw_bar(274, 6, 26, 13, 0x05080d0);
34
        _ksys_draw_bar(274, 6, 26, 13, 0x05080d0);
35
	_msys_make_button(300 - 19, 5, 12, 12, 1 | BT_NORMAL, 0x6688dd);
35
        _ksys_make_button(300 - 19, 5, 12, 12, 1 | BT_NORMAL, 0x6688dd);
36
	_msys_window_redraw(2);
36
        _ksys_window_redraw(2);
Line 37... Line 37...
37
 
37
 
38
	offs = (offs + 1) % 6;
38
        offs = (offs + 1) % 6;
Line 39... Line 39...
39
	if(!offs)rotate_str(header);
39
        if(!offs)rotate_str(header);
Line 44... Line 44...
44
 
44
 
Line 45... Line 45...
45
int main(int argc, char **argv){
45
int main(int argc, char **argv){
Line 46... Line 46...
46
 
46
 
47
	while(!0){
47
        while(!0){
48
		switch(_msys_wait_for_event(10)){
48
                switch(_ksys_wait_for_event(10)){
Line 49... Line 49...
49
		case 2:return 0;
49
                case 2:return 0;
50
			
50
 
51
		case 3:
51
                case 3:
Line 52... Line 52...
52
			if(_msys_get_button_id() == 1)return 0;
52
                        if(_ksys_get_button_id() == 1)return 0;
53
			break;
53
                        break;
54
			
54