Subversion Repositories Kolibri OS

Rev

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

Rev 7450 Rev 7521
Line 2... Line 2...
2
 * Icon Editor for KolibriOS
2
 * Icon Editor for KolibriOS
3
 * Authors: Leency, Nicolas
3
 * Authors: Leency, Nicolas
4
 * Licence: GPL v2
4
 * Licence: GPL v2
5
*/
5
*/
Line 6... Line 6...
6
 
6
 
Line 7... Line 7...
7
#define MEMSIZE 4096*500
7
#define MEMSIZE 1024*2000
8
 
8
 
9
#include "../lib/gui.h"
9
#include "../lib/gui.h"
10
#include "../lib/random.h"
10
#include "../lib/random.h"
11
#include "../lib/mem.h"
11
#include "../lib/mem.h"
-
 
12
#include "../lib/cursor.h"
Line 12... Line 13...
12
#include "../lib/cursor.h"
13
#include "../lib/list_box.h"
13
#include "../lib/list_box.h"
14
#include "../lib/events.h"
Line 14... Line 15...
14
 
15
 
Line 34... Line 35...
34
char image_menu_items[] = 
35
char image_menu_items[] = 
35
"Š®«¨ç¥á⢮ ¨á¯®«ì§®¢ ­­ëå 梥⮢
36
"Š®«¨ç¥á⢮ ¨á¯®«ì§®¢ ­­ëå 梥⮢
36
‡ ¬¥­¨âì ¢á¥ æ¢¥â  1 ­  2";
37
‡ ¬¥­¨âì ¢á¥ æ¢¥â  1 ­  2";
37
?define T_MENU_IMAGE "ˆª®­ª "
38
?define T_MENU_IMAGE "ˆª®­ª "
38
?define T_TEST_ICON "à®¢¥à¨âì ¨ª®­ªã"
39
?define T_TEST_ICON "à®¢¥à¨âì ¨ª®­ªã"
39
?define T_TITLE "Icon Editor 0.59 Alpha"
40
?define T_TITLE "Icon Editor 0.60 Alpha"
40
#else
41
#else
41
char image_menu_items[] = 
42
char image_menu_items[] = 
42
"Count colors used
43
"Count colors used
43
Replace all colors equal to 1 by 2";
44
Replace all colors equal to 1 by 2";
44
?define T_MENU_IMAGE "Icon"
45
?define T_MENU_IMAGE "Icon"
45
?define T_TEST_ICON "Test Icon"
46
?define T_TEST_ICON "Test Icon"
46
?define T_TITLE "¥¤ ªâ®à ¨ª®­®ª 0.59 Alpha"
47
?define T_TITLE "¥¤ ªâ®à ¨ª®­®ª 0.60 Alpha"
47
#endif
48
#endif
Line 48... Line 49...
48
 
49
 
Line 79... Line 80...
79
signed hoverY;
80
signed hoverY;
80
signed priorHoverX;
81
signed priorHoverX;
81
signed priorHoverY;
82
signed priorHoverY;
82
bool canvasMouseMoved = false;
83
bool canvasMouseMoved = false;
Line -... Line 84...
-
 
84
 
-
 
85
EVENTS button;
-
 
86
EVENTS key;
83
 
87
 
