17,6 → 17,7 |
#include "../lib/obj/box_lib.h" |
|
#include "../lib/patterns/rgb.h" |
#include "../lib/patterns/toolbar_button.h" |
|
#include "colors_mas.h" |
|
36,10 → 37,11 |
®¯¨à®¢ âì|Ctrl+C |
áâ ¢¨âì|Ctrl+V"; |
char image_menu_items[] = |
"®«¨ç¥á⢮ ¨á¯®«ì§®¢ ëå 梥⮢ |
¬¥¨âì ¢á¥ æ¢¥â 1 2"; |
"®áç¨â âì ª®«¨ç¥á⢮ 㨪 «ìëå 梥⮢ |
¬¥¨âì ¢á¥ æ¢¥â 1 2 |
஢¥à¨âì ¨ª®ªã"; |
?define T_MENU_IMAGE "ª®ª " |
?define T_TEST_ICON "஢¥à¨âì ¨ª®ªã" |
?define T_TEST_ICON "஢¥àª ¨ª®ª¨" |
?define T_TITLE "¥¤ ªâ®à ¨ª®®ª 0.70a Beta" |
?define T_UNIC_COLORS_COUNT "'¨ª «ìëå 梥⮢: %i.' -I" |
?define T_TOO_BIG_IMAGE_FOR_PREVIEW "'IconEdit |
53,8 → 55,9 |
Copy|Ctrl+C |
Paste|Ctrl+V"; |
char image_menu_items[] = |
"Count colors used |
Replace all colors equal to 1 by 2"; |
"Count unic colors used |
Replace all colors equal to 1 by 2 |
Test icon"; |
?define T_MENU_IMAGE "Icon" |
?define T_TEST_ICON "Test Icon" |
?define T_TITLE "Icon Editor 0.70 Beta" |
68,10 → 71,11 |
|
|
|
#define TOPBAR_H 24+8 |
#define LEFTBAR_W 16+5+5+3+3 |
#define PALLETE_SIZE 116 |
|
#define TOPBAR_H 24+8 |
int leftbar_w; |
|
#define PAL_ITEMS_X_COUNT 13 |
#define COLSIZE 18 |
#define RIGHT_BAR_W PAL_ITEMS_X_COUNT*COLSIZE |
80,7 → 84,7 |
#define TO_CANVAS_Y(yval) yval - canvas.y/zoom.value |
|
block canvas = { NULL, NULL, NULL, NULL }; |
block wrapper = { LEFTBAR_W, TOPBAR_H, NULL, NULL }; |
block wrapper = { 0, TOPBAR_H, NULL, NULL }; |
block right_bar = { NULL, 10+TOPBAR_H, RIGHT_BAR_W+10, NULL }; |
block image_menu_btn = { NULL, 4, NULL, 22 }; |
|
173,6 → 177,7 |
|
top_icons.load("/sys/icons16.png"); |
left_icons.load("/sys/icons16.png"); |
leftbar_w = left_icons.w + 16; |
|
sc.get(); |
bg_dark = skin_is_dark(); |
300,7 → 305,7 |
} |
} |
|
void DrawTopPanelButton(dword _event, _hotkey, _x, _icon_n) |
void DrawTopPanelButton1(dword _event, _hotkey, _x, _icon_n) |
{ |
DrawWideRectangle(_x, 4, 22, 22, 3, semi_white); |
PutPixel(_x,4,sc.work); |
308,7 → 313,9 |
PutPixel(_x+21,4,sc.work); |
PutPixel(_x+21,4+21,sc.work); |
DefineHiddenButton(_x, 4, 21, 21, button.add(_event)); |
img_draw stdcall(top_icons.image, _x+3, 7, 16, 16, 0, _icon_n*16); |
img_draw stdcall(top_icons.image, -top_icons.w+16/2+_x+3, -top_icons.w+16/2+7, left_icons.w, |
left_icons.w, 0, _icon_n*left_icons.w); |
//DrawTopPanelButton(button.add(_event), _x, 5, _icon_n, false); |
if (_hotkey) key.add_n(_hotkey, _event); |
} |
|
330,9 → 337,10 |
void DrawLeftPanelButton(dword _event, _hotkey, _y, _icon_n) |
{ |
int x = 5; |
DrawRectangle(x, _y, 22-1, 22-1, sc.work); |
DefineHiddenButton(x, _y, 21, 21, button.add(_event)); |
img_draw stdcall(left_icons.image, x+3, _y+3, 16, 16, 0, _icon_n*16); |
DrawRectangle(x, _y, left_icons.w + 5, left_icons.w + 5, sc.work); |
DefineHiddenButton(x, _y, left_icons.w + 5, left_icons.w + 5, button.add(_event)); |
img_draw stdcall(left_icons.image, x+3, _y+3, left_icons.w, |
left_icons.w, 0, _icon_n*left_icons.w); |
key.add_n(_hotkey, _event); |
} |
void DrawStatusBar() |
357,6 → 365,8 |
{ |
#define GAPH 27 |
#define GAPV 28 |
#define GAP_S 26+5 |
#define GAP_B 26+18 |
#define BLOCK_SPACE 10 |
incn tx; |
incn ty; |
374,27 → 384,26 |
DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, sc.work); |
DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, sc.work_graph); |
|
DrawTopPanelButton(#EventCreateNewIcon, ECTRL + SCAN_CODE_KEY_N, tx.set(5), 2); |
DrawTopPanelButton(#EventOpenIcon, ECTRL + SCAN_CODE_KEY_O, tx.inc(GAPH), 0); |
DrawTopPanelButton(#EventSaveIconToFile, ECTRL + SCAN_CODE_KEY_S, tx.inc(GAPH), 5); |
DrawTopPanelButton(#EventMoveLeft, ECTRL + SCAN_CODE_LEFT, tx.inc(GAPH+BLOCK_SPACE), 30); |
DrawTopPanelButton(#EventMoveRight, ECTRL + SCAN_CODE_RIGHT, tx.inc(GAPH), 31); |
DrawTopPanelButton(#EventMoveUp, ECTRL + SCAN_CODE_UP, tx.inc(GAPH), 32); |
DrawTopPanelButton(#EventMoveDown, ECTRL + SCAN_CODE_DOWN, tx.inc(GAPH), 33); |
DrawTopPanelButton(#EventFlipHor, 0, tx.inc(GAPH+BLOCK_SPACE), 34); |
DrawTopPanelButton(#EventFlipVer, 0, tx.inc(GAPH), 35); |
DrawTopPanelButton(#EventRotateLeft, ECTRL + SCAN_CODE_KEY_L, tx.inc(GAPH), 37); |
DrawTopPanelButton(#EventRotateRight, ECTRL + SCAN_CODE_KEY_R, tx.inc(GAPH), 36); |
DrawTopPanelButton(#EventTestIcon, ECTRL + SCAN_CODE_KEY_T, tx.inc(GAPH+BLOCK_SPACE), 12); |
DrawTopPanelButton(#EventCrop, 0, tx.inc(GAPH+BLOCK_SPACE), 46); |
DrawTopPanelButton1(#EventCreateNewIcon, ECTRL + SCAN_CODE_KEY_N, tx.set(5), 2); |
DrawTopPanelButton1(#EventOpenIcon, ECTRL + SCAN_CODE_KEY_O, tx.inc(GAP_S), 0); |
DrawTopPanelButton1(#EventSaveIconToFile, ECTRL + SCAN_CODE_KEY_S, tx.inc(GAP_S), 5); |
DrawTopPanelButton1(#EventMoveLeft, ECTRL + SCAN_CODE_LEFT, tx.inc(GAP_B), 30); |
DrawTopPanelButton1(#EventMoveRight, ECTRL + SCAN_CODE_RIGHT, tx.inc(GAP_S), 31); |
DrawTopPanelButton1(#EventMoveUp, ECTRL + SCAN_CODE_UP, tx.inc(GAP_S), 32); |
DrawTopPanelButton1(#EventMoveDown, ECTRL + SCAN_CODE_DOWN, tx.inc(GAP_S), 33); |
DrawTopPanelButton1(#EventFlipHor, 0, tx.inc(GAP_B), 34); |
DrawTopPanelButton1(#EventFlipVer, 0, tx.inc(GAP_S), 35); |
DrawTopPanelButton1(#EventRotateLeft, ECTRL + SCAN_CODE_KEY_L, tx.inc(GAP_S), 37); |
DrawTopPanelButton1(#EventRotateRight, ECTRL + SCAN_CODE_KEY_R, tx.inc(GAP_S), 36); |
DrawTopPanelButton1(#EventCrop, 0, tx.inc(GAP_B), 46); |
|
image_menu_btn.x = tx.inc(GAPH+BLOCK_SPACE); |
image_menu_btn.x = tx.inc(GAP_B); |
image_menu_btn.w = DrawFlatPanelButton(button.add(#EventShowImageMenu), image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE); |
//tx.inc(image_menu_btn.w + BLOCK_SPACE); |
|
DrawEditArea(); |
|
DrawBar(0, TOPBAR_H, LEFTBAR_W-1, Form.cheight - TOPBAR_H, sc.work); |
DrawBar(0, TOPBAR_H, leftbar_w-1, Form.cheight - TOPBAR_H, sc.work); |
|
ty.n = right_bar.y - GAPV - 2; |
|
409,6 → 418,7 |
DrawLeftPanelSelection(); |
|
button.add_n(1, #EventExitIconEdit); |
key.add_n(ECTRL + SCAN_CODE_KEY_T, #EventTestIcon); |
|
DrawBar(wrapper.x+wrapper.w, TOPBAR_H, Form.cwidth-wrapper.x-wrapper.w, |
Form.cheight - TOPBAR_H, sc.work); |
416,7 → 426,7 |
DrawColorPallets(); |
DrawPreview(); |
|
DrawBar(LEFTBAR_W-1, wrapper.y + wrapper.h, wrapper.w+1, |
DrawBar(leftbar_w-1, wrapper.y + wrapper.h, wrapper.w+1, |
Form.cheight - wrapper.y - wrapper.h, sc.work); |
DrawStatusBar(); |
} |
423,8 → 433,8 |
|
void DrawLeftPanelSelection() |
{ |
if (previousTool!=-1) DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, 16+3+2, 16+3+2, sc.work, sc.work); |
DrawRectangle3D(5, currentTool*GAPV+right_bar.y-2, 16+3+2, 16+3+2, 0x333333, 0x777777); |
if (previousTool!=-1) DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, left_icons.w+5, left_icons.w+5, sc.work, sc.work); |
DrawRectangle3D(5, currentTool*GAPV+right_bar.y-2, left_icons.w+5, left_icons.w+5, 0x333333, 0x777777); |
} |
|
void DrawEditArea() |
433,6 → 443,7 |
int top_side; |
int left_side; |
|
wrapper.x = left_icons.w + 16; |
wrapper.w = Form.cwidth - right_bar.w - 10 - wrapper.x; |
wrapper.h = Form.cheight - TOPBAR_H - 35; |
|
761,6 → 772,9 |
case 2: |
EventReplaceImageColors(color1, color2); |
break; |
case 3: |
EventTestIcon(); |
break; |
} |
} |
|