Rev 7823 | Rev 8020 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7823 | Rev 7977 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | // DATA // |
30 | // DATA // |
31 | // // |
31 | // // |
32 | //===================================================// |
32 | //===================================================// |
Line 33... | Line 33... | ||
33 | 33 | ||
- | 34 | #ifdef LANG_RUS |
|
- | 35 | char edit_menu_items[] = |
|
- | 36 | "ë१ âì|Ctrl+X |
|
- | 37 | ®¯¨à®¢ âì|Ctrl+C |
|
34 | #ifdef LANG_RUS |
38 | áâ ¢¨âì|Ctrl+V"; |
35 | char image_menu_items[] = |
39 | char image_menu_items[] = |
36 | "®«¨ç¥á⢮ ¨á¯®«ì§®¢ ëå 梥⮢ |
40 | "®«¨ç¥á⢮ ¨á¯®«ì§®¢ ëå 梥⮢ |
37 | ¬¥¨âì ¢á¥ æ¢¥â 1 2"; |
41 | ¬¥¨âì ¢á¥ æ¢¥â 1 2"; |
38 | ?define T_MENU_IMAGE "ª®ª " |
42 | ?define T_MENU_IMAGE "ª®ª " |
39 | ?define T_TEST_ICON "஢¥à¨âì ¨ª®ªã" |
43 | ?define T_TEST_ICON "஢¥à¨âì ¨ª®ªã" |
40 | ?define T_TITLE "¥¤ ªâ®à ¨ª®®ª 0.60 Alpha" |
44 | ?define T_TITLE "¥¤ ªâ®à ¨ª®®ª 0.70 Beta" |
41 | ?define T_UNIC_COLORS_COUNT "'¨ª «ìëå 梥⮢: %i.' -I" |
45 | ?define T_UNIC_COLORS_COUNT "'¨ª «ìëå 梥⮢: %i.' -I" |
42 | ?define T_TOO_BIG_IMAGE_FOR_PREVIEW "'IconEdit |
46 | ?define T_TOO_BIG_IMAGE_FOR_PREVIEW "'IconEdit |
43 | §®¡à ¦¥¨¥ ᫨誮¬ ¡®«ì讥 ¤«ï ¯à¥¤¯à®á¬®âà !' -tE" |
47 | §®¡à ¦¥¨¥ ᫨誮¬ ¡®«ì讥 ¤«ï ¯à¥¤¯à®á¬®âà !' -tE" |
44 | ?define T_ERROR_CROP_TOOL "'«ï ®¡à¥§ª¨ ¨§®¡à ¦¥¨ï ¢ ç «¥ 㦮 ¢ë¤¥«¨âì ®¡« áâì.' -W" |
48 | ?define T_ERROR_CROP_TOOL "'«ï ®¡à¥§ª¨ ¨§®¡à ¦¥¨ï ¢ ç «¥ 㦮 ¢ë¤¥«¨âì ®¡« áâì.' -W" |
45 | ?define T_ERROR_IMA_ICONEDIT "'â® ¯à®á⮠। ªâ®à ¨ª®®ª, ¢ë¡à ®¥ |
49 | ?define T_ERROR_IMA_ICONEDIT "'â® ¯à®á⮠। ªâ®à ¨ª®®ª, ¢ë¡à ®¥ |
46 | ¨§®¡à ¦¥¨¥ ᫨誮¬ ¢¥«¨ª® ¤«ï ¥£®!' -E" |
50 | ¨§®¡à ¦¥¨¥ ᫨誮¬ ¢¥«¨ª® ¤«ï ¥£®!' -E" |
- | 51 | #else |
|
- | 52 | char edit_menu_items[] = |
|
- | 53 | "Cut|Ctrl+X |
|
- | 54 | Copy|Ctrl+C |
|
47 | #else |
55 | Paste|Ctrl+V"; |
48 | char image_menu_items[] = |
56 | char image_menu_items[] = |
49 | "Count colors used |
57 | "Count colors used |
50 | Replace all colors equal to 1 by 2"; |
58 | Replace all colors equal to 1 by 2"; |
51 | ?define T_MENU_IMAGE "Icon" |
59 | ?define T_MENU_IMAGE "Icon" |
52 | ?define T_TEST_ICON "Test Icon" |
60 | ?define T_TEST_ICON "Test Icon" |
53 | ?define T_TITLE "Icon Editor 0.60 Alpha" |
61 | ?define T_TITLE "Icon Editor 0.70 Beta" |
54 | ?define T_UNIC_COLORS_COUNT "'Image has %i unique colors.' -I" |
62 | ?define T_UNIC_COLORS_COUNT "'Image has %i unique colors.' -I" |
55 | ?define T_TOO_BIG_IMAGE_FOR_PREVIEW "'IconEdit |
63 | ?define T_TOO_BIG_IMAGE_FOR_PREVIEW "'IconEdit |
56 | Image is too big for preview!' -tE" |
64 | Image is too big for preview!' -tE" |
57 | ?define T_ERROR_CROP_TOOL "'You need to select something before using crop tool.' -W" |
65 | ?define T_ERROR_CROP_TOOL "'You need to select something before using crop tool.' -W" |
Line 158... | Line 166... | ||
158 | 166 | ||
159 | void main() |
167 | void main() |
160 | { |
168 | { |
161 | word btn; |
169 | word btn; |
162 | libimg_image open_image; |
- | |
Line 163... | Line 170... | ||
163 | dword bg_col; |
170 | libimg_image open_image; |
164 | 171 | ||
165 | load_dll(libio, #libio_init, 1); |
172 | load_dll(libio, #libio_init, 1); |
Line 166... | Line 173... | ||
166 | load_dll(libimg, #libimg_init, 1); |
173 | load_dll(libimg, #libimg_init, 1); |
167 | load_dll(boxlib, #box_lib_init,0); |
174 | load_dll(boxlib, #box_lib_init,0); |
Line 168... | Line 175... | ||
168 | 175 | ||
169 | Libimg_LoadImage(#top_icons, "/sys/icons16.png"); |
- | |
170 | Libimg_LoadImage(#left_icons, "/sys/icons16.png"); |
176 | top_icons.load("/sys/icons16.png"); |
Line 171... | Line 177... | ||
171 | 177 | left_icons.load("/sys/icons16.png"); |
|
172 | sc.get(); |
178 | |
173 | bg_col = sc.work; |
179 | sc.get(); |
Line 174... | Line 180... | ||
174 | bg_dark = skin_is_dark(); |
180 | bg_dark = skin_is_dark(); |
175 | 181 | ||
Line 176... | Line 182... | ||
176 | semi_white = MixColors(sc.work, 0xFFFfff, bg_dark*90 + 96); |
182 | semi_white = MixColors(sc.work, 0xFFFfff, bg_dark*90 + 96); |
177 | Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white); |
183 | top_icons.replace_color(0xffFFFfff, semi_white); |
Line 178... | Line 184... | ||
178 | Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220)); |
184 | top_icons.replace_color(0xffCACBD6, MixColors(semi_white, 0, 220)); |
Line 179... | Line 185... | ||
179 | 185 | ||
180 | Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffFFFfff, sc.work); |
186 | left_icons.replace_color(0xffFFFfff, sc.work); |
181 | Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffCACBD6, MixColors(sc.work, 0, 200)); |
187 | left_icons.replace_color(0xffCACBD6, MixColors(sc.work, 0, 200)); |
182 | 188 | ||
183 | //fix line and rectandle color for dark skins |
189 | //fix line and rectandle color for dark skins |
184 | if (bg_dark) Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xff545454, 0xffD3D3D4); |
190 | if (bg_dark) left_icons.replace_color(0xff545454, 0xffD3D3D4); |
Line 185... | Line 191... | ||
185 | 191 | ||
186 | EventSetActiveColor(1, color1); |
192 | EventSetActiveColor(1, color1); |
187 | 193 | ||
188 | if (!param[0]) { |
194 | if (!param[0]) { |
Line 367... | Line 373... | ||
367 | right_bar.x = Form.cwidth - right_bar.w; |
373 | right_bar.x = Form.cwidth - right_bar.w; |
368 | b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x; |
374 | b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x; |
369 | DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, sc.work); |
375 | DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, sc.work); |
370 | DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, sc.work_graph); |
376 | DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, sc.work_graph); |
Line 371... | Line -... | ||
371 | - | ||
372 | tx.n = 5-GAPH; |
377 | |
373 | DrawTopPanelButton(#EventCreateNewIcon, ECTRL + SCAN_CODE_KEY_N, tx.inc(GAPH), 2); |
378 | DrawTopPanelButton(#EventCreateNewIcon, ECTRL + SCAN_CODE_KEY_N, tx.set(5), 2); |
374 | DrawTopPanelButton(#EventOpenIcon, ECTRL + SCAN_CODE_KEY_O, tx.inc(GAPH), 0); |
379 | DrawTopPanelButton(#EventOpenIcon, ECTRL + SCAN_CODE_KEY_O, tx.inc(GAPH), 0); |
375 | DrawTopPanelButton(#EventSaveIconToFile, ECTRL + SCAN_CODE_KEY_S, tx.inc(GAPH), 5); |
380 | DrawTopPanelButton(#EventSaveIconToFile, ECTRL + SCAN_CODE_KEY_S, tx.inc(GAPH), 5); |
376 | DrawTopPanelButton(#EventMoveLeft, ECTRL + SCAN_CODE_LEFT, tx.inc(GAPH+BLOCK_SPACE), 30); |
381 | DrawTopPanelButton(#EventMoveLeft, ECTRL + SCAN_CODE_LEFT, tx.inc(GAPH+BLOCK_SPACE), 30); |
377 | DrawTopPanelButton(#EventMoveRight, ECTRL + SCAN_CODE_RIGHT, tx.inc(GAPH), 31); |
382 | DrawTopPanelButton(#EventMoveRight, ECTRL + SCAN_CODE_RIGHT, tx.inc(GAPH), 31); |
Line 382... | Line 387... | ||
382 | DrawTopPanelButton(#EventRotateLeft, ECTRL + SCAN_CODE_KEY_L, tx.inc(GAPH), 37); |
387 | DrawTopPanelButton(#EventRotateLeft, ECTRL + SCAN_CODE_KEY_L, tx.inc(GAPH), 37); |
383 | DrawTopPanelButton(#EventRotateRight, ECTRL + SCAN_CODE_KEY_R, tx.inc(GAPH), 36); |
388 | DrawTopPanelButton(#EventRotateRight, ECTRL + SCAN_CODE_KEY_R, tx.inc(GAPH), 36); |
384 | DrawTopPanelButton(#EventTestIcon, ECTRL + SCAN_CODE_KEY_T, tx.inc(GAPH+BLOCK_SPACE), 12); |
389 | DrawTopPanelButton(#EventTestIcon, ECTRL + SCAN_CODE_KEY_T, tx.inc(GAPH+BLOCK_SPACE), 12); |
385 | DrawTopPanelButton(#EventCrop, 0, tx.inc(GAPH+BLOCK_SPACE), 46); |
390 | DrawTopPanelButton(#EventCrop, 0, tx.inc(GAPH+BLOCK_SPACE), 46); |
Line 386... | Line 391... | ||
386 | 391 | ||
387 | image_menu_btn.x = tx.n; |
392 | image_menu_btn.x = tx.inc(GAPH+BLOCK_SPACE); |
388 | image_menu_btn.w = DrawFlatPanelButton(button.add(#EventShowImageMenu), image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE); |
393 | image_menu_btn.w = DrawFlatPanelButton(button.add(#EventShowImageMenu), image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE); |
Line 389... | Line 394... | ||
389 | //tx.inc(image_menu_btn.w + BLOCK_SPACE); |
394 | //tx.inc(image_menu_btn.w + BLOCK_SPACE); |
Line 740... | Line 745... | ||
740 | { |
745 | { |
741 | open_lmenu(Form.left+5 + image_menu_btn.x, Form.top+skin_height + |
746 | open_lmenu(Form.left+5 + image_menu_btn.x, Form.top+skin_height + |
742 | image_menu_btn.y + image_menu_btn.h, MENU_ALIGN_TOP_LEFT, NULL, #image_menu_items); |
747 | image_menu_btn.y + image_menu_btn.h, MENU_ALIGN_TOP_LEFT, NULL, #image_menu_items); |
743 | } |
748 | } |
Line -... | Line 749... | ||
- | 749 | ||
- | 750 | void EventShowEditMenu() |
|
- | 751 | { |
|
- | 752 | open_lmenu(Form.left+5 + image_menu_btn.x, Form.top+skin_height + |
|
- | 753 | image_menu_btn.y + image_menu_btn.h, MENU_ALIGN_TOP_LEFT, NULL, #edit_menu_items); |
|
- | 754 | } |
|
744 | 755 | ||
745 | void EventCheckMenuItemSelected() |
756 | void EventCheckMenuItemSelected() |
746 | { |
757 | { |
747 | switch(get_menu_click()) { |
758 | switch(get_menu_click()) { |
748 | case 1: |
759 | case 1: |
Line 792... | Line 803... | ||
792 | void EventFlipHor() { EventMove(FLIP_HOR); } |
803 | void EventFlipHor() { EventMove(FLIP_HOR); } |
793 | void EventFlipVer() { EventMove(FLIP_VER); } |
804 | void EventFlipVer() { EventMove(FLIP_VER); } |
794 | void EventRotateLeft() { EventMove(ROTATE_LEFT); } |
805 | void EventRotateLeft() { EventMove(ROTATE_LEFT); } |
795 | void EventRotateRight() { EventMove(ROTATE_RIGHT); } |
806 | void EventRotateRight() { EventMove(ROTATE_RIGHT); } |
Line 796... | Line 807... | ||
796 | 807 | ||
797 | void EventSelectToolPencil() { setCurrentTool(TOOL_PENCIL); DrawLeftPanelSelection(); } |
808 | void EventSelectToolPencil() { setCurrentTool(TOOL_PENCIL); } |
798 | void EventSelectToolPick() { setCurrentTool(TOOL_PIPETTE); DrawLeftPanelSelection(); } |
809 | void EventSelectToolPick() { setCurrentTool(TOOL_PIPETTE); } |
799 | void EventSelectToolFill() { setCurrentTool(TOOL_FILL); DrawLeftPanelSelection(); } |
810 | void EventSelectToolFill() { setCurrentTool(TOOL_FILL); } |
800 | void EventSelectToolLine() { setCurrentTool(TOOL_LINE); DrawLeftPanelSelection(); } |
811 | void EventSelectToolLine() { setCurrentTool(TOOL_LINE); } |
801 | void EventSelectToolRect() { setCurrentTool(TOOL_RECT); DrawLeftPanelSelection(); } |
812 | void EventSelectToolRect() { setCurrentTool(TOOL_RECT); } |
802 | void EventSelectToolBar() { setCurrentTool(TOOL_BAR); DrawLeftPanelSelection(); } |
813 | void EventSelectToolBar() { setCurrentTool(TOOL_BAR); } |
803 | void EventSelectToolSelect() { setCurrentTool(TOOL_SELECT); DrawLeftPanelSelection(); } |
814 | void EventSelectToolSelect() { setCurrentTool(TOOL_SELECT); } |
Line 804... | Line 815... | ||
804 | void EventSelectToolScrCopy() { setCurrentTool(TOOL_SCREEN_COPY); DrawLeftPanelSelection(); } |
815 | void EventSelectToolScrCopy() { setCurrentTool(TOOL_SCREEN_COPY); } |
Line 805... | Line 816... | ||
805 | 816 |