84
enum {
-
 
85
	BTN_NEW = 40,
-
 
86
	BTN_OPEN,
-
 
87
	BTN_SAVE,
-
 
88
	BTN_MOVE_LEFT,
-
 
89
	BTN_MOVE_RIGHT,
-
 
90
	BTN_MOVE_UP,
-
 
91
	BTN_MOVE_DOWN,
-
 
92
	BTN_FLIP_HOR,
-
 
93
	BTN_FLIP_VER,
-
 
94
	BTN_ROTATE_LEFT,
-
 
95
	BTN_ROTATE_RIGHT,
-
 
96
	BTN_TEST_ICON,
-
 
97
	BTN_PENCIL,
-
 
98
	BTN_PICK,
-
 
99
	BTN_FILL,
-
 
100
	BTN_LINE,
-
 
101
	BTN_RECT,
-
 
102
	BTN_BAR,
-
 
103
	BTN_SELECT,
-
 
104
	BTN_SCREEN_COPY,
-
 
105
	BTN_ZOOM_IN,
-
 
106
	BTN_ZOOM_OUT,
-
 
107
	BTN_CANVAS_RESIZE,
-
 
108
	BTN_CROP,
-
 
109
	BTN_IMAGE_MENU,
88
enum {
110
	BTNS_PALETTE_COLOR_MAS = 100,
89
	BTNS_PALETTE_COLOR_MAS = 100,
111
	BTNS_LAST_USED_COLORS = 400
90
	BTNS_LAST_USED_COLORS = 400
Line 112... Line 91...
112
};
91
};
Line 270... Line 249...
270
			if (Window_CanvasReSize.thread_exists()) break;
249
			if (Window_CanvasReSize.thread_exists()) break;
271
			btn = GetButtonID();
250
			btn = GetButtonID();
Line 272... Line 251...
272
 
251
 
Line 273... Line -...
273
			if (zoom.click(btn)) DrawEditArea();
-
 
274
 
-
 
275
			switch(btn)
-
 
276
			{
-
 
277
				case BTN_NEW:
-
 
278
					EventCreateNewIcon();
-
 
279
					break;
-
 
280
				case BTN_OPEN:
-
 
281
					EventOpenIcon();
-
 
282
					break;
-
 
283
				case BTN_SAVE:
-
 
284
					EventSaveIconToFile();
-
 
285
					break;
-
 
286
				case BTN_MOVE_LEFT:
-
 
287
					EventMove(MOVE_LEFT);
-
 
288
					break;
-
 
289
				case BTN_MOVE_RIGHT:
-
 
290
					EventMove(MOVE_RIGHT);
-
 
291
					break;
-
 
292
				case BTN_MOVE_UP:
-
 
293
					EventMove(MOVE_UP);
-
 
294
					break;
-
 
295
				case BTN_MOVE_DOWN:
-
 
296
					EventMove(MOVE_DOWN);
-
 
297
					break;
-
 
298
				case BTN_FLIP_VER:
-
 
299
					EventMove(FLIP_VER);
-
 
300
					break;
-
 
301
				case BTN_FLIP_HOR:
-
 
302
					EventMove(FLIP_HOR);
-
 
303
					break;
-
 
304
				case BTN_ROTATE_LEFT:
-
 
305
					EventMove(ROTATE_LEFT);
-
 
306
					break;
-
 
307
				case BTN_ROTATE_RIGHT:
-
 
308
					EventMove(ROTATE_RIGHT);
-
 
309
					break;
252
			if (zoom.click(btn)) DrawEditArea();
310
				case BTN_TEST_ICON:
-
 
311
					EventTestIcon();
-
 
312
					break;
-
 
313
				case BTN_PENCIL:
-
 
314
					setCurrentTool(TOOL_PENCIL);
-
 
315
					break;
-
 
316
				case BTN_PICK:
-
 
317
					setCurrentTool(TOOL_PIPETTE);
-
 
318
					break;
-
 
319
				case BTN_FILL:
-
 
320
					setCurrentTool(TOOL_FILL);
-
 
321
					break;
-
 
322
				case BTN_LINE:
-
 
323
					setCurrentTool(TOOL_LINE);
-
 
324
					break;
-
 
325
				case BTN_RECT:
-
 
326
					setCurrentTool(TOOL_RECT);
-
 
327
					break;
-
 
328
				case BTN_BAR:
-
 
329
					setCurrentTool(TOOL_BAR);
-
 
330
					break;
-
 
331
				case BTN_SELECT:
-
 
332
					setCurrentTool(TOOL_SELECT);
-
 
333
					break;
-
 
334
				case BTN_SCREEN_COPY:
-
 
335
					setCurrentTool(TOOL_SCREEN_COPY);
-
 
336
					break;
-
 
337
				case BTN_CANVAS_RESIZE:
-
 
338
					notify("Sorry, not implemented yet.");
-
 
339
					break;
-
 
340
				case BTN_CROP:
-
 
341
					EventCrop();
-
 
342
					break;
-
 
343
				case BTN_IMAGE_MENU:
-
 
344
					EventShowImageMenu();
-
 
345
					break;
-
 
346
				case CLOSE_BTN:
-
 
347
					EventExitIconEdit();
-
 
348
					break;
-
 
Line 349... Line 253...
349
			}
