Subversion Repositories Kolibri OS

Rev

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

Rev 5825 Rev 5915
Line 7... Line 7...
7
#include "..\lib\strings.h" 
7
#include "..\lib\strings.h" 
8
#include "..\lib\mem.h" 
8
#include "..\lib\mem.h" 
9
#include "..\lib\file_system.h"
9
#include "..\lib\file_system.h"
10
#include "..\lib\dll.h"
10
#include "..\lib\dll.h"
11
#include "..\lib\gui.h"
11
#include "..\lib\gui.h"
12
#include "..\lib\list_box.h"
12
#include "..\lib\obj\iconv.h"
13
 
-
 
14
#include "..\lib\obj\box_lib.h"
13
#include "..\lib\obj\box_lib.h"
15
#include "..\lib\obj\proc_lib.h"
14
#include "..\lib\obj\proc_lib.h"
16
#include "..\lib\obj\libio_lib.h"
15
#include "..\lib\obj\libio_lib.h"
-
 
16
//#include "..\lib\obj\wword.h"
Line 17... Line 17...
17
 
17
 
18
#ifdef LANG_RUS
18
#ifdef LANG_RUS
19
	?define T_FILE "” ©«"
19
	?define T_FILE "” ©«"
20
	?define T_TYPE "’¨¯"
20
	?define T_TYPE "’¨¯"
-
 
21
	?define T_SIZE " §¬¥à"
21
	?define T_SIZE " §¬¥à"
22
 
22
	?define MENU1 "” ©«"
23
	?define MENU1 "” ©«"
23
	?define MENU1_SUBMENU1 "Žâªàëâì"
24
	?define MENU1_SUBMENU1 "Žâªàëâì"
24
	?define MENU1_SUBMENU2 "‡ ªàëâì"
25
	?define MENU1_SUBMENU2 "‡ ªàëâì"
25
	?define MENU1_SUBMENU3 "‘¢®©á⢠"
26
	?define MENU1_SUBMENU3 "‘¢®©á⢠"
-
 
27
	?define MENU1_SUBMENU4 "‚ë室"
-
 
28
 
-
 
29
	?define MENU2 "Š®¤¨à®¢ª "
-
 
30
	?define MENU2_SUBMENU1 "UTF-8"
-
 
31
	?define MENU2_SUBMENU2 "KOI8-RU"
-
 
32
	?define MENU2_SUBMENU3 "CP1251"
-
 
33
	?define MENU2_SUBMENU4 "CP1252"
-
 
34
	?define MENU2_SUBMENU5 "ISO8859-5"
-
 
35
	?define MENU2_SUBMENU6 "CP866"
-
 
36
 
-
 
37
	?define ERROR_LOAD_BOX_LIB "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ - box_lib.obj"
-
 
38
	?define ERROR_LOAD_LIBIO "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ - libio.obj"
26
	?define MENU1_SUBMENU4 "‚ë室"
39
	?define ERROR_LOAD_PROC_LIB "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ - proc_lib.obj"
27
#else
40
#else
28
	?define T_FILE "File"
41
	?define T_FILE "File"
29
	?define T_TYPE "Type"
42
	?define T_TYPE "Type"
30
	?define T_SIZE "Size"
43
	?define T_SIZE "Size"
-
 
44
	?define MENU1 "File"
31
	?define MENU1 "File"
45
 
32
	?define MENU1_SUBMENU1 "Open"
46
	?define MENU1_SUBMENU1 "Open"
33
	?define MENU1_SUBMENU2 "Close"
47
	?define MENU1_SUBMENU2 "Close"
34
	?define MENU1_SUBMENU3 "Properties"
48
	?define MENU1_SUBMENU3 "Properties"
-
 
49
	?define MENU1_SUBMENU4 "Exit"
-
 
50
 
-
 
51
	?define MENU2 "Encoding"
-
 
52
	?define MENU2_SUBMENU1 "UTF-8"
-
 
53
	?define MENU2_SUBMENU2 "KOI8-RU"
