various small updates

git-svn-id: svn://kolibrios.org@7266 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2018-05-02 16:32:29 +00:00
parent aa4bb9a838
commit 66feca6f18
8 changed files with 53 additions and 57 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -38,7 +38,6 @@ void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
if (fairing_color==col_selec) if (fairing_color==col_selec)
{ {
img_draw stdcall(selected_image, xx, yy, icon_size, icon_size, 0, icon_n*icon_size); img_draw stdcall(selected_image, xx, yy, icon_size, icon_size, 0, icon_n*icon_size);
if (big_icons.checked==false) IconFairing(icon_n, xx, yy, fairing_color);
} }
else else
{ {
@ -46,20 +45,3 @@ void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
} }
} }
void IconFairing(dword filenum, x,y, color)
{
//0 = folder
//22 = forder with up arrow
if (filenum == 0) || (filenum == 22)
{
DrawBar(x+7,y+1,8,2,color);
DrawBar(x,y+14,15,2,color);
PutPixel(x,y+1,color);
PutPixel(x+6,y+1,color);
PutPixel(x+14,y+3,color);
PutPixel(x,y+13,color);
PutPixel(x+14,y+13,color);
}
if (filenum == 22) PutPixel(x+10,y+2,0x1A7B17); //green arrow part
}

View File

@ -98,7 +98,7 @@ void settings_dialog()
if (line_height.click(id)) files.item_h = line_height.value; if (line_height.click(id)) files.item_h = line_height.value;
if (big_icons.click(id)) BigIconsSwitch(); if (big_icons.click(id)) BigIconsSwitch();
EventRedrawWindow(Form.left,Form.top); EventRedrawWindow(Form.left,Form.top);
//RefreshWindow(Form.num_slot, Settings.num_slot); //RefreshWindow(Form.slot, Settings.slot);
break; break;
case evKey: case evKey:

View File