253
 
350
			break;
254
			button.press(btn);
Line 351... Line 255...
351
	  
255
	  
352
		case evKey:
-
 
353
			GetKeys();
-
 
354
 
-
 
355
			if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL)
-
 
356
			{
-
 
357
				switch(key_scancode)
-
 
358
				{
-
 
359
					case SCAN_CODE_KEY_S:
-
 
360
						EventSaveIconToFile();
-
 
361
						break;
-
 
362
					case SCAN_CODE_KEY_O:
-
 
363
						EventOpenIcon();
-
 
364
						break;
-
 
365
					case SCAN_CODE_LEFT:
-
 
366
						EventMove(MOVE_LEFT);
-
 
367
						break;
-
 
368
					case SCAN_CODE_RIGHT:
-
 
369
						EventMove(MOVE_RIGHT);
-
 
370
						break;
-
 
371
					case SCAN_CODE_UP:
-
 
372
						EventMove(MOVE_UP);
-
 
373
						break;
-
 
374
					case SCAN_CODE_DOWN:
-
 
375
						EventMove(MOVE_DOWN);
-
 
376
						break;
-
 
377
					case SCAN_CODE_KEY_R:
-
 
378
						EventMove(BTN_ROTATE_RIGHT);
-
 
379
						break;
-
 
380
					case SCAN_CODE_KEY_L:
-
 
Line 381... Line 256...
381
						EventMove(BTN_ROTATE_LEFT);
256
		case evKey:
382
						break;
257
			GetKeys();
383
				}
258
 
Line 384... Line 259...
384
			}
259
			if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) key.press(ECTRL + key_scancode);
385
 
260
 
Line 386... Line -...
386
			if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
-
 
387
				if (key_scancode == SCAN_CODE_DEL) EventCleanCanvas();
-
 
388
			}
-
 
389
 
-
 
390
			if (currentTool != TOOL_NONE) && (tools[currentTool].onKeyEvent != 0)
-
 
391
				tools[currentTool].onKeyEvent(key_scancode);
-
 
392
 
-
 
393
			if (key_scancode == SCAN_CODE_KEY_P) setCurrentTool(TOOL_PENCIL);
-
 
394
			if (key_scancode == SCAN_CODE_KEY_I) setCurrentTool(TOOL_PIPETTE);
261
			if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
Line 395... Line 262...
395
			if (key_scancode == SCAN_CODE_KEY_F) setCurrentTool(TOOL_FILL);
262
				if (key_scancode == SCAN_CODE_DEL) EventCleanCanvas();
396
			if (key_scancode == SCAN_CODE_KEY_L) setCurrentTool(TOOL_LINE);
263
			}
Line 397... Line 264...
397
			if (key_scancode == SCAN_CODE_KEY_R) setCurrentTool(TOOL_RECT);
264
 
Line 414... Line 281...
414
			DrawWindow();
281
			DrawWindow();
415
			break;
282
			break;
416
	}
283
	}
417
}
284
}
Line 418... Line 285...
418
 
285
 
