From 6a69fa2b7942235a785534471e08e9eba58681a8 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 17 Jan 2010 01:56:56 +0000 Subject: [PATCH] Hide button now brings a drop-down menu to choose toolbars to show/hide. Right-clicking it toggles them all off/on. Internal: Added support for dropdowns that expand above the button (available in toolbars and windows); Allowed toolbar buttons to wait for button release (the usual) or immediately trigger their effect. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1266 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile.dep | 7 +-- buttons.c | 75 ++++++++++++++++++++++++++++---- buttons.h | 8 ++-- engine.c | 107 ++++++++++++++++++++++++++++++---------------- engine.h | 10 ++++- filesel.c | 4 +- global.h | 2 + helpfile.h | 12 +++--- hotkeys.c | 8 ++-- init.c | 52 +++++++++++++++++++++- miscfileformats.c | 4 +- palette.c | 2 +- struct.h | 1 + transform.c | 2 +- 14 files changed, 224 insertions(+), 70 deletions(-) diff --git a/Makefile.dep b/Makefile.dep index fa894492..e3a9b91b 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -13,7 +13,8 @@ $(OBJDIR)/engine.o: engine.c const.h struct.h global.h graph.h misc.h special.h buttons.h operatio.h shade.h errors.h sdlscreen.h windows.h brush.h \ input.h engine.h pages.h layers.h $(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h engine.h errors.h \ - filesel.h global.h graph.h io.h misc.h readline.h sdlscreen.h windows.h + filesel.h loadsave.h global.h graph.h io.h misc.h pages.h readline.h \ + sdlscreen.h windows.h $(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \ loadsave.h misc.h io.h windows.h pages.h $(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \ @@ -35,7 +36,7 @@ $(OBJDIR)/input.o: input.c global.h struct.h const.h keyboard.h sdlscreen.h \ $(OBJDIR)/io.o: io.c struct.h const.h io.h realpath.h $(OBJDIR)/keyboard.o: keyboard.c global.h struct.h const.h keyboard.h $(OBJDIR)/layers.o: layers.c const.h struct.h global.h windows.h engine.h pages.h -$(OBJDIR)/libraw2crtc.o: libraw2crtc.c global.h struct.h const.h +$(OBJDIR)/libraw2crtc.o: libraw2crtc.c const.h global.h struct.h loadsave.h $(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h errors.h global.h io.h \ loadsave.h misc.h graph.h op_c.h pages.h palette.h sdlscreen.h \ windows.h engine.h @@ -43,7 +44,7 @@ $(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons engine.h pages.h loadsave.h sdlscreen.h errors.h readini.h saveini.h \ io.h text.h setup.h windows.h brush.h palette.h realpath.h $(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.h \ - engine.h misc.h keyboard.h windows.h palette.h input.h graph.h + engine.h misc.h keyboard.h windows.h palette.h input.h graph.h pages.h $(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \ global.h io.h libraw2crtc.h loadsave.h misc.h sdlscreen.h windows.h $(OBJDIR)/mountlist.o: mountlist.c diff --git a/buttons.c b/buttons.c index 931fef94..81857115 100644 --- a/buttons.c +++ b/buttons.c @@ -488,21 +488,80 @@ void Set_bar_visibility(word bar, byte visible) } } -void Button_Toggle_layerbar(void) -{ +void Button_Toggle_toolbar(void) +{ + T_Dropdown_button dropdown; + T_Dropdown_choice *item; + static char menu_name[2][9]= { + " Tools", + " Layers" + }; + + menu_name[0][0] = Menu_bars[MENUBAR_TOOLS ].Visible ? 22 : ' '; + menu_name[1][0] = Menu_bars[MENUBAR_LAYERS].Visible ? 22 : ' '; + Hide_cursor(); - Set_bar_visibility(MENUBAR_LAYERS, !Menu_bars[MENUBAR_LAYERS].Visible); + dropdown.Pos_X =Buttons_Pool[BUTTON_HIDE].X_offset; + dropdown.Pos_Y =Buttons_Pool[BUTTON_HIDE].Y_offset; + dropdown.Height =Buttons_Pool[BUTTON_HIDE].Height; + dropdown.Dropdown_width=70; + dropdown.First_item =NULL; + dropdown.Bottom_up =1; + + Window_dropdown_add_item(&dropdown, 0, menu_name[0]); + Window_dropdown_add_item(&dropdown, 1, menu_name[1]); + + item=Dropdown_activate(&dropdown,0,Menu_Y+Menu_bars[MENUBAR_STATUS].Top*Menu_factor_Y); + + if (item) + { + switch (item->Number) + { + case 0: + Set_bar_visibility(MENUBAR_TOOLS, !Menu_bars[MENUBAR_TOOLS].Visible); + break; + case 1: + Set_bar_visibility(MENUBAR_LAYERS, !Menu_bars[MENUBAR_LAYERS].Visible); + break; + } + } + + // Closing + Window_dropdown_clear_items(&dropdown); Unselect_button(BUTTON_HIDE); Display_cursor(); } -void Button_Toggle_toolbox(void) +void Button_Toggle_all_toolbars(void) { + // This is used to memorize the bars' visibility when temporarily hidden + static word Last_visibility = 0xFFFF; + int i; + word current_visibility; + Hide_cursor(); - Set_bar_visibility(MENUBAR_TOOLS, !Menu_bars[MENUBAR_TOOLS].Visible); + // Check which bars are visible + current_visibility=0; + for (i=MENUBAR_STATUS+1;iCursor_position = Find_file_in_fileselector(&Skin_files_list, Config.Skin_file); // Buttons to choose a font - font_dropdown = Window_set_dropdown_button(172, 43, 104, 11, 0, Get_item_by_index(&Font_files_list,selected_font)->Short_name,1,0,1,RIGHT_SIDE|LEFT_SIDE); // 5 + font_dropdown = Window_set_dropdown_button(172, 43, 104, 11, 0, Get_item_by_index(&Font_files_list,selected_font)->Short_name,1,0,1,RIGHT_SIDE|LEFT_SIDE,0); // 5 for (temp=0; tempShort_name); @@ -1034,7 +1093,7 @@ void Button_Skins(void) // Dropdown list to choose cursor type cursor_dropdown = Window_set_dropdown_button(172, 69, 104, 11, 0, - cursors[selected_cursor], 1, 0, 1, RIGHT_SIDE|LEFT_SIDE); // 7 + cursors[selected_cursor], 1, 0, 1, RIGHT_SIDE|LEFT_SIDE,0); // 7 for (temp = 0; temp<3; temp++) Window_dropdown_add_item(cursor_dropdown, temp, cursors[temp]); @@ -1617,7 +1676,7 @@ void Button_Resolution(void) chosen_pixel=Pixel_ratio; Print_in_window( 12, 57,"Pixel size:" ,MC_Dark,MC_Light); - pixel_button=Window_set_dropdown_button(108,55,17*8,11,17*8,pixel_ratio_labels[Pixel_ratio],1,0,1,LEFT_SIDE|RIGHT_SIDE); // 7 + pixel_button=Window_set_dropdown_button(108,55,17*8,11,17*8,pixel_ratio_labels[Pixel_ratio],1,0,1,LEFT_SIDE|RIGHT_SIDE,0); // 7 for (temp=0;tempDisplay_centered=display_centered; temp->Display_arrow=display_arrow; temp->Active_button=active_button; + temp->Bottom_up=bottom_up; temp->Next=Window_dropdown_button_list; Window_dropdown_button_list=temp; @@ -2317,8 +2322,12 @@ void Move_window(short dx, short dy) } -// Gestion des dropdown -short Window_dropdown_on_click(T_Dropdown_button *Button) +/// +/// Displays a dropped-down menu and handles the UI logic until the user +/// releases a mouse button. +/// This function then clears the dropdown and returns the selected item, +/// or NULL if the user wasn't highlighting an item when he closed. +T_Dropdown_choice * Dropdown_activate(T_Dropdown_button *button, short off_x, short off_y) { short nb_choices; short choice_index; @@ -2326,6 +2335,7 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) short old_selected_index; short box_height; T_Dropdown_choice *item; + // Taille de l'ombre portée (en plus des dimensions normales) #define SHADOW_RIGHT 3 #define SHADOW_BOTTOM 4 @@ -2333,18 +2343,17 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) // Comptage des items pour calculer la taille nb_choices=0; - for (item=Button->First_item; item!=NULL; item=item->Next) + for (item=button->First_item; item!=NULL; item=item->Next) { nb_choices++; } box_height=3+nb_choices*8+1; - - Hide_cursor(); - Window_select_normal_button(Button->Pos_X,Button->Pos_Y,Button->Width,Button->Height); + + // Open a new stacked "window" to serve as drawing area. Open_popup( - Window_pos_X+(Button->Pos_X)*Menu_factor_X, - Window_pos_Y+(Button->Pos_Y+Button->Height)*Menu_factor_Y, - Button->Dropdown_width+SHADOW_RIGHT, + off_x+(button->Pos_X)*Menu_factor_X, + off_y+(button->Pos_Y+(button->Bottom_up?-box_height:button->Height))*Menu_factor_Y, + button->Dropdown_width+SHADOW_RIGHT, box_height+SHADOW_BOTTOM); // Dessin de la boite @@ -2352,13 +2361,13 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) // Bord gauche Block(Window_pos_X,Window_pos_Y,Menu_factor_X,box_height*Menu_factor_Y,MC_Black); // Frame fonce et blanc - Window_display_frame_out(1,0,Button->Dropdown_width-1,box_height); + Window_display_frame_out(1,0,button->Dropdown_width-1,box_height); // Ombre portée if (SHADOW_BOTTOM) { Block(Window_pos_X+SHADOW_RIGHT*Menu_factor_X, Window_pos_Y+box_height*Menu_factor_Y, - Button->Dropdown_width*Menu_factor_X, + button->Dropdown_width*Menu_factor_X, SHADOW_BOTTOM*Menu_factor_Y, MC_Black); Block(Window_pos_X, @@ -2369,12 +2378,12 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) } if (SHADOW_RIGHT) { - Block(Window_pos_X+Button->Dropdown_width*Menu_factor_X, + Block(Window_pos_X+button->Dropdown_width*Menu_factor_X, Window_pos_Y+SHADOW_BOTTOM*Menu_factor_Y, SHADOW_RIGHT*Menu_factor_X, (box_height-SHADOW_BOTTOM)*Menu_factor_Y, MC_Black); - Block(Window_pos_X+Button->Dropdown_width*Menu_factor_X, + Block(Window_pos_X+button->Dropdown_width*Menu_factor_X, Window_pos_Y, Menu_factor_X, SHADOW_BOTTOM*Menu_factor_Y, @@ -2388,9 +2397,9 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) // Fenêtre grise Block(Window_pos_X+2*Menu_factor_X, Window_pos_Y+1*Menu_factor_Y, - (Button->Dropdown_width-3)*Menu_factor_X,(box_height-2)*Menu_factor_Y,MC_Light); + (button->Dropdown_width-3)*Menu_factor_X,(box_height-2)*Menu_factor_Y,MC_Light); // Affichage des items - for(item=Button->First_item,choice_index=0; item!=NULL; item=item->Next,choice_index++) + for(item=button->First_item,choice_index=0; item!=NULL; item=item->Next,choice_index++) { byte color_1; byte color_2; @@ -2400,7 +2409,7 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) color_2=MC_Dark; Block(Window_pos_X+3*Menu_factor_X, Window_pos_Y+((2+choice_index*8)*Menu_factor_Y), - (Button->Dropdown_width-5)*Menu_factor_X,(8)*Menu_factor_Y,MC_Dark); + (button->Dropdown_width-5)*Menu_factor_X,(8)*Menu_factor_Y,MC_Dark); } else { @@ -2417,7 +2426,7 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) // Attente if(!Get_input()) SDL_Delay(20); // Mise à jour du survol - selected_index=Window_click_in_rectangle(2,2,Button->Dropdown_width-2,box_height-1)? + selected_index=Window_click_in_rectangle(2,2,button->Dropdown_width-2,box_height-1)? (((Mouse_Y-Window_pos_Y)/Menu_factor_Y-2)>>3) : -1; } while (Mouse_K && selected_index==old_selected_index); @@ -2429,27 +2438,49 @@ short Window_dropdown_on_click(T_Dropdown_button *Button) Close_popup(); - - Window_unselect_normal_button(Button->Pos_X,Button->Pos_Y,Button->Width,Button->Height); - Display_cursor(); - if (selected_index>=0 && selected_indexFirst_item; selected_index; item=item->Next,selected_index--) + for(item=button->First_item; selected_index; item=item->Next,selected_index--) ; - Window_attribute2=item->Number; - if (Button->Display_choice) - { - // Automatically update the label of the dropdown list. - int text_length = (Button->Width-4-(Button->Display_arrow?8:0))/8; - // Clear original label area - Window_rectangle(Button->Pos_X+2,Button->Pos_Y+(Button->Height-7)/2,text_length*8,8,MC_Light); - Print_in_window_limited(Button->Pos_X+2,Button->Pos_Y+(Button->Height-7)/2,item->Label,text_length ,MC_Black,MC_Light); - } - return Button->Number; + return item; } - Window_attribute2=-1; - return 0; + return NULL; +} + +// Gestion des dropdown +short Window_dropdown_on_click(T_Dropdown_button *button) +{ + T_Dropdown_choice * item; + + // Highlight the button + Hide_cursor(); + Window_select_normal_button(button->Pos_X,button->Pos_Y,button->Width,button->Height); + + // Handle the dropdown's logic + item = Dropdown_activate(button, Window_pos_X, Window_pos_Y); + + // Unhighlight the button + Window_unselect_normal_button(button->Pos_X,button->Pos_Y,button->Width,button->Height); + Display_cursor(); + + if (item == NULL) + { + Window_attribute2=-1; + return 0; + } + + if (button->Display_choice) + { + // Automatically update the label of the dropdown list. + int text_length = (button->Width-4-(button->Display_arrow?8:0))/8; + // Clear original label area + Window_rectangle(button->Pos_X+2,button->Pos_Y+(button->Height-7)/2,text_length*8,8,MC_Light); + Print_in_window_limited(button->Pos_X+2,button->Pos_Y+(button->Height-7)/2,item->Label,text_length ,MC_Black,MC_Light); + } + + Window_attribute2=item->Number; + return button->Number; + } // --- Fonction de clic sur un bouton a peu près ordinaire: diff --git a/engine.h b/engine.h index 4af90670..f52eb937 100644 --- a/engine.h +++ b/engine.h @@ -78,13 +78,21 @@ T_Special_button * Window_set_input_button(word x_pos, word y_pos, T_Dropdown_button * Window_set_dropdown_button(word x_pos, word y_pos, word width, word height, word dropdown_width, const char *label, byte display_choice, byte display_centered, byte display_arrow, - byte active_button); + byte active_button,byte bottom_up); /// Adds an item to a dropdown menu void Window_dropdown_add_item(T_Dropdown_button * dropdown, word btn_number, const char *label); void Window_dropdown_clear_items(T_Dropdown_button * dropdown); + +/// +/// Displays a dropped-down menu and handles the UI logic until the user +/// releases a mouse button. +/// This function then clears the dropdown and returns the selected item, +/// or NULL if the user wasn't highlighting an item when he closed. +T_Dropdown_choice * Dropdown_activate(T_Dropdown_button *button, short off_x, short off_y); + T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroller_button * scroller, Func_draw_list_item draw_list_item); void Window_redraw_list(T_List_button * list); diff --git a/filesel.c b/filesel.c index c1c689ca..895949be 100644 --- a/filesel.c +++ b/filesel.c @@ -1109,7 +1109,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) formats_dropdown= Window_set_dropdown_button(68,28,52,11,0, Get_fileformat(Main_format)->Label, - 1,0,1,RIGHT_SIDE|LEFT_SIDE); // 6 + 1,0,1,RIGHT_SIDE|LEFT_SIDE,0); // 6 for (temp=0; temp < NB_KNOWN_FORMATS; temp++) { @@ -1141,7 +1141,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) for (temp=0;tempPos_X+3,bookmark_dropdown[temp]->Pos_Y+2,ICON_STAR); Display_bookmark(bookmark_dropdown[temp],temp); } diff --git a/global.h b/global.h index 38e31f29..400f24d9 100644 --- a/global.h +++ b/global.h @@ -595,6 +595,8 @@ GFX2_GLOBAL struct Func_action Right_action; ///< Action triggered by a right mouseclick on the button word Left_shortcut[2]; ///< Keyboard shortcut for a left mouseclick word Right_shortcut[2];///< Keyboard shortcut for a right mouseclick + byte Left_instant; ///< Will not wait for mouse release before triggering action + byte Right_instant; ///< Will not wait for mouse release before triggering action // Data used when the button is unselected Func_action Unselect_action; ///< Action triggered by unselecting the button diff --git a/helpfile.h b/helpfile.h index f66994c2..0b428f21 100644 --- a/helpfile.h +++ b/helpfile.h @@ -2478,14 +2478,16 @@ static const T_Help_table helptable_hide[] = HELP_TEXT ("") HELP_BOLD ("LEFT CLICK") HELP_TEXT ("") - HELP_TEXT ("Allow you to hide or show the layer bar.") + HELP_TEXT ("Opens a drop-down menu where you can choose") + HELP_TEXT ("Which toolbars are going to be visible in") + HELP_TEXT ("the menu.") HELP_TEXT ("") HELP_BOLD ("RIGHT CLICK") + HELP_LINK ("(Key:%s)",0x200+BUTTON_HIDE) HELP_TEXT ("") - HELP_TEXT ("Allows you to hide all the menus. If you do ") - HELP_TEXT ("this, take care to watch before the key to ") - HELP_TEXT ("press to show the menu back (the key is") - HELP_LINK ("%s).",0x100+BUTTON_HIDE) + HELP_TEXT ("Allows you to hide all toolbars, leaving") + HELP_TEXT ("only the status bar.") + HELP_TEXT ("Click again to show them again.") }; diff --git a/hotkeys.c b/hotkeys.c index 16120236..7a95200f 100644 --- a/hotkeys.c +++ b/hotkeys.c @@ -174,9 +174,9 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = { SDLK_SPACE|MOD_SHIFT, // Shift + Space 0}, {18, - "Show/hide option menu", - "Switch the tool bar display on/off.", - "This hot-key cannot be removed.", + "Show/hide menu toolbars", + "Hides all toolbar menus, or shows", + "them back.", "", false, SDLK_F10, // F10 @@ -1499,7 +1499,7 @@ word Ordering[NB_SHORTCUTS]= SPECIAL_MOUSE_RIGHT, // Emulate mouse right SPECIAL_CLICK_LEFT, // Emulate mouse click left SPECIAL_CLICK_RIGHT, // Emulate mouse click right - 0x200+BUTTON_HIDE, // Show / Hide menu + 0x200+BUTTON_HIDE, // Show / Hide menus SPECIAL_SHOW_HIDE_CURSOR, // Show / Hide cursor SPECIAL_DOT_PAINTBRUSH, // Paintbrush = "." 0x100+BUTTON_PAINTBRUSHES, // Paintbrush choice diff --git a/init.c b/init.c index 465047b3..a7e1a42a 100644 --- a/init.c +++ b/init.c @@ -928,6 +928,8 @@ void Init_button(byte btn_number, byte shape, Func_action left_action, Func_action right_action, + byte left_instant, + byte right_instant, Func_action unselect_action, byte family) { @@ -939,6 +941,8 @@ void Init_button(byte btn_number, Buttons_Pool[btn_number].Shape =shape; Buttons_Pool[btn_number].Left_action =left_action; Buttons_Pool[btn_number].Right_action =right_action; + Buttons_Pool[btn_number].Left_instant =left_instant; + Buttons_Pool[btn_number].Right_instant =right_instant; Buttons_Pool[btn_number].Unselect_action =unselect_action; Buttons_Pool[btn_number].Family =family; } @@ -961,6 +965,7 @@ void Init_buttons(void) 1,1, BUTTON_SHAPE_RECTANGLE, Do_nothing,Do_nothing, + 0,0, Do_nothing, 0); } @@ -972,6 +977,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Paintbrush_menu,Button_Brush_monochrome, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -980,6 +986,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Adjust,Button_Transform_menu, + 0,0, Do_nothing, FAMILY_TOOL); @@ -988,6 +995,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Draw,Button_Draw_switch_mode, + 0,0, Do_nothing, FAMILY_TOOL); @@ -996,6 +1004,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Curves,Button_Curves_switch_mode, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1004,6 +1013,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Lines,Button_Lines_switch_mode, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1012,6 +1022,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Airbrush,Button_Airbrush_menu, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1020,6 +1031,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Fill,Button_Replace, + 0,0, Button_Unselect_fill, FAMILY_TOOL); @@ -1028,6 +1040,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_TOP_LEFT, Button_polygon,Button_Polyform, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1036,6 +1049,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT, Button_Polyfill,Button_Filled_polyform, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1044,6 +1058,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_TOP_LEFT, Button_Empty_rectangle,Button_Empty_rectangle, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1052,6 +1067,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT, Button_Filled_rectangle,Button_Filled_rectangle, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1060,6 +1076,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_TOP_LEFT, Button_Empty_circle,Button_Empty_ellipse, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1068,6 +1085,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT, Button_Filled_circle,Button_Filled_ellipse, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1076,6 +1094,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Grad_rectangle,Button_Gradients, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1084,6 +1103,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Grad_circle,Button_Grad_ellipse, + 0,0, Do_nothing, FAMILY_TOOL); @@ -1092,6 +1112,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_TOP_LEFT, Button_Brush,Button_Restore_brush, + 0,0, Button_Unselect_brush, FAMILY_INTERRUPTION); @@ -1100,6 +1121,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT, Button_Lasso,Button_Restore_brush, + 0,0, Button_Unselect_lasso, FAMILY_INTERRUPTION); @@ -1112,6 +1134,7 @@ void Init_buttons(void) #else Button_Brush_FX, Button_Brush_FX, #endif + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1120,6 +1143,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Effects,Button_Effects, + 0,0, Do_nothing, FAMILY_EFFECTS); @@ -1128,6 +1152,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Text,Button_Text, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1136,6 +1161,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Magnify,Button_Magnify_menu, + 0,0, Button_Unselect_magnifier, FAMILY_INTERRUPTION); @@ -1144,6 +1170,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Colorpicker,Button_Invert_foreback, + 0,0, Button_Unselect_colorpicker, FAMILY_INTERRUPTION); @@ -1152,6 +1179,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Resolution,Button_Safety_resolution, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1160,6 +1188,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Page,Button_Copy_page, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1168,6 +1197,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_TOP_LEFT, Button_Save,Button_Autosave, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1176,6 +1206,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT, Button_Load,Button_Reload, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1184,6 +1215,7 @@ void Init_buttons(void) 16,16, BUTTON_SHAPE_RECTANGLE, Button_Settings,Button_Skins, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1192,6 +1224,7 @@ void Init_buttons(void) 17,16, BUTTON_SHAPE_RECTANGLE, Button_Clear,Button_Clear_with_backcolor, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1200,6 +1233,7 @@ void Init_buttons(void) 17,16, BUTTON_SHAPE_RECTANGLE, Button_Help,Button_Stats, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1208,6 +1242,7 @@ void Init_buttons(void) 19,12, BUTTON_SHAPE_RECTANGLE, Button_Undo,Button_Redo, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1216,6 +1251,7 @@ void Init_buttons(void) 19,7, BUTTON_SHAPE_RECTANGLE, Button_Kill,Button_Kill, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1224,6 +1260,7 @@ void Init_buttons(void) 19,12, BUTTON_SHAPE_RECTANGLE, Button_Quit,Button_Quit, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1232,6 +1269,7 @@ void Init_buttons(void) 16,8, BUTTON_SHAPE_RECTANGLE, Button_Palette,Button_Secondary_palette, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1240,6 +1278,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_TOP_LEFT, Button_Pal_left,Button_Pal_left_fast, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1248,6 +1287,7 @@ void Init_buttons(void) 15,15, BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT, Button_Pal_right,Button_Pal_right_fast, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1256,6 +1296,7 @@ void Init_buttons(void) 1,32, // La largeur est mise à jour à chq chngmnt de mode BUTTON_SHAPE_NO_FRAME, Button_Select_forecolor,Button_Select_backcolor, + 0,0, Do_nothing, FAMILY_INSTANT); @@ -1265,6 +1306,7 @@ void Init_buttons(void) 57,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_menu, Button_Layer_menu, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_COLOR, @@ -1272,6 +1314,7 @@ void Init_buttons(void) 13,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_get_transparent, Button_Layer_set_transparent, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_MERGE, @@ -1279,6 +1322,7 @@ void Init_buttons(void) 13,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_merge, Button_Layer_merge, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_ADD, @@ -1286,6 +1330,7 @@ void Init_buttons(void) 13,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_add, Button_Layer_add, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_REMOVE, @@ -1293,6 +1338,7 @@ void Init_buttons(void) 13,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_remove, Button_Layer_remove, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_DOWN, @@ -1300,6 +1346,7 @@ void Init_buttons(void) 13,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_down, Button_Layer_down, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_UP, @@ -1307,6 +1354,7 @@ void Init_buttons(void) 13,9, BUTTON_SHAPE_RECTANGLE, Button_Layer_up, Button_Layer_up, + 0,0, Do_nothing, FAMILY_INSTANT); Init_button(BUTTON_LAYER_SELECT, @@ -1314,6 +1362,7 @@ void Init_buttons(void) 13,9, // Will be updated according to actual number of layers BUTTON_SHAPE_NO_FRAME, Button_Layer_select, Button_Layer_toggle, + 0,0, Do_nothing, FAMILY_INSTANT); // Status bar @@ -1321,7 +1370,8 @@ void Init_buttons(void) 0,0, 16,9, BUTTON_SHAPE_RECTANGLE, - Button_Toggle_layerbar, Button_Toggle_toolbox, + Button_Toggle_toolbar, Button_Toggle_all_toolbars, + 1,0, Do_nothing, FAMILY_TOOLBAR); } diff --git a/miscfileformats.c b/miscfileformats.c index cdfd93e7..fa67154d 100644 --- a/miscfileformats.c +++ b/miscfileformats.c @@ -2301,13 +2301,13 @@ int Save_C64_window(byte *saveWhat, byte *loadAddr) Window_set_normal_button(10,100,80,15,"Cancel",1,1,SDLK_ESCAPE); Print_in_window(13,18,"Data:",MC_Dark,MC_Light); - what=Window_set_dropdown_button(10,28,90,15,70,what_label[*saveWhat],1, 0, 1, LEFT_SIDE); + what=Window_set_dropdown_button(10,28,90,15,70,what_label[*saveWhat],1, 0, 1, LEFT_SIDE,0); Window_dropdown_clear_items(what); for (i=0; i