Subversion Repositories Kolibri OS

Rev

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

Rev 7806 Rev 7909
Line 4... Line 4...
4
#include "../lib/gui.h"
4
#include "../lib/gui.h"
Line 5... Line 5...
5
 
5
 
6
#define PANELH 28
6
#define PANELH 28
7
#define WIN_W 490
7
#define WIN_W 490
-
 
8
#define WIN_H 315
8
#define WIN_H 315
9
#define BASE_TAB_BUTTON_ID 97
Line 9... Line -...
9
proc_info Form;
-
 
10
 
-
 
11
enum { 
-
 
12
	PHRASE_TAB=20, CHARS_TAB
-
 
13
};
10
proc_info Form;
Line 14... Line 11...
14
 
11
 
15
_tabs tabs = { PHRASE_TAB };
12
_tabs tabs = { WIN_W-130, 0, NULL, BASE_TAB_BUTTON_ID };
16
 
13
 
17
block preview = { 0, PANELH, WIN_W, WIN_H - PANELH };
14
block preview = { 0, PANELH, WIN_W, WIN_H - PANELH };
Line 25... Line 22...
25
	char title[4196];
22
	char title[4196];
26
	if (!param) strcpy(#param, DEFAULT_FONT);
23
	if (!param) strcpy(#param, DEFAULT_FONT);
27
	kfont.init(#param);
24
	kfont.init(#param);
28
	strcpy(#title, "Font preview: ");
25
	strcpy(#title, "Font preview: ");
29
	strcat(#title, #param);
26
	strcat(#title, #param);
-
 
27
 
-
 
28
	tabs.add("Phrase", #DrawPreviewPhrase);
-
 
29
	tabs.add("Chars", #DrawPreviewChars);
-
 
30
 
30
	loop() switch(WaitEvent())
31
	loop() switch(WaitEvent())
31
	{
32
	{
32
		case evButton:
33
		case evButton:
33
			btn = GetButtonID();
34
			btn = GetButtonID();
34
			if (btn==1) ExitProcess();
35
			if (btn==1) ExitProcess();
35
			bold.click(btn); 
36
			bold.click(btn); 
36
			smooth.click(btn);
37
			smooth.click(btn);
37
			colored.click(btn);
38
			colored.click(btn);
38
			if (btn==PHRASE_TAB) || (btn==CHARS_TAB) tabs.click(btn);
39
			tabs.click(btn);
39
			goto _DRAW_WINDOW_CONTENT;
40
			goto _DRAW_WINDOW_CONTENT;
40
		case evReDraw:
41
		case evReDraw:
41
			sc.get();
42
			sc.get();
42
			DefineAndDrawWindow(215,100,WIN_W+9,WIN_H+skin_height+5,0x74,0xFFFFFF,#title,0);
43
			DefineAndDrawWindow(215,100,WIN_W+9,WIN_H+skin_height+5,0x74,0xFFFFFF,#title,0);
43
			GetProcessInfo(#Form, SelfInfo);
44
			GetProcessInfo(#Form, SelfInfo);
Line 51... Line 52...
51
			DrawBar(0, PANELH-1,Form.cwidth,1,sc.work_graph);
52
			DrawBar(0, PANELH-1,Form.cwidth,1,sc.work_graph);
52
			bold.draw(10, 8);
53
			bold.draw(10, 8);
53
			smooth.draw(83,8);
54
			smooth.draw(83,8);
54
			colored.draw(170,8);
55
			colored.draw(170,8);
Line 55... Line 56...
55
 
56
 
56
			tabs.draw_button(Form.cwidth-130, PHRASE_TAB, "Phrase");
57
			tabs.draw();
Line 57... Line 58...
57
			tabs.draw_button(Form.cwidth-60, CHARS_TAB, "Chars");
58
			tabs.draw_active_tab();
58
 
59
 
59
			if (!kfont.font)
60
			if (!kfont.font)
60
			{
61
			{
61
				DrawBar(preview.x, preview.y, preview.w, preview.h, 0xFFFfff);
62
				DrawBar(preview.x, preview.y, preview.w, preview.h, 0xFFFfff);
62
				WriteText(10, 50, 0x82, 0xFF00FF, "Font is not loaded.");
63
				WriteText(10, 50, 0x82, 0xFF00FF, "Font is not loaded.");
63
				break;
-
 
64
			}
-
 
65
			if (tabs.active_tab==PHRASE_TAB) DrawPreviewPhrase();
64
				break;
66
			if (tabs.active_tab==CHARS_TAB) DrawPreviewChars();
65
			}
Line 67... Line 66...
67
	}
66
	}
68
}
67
}