From 1d22e52024056b233fc52545c2fab1c1e38767cf Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 3 Apr 2018 12:45:08 +0000 Subject: [PATCH] txtread: add show file properties button, cmm gui EditBox: 1px smaller border git-svn-id: svn://kolibrios.org@7218 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/gui.h | 7 ++--- programs/cmm/lib/keyboard.h | 3 ++ programs/cmm/txtread/gui.h | 4 +-- programs/cmm/txtread/toolbar.png | Bin 566 -> 576 bytes programs/cmm/txtread/txtread.c | 46 +++++++++++++++++++++++-------- 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index 413f89c8fe..cf1b67150e 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -191,10 +191,9 @@ if (ESI.edit_box.flags & 100000000000b) bg = 0xCACACA; else bg = 0xFFFfff; edit_box_draw stdcall (edit_box_pointer); h = 22; - DrawRectangle(x-1, y-1, w+1, h+1, bg); - DrawRectangle3D(x-2, y-2, w+3, h+3, 0xDDDddd, bg); - DrawRectangle(x-3, y-3, w+5, h+5, system.color.work_graph); - DrawRectangle3D(x-4, y-4, w+7, h+7, system.color.work_dark, system.color.work_light); + DrawRectangle3D(x-1, y-1, w+1, h+1, 0xE7E7E7, bg); + DrawRectangle(x-2, y-2, w+3, h+3, system.color.work_graph); + DrawRectangle3D(x-3, y-3, w+5, h+5, system.color.work_dark, system.color.work_light); } :void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent) diff --git a/programs/cmm/lib/keyboard.h b/programs/cmm/lib/keyboard.h index 93c3174735..9d41a93a3e 100644 --- a/programs/cmm/lib/keyboard.h +++ b/programs/cmm/lib/keyboard.h @@ -40,7 +40,10 @@ #define SCAN_CODE_MINUS 012 #define SCAN_CODE_PLUS 013 +#define SCAN_CODE_F1 059 + #define SCAN_CODE_KEY_C 046 +#define SCAN_CODE_KEY_E 018 #define SCAN_CODE_KEY_F 033 #define SCAN_CODE_KEY_I 023 #define SCAN_CODE_KEY_L 038 diff --git a/programs/cmm/txtread/gui.h b/programs/cmm/txtread/gui.h index 45fa3320e0..349d3f81df 100644 --- a/programs/cmm/txtread/gui.h +++ b/programs/cmm/txtread/gui.h @@ -1,7 +1,7 @@ void DrawToolbarButton(char image_id, int x) { - DefineButton(x+1, 7, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0); - img_draw stdcall(skin.image, x, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT); + DefineButton(x+1, 6, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0); + img_draw stdcall(skin.image, x, 5, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT); } diff --git a/programs/cmm/txtread/toolbar.png b/programs/cmm/txtread/toolbar.png index bd3bc923fb9dbe21100d01c68ab37328e35ca2a4..4052692b6ceaa240cacec9f72fe2170d894bb09e 100644 GIT binary patch delta 564 zcmV-40?Ylj1i%E47k{V(0{{R33})kl0000jP)t-s@$vEO?Cjs)-`UyO%gf8b!NIAi zs+X6SjEszihK7KEfOmIyW@ctwTwMSE{}T?b`~Uy}&PhZ;RCwCOmAy~GKp4gkC`b4h zn1~4rn});$gPV&nYIGwGE;2yW7>olU(L}>yT$l_lEHD@ySbrFFa9}WLP-;rvfx%7x z2LA@zyK8%|0W2R0@Am7{T;KP(d#+@^;?yz8|2P#Rx5TNXe~1D=&ZdY#8X{o2OzK>S zqF&t3C(~itscnKCtRT7`%TIq9J~9@08nw-W9u*XSF`geh3#um!^0qnoyKISUhEbr( zC|KmP^DUvmiGOuAx-yW^n|Kxc1yWBL;A;=;40nwu8an$8@)J8KyIVo$b77`_0`e1( zpMd-X*M0)>6Of;P{DhhMDWA`sKMu|+?;|OYlW9#gJO9qe+KJGX`?OEuUwuyHPufYn z?xi^CI)x2Qtm4&L;f}BC+%~(aM;8=QBNuw@Os|T4pnpdVO)2N5o55w?r}eXZCy@fZ zs6&rgsM-`NZHXJqtY-2(TeK)tYCWvlt2C3n#e0iP>B|0|kT_WqrPx#El^BUMe*_RjEszCW@i8Y|Jm8u-{0S9FjB$*sV*=6}5aAPIPLIWn>i~2Vl zq%laIU)gQMwSTWXD%7C7qozFC<-QIFV(UrN+WtJWpQyuSDyTY~k*>o9sXAQI^K_`) zaFE6z`BjHA`ZyhS=b;^m?UQ`@wRJ2CW#_UnU&<7 zNmKAnBH->`Z87_8{%wdaR4@s=aodb*Y%~*RS%6x^TYn5h1R~^BM6KoxB5&g-<@gTs zeY!8dQ-^W=EYB!&cWTj4b%7Zvs79Yddsx~@1!nPtW>US&r!-a)>nZt`NOT|q9f=rU zcpy7M9$yU+!gfdv5mU6ff>o>hb>3l7n?f=8FVtb*0(Rp#B560~vGd_#eyT4!_oy!m sl2) return; @@ -272,11 +293,14 @@ void draw_window() DrawBar(0, 0, Form.cwidth, TOOLBAR_H - 1, 0xe1e1e1); DrawBar(0, TOOLBAR_H - 1, Form.cwidth, 1, 0x7F7F7F); - DrawToolbarButton(OPEN_FILE, 8); - DrawToolbarButton(MAGNIFY_PLUS, 42); - DrawToolbarButton(MAGNIFY_MINUS, 67); - DrawToolbarButton(CHANGE_ENCODING, 101); - DrawToolbarButton(RUN_EDIT, 135); + x.n = 0; + DrawToolbarButton(OPEN_FILE, x.inc(8)); + DrawToolbarButton(SHOW_FILE_PROPERTIES, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING)); + DrawToolbarButton(MAGNIFY_PLUS, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING + PADDING)); + DrawToolbarButton(MAGNIFY_MINUS, x.inc(TOOLBAR_BUTTON_WIDTH - 1)); + DrawToolbarButton(CHANGE_ENCODING, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING + PADDING)); + charsets_menu_left = x.n; + DrawToolbarButton(RUN_EDIT, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING)); DrawToolbarButton(SHOW_INFO, Form.cwidth - 34);