diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 1efd1b4ddc..e5590efe59 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -307,6 +307,9 @@ void SetElementSizes() void draw_window() { int i; + bool burger_active = false; + if (menu_id == OPEN_FILE) burger_active = true; + SetElementSizes(); DrawBar(0,0, Form.cwidth,PADDING, sc.work); @@ -316,9 +319,9 @@ void draw_window() DrawBar(0, PADDING, address_box.left-2, TSZE+1, sc.work); DrawBar(address_box.left+address_box.width+18, PADDING, Form.cwidth-address_box.left-address_box.width-18, TSZE+1, sc.work); - DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30); - DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31); - DrawTopPanelButton(SANDWICH_BUTTON, Form.cwidth-PADDING-TSZE-3, PADDING, -1); //burger menu + DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30, false); + DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31, false); + DrawTopPanelButton(SANDWICH_BUTTON, Form.cwidth-PADDING-TSZE-3, PADDING, -1, burger_active); //burger menu DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, sc.work_graph); @@ -763,10 +766,12 @@ void EventShowEncodingsList() void ProcessMenuClick() { int click_id; - if (menu_id) && (click_id = get_menu_click()) { - click_id += menu_id - 1; - menu_id = NULL; - ProcessEvent(click_id); + if (menu_id) { + if (click_id = get_menu_click()) { + click_id += menu_id - 1; + ProcessEvent(click_id); + } + if (!menu_process_id) menu_id = NULL; } } diff --git a/programs/cmm/codeview/codeview.c b/programs/cmm/codeview/codeview.c index ebedc38d6c..d530e731c1 100644 --- a/programs/cmm/codeview/codeview.c +++ b/programs/cmm/codeview/codeview.c @@ -180,7 +180,7 @@ void draw_window() DrawEditBoxWebView(); } DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col); - DrawTopPanelButton(OPEN_PAGE, 10, address_box.top-3, 0); + DrawTopPanelButton(OPEN_PAGE, 10, address_box.top-3, 0, false); } diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index 990de9aeaa..bcbfa5e96b 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -209,8 +209,7 @@ :void PutShadow(dword x,y,w,h,skinned,strength) { proc_info wForm; - dword shadow_buf, skin_height; - shadow_buf = mem_Alloc(w*h*3); + dword shadow_buf = mem_Alloc(w*h*3); GetProcessInfo(#wForm, SelfInfo); CopyScreen(shadow_buf, 5*skinned+x+wForm.left, GetSkinHeight()*skinned+y+wForm.top, w, h); ShadowImage(shadow_buf, w, h, strength); diff --git a/programs/cmm/lib/patterns/toolbar_button.h b/programs/cmm/lib/patterns/toolbar_button.h index da1b624136..53c7b9c1e3 100644 --- a/programs/cmm/lib/patterns/toolbar_button.h +++ b/programs/cmm/lib/patterns/toolbar_button.h @@ -1,5 +1,5 @@ -unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n) +unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed) { #define TSZE 25 static libimg_image top_icons; @@ -17,14 +17,21 @@ unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n) } DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white); - DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work); DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id); if (_icon_n==-1) { DrawBar(_x+6, _y+5, 16, 16, semi_white); for (i=0; i<=2; i++) DrawBar(_x+6, i*5+_y+7, 15, 3, sc.work_graph); } else { - img_draw stdcall(top_icons.image, _x+6, _y+5, 16, 16, 0, _icon_n*16); + img_draw stdcall(top_icons.image, _x+6, _y+5+pressed, 16, 16, 0, _icon_n*16); } + + if (!pressed) { + DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work); + } else { + DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, bg_col_light, semi_white, sc.work); + PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2); + } + return _x; } \ No newline at end of file diff --git a/programs/develop/ktcc/trunk/samples/build_all.sh b/programs/develop/ktcc/trunk/samples/build_all.sh new file mode 100644 index 0000000000..52120ef912 --- /dev/null +++ b/programs/develop/ktcc/trunk/samples/build_all.sh @@ -0,0 +1,6 @@ +#SHS +../tcc asm_ex.c /kolibrios/develop/tcc/lib/libck.a -o asm_ex +../tcc consoleio.c /kolibrios/develop/tcc/lib/libck.a -o consoleio +../tcc files.c /kolibrios/develop/tcc/lib/libck.a -o files +../tcc winbasics.c /kolibrios/develop/tcc/lib/libck.a -o winbasics +exit \ No newline at end of file diff --git a/programs/develop/ktcc/trunk/samples/simplewin_old.c b/programs/develop/ktcc/trunk/samples/simplewin_old.c deleted file mode 100644 index 63bf266186..0000000000 --- a/programs/develop/ktcc/trunk/samples/simplewin_old.c +++ /dev/null @@ -1,61 +0,0 @@ - -// simple sample by Ghost - -#include -#include -#include - -#define FONT0 0 -#define FONT1 0x10000000 - -#define BT_NORMAL 0 -#define BT_DEL 0x80000000 -#define BT_HIDE 0x40000000 -#define BT_NOFRAME 0x20000000 - -char header[]={" -= C demo programm. Compiled whith KTCC halyavin and andrew_programmer port =- "}; - -void rotate_str(char *str){ - char tmp; - int i; - tmp = str[0]; - for(i = 1; str[i]; i++)str[i - 1] = str[i]; - str[i - 1] = tmp; -} - -void draw_window(){ - static int offs = 0; - static int fcolor = 0; - static int col = 0; - - _ksys_window_redraw(1); - _ksys_draw_window(100, 100, 300, 120, 0xaabbcc, 2, 0x5080d0, 0, 0x5080d0); - _ksys_write_text(6 - offs, 8, fcolor | FONT0, header, strlen(header)); - _ksys_draw_bar(1, 6, 5, 13, 0x05080d0); - _ksys_draw_bar(274, 6, 26, 13, 0x05080d0); - _ksys_make_button(300 - 19, 5, 12, 12, 1 | BT_NORMAL, 0x6688dd); - _ksys_window_redraw(2); - - offs = (offs + 1) % 6; - if(!offs)rotate_str(header); - - fcolor += (col)?-0x80808:0x80808; - if(fcolor > 0xf80000 || fcolor == 0)col = !col; -} - -int main(int argc, char **argv){ - - while(!0){ - switch(_ksys_wait_for_event(10)){ - case 2:return 0; - - case 3: - if(_ksys_get_button_id() == 1)return 0; - break; - - default: - draw_window(); - break; - } - } -}