@ -32,12 +32,11 @@ pipet aside color view
// // // //
//===================================================// //===================================================//
#define T_TITLE "Icon Editor 0.53 Alpha" #define T_TITLE "Icon Editor 0.53.1 Alpha"
#define TOOLBAR_H 24+8 #define TOOLBAR_H 24+8
#define PANEL_LEFT_W 16+5+5+3+3 #define PANEL_LEFT_W 16+5+5+3+3
#define PALLETE_SIZE 116 #define PALLETE_SIZE 116
#define TB_ICON_PADDING 26
#define PAL_ITEMS_X_COUNT 13 #define PAL_ITEMS_X_COUNT 13
#define COLSIZE 18 #define COLSIZE 18
@ -139,6 +138,9 @@ _ActionsHistory actionsHistory;
// // // //
//===================================================// //===================================================//
libimg_image top_icons;
libimg_image left_icons;
void main() void main()
{ {
word btn; word btn;
@ -148,11 +150,16 @@ void main()
load_dll(libimg, #libimg_init, 1); load_dll(libimg, #libimg_init, 1);
load_dll(boxlib, #box_lib_init,0); load_dll(boxlib, #box_lib_init,0);
Libimg_LoadImage(#skin, "/sys/icons16.png"); Libimg_LoadImage(#top_icons, "/sys/icons16.png");
Libimg_LoadImage(#left_icons, "/sys/icons16.png");
system.color.get(); system.color.get();
semi_white = MixColors(system.color.work, 0xFFFfff, 64); semi_white = MixColors(system.color.work, 0xFFFfff, 96);
Libimg_ReplaceColor(skin.image, skin.w, skin.h, Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white);
0xffFFFfff, semi_white); Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220));
Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffFFFfff, system.color.work);
Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffCACBD6, MixColors(system.color.work, 0, 200));
if (!param[0]) { if (!param[0]) {
image.create(32, 32); image.create(32, 32);
@ -329,19 +336,19 @@ void main()
} }
} }
void DrawToolbarButton(dword _id, _x, _icon_n) void DrawTopPanelButton(dword _id, _x, _icon_n)
{ {
DrawWideRectangle(_x, 4, 22, 22, 3, semi_white); DrawWideRectangle(_x, 4, 22, 22, 3, semi_white);
DefineHiddenButton(_x, 4, 21, 21, _id); DefineHiddenButton(_x, 4, 21, 21, _id);
img_draw stdcall(skin.image, _x+3, 7, 16, 16, 0, _icon_n*16); img_draw stdcall(top_icons.image, _x+3, 7, 16, 16, 0, _icon_n*16);
} }
void DrawLeftPanelButton(dword _id, _y, _icon_n) void DrawLeftPanelButton(dword _id, _y, _icon_n)
{ {
int x = 5; int x = 5;
DrawWideRectangle(x, _y, 22, 22, 3, semi_white); DrawRectangle(x, _y, 22-1, 22-1, system.color.work);
DefineHiddenButton(x, _y, 21, 21, _id); DefineHiddenButton(x, _y, 21, 21, _id);
img_draw stdcall(skin.image, x+3, _y+3, 16, 16, 0, _icon_n*16); img_draw stdcall(left_icons.image, x+3, _y+3, 16, 16, 0, _icon_n*16);
} }
void DrawStatusBar() void DrawStatusBar()
@ -354,6 +361,8 @@ void DrawStatusBar()
void draw_window() void draw_window()
{ {
#define GAP 27
#define BLOCK_SPACE 10
incn tx; incn tx;
system.color.get(); system.color.get();
DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x33, system.color.work, T_TITLE, 0); DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x33, system.color.work, T_TITLE, 0);
@ -366,21 +375,21 @@ void draw_window()
b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x; b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x;
DrawBar(0, TOOLBAR_H-1, Form.cwidth, 1, system.color.work_graph); DrawBar(0, TOOLBAR_H-1, Form.cwidth, 1, system.color.work_graph);
tx.n = 5-TB_ICON_PADDING; tx.n = 5-GAP;
DrawToolbarButton(BTN_NEW, tx.inc(TB_ICON_PADDING), 2); //not implemented DrawTopPanelButton(BTN_NEW, tx.inc(GAP), 2); //not implemented
DrawToolbarButton(BTN_OPEN, tx.inc(TB_ICON_PADDING), 0); //not implemented DrawTopPanelButton(BTN_OPEN, tx.inc(GAP), 0); //not implemented
DrawToolbarButton(BTN_SAVE, tx.inc(TB_ICON_PADDING), 5); DrawTopPanelButton(BTN_SAVE, tx.inc(GAP), 5);
DrawToolbarButton(BTN_MOVE_LEFT, tx.inc(TB_ICON_PADDING+8), 30); DrawTopPanelButton(BTN_MOVE_LEFT, tx.inc(GAP+BLOCK_SPACE), 30);
DrawToolbarButton(BTN_MOVE_RIGHT, tx.inc(TB_ICON_PADDING), 31); DrawTopPanelButton(BTN_MOVE_RIGHT, tx.inc(GAP), 31);
DrawToolbarButton(BTN_MOVE_UP, tx.inc(TB_ICON_PADDING), 32); DrawTopPanelButton(BTN_MOVE_UP, tx.inc(GAP), 32);
DrawToolbarButton(BTN_MOVE_DOWN, tx.inc(TB_ICON_PADDING), 33); DrawTopPanelButton(BTN_MOVE_DOWN, tx.inc(GAP), 33);
DrawToolbarButton(BTN_FLIP_HOR, tx.inc(TB_ICON_PADDING+8), 34); DrawTopPanelButton(BTN_FLIP_HOR, tx.inc(GAP+BLOCK_SPACE), 34);
DrawToolbarButton(BTN_FLIP_VER, tx.inc(TB_ICON_PADDING), 35); DrawTopPanelButton(BTN_FLIP_VER, tx.inc(GAP), 35);
DrawToolbarButton(BTN_TEST_ICON, tx.inc(TB_ICON_PADDING+8), 12); DrawTopPanelButton(BTN_TEST_ICON, tx.inc(GAP+BLOCK_SPACE), 12);
// DrawToolbarButton(BTN_ROTATE_LEFT, tx.inc(TB_ICON_PADDING), 36); //not implemented // DrawTopPanelButton(BTN_ROTATE_LEFT, tx.inc(GAP), 36); //not implemented
// DrawToolbarButton(BTN_ROTATE_RIGHT, tx.inc(TB_ICON_PADDING), 37); //not implemented // DrawTopPanelButton(BTN_ROTATE_RIGHT, tx.inc(GAP), 37); //not implemented
DrawLeftPanel(); DrawLeftPanel();
@ -394,17 +403,18 @@ void draw_window()
void DrawLeftPanel() void DrawLeftPanel()
{ {
#define GAP 28
incn ty; incn ty;
ty.n = right_bar.y - TB_ICON_PADDING; ty.n = right_bar.y - GAP - 2;
DrawLeftPanelButton(BTN_PENCIL, ty.inc(TB_ICON_PADDING), 38); DrawLeftPanelButton(BTN_PENCIL, ty.inc(GAP), 38);
DrawLeftPanelButton(BTN_PICK, ty.inc(TB_ICON_PADDING), 39); DrawLeftPanelButton(BTN_PICK, ty.inc(GAP), 39);
DrawLeftPanelButton(BTN_FILL, ty.inc(TB_ICON_PADDING), 40); DrawLeftPanelButton(BTN_FILL, ty.inc(GAP), 40);
DrawLeftPanelButton(BTN_LINE, ty.inc(TB_ICON_PADDING), 41); DrawLeftPanelButton(BTN_LINE, ty.inc(GAP), 41);
DrawLeftPanelButton(BTN_RECT, ty.inc(TB_ICON_PADDING), 42); DrawLeftPanelButton(BTN_RECT, ty.inc(GAP), 42);
DrawLeftPanelButton(BTN_BAR, ty.inc(TB_ICON_PADDING), 43); DrawLeftPanelButton(BTN_BAR, ty.inc(GAP), 43);
DrawLeftPanelButton(BTN_SELECT, ty.inc(TB_ICON_PADDING), 44); DrawLeftPanelButton(BTN_SELECT, ty.inc(GAP), 44);
DrawLeftPanelButton(BTN_SCREEN_COPY, ty.inc(TB_ICON_PADDING), 45); DrawLeftPanelButton(BTN_SCREEN_COPY, ty.inc(GAP), 45);
DrawRectangle3D(5, currentTool*TB_ICON_PADDING+right_bar.y, 16+3+2, 16+3+2, 0x333333, 0x777777); DrawRectangle3D(5, currentTool*GAP+right_bar.y-2, 16+3+2, 16+3+2, 0x333333, 0x777777);
} }
void DrawEditArea() void DrawEditArea()