-
 
54
	?define MENU2_SUBMENU3 "CP1251"
-
 
55
	?define MENU2_SUBMENU4 "CP1252"
-
 
56
	?define MENU2_SUBMENU5 "ISO8859-5"
-
 
57
	?define MENU2_SUBMENU6 "CP866"
-
 
58
 
-
 
59
	?define ERROR_LOAD_BOX_LIB "Error while loading library - box_lib.obj"
-
 
60
	?define ERROR_LOAD_LIBIO "Error while loading library - libio.obj"
35
	?define MENU1_SUBMENU4 "Exit"
61
	?define ERROR_LOAD_PROC_LIB "Error while loading library - proc_lib.obj"
Line 36... Line 62...
36
#endif
62
#endif
37
 
63
 
38
#ifdef LANG_RUS
64
#ifdef LANG_RUS
39
struct menu_text_struct
65
struct menu1_text_struct
40
{
66
{
41
	char menu[5];
67
	char menu[5];
42
	char sub_menu1[8];
68
	char sub_menu1[8];
43
	char sub_menu2[8];
69
	char sub_menu2[8];
44
	//char sub_menu3[9];
70
	//char sub_menu3[9];
45
	char sub_menu4[6];
71
	char sub_menu4[6];
-
 
72
	byte end;
-
 
73
};
-
 
74
struct menu2_text_struct
-
 
75
{
-
 
76
	char menu[10];
-
 
77
	char sub_menu1[6];
-
 
78
	char sub_menu2[8];
-
 
79
	char sub_menu3[7];
-
 
80
	char sub_menu4[7];
-
 
81
	char sub_menu5[10];
-
 
82
	char sub_menu6[6];
46
	byte end;
83
	byte end;
47
};
84
};
48
#else
85
#else
49
struct menu_text_struct
86
struct menu1_text_struct
50
{
87
{
51
	char menu[5];
88
	char menu[5];
52
	char sub_menu1[5];
89
	char sub_menu1[5];
53
	char sub_menu2[6];
90
	char sub_menu2[6];
54
	//char sub_menu3[11];
91
	//char sub_menu3[11];
55
	char sub_menu4[5];
92
	char sub_menu4[5];
-
 
93
	byte end;
-
 
94
};
-
 
95
struct menu2_text_struct
-
 
96
{
-
 
97
	char menu[9];
-
 
98
	char sub_menu1[6];
-
 
99
	char sub_menu2[8];
-
 
100
	char sub_menu3[7];
-
 
101
	char sub_menu4[7];
-
 
102
	char sub_menu5[10];
-
 
103
	char sub_menu6[6];
56
	byte end;
104
	byte end;
Line -... Line 105...
-
 
105
};
-
 
106
#endif
57
};
107
 
58
#endif
108
#define TITLE "Calypte v0.15"
59
 
109
 
60
#define TOPPANELH 19
110
#define TOPPANELH 19
Line 61... Line -...
61
#define BOTPANELH 10
-
 
62
#define WIN_W 600
-
 
63
#define WIN_H 400
111
#define BOTPANELH 10
Line 64... Line -...
64
 
-
 
65
#define TITLE "Calypte v0.13"
-
 
66
char win_title[4096] = TITLE;
-
 
67
proc_info Form;
112
#define WIN_W 600
-
 
113
#define WIN_H 400
68
 
114
 
Line 69... Line 115...
69
dword old_width,old_height;
115
proc_info Form;
70
llist tview;
116
 
71
 
-
 
72
byte active_properties = 0;
-
 
Line 73... Line 117...
73
dword properties_window;
117
byte active_properties = 0;
74
 
118
int encoding;
75
#include "include\gui.h"
119
dword properties_window;
76
#include "include\properties.h"
120
 
Line 86... Line 130...
86
	//char ext4[4];
130
	//char ext4[4];
87
	byte end;
131
	byte end;
88
};
132
};
Line 89... Line 133...
89
 
133
 
90
filter filter2;
134
filter filter2;
-
 
