Subversion Repositories Kolibri OS

Rev

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

Rev 5776 Rev 5784
Line 1... Line 1...
1
#define MEMSIZE 0xEE80
1
#define MEMSIZE 0x2EE80
Line 2... Line 2...
2
 
2
 
3
#include "../lib/font.h"
3
#include "../lib/font.h"
Line -... Line 4...
-
 
4
#include "../lib/gui.h"
-
 
5
 
4
#include "../lib/gui.h"
6
#define PANELH 30
5
 
7
 
-
 
8
void main()
6
void main()
9
{   
7
{   
10
	proc_info Form;
8
	word i, y, btn;
11
	word i, y, btn;
9
	char line[256], title[4196];
12
	char line[256], title[4196];
10
	font.no_bg_copy = true;
13
	font.no_bg_copy = true;
Line 21... Line 24...
21
		case evButton:
24
		case evButton:
22
			btn = GetButtonID();
25
			btn = GetButtonID();
23
			if (btn==1) ExitProcess();
26
			if (btn==1) ExitProcess();
24
			if (btn==2) font.weight ^=1;
27
			if (btn==2) font.weight ^=1;
25
			if (btn==3) font.italic ^=1;
28
			if (btn==3) font.italic ^=1;
26
			if (btn==4) font.no_bg_copy ^=1;
29
			if (btn==4) font.smooth ^=1;
-
 
30
			goto _DRAW_WINDOW_CONTENT;
27
		case evReDraw:
31
		case evReDraw:
28
			DefineAndDrawWindow(215,100,500,320,0x33,0xFFFFFF,#title);
32
			DefineAndDrawWindow(215,100,500,320,0x74,0xFFFFFF,#title);
-
 
33
			GetProcessInfo(#Form, SelfInfo);
-
 
34
			_DRAW_WINDOW_CONTENT:
29
			DrawBar(0, 0, 500-9, 30, 0xCCCccc);
35
			DrawBar(0, 0, Form.cwidth, PANELH, 0xCCCccc);
30
			CheckBox2(10, 8, 2, "Bold",  font.weight);
36
			CheckBox2(10, 8, 2, "Bold",  font.weight);
31
			CheckBox2(70, 8, 3, "Italic",  font.italic);
37
			CheckBox2(70, 8, 3, "Italic",  font.italic);
32
			CheckBox2(140, 8, 4, "Smooth",  font.no_bg_copy);
38
			CheckBox2(140, 8, 4, "Smooth",  font.smooth);
-
 
39
			font.buffer_size = free(font.buffer);
33
			if (!font.data)
40
			if (!font.data)
34
			{
41
			{
-
 
42
				DrawBar(0, PANELH, Form.cwidth, Form.cheight - PANELH, 0xFFFfff);
35
				WriteText(10, 50, 0x82, 0xFF00FF, "Font is not loaded.");
43
				WriteText(10, 50, 0x82, 0xFF00FF, "Font is not loaded.");
36
			} 
44
			}
37
			else for (i=10, y=40; i<22; i++, y+=font.height;)
45
			else for (i=10, y=5; i<22; i++, y+=font.height;) //not flexible, need to calculate font count and max line length
38
			{
46
			{
39
				font.size.text = i;
47
				font.size.text = i;
40
				sprintf(#line," §¬¥à èà¨äâ /size font %d ¯¨ªá¥«¥©.",i);
48
				sprintf(#line," §¬¥à èà¨äâ /size font %d ¯¨ªá¥«¥©.",i);
41
				font.prepare(10,y,#line);
49
				font.prepare_buf(10,y,Form.cwidth,Form.cheight-PANELH, #line);
42
				font.show(10, y);
-
 
43
			}
50
			}
-
 
51
			if (font.smooth) SmoothFont(font.buffer, font.size.width, font.size.height);
-
 
52
			font.show(0, PANELH);
44
	  }
53
	  }
45
	}
54
	}
46
}
55
}
Line 47... Line 56...
47
 
56