Subversion Repositories Kolibri OS

Rev

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

Rev 5923 Rev 5962
Line 1... Line 1...
1
#define MEMSIZE 4096*20
1
#define MEMSIZE 4096*25
Line 2... Line 2...
2
 
2
 
3
#include "../lib/font.h"
3
#include "../lib/font.h"
4
#include "../lib/io.h"
4
#include "../lib/io.h"
5
#include "../lib/gui.h"
5
#include "../lib/gui.h"
Line 23... Line 23...
23
 
23
 
24
#define DEFAULT_FONT   "/sys/fonts/Tahoma.kf"
24
#define DEFAULT_FONT   "/sys/fonts/Tahoma.kf"
Line 25... Line 25...
25
#define DEFAULT_EDITOR "/sys/tinypad"
25
#define DEFAULT_EDITOR "/sys/tinypad"
-
 
26
 
-
 
27
#define INTRO_TEXT "This is a plain text reader.\nTry to open some text file."
-
 
28
#define VERSION "Text Reader v1.02"
-
 
29
#define ABOUT "Idea: Leency, punk_joker
-
 
30
Code: Leency, Veliant, KolibriOS Team
-
 
31
 
-
 
32
Hotkeys:
-
 
33
Ctrl+O - open file
-
 
34
Ctrl+Up - bigger font
-
 
35
Ctrl+Down - smaller font
-
 
36
Ctrl+Tab - select charset
-
 
37
Ctrl+E - edit current document
Line 26... Line 38...
26
 
38
 
27
#define INTRO_TEXT "This is a plain text reader.\nTry to open some text file."
39
Press any key..."
Line 28... Line 40...
28
 
40
 
Line 40... Line 52...
40
char char_width[255];
52
char char_width[255];
41
dword line_offset;
53
dword line_offset;
42
#define DWORD 4;
54
#define DWORD 4;
Line 43... Line 55...
43
 
55
 
44
enum {
56
enum {
45
	OPEN_FILE = 10,
57
	OPEN_FILE,
46
	MAGNIFY_MINUS,
58
	MAGNIFY_MINUS,
47
	MAGNIFY_PLUS,
59
	MAGNIFY_PLUS,
48
	CHANGE_ENCODING,
60
	CHANGE_ENCODING,
49
	RUN_EDIT,
61
	RUN_EDIT,
Line 378... Line 390...
378
	if (encoding!=CH_CP866) ChangeCharset(charsets[encoding], "CP866", io.buffer_data);
390
	if (encoding!=CH_CP866) ChangeCharset(charsets[encoding], "CP866", io.buffer_data);
379
	list.KeyHome();
391
	list.KeyHome();
380
	list.ClearList();
392
	list.ClearList();
381
}
393
}
Line 382... Line -...
382
 
-
 
383
 
-
 
384
 
-
 
385
char *about[] = {
-
 
386
	"Text Reader v1.01",
-
 
387
	"Idea: Leency, punk_joker",
-
 
388
	"Code: Leency, Veliant, KolibriOS Team",
-
 
389
	" ",
-
 
390
	"Hotkeys:",
-
 
391
	"Ctrl+O - open file",
-
 
392
	"Ctrl+Up - bigger font",
-
 
393
	"Ctrl+Down - smaller font",
-
 
394
	"Ctrl+Tab - select charset",
-
 
395
	"Ctrl+E - edit current document",
-
 
396
	" ",
-
 
397
	"Press any key...",
-
 
398
	0
-
 
399
};
-
 
400
 
394
 
401
ShowAbout() {
-
 
402
	int i;
395
ShowAbout() {
403
	help_opened = true;
396
	help_opened = true;
404
	DrawBar(list.x, list.y, list.w, list.h, 0xFFFfff);
397
	DrawBar(list.x, list.y, list.w, list.h, 0xFFFfff);
405
	WriteText(list.x + 10, list.y + 10, 10000001b, 0x555555, about[0]);
398
	WriteText(list.x + 10, list.y + 10, 10000001b, 0x555555, VERSION);
406
	for (i=1; about[i]; i++) WriteText(list.x + 10, i+1*20 + list.y, 10110000b, 0, about[i]);
399
	WriteTextLines(list.x + 10, list.y+40, 10110000b, 0, ABOUT, 20);