-Add some more zoom factors (up to x32)
-Replace the zoom window with a popup menu. Note this make shift+M unusable. Do you think it's annoying ? (also, I don't know how to remove/disable the shortcut, and have no idea what it could do instead) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1272 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
98a9eb44c4
commit
fe0f87521b
72
buttons.c
72
buttons.c
@ -3273,65 +3273,51 @@ void Button_Magnify(void)
|
|||||||
Update_rect(0,0,0,0);
|
Update_rect(0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Magnify_menu(void)
|
void Button_Magnify_menu(void)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
T_Dropdown_button dropdown;
|
||||||
|
T_Dropdown_choice *item;
|
||||||
Open_window(141,114,"Zoom factors");
|
int i;
|
||||||
|
const char text[NB_ZOOM_FACTORS][4] =
|
||||||
Window_set_normal_button(45,88,51,14,"Cancel",0,1,KEY_ESC); // 1
|
{"x2", "x3", "x4", "x5", "x6", "x8", "x10", "x12", "x14", "x16", "x18", "x20",
|
||||||
|
"x24", "x28", "x32"};
|
||||||
Window_set_normal_button( 9,25,27,14, "x2",0,Main_magnifier_factor!= 2,SDLK_F1); // 2
|
|
||||||
Window_set_normal_button( 41,25,27,14, "x3",0,Main_magnifier_factor!= 3,SDLK_F2); // 3
|
Hide_cursor();
|
||||||
Window_set_normal_button( 73,25,27,14, "x4",0,Main_magnifier_factor!= 4,SDLK_F3); // 4
|
|
||||||
Window_set_normal_button(105,25,27,14, "x5",0,Main_magnifier_factor!= 5,SDLK_F4); // 5
|
dropdown.Pos_X =Buttons_Pool[BUTTON_MAGNIFIER].X_offset;
|
||||||
Window_set_normal_button( 9,45,27,14, "x6",0,Main_magnifier_factor!= 6,SDLK_F5); // 6
|
dropdown.Pos_Y =Buttons_Pool[BUTTON_MAGNIFIER].Y_offset;
|
||||||
Window_set_normal_button( 41,45,27,14, "x8",0,Main_magnifier_factor!= 8,SDLK_F6); // 7
|
dropdown.Height =Buttons_Pool[BUTTON_MAGNIFIER].Height;
|
||||||
Window_set_normal_button( 73,45,27,14,"x10",0,Main_magnifier_factor!=10,SDLK_F7); // 8
|
dropdown.Dropdown_width=28;
|
||||||
Window_set_normal_button(105,45,27,14,"x12",0,Main_magnifier_factor!=12,SDLK_F8); // 9
|
dropdown.First_item =NULL;
|
||||||
Window_set_normal_button( 9,65,27,14,"x14",0,Main_magnifier_factor!=14,SDLK_F9); // 10
|
dropdown.Bottom_up =1;
|
||||||
Window_set_normal_button( 41,65,27,14,"x16",0,Main_magnifier_factor!=16,SDLK_F10); // 11
|
|
||||||
Window_set_normal_button( 73,65,27,14,"x18",0,Main_magnifier_factor!=18,SDLK_F11); // 12
|
for(i = 0; i < NB_ZOOM_FACTORS; i++) {
|
||||||
Window_set_normal_button(105,65,27,14,"x20",0,Main_magnifier_factor!=20,SDLK_F12); // 13
|
Window_dropdown_add_item(&dropdown, i, text[i]);
|
||||||
Update_window_area(0,0,Window_width, Window_height);
|
|
||||||
|
|
||||||
Display_cursor();
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
clicked_button=Window_clicked_button();
|
|
||||||
if (Is_shortcut(Key,0x100+BUTTON_HELP))
|
|
||||||
Window_help(BUTTON_MAGNIFIER, NULL);
|
|
||||||
else if (Is_shortcut(Key,0x200+BUTTON_MAGNIFIER))
|
|
||||||
clicked_button=1;
|
|
||||||
}
|
|
||||||
while (clicked_button<=0);
|
|
||||||
|
|
||||||
Close_window();
|
|
||||||
|
|
||||||
if (clicked_button>1)
|
|
||||||
{
|
|
||||||
Menu_Y=Menu_Y_before_window;
|
|
||||||
Change_magnifier_factor(clicked_button-2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (clicked_button==1) && (!Main_magnifier_mode) && (Current_operation!=OPERATION_MAGNIFY) ) // Cancel
|
item=Dropdown_activate(&dropdown,0,Menu_Y);
|
||||||
|
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
Change_magnifier_factor(item->Number);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (!item) && (!Main_magnifier_mode) && (Current_operation!=OPERATION_MAGNIFY) ) // Cancel
|
||||||
Unselect_button(BUTTON_MAGNIFIER);
|
Unselect_button(BUTTON_MAGNIFIER);
|
||||||
|
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
Update_rect(Main_separator_position,0,Screen_width-Main_separator_position,Menu_Y);
|
Update_rect(Main_separator_position,0,Screen_width-Main_separator_position,Menu_Y);
|
||||||
|
|
||||||
if ( (clicked_button>1) && (!Main_magnifier_mode) && (Current_operation!=OPERATION_MAGNIFY) ) // Passage en mode zoom
|
if ( (item) && (!Main_magnifier_mode) && (Current_operation!=OPERATION_MAGNIFY) ) // Passage en mode zoom
|
||||||
{
|
{
|
||||||
Coming_from_zoom_factor_menu=1;
|
Coming_from_zoom_factor_menu=1;
|
||||||
Select_button(BUTTON_MAGNIFIER,LEFT_SIDE);
|
Select_button(BUTTON_MAGNIFIER,LEFT_SIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Window_dropdown_clear_items(&dropdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Unselect_magnifier(void)
|
void Button_Unselect_magnifier(void)
|
||||||
{
|
{
|
||||||
if (Main_magnifier_mode)
|
if (Main_magnifier_mode)
|
||||||
|
|||||||
2
const.h
2
const.h
@ -36,7 +36,7 @@
|
|||||||
#define BETA2 0 ///< Version number for gfx2.cfg (4/4)
|
#define BETA2 0 ///< Version number for gfx2.cfg (4/4)
|
||||||
#define MAX_VIDEO_MODES 100 ///< Maximum number of video modes Grafx2 can propose.
|
#define MAX_VIDEO_MODES 100 ///< Maximum number of video modes Grafx2 can propose.
|
||||||
#define NB_SHORTCUTS 181 ///< Number of actions that can have a key combination associated to it.
|
#define NB_SHORTCUTS 181 ///< Number of actions that can have a key combination associated to it.
|
||||||
#define NB_ZOOM_FACTORS 12 ///< Number of zoom levels available in the magnifier.
|
#define NB_ZOOM_FACTORS 15 ///< Number of zoom levels available in the magnifier.
|
||||||
#define MENU_WIDTH 254 ///< Width of the menu (not counting the palette)
|
#define MENU_WIDTH 254 ///< Width of the menu (not counting the palette)
|
||||||
#define MENU_HEIGHT 44 ///< Height of the menu.
|
#define MENU_HEIGHT 44 ///< Height of the menu.
|
||||||
#define NB_CURSOR_SPRITES 8 ///< Number of available mouse cursor sprites.
|
#define NB_CURSOR_SPRITES 8 ///< Number of available mouse cursor sprites.
|
||||||
|
|||||||
2
global.h
2
global.h
@ -742,7 +742,7 @@ GFX2_GLOBAL byte Mask_table[256];
|
|||||||
// -- Magnifier data
|
// -- Magnifier data
|
||||||
|
|
||||||
#ifdef GLOBAL_VARIABLES
|
#ifdef GLOBAL_VARIABLES
|
||||||
word ZOOM_FACTOR[NB_ZOOM_FACTORS]={2,3,4,5,6,8,10,12,14,16,18,20};
|
word ZOOM_FACTOR[NB_ZOOM_FACTORS]={2,3,4,5,6,8,10,12,14,16,18,20, 24, 28, 32};
|
||||||
#else
|
#else
|
||||||
/// Successive zoom factors, used by the Magnifier.
|
/// Successive zoom factors, used by the Magnifier.
|
||||||
extern word ZOOM_FACTOR[NB_ZOOM_FACTORS];
|
extern word ZOOM_FACTOR[NB_ZOOM_FACTORS];
|
||||||
|
|||||||
2
init.c
2
init.c
@ -1161,7 +1161,7 @@ void Init_buttons(void)
|
|||||||
16,16,
|
16,16,
|
||||||
BUTTON_SHAPE_RECTANGLE,
|
BUTTON_SHAPE_RECTANGLE,
|
||||||
Button_Magnify,Button_Magnify_menu,
|
Button_Magnify,Button_Magnify_menu,
|
||||||
0,0,
|
0,1,
|
||||||
Button_Unselect_magnifier,
|
Button_Unselect_magnifier,
|
||||||
FAMILY_INTERRUPTION);
|
FAMILY_INTERRUPTION);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user