419
void DrawTopPanelButton(dword _id, _x, _icon_n)
286
void DrawTopPanelButton(dword _event, _hotkey, _x, _icon_n)
420
{
287
{
421
	DrawWideRectangle(_x, 4, 22, 22, 3, semi_white);
288
	DrawWideRectangle(_x, 4, 22, 22, 3, semi_white);
422
	PutPixel(_x,4,system.color.work);
289
	PutPixel(_x,4,system.color.work);
423
	PutPixel(_x,4+21,system.color.work);
290
	PutPixel(_x,4+21,system.color.work);
424
	PutPixel(_x+21,4,system.color.work);
291
	PutPixel(_x+21,4,system.color.work);
425
	PutPixel(_x+21,4+21,system.color.work);
292
	PutPixel(_x+21,4+21,system.color.work);
426
	DefineHiddenButton(_x, 4, 21, 21, _id);
293
	DefineHiddenButton(_x, 4, 21, 21, button.add(_event));
-
 
294
	img_draw stdcall(top_icons.image, _x+3, 7, 16, 16, 0, _icon_n*16);
427
	img_draw stdcall(top_icons.image, _x+3, 7, 16, 16, 0, _icon_n*16);
295
	if (_hotkey) key.add_n(_hotkey, _event);
Line -... Line 296...
-
 
296
}
428
}
297
 
429
 
298
 
430
int DrawFlatPanelButton(dword _id, _x, _y, _text)
299
int DrawFlatPanelButton(dword _id, _x, _y, _text)
431
{
300
{
432
	#define P 10
301
	#define P 10
Line 439... Line 308...
439
	DefineHiddenButton(_x, _y, w, 21, _id);
308
	DefineHiddenButton(_x, _y, w, 21, _id);
440
	WriteText(_x+P, _y+7, 0x80, system.color.work_text, _text);
309
	WriteText(_x+P, _y+7, 0x80, system.color.work_text, _text);
441
	return w;
310
	return w;
442
}
311
}
Line 443... Line 312...
443
 
312
 