View File

@ -7,7 +7,10 @@ void ScreenCopy_activate() {
void ScreenCopy_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) { void ScreenCopy_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) {
dword i; dword i;
CopyScreen(screen_copy, mouse.x + Form.left + 5, mouse.y + Form.top + skin_height, image.columns, image.rows); CopyScreen(screen_copy,
mouse.x + Form.left + 5 - calc(image.columns/2),
mouse.y + Form.top + skin_height - calc(image.rows/2),
image.columns, image.rows);
for (i = 0; i < image.columns*image.rows; i++;) for (i = 0; i < image.columns*image.rows; i++;)
{ {
image.mas[i] = ESDWORD[i*3+screen_copy] & 0xFFFFFF; image.mas[i] = ESDWORD[i*3+screen_copy] & 0xFFFFFF;
@ -19,5 +22,6 @@ void ScreenCopy_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) {
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
actionsHistory.saveCurrentState(); actionsHistory.saveCurrentState();
setCurrentTool(previousTool); setCurrentTool(previousTool);
if (!CheckActiveProcess(Form.ID)) ActivateWindow(GetProcessSlot(Form.ID));
} }
} }

View File

@ -147,7 +147,7 @@ struct proc_info
{ {
#define SelfInfo -1 #define SelfInfo -1
dword use_cpu; dword use_cpu;
word pos_in_stack,num_slot,rezerv1; word pos_in_stack,slot,rezerv1;
unsigned char name[11]; unsigned char name[11];
char rezerv2; char rezerv2;
dword adress,use_memory,ID,left,top,width,height; dword adress,use_memory,ID,left,top,width,height;
@ -196,7 +196,7 @@ inline fastcall int GetActiveProcess()
return 0; return 0;
} }
inline fastcall void ActivateWindow( ECX) inline fastcall void ActivateWindow( ECX) //ECX - slot
{ {
EAX = 18; EAX = 18;
EBX = 3; EBX = 3;

View File

@ -244,8 +244,8 @@ void GetAttachedItems()
void EventSetActiveProcess(dword i) void EventSetActiveProcess(dword i)
{ {
GetProcessInfo(#Process, proc_list[i+list.first]); GetProcessInfo(#Process, proc_list[i+list.first]);
Process.num_slot = GetProcessSlot(Process.ID); Process.slot = GetProcessSlot(Process.ID);
if (Process.ID) ActivateWindow(Process.num_slot); if (Process.ID) ActivateWindow(Process.slot);
if (current_process_id == Process.ID) && (Process.status_window!=2) { if (current_process_id == Process.ID) && (Process.status_window!=2) {
MinimizeWindow(); MinimizeWindow();
//TODO: make another window active //TODO: make another window active