Subversion Repositories Kolibri OS

Rev

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

Rev 5985 Rev 5987
Line 13... Line 13...
13
 
13
 
14
#define TOOLBAR_H 34
14
#define TOOLBAR_H 34
15
#define TOOLBAR_ICON_WIDTH  26
15
#define TOOLBAR_ICON_WIDTH  26
Line 16... Line -...
16
#define TOOLBAR_ICON_HEIGHT 24
-
 
17
 
16
#define TOOLBAR_ICON_HEIGHT 24
Line 18... Line 17...
18
#define DEFAULT_FONT   "/sys/fonts/Tahoma.kf"
17
 
19
#define DEFAULT_EDITOR "/sys/tinypad"
18
#define DEFAULT_EDITOR "/sys/tinypad"
20
 
19
 
21
#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file."
20
#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file."
Line 22... Line 21...
22
#define VERSION "Text Reader v1.04"
21
#define VERSION "Text Reader v1.05"
23
#define ABOUT "Idea: Leency, punk_joker
22
#define ABOUT "Idea: Leency, punk_joker
Line 70... Line 69...
70
 
69
 
71
 
70
 
72
void main()
71
void main()
73
{   	
-
 
74
	InitDlls();
72
{   	
75
	
-
 
76
	OpenDialog_init stdcall (#o_dialog);
-
 
77
	
-
 
78
	font.color      = 0;
-
 
79
	font.bg_color   = 0xFFFFFF;
73
	InitDlls();	
80
	
-
 
81
	font.load(DEFAULT_FONT);
-
 
82
	
-
 
83
	if (!font.data) {
-
 
84
		io.run("/sys/@notify","'Error: Font is not loaded.' -E");
-
 
85
		ExitProcess();
-
 
86
	}
74
	OpenDialog_init stdcall (#o_dialog);
87
	
-
 
88
	Libimg_LoadImage(#skin, abspath("toolbar.png"));
75
	label.init(DEFAULT_FONT);
89
	
-
 
90
	LoadIniSettings();
76
	Libimg_LoadImage(#skin, abspath("toolbar.png"));
91
	
77
	LoadIniSettings();
92
	OpenFile(#param);
78
	OpenFile(#param);
93
	list.no_selection = true;
79
	list.no_selection = true;
94
	SetEventMask(10000000000000000000000001100111b);
80
	SetEventMask(10000000000000000000000001100111b);
Line 213... Line 199...
213
	PreparePage();
199
	PreparePage();
214
}
200
}
Line 215... Line 201...
215
 
201
 
216
void EventMagnifyPlus()
202
void EventMagnifyPlus()
217
{
203
{
218
	font.size.text++;
204
	label.size.pt++;
219
	if(!font.changeSIZE())
205
	if(!label.changeSIZE())
220
		font.size.text--;
206
		label.size.pt--;
221
	else
207
	else
222
		PreparePage();
208
		PreparePage();
Line 223... Line 209...
223
}
209
}
224
 
210
 
225
void EventMagnifyMinus()
211
void EventMagnifyMinus()
226
{
212
{
227
	font.size.text--;
213
	label.size.pt--;
228
	if(!font.changeSIZE())
214
	if(!label.changeSIZE())
229
		font.size.text++;
215
		label.size.pt++;
230
	else
216
	else
Line 231... Line 217...
231
		PreparePage();
217
		PreparePage();
Line 301... Line 287...
301
	DrawRectangle(scroll.start_x, scroll.start_y, scroll.size_x, scroll.size_y-1, scroll.bckg_col);
287
	DrawRectangle(scroll.start_x, scroll.start_y, scroll.size_x, scroll.size_y-1, scroll.bckg_col);
302
}
288
}
Line 303... Line 289...
303
 
289
 
304
void DrawPage()
290
void DrawPage()
305
{
291
{
306
	_PutImage(list.x,list.y,list.w,list.h,list.first*list.item_h*list.w*3 + font.buffer);
292
	_PutImage(list.x,list.y,list.w,list.h,list.first*list.item_h*list.w*3 + label.raw);
307
	DrawScroller();
293
	DrawScroller();
308
}
294
}