135
menu1_text_struct menu1_text_area1;
-
 
136
menu2_text_struct menu2_text_area2;
-
 
137
 
Line -... Line 138...
-
 
138
char win_title[4096] = "Calypte v0.15";
-
 
139
 
91
menu_text_struct menu_text_area1;
140
int
-
 
141
	cur_row=0,
-
 
142
	read=0,
-
 
143
	pos=0,
-
 
144
	row_num=0,
Line -... Line 145...
-
 
145
	col_count=0,
Line 92... Line 146...
92
 
146
	row_count=0;	
93
int read=0;
147
	
94
 
148
dword old_width,old_height;
95
 
149
 
Line 105... Line 159...
105
 
159
 
106
dword bufpointer;
160
dword bufpointer;
107
dword bufsize;
161
dword bufsize;
Line 108... Line 162...
108
dword draw_sruct;
162
dword draw_sruct;
-
 
163
 
Line 109... Line 164...
109
 
164
menu_data menudata1 = {0, 40, 2, 15, 2, #menu1_text_area1.menu, #menu1_text_area1.sub_menu1, #menu1_text_area1.end, 0, 0, 80, 2, 100, 18, 0xEEEEEE, 0xFF, 0xEEEEEE, 0, 0, 0, #Form, 0, 0, 0, 16, 0, 0, 0x00CC00, 0, 0xFFFFFF, 0, 8, 0, 0};
110
menu_data menudata1 = {0, 40, 2, 15, 2, #menu_text_area1.menu, #menu_text_area1.sub_menu1, #menu_text_area1.end, 0, 0, 80, 2, 100, 18, 0xEEEEEE, 0xFF, 0xEEEEEE, 0, 0, 0, #Form, 0, 0, 0, 16, 0, 0, 0x00CC00, 0, 0xFFFFFF, 0, 8, 0, 0};
165
menu_data menudata2 = {0, 70, 44, 15, 2, #menu2_text_area2.menu, #menu2_text_area2.sub_menu1, #menu2_text_area2.end, 0, 0, 80, 44, 100, 18, 0xEEEEEE, 0xFF, 0xEEEEEE, 0, 0, 0, #Form, 0, 0, 0, 16, 0, 0, 0x00CC00, 0, 0xFFFFFF, 0, 8, 0, 0};
111
 
166
 
Line 118... Line 173...
118
	//strcpy(#filter2.ext3, "INC\0");
173
	//strcpy(#filter2.ext3, "INC\0");
119
	//strcpy(#filter2.ext4, "\0");
174
	//strcpy(#filter2.ext4, "\0");
120
	filter2.size = 8;
175
	filter2.size = 8;
121
	filter2.end = 0;
176
	filter2.end = 0;
Line 122... Line 177...
122
 
177
 
123
	strcpy(#menu_text_area1.menu, MENU1);
178
	strcpy(#menu1_text_area1.menu, MENU1);
124
	strcpy(#menu_text_area1.sub_menu1, MENU1_SUBMENU1);
179
	strcpy(#menu1_text_area1.sub_menu1, MENU1_SUBMENU1);
125
	strcpy(#menu_text_area1.sub_menu2, MENU1_SUBMENU2);
180
	strcpy(#menu1_text_area1.sub_menu2, MENU1_SUBMENU2);
126
	//strcpy(#menu_text_area1.sub_menu3, MENU1_SUBMENU3);
181
	//strcpy(#menu1_text_area1.sub_menu3, MENU1_SUBMENU3);
127
	strcpy(#menu_text_area1.sub_menu4, MENU1_SUBMENU4);
182
	strcpy(#menu1_text_area1.sub_menu4, MENU1_SUBMENU4);
-
 
183
	menu1_text_area1.end = 0;
-
 
184
	
-
 
185
	strcpy(#menu2_text_area2.menu, MENU2);
-
 
186
	strcpy(#menu2_text_area2.sub_menu1, MENU2_SUBMENU1);
-
 
187
	strcpy(#menu2_text_area2.sub_menu2, MENU2_SUBMENU2);
-
 
188
	strcpy(#menu2_text_area2.sub_menu3, MENU2_SUBMENU3);
-
 
189
	strcpy(#menu2_text_area2.sub_menu4, MENU2_SUBMENU4);
-
 
190
	strcpy(#menu2_text_area2.sub_menu5, MENU2_SUBMENU5);
-
 
191
	strcpy(#menu2_text_area2.sub_menu6, MENU2_SUBMENU6);
Line -... Line 192...
-
 
192
	menu2_text_area2.end = 0;
128
	menu_text_area1.end = 0;
193
	
129
	
194
	//mem_Init();
-
 
195
	load_dll(boxlib, #box_lib_init,0);
130
	load_dll(boxlib, #box_lib_init,0);
196
	load_dll(libio, #libio_init,1);
131
	load_dll(libio, #libio_init,1);
197
	load_dll(iconv_lib, #iconv_open,0);
-
 
198
	load_dll(Proc_lib, #OpenDialog_init,0);
132
	load_dll(Proc_lib, #OpenDialog_init,0);
199
	OpenDialog_init stdcall (#o_dialog);
133
	OpenDialog_init stdcall (#o_dialog);
200
	
134
	SetEventMask(0x27);
201
	SetEventMask(0x27);
135
	loop()
202
	loop()
136
	{
203
	{
137
      switch(WaitEvent())
204
      switch(WaitEvent())
138
      {
-
 
139
		case evMouse:
-
 
140
			mouse.get();
-
 
141
			if (tview.MouseScroll(mouse.vert)) DrawText();
205
      {
-
 
206
		case evMouse:
142
		
207
			menu_bar_mouse stdcall (#menudata1);
143
			menu_bar_mouse stdcall (#menudata1);			
208
			menu_bar_mouse stdcall (#menudata2);
144
			if (menudata1.click)
209
			if (menudata1.click==1)
145
			{
210
			{
146
				switch(menudata1.cursor_out)
211
				switch(menudata1.cursor_out)
147
				{
212
				{
Line 151... Line 216...
151
						Prepare();
216
						Prepare();
152
						draw_window();
217
						draw_window();
153
						break;
218
						break;
154
					case 2:
219
					case 2:
155
						read = 0;
220
						read = 0;
156
						tview.cur_y = 0;
-
 
157
						strcpy(#win_title, TITLE);
221
						strcpy(#win_title, TITLE);
158
						FreeBuf();
222
						FreeBuf();
159
						draw_window();
223
						draw_window();
160
						break;
224
						break;
161
					case 3:
225
					case 3:
Line 172... Line 236...
172
						break;
236
						break;
173
					case 4:
237
					case 4:
174
						ExitProcess();
238
						ExitProcess();
175
				}
239
				}
176
			}
240
			}
-
 
241
			if (menudata2.click==1)
-
 
242
			{
-
 
243
				encoding = menudata2.cursor_out - 1;
-
 
244
				OpenFile(#openfile_path);
-
 
245
				Prepare();
-
 
246
				draw_window();
-
 
247
			}
177
			break;
248
			break;
Line 178... Line 249...
178
		
249
		
179
        case evButton:
250
        case evButton:
180
            id=GetButtonID();               
251
			id=GetButtonID();               
181
            if (id==1) ExitProcess();
252
            if (id==1) || (id==10) ExitProcess();
Line 182... Line 253...
182
			break;
253
			break;
183
      
-
 
184
        case evKey:
254
		
185
			if (Form.status_window>2) break;
-
 
186
			GetKeys();
255
        case evKey:
187
			if (tview.ProcessKey(key_scancode)) DrawText();
256
            GetKeys();
188
			if (TestBit(key_modifier, 2))
257
			if (TestBit(key_modifier, 2))
189
			{
258
			{
190
				switch(key_scancode)
259
				switch(key_scancode)
Line 198... Line 267...
198
				}
267
				}
199
				break;
268
				break;
200
			}
269
			}
201
			switch (key_scancode)
270
			switch (key_scancode)
202
			{
271
			{
-
 
272
				if (Form.status_window>2) break;
203
				/*case SCAN_CODE_HOME:
273
				case SCAN_CODE_HOME:
-
 
274
					cur_row = 0;
-
 
275
					DrawText();
-
 
276
					break;
204
				case SCAN_CODE_END:
277
				case SCAN_CODE_END:
-
 
278
					cur_row = row_num - row_count - 1;
-
 
279
					DrawText();
-
 
280
					break;
205
				case SCAN_CODE_UP:
281
				case SCAN_CODE_UP:
-
 
282
					if (!cur_row) break;
-
 
283
					else cur_row = cur_row-1;
-
 
284
					DrawText();
-
 
285
					break;
206
				case SCAN_CODE_DOWN:
286
				case SCAN_CODE_DOWN:
207
					if (tview.ProcessKey(key_scancode)) DrawText();
287
					if (cur_row+row_count>=row_num) break;
-
 
288
					cur_row = cur_row+1;
-
 
289
					DrawText();
208
					break;*/
290
					break;
209
				case SCAN_CODE_PGUP:
291
				case SCAN_CODE_PGUP:
210
					if (!tview.cur_y) break;
292
					if (!cur_row) break;
211
					if (tview.cur_y
293
					if (cur_row
212
					else tview.cur_y = tview.cur_y-tview.visible;
294
					else cur_row = cur_row-row_count;
213
					DrawText();
295
					DrawText();
214
					break;
296
					break;
215
				case SCAN_CODE_PGDN:
297
				case SCAN_CODE_PGDN:
216
					if (tview.cur_y+tview.visible>tview.count) break;
298
					if (cur_row+row_count>row_num) break;
217
					tview.cur_y = tview.cur_y+tview.visible;
299
					cur_row = cur_row+row_count;
218
					DrawText();
300
					DrawText();
219
					break;
301
					break;
220
			}
302
			}
221
			break;
303
			break;
Line 231... Line 313...
231
void draw_window()
313
void draw_window()
232
{
314
{
233
	system.color.get();
315
	system.color.get();
234
	DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,0xFFFFFF,#win_title);
316
	DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,0xFFFFFF,#win_title);
235
	GetProcessInfo(#Form, SelfInfo);
317
	GetProcessInfo(#Form, SelfInfo);
236
	if (Form.status_window>2) return;
-
 
237
	tview.SetSizes(0, TOPPANELH, Form.cwidth, Form.cheight-BOTPANELH-TOPPANELH, 12);
-
 
238
	DrawBar(0, 0, Form.cwidth, TOPPANELH, system.color.work);
318
	DrawBar(0, 0, Form.cwidth, TOPPANELH, system.color.work);
239
	DrawBar(0, Form.cheight-BOTPANELH, Form.cwidth, BOTPANELH, system.color.work);
319
	DrawBar(0, Form.cheight-BOTPANELH, Form.cwidth, BOTPANELH, system.color.work);
Line 240... Line 320...
240
	
320
	
-
 
321
	menudata1.bckg_col = system.color.work;
241
	menudata1.bckg_col = system.color.work;
322
	menudata2.bckg_col = system.color.work;
-
 
323
	menu_bar_draw stdcall (#menudata1);
Line 242... Line 324...
242
	menu_bar_draw stdcall (#menudata1);
324
	menu_bar_draw stdcall (#menudata2);
243
	
325
	
244
	if (old_width!=Form.width) || (old_height!=Form.height)
326
	if (old_width!=Form.width) || (old_height!=Form.height)
245
	{
327
	{
-
 
328
		old_width = Form.width;
-
 
329
		old_height = Form.height;
-
 
330
		
-
 
331
		col_count = Form.cwidth/6;
-
 
332
		row_count = Form.cheight-BOTPANELH-TOPPANELH-2;
246
		old_width = Form.width;
333
		row_count = row_count/10;
247
		old_height = Form.height;
-
 
248
		if (read==1) Prepare();
334
	
249
		tview.debug_values();
335
		if (read==1) Prepare();
250
	}
336
	}
251
	if (read==1) 
337
	if (read==1) 
252
	{
338
	{
253
		DrawText();
339
		DrawText();
254
	}
340
	}
Line 255... Line 341...
255
	else DrawBar(tview.x, tview.y, tview.w, tview.h, 0xFFFFFF);
341
	else DrawBar(0, TOPPANELH, Form.cwidth, Form.cheight-BOTPANELH-TOPPANELH, 0xFFFFFF);
256
}
342
}
257
 
343
 
Line 267... Line 353...
267
		mem_Free(bufpointer);
353
		mem_Free(bufpointer);
268
		bufpointer = mem_Alloc(bufsize);
354
		bufpointer = mem_Alloc(bufsize);
269
		ReadFile(0, bufsize, bufpointer, path);
355
		ReadFile(0, bufsize, bufpointer, path);
270
		read=1;
356
		read=1;
271
	}
357
	}
-
 
358
	if (encoding!=CH_CP866) ChangeCharset(charsets[encoding], "CP866", bufpointer);
272
}
359
}
Line 273... Line 360...
273
 
360
 
274
void FreeBuf()
361
void FreeBuf()
275
{
362
{
276
	int i;
363
	int i;
277
	for (i=0; i
364
	for (i=0; i
278
	{
365
	{
279
		mem_Free(DSDWORD[i*4+draw_sruct]);
366
		mem_Free(DSDWORD[i*4+draw_sruct]);
280
	}
367
	}
281
	mem_Free(draw_sruct);
368
	mem_Free(draw_sruct);
282
	mem_Free(bufpointer);
369
	mem_Free(bufpointer);
Line 283... Line 370...
283
}
370
}
284
 
371
 
285
void Prepare()
372
void Prepare()
286
{
-
 
287
	int i, sub_pos;
373
{
288
	static int cur_pos;
374
	int i, sub_pos;
289
	int len_str = 0;
375
	int len_str = 0;
290
	byte do_eof = 0;
376
	byte do_eof = 0;
291
	word bukva[2];
377
	word bukva[2];
292
	dword address;
378
	dword address;
293
	tview.count = 0;
379
	row_num = 0;
294
	while(1)
380
	while(1)
295
	{
381
	{
296
		while(1)
382
		while(1)
297
		{
383
		{
298
			bukva = DSBYTE[bufpointer+cur_pos+len_str];
384
			bukva = DSBYTE[bufpointer+pos+len_str];
299
			if (bukva=='\0')
385
			if (bukva=='\0')
300
			{
386
			{
301
				do_eof = 1;
387
				do_eof = 1;
302
				break;
388
				break;
303
			}
389
			}
304
			if (bukva==0x0a) break;
390
			if (bukva==0x0a) break;
305
			else len_str++;
391
			else len_str++;
306
		}
392
		}
307
		if (len_str<=tview.column_max)
393
		if (len_str<=col_count)
308
		{
394
		{
309
			cur_pos=cur_pos+len_str+1;
395
			pos=pos+len_str+1;
310
			tview.count++;
396
			row_num++;
311
		}
397
		}
312
		else
398
		else
313
		{
399
		{
314
			cur_pos=cur_pos+tview.column_max;
400
			pos=pos+col_count;
315
			tview.count++;
401
			row_num++;
316
		}
402
		}
317
		len_str = 0;
403
		len_str = 0;
318
		if (do_eof) break;
404
		if (do_eof) break;
319
	}
405
	}
320
	mem_Free(draw_sruct);
406
	mem_Free(draw_sruct);
321
	draw_sruct = mem_Alloc(tview.count*4);
407
	draw_sruct = mem_Alloc(row_num*4);
322
	cur_pos=0;
408
	pos=0;
323
	sub_pos=0;
409
	sub_pos=0;
324
	len_str = 0;
410
	len_str = 0;
325
	do_eof = 0;
411
	do_eof = 0;
326
	while(1)
412
	while(1)
327
	{
413
	{
328
		while(1)
414
		while(1)
329
		{
415
		{
330
			bukva = DSBYTE[bufpointer+cur_pos+len_str];
416
			bukva = DSBYTE[bufpointer+pos+len_str];
331
			if (bukva=='\0')
417
			if (bukva=='\0')
332
			{
418
			{
333
				do_eof = 1;
419
				do_eof = 1;
334
				break;
420
				break;
335
			}
421
			}
336
			if (bukva==0x0a) break;
422
			if (bukva==0x0a) break;
337
			else len_str++;
423
			else len_str++;
338
		}
424
		}
339
		if (len_str<=tview.column_max)
425
		if (len_str<=col_count)
340
		{
426
		{
341
			address = mem_Alloc(len_str+1);
427
			address = mem_Alloc(len_str+1);
342
			ESDWORD[sub_pos*4+draw_sruct] = address;
428
			ESDWORD[sub_pos*4+draw_sruct] = address;
343
			strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+cur_pos, len_str);
429
			strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+pos, len_str);
344
			cur_pos=cur_pos+len_str+1;
430
			pos=pos+len_str+1;
345
			sub_pos++;
431
			sub_pos++;
346
		}
432
		}
347
		else
433
		else
348
		{
434
		{
349
			address = mem_Alloc(len_str+1);
435
			address = mem_Alloc(len_str+1);
350
			ESDWORD[sub_pos*4+draw_sruct] = address;
436
			ESDWORD[sub_pos*4+draw_sruct] = address;
351
			strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+cur_pos, tview.column_max);
437
			strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+pos, col_count);
352
			cur_pos=cur_pos+tview.column_max;
438
			pos=pos+col_count;
353
			sub_pos++;
439
			sub_pos++;
354
		}
440
		}
355
		len_str = 0;
441
		len_str = 0;
356
		if (cur_pos>=bufsize-1) break;
442
		if (pos>=bufsize-1) break;
357
	}
443
	}
Line 358... Line 444...
358
	cur_pos=0;
444
	pos=0;
359
}
445
}
360
 
446
 
361
void DrawText()
447
void DrawText()
362
{
448
{
363
	int i, top, num_line;
449
	int i, top, num_line;
364
	if (tview.count
450
	if (row_num
365
	else
451
	else
366
	{
452
	{
367
		if (tview.count-tview.cur_y<=tview.visible) top = tview.count-tview.cur_y-1;
453
		if (row_num-cur_row<=row_count) top = row_num-cur_row-1;
368
		else top = tview.visible;
454
		else top = row_count;
369
	}
455
	}
370
	DrawBar(tview.x, tview.y, tview.w, 3, 0xFFFFFF);
456
	DrawBar(0, TOPPANELH, Form.cwidth, 3, 0xFFFFFF);
371
	for (i=0, num_line = tview.cur_y; i
457
	for (i=0, num_line = cur_row; i
372
	{
458
	{
373
		DrawBar(tview.x, i * tview.item_h + tview.y + 3, tview.w, tview.item_h, 0xFFFFFF);
459
		DrawBar(0, i*10+TOPPANELH+3, Form.cwidth, 10, 0xFFFFFF);
374
		WriteText(tview.x + 2, i * tview.item_h + tview.y + 3, 0x80, 0x000000, DSDWORD[num_line*4+draw_sruct]);
460
		WriteText(2, i*10+TOPPANELH+3, 0x80, 0x000000, DSDWORD[num_line*4+draw_sruct]);
Line 375... Line 461...
375
	}
461
	}
376
	DrawBar(0, i * tview.item_h + tview.y + 3, tview.w, -i* tview.item_h + tview.h, 0xFFFFFF);
462
	DrawBar(0, i*10+TOPPANELH+3, Form.cwidth, -i*10-TOPPANELH-BOTPANELH+Form.cheight, 0xFFFFFF);
377
}
463
}