444
void DrawLeftPanelButton(dword _id, _y, _icon_n)
313
void DrawLeftPanelButton(dword _event, _hotkey, _y, _icon_n)
445
{
314
{
446
	int x = 5;
315
	int x = 5;
447
	DrawRectangle(x, _y, 22-1, 22-1, system.color.work);
316
	DrawRectangle(x, _y, 22-1, 22-1, system.color.work);
448
	DefineHiddenButton(x, _y, 21, 21, _id);
317
	DefineHiddenButton(x, _y, 21, 21, button.add(_event));
-
 
318
	img_draw stdcall(left_icons.image, x+3, _y+3, 16, 16, 0, _icon_n*16);
449
	img_draw stdcall(left_icons.image, x+3, _y+3, 16, 16, 0, _icon_n*16);
319
	key.add_n(_hotkey, _event);
450
}
-
 
451
 
320
}
452
void DrawStatusBar()
321
void DrawStatusBar()
453
{
322
{
Line 454... Line 323...
454
	zoom.draw(wrapper.x, wrapper.y + wrapper.h + 6);
323
	zoom.draw(wrapper.x, wrapper.y + wrapper.h + 6);
455
 
324
 
456
	sprintf(#param,"%i x %i", image.columns, image.rows);
325
	sprintf(#param,"%i x %i", image.columns, image.rows);
457
	DrawCaptButton(
326
	DrawCaptButton(
458
		wrapper.x+wrapper.w-calc(strlen(#param)*8) -6 - 1,
327
		wrapper.x+wrapper.w-calc(strlen(#param)*8) -6 - 1,
459
		zoom.y,
328
		zoom.y,
460
		calc(strlen(#param)*8)+6,
329
		calc(strlen(#param)*8)+6,
461
		18,
330
		18,
462
		BTN_CANVAS_RESIZE,
331
		button.add(#EventCanvasResize),
463
		system.color.work_button,
332
		system.color.work_button,
464
		system.color.work_button_text,
333
		system.color.work_button_text,
465
		#param
334
		#param
Line -... Line 335...
-
 
335
		);
466
		);
336
}
467
}
337
 
468
 
338
 
-
 
339
void DrawWindow()
469
void DrawWindow()
340
{
470
{
341
	#define GAPH 27
-
 
342
	#define GAPV 28
471
	#define GAP 27
343
	#define BLOCK_SPACE 10
472
	#define BLOCK_SPACE 10
344
	incn tx;
473
	incn tx;
345
	incn ty;
474
	system.color.get();
346
	system.color.get();
475
	DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x73, NULL, T_TITLE, 0);
347
	DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x73, NULL, T_TITLE, 0);
476
	GetProcessInfo(#Form, SelfInfo);
348
	GetProcessInfo(#Form, SelfInfo);
-
 
349
	if (Form.status_window>2) return;
-
 
350
	if (Form.width  < 560) { MoveSize(OLD,OLD,560,OLD); return; }
Line 477... Line 351...
477
	if (Form.status_window>2) return;
351
	if (Form.height < 430) { MoveSize(OLD,OLD,OLD,430); return; }
478
	if (Form.width  < 560) { MoveSize(OLD,OLD,560,OLD); return; }
352
	button.init(40);
479
	if (Form.height < 430) { MoveSize(OLD,OLD,OLD,430); return; }
353
	key.init(40);
480
 
354
 
Line 481... Line 355...
481
	right_bar.x = Form.cwidth - right_bar.w;
355
	right_bar.x = Form.cwidth - right_bar.w;
482
	b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x;
356
	b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x;
483
	DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, system.color.work);
357
	DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, system.color.work);
484
	DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, system.color.work_graph);
358
	DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, system.color.work_graph);
485
 
359
 
486
	tx.n = 5-GAP;
360
	tx.n = 5-GAPH;
487
	DrawTopPanelButton(BTN_NEW,    tx.inc(GAP), 2);
361
	DrawTopPanelButton(#EventCreateNewIcon,  ECTRL + SCAN_CODE_KEY_N, tx.inc(GAPH), 2);
488
	DrawTopPanelButton(BTN_OPEN,   tx.inc(GAP), 0); //not implemented
362
	DrawTopPanelButton(#EventOpenIcon,       ECTRL + SCAN_CODE_KEY_O, tx.inc(GAPH), 0);
489
	DrawTopPanelButton(BTN_SAVE,   tx.inc(GAP), 5);
-
 
490
	DrawTopPanelButton(BTN_MOVE_LEFT,  tx.inc(GAP+BLOCK_SPACE), 30);
363
	DrawTopPanelButton(#EventSaveIconToFile, ECTRL + SCAN_CODE_KEY_S, tx.inc(GAPH), 5);
491
	DrawTopPanelButton(BTN_MOVE_RIGHT, tx.inc(GAP),   31);
364
	DrawTopPanelButton(#EventMoveLeft,       ECTRL + SCAN_CODE_LEFT, tx.inc(GAPH+BLOCK_SPACE), 30);
492
	DrawTopPanelButton(BTN_MOVE_UP,    tx.inc(GAP),   32);
365
	DrawTopPanelButton(#EventMoveRight,      ECTRL + SCAN_CODE_RIGHT, tx.inc(GAPH), 31);
493
	DrawTopPanelButton(BTN_MOVE_DOWN,  tx.inc(GAP),   33);
366
	DrawTopPanelButton(#EventMoveUp,         ECTRL + SCAN_CODE_UP, tx.inc(GAPH), 32);
494
	
-
 
495
	DrawTopPanelButton(BTN_FLIP_HOR,   tx.inc(GAP+BLOCK_SPACE), 34);
367
	DrawTopPanelButton(#EventMoveDown,       ECTRL + SCAN_CODE_DOWN, tx.inc(GAPH), 33);
496
	DrawTopPanelButton(BTN_FLIP_VER,   tx.inc(GAP),   35);
-
 
497
	DrawTopPanelButton(BTN_ROTATE_LEFT,   tx.inc(GAP), 37);
368
	DrawTopPanelButton(#EventFlipHor,        0, tx.inc(GAPH+BLOCK_SPACE), 34);
Line 498... Line 369...
498
	DrawTopPanelButton(BTN_ROTATE_RIGHT,  tx.inc(GAP), 36);
369
	DrawTopPanelButton(#EventFlipVer,        0, tx.inc(GAPH), 35);
499
 
370
	DrawTopPanelButton(#EventRotateLeft,     ECTRL + SCAN_CODE_KEY_L, tx.inc(GAPH), 37);
500
	DrawTopPanelButton(BTN_TEST_ICON,  tx.inc(GAP+BLOCK_SPACE), 12);
371
	DrawTopPanelButton(#EventRotateRight,    ECTRL + SCAN_CODE_KEY_R, tx.inc(GAPH), 36);
Line 501... Line 372...
501
 
372
	DrawTopPanelButton(#EventTestIcon,       ECTRL + SCAN_CODE_KEY_T, tx.inc(GAPH+BLOCK_SPACE), 12);
Line 502... Line 373...
502
	DrawTopPanelButton(BTN_CROP,  tx.inc(GAP+BLOCK_SPACE), 46);
373
	DrawTopPanelButton(#EventCrop,           0, tx.inc(GAPH+BLOCK_SPACE), 46);
-
 
374
 
-
 
375
	image_menu_btn.x = tx.n;
-
 
376
	image_menu_btn.w = DrawFlatPanelButton(button.add(#EventShowImageMenu), image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE);
-
 
377
	//tx.inc(image_menu_btn.w + BLOCK_SPACE);
-
 
378
	
-
 
379
	DrawEditArea();
-
 
380
 
-
 
381
	DrawBar(0, TOPBAR_H, LEFTBAR_W-1, Form.cheight - TOPBAR_H, system.color.work);
-
 
382
 
-
 
383
	ty.n = right_bar.y - GAPV - 2;
-
 
384
 
503
 
385
	DrawLeftPanelButton(#EventSelectToolPencil, SCAN_CODE_KEY_P, ty.inc(GAPV), 38);
-
 
386
	DrawLeftPanelButton(#EventSelectToolPick,   SCAN_CODE_KEY_I, ty.inc(GAPV), 39);
-
 
387
	DrawLeftPanelButton(#EventSelectToolFill,   SCAN_CODE_KEY_F, ty.inc(GAPV), 40);
Line 504... Line 388...
504
	image_menu_btn.x = tx.n;
388
	DrawLeftPanelButton(#EventSelectToolLine,   SCAN_CODE_KEY_L, ty.inc(GAPV), 41);
505
	image_menu_btn.w = DrawFlatPanelButton(BTN_IMAGE_MENU, image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE);
389
	DrawLeftPanelButton(#EventSelectToolRect,   SCAN_CODE_KEY_R, ty.inc(GAPV), 42);
506
	//tx.inc(image_menu_btn.w + BLOCK_SPACE);
390
	DrawLeftPanelButton(#EventSelectToolBar,    SCAN_CODE_KEY_B, ty.inc(GAPV), 43);
507
	
391
	DrawLeftPanelButton(#EventSelectToolSelect, SCAN_CODE_KEY_S, ty.inc(GAPV), 44);
Line 519... Line 403...
519
	DrawBar(LEFTBAR_W-1, wrapper.y + wrapper.h, wrapper.w+1, 
403
	DrawBar(LEFTBAR_W-1, wrapper.y + wrapper.h, wrapper.w+1, 
520
		Form.cheight - wrapper.y - wrapper.h, system.color.work);
404
		Form.cheight - wrapper.y - wrapper.h, system.color.work);
521
	DrawStatusBar();
405
	DrawStatusBar();
522
}
406
}
Line 523... Line 407...
523
 
407
 
524
void DrawLeftPanel()
408
void DrawLeftPanelSelection()
525
{
-
 
526
	#define GAP 28
-
 
527
	incn ty;
-
 
528
	ty.n = right_bar.y - GAP - 2;
-
 
529
	DrawLeftPanelButton(BTN_PENCIL, ty.inc(GAP), 38);
-
 
530
	DrawLeftPanelButton(BTN_PICK,   ty.inc(GAP), 39);
-
 
531
	DrawLeftPanelButton(BTN_FILL,   ty.inc(GAP), 40);
-
 
532
	DrawLeftPanelButton(BTN_LINE,   ty.inc(GAP), 41);
-
 
533
	DrawLeftPanelButton(BTN_RECT,   ty.inc(GAP), 42);
-
 
534
	DrawLeftPanelButton(BTN_BAR,    ty.inc(GAP), 43);
-
 
535
	DrawLeftPanelButton(BTN_SELECT, ty.inc(GAP), 44);
409
{
536
	DrawLeftPanelButton(BTN_SCREEN_COPY, ty.inc(GAP), 45);
410
	DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, 16+3+2, 16+3+2, system.color.work, system.color.work);
537
	DrawRectangle3D(5, currentTool*GAP+right_bar.y-2, 16+3+2, 16+3+2, 0x333333, 0x777777);
411
	DrawRectangle3D(5, currentTool*GAPV+right_bar.y-2, 16+3+2, 16+3+2, 0x333333, 0x777777);
Line 538... Line 412...
538
}
412
}
539
 
413
 
540
void DrawEditArea()
414
void DrawEditArea()
Line 893... Line 767...
893
	for (cur=0; cur
767
	for (cur=0; cur
894
		if (image.mas[cur] == color1) image.mas[cur] = color2;
768
		if (image.mas[cur] == color1) image.mas[cur] = color2;
895
	}
769
	}
896
}
770
}
Line -... Line 771...
-
 
771
 
-
 
772
void EventCanvasResize()
-
 
773
{
-
 
774
	notify("Sorry, not implemented yet.");
-
 
775
}
-
 
776
 
-
 
777
void EventMoveLeft() { EventMove(MOVE_LEFT); }
-
 
778
void EventMoveRight() { EventMove(MOVE_RIGHT); }
-
 
779
void EventMoveUp() { EventMove(MOVE_UP); }
-
 
780
void EventMoveDown() { EventMove(MOVE_DOWN); }
-
 
781
void EventFlipHor() { EventMove(FLIP_HOR); }
-
 
782
void EventFlipVer() { EventMove(FLIP_VER); }
-
 
783
void EventRotateLeft() { EventMove(ROTATE_LEFT); }
-
 
784
void EventRotateRight() { EventMove(ROTATE_RIGHT); }
-
 
785
 
-
 
786
void EventSelectToolPencil() { setCurrentTool(TOOL_PENCIL); DrawLeftPanelSelection(); }
-
 
787
void EventSelectToolPick() { setCurrentTool(TOOL_PIPETTE); DrawLeftPanelSelection(); }
-
 
788
void EventSelectToolFill() { setCurrentTool(TOOL_FILL); DrawLeftPanelSelection(); }
-
 
789
void EventSelectToolLine() { setCurrentTool(TOOL_LINE); DrawLeftPanelSelection(); }
-
 
790
void EventSelectToolRect() { setCurrentTool(TOOL_RECT); DrawLeftPanelSelection(); }
-
 
791
void EventSelectToolBar() { setCurrentTool(TOOL_BAR); DrawLeftPanelSelection(); }
-
 
792
void EventSelectToolSelect() { setCurrentTool(TOOL_SELECT); DrawLeftPanelSelection(); }
-
 
793
void EventSelectToolScrCopy() { setCurrentTool(TOOL_SCREEN_COPY); DrawLeftPanelSelection(); }
-
 
794
 
-
 
795
char test_icon_stak22[4096];
897
 
796
 
Line 898... Line 797...
898
stop:
797
stop: