GP2X: Underlines of keyboard shortcuts is disabled, there is no keyboard

This commit is contained in:
Thomas Bernard 2019-02-20 12:27:47 +01:00
parent 5ebb6dc463
commit 53d5b341c1
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
2 changed files with 19 additions and 2 deletions

View File

@ -53,6 +53,11 @@
#include "pxsimple.h" #include "pxsimple.h"
#include "oldies.h" #include "oldies.h"
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
// We don't want to underline the keyboard shortcuts as there is no keyboard
#define NO_KEYBOARD
#endif
// we need this as global // we need this as global
short Old_MX = -1; short Old_MX = -1;
@ -1881,9 +1886,13 @@ void Window_draw_normal_bouton(word x_pos,word y_pos,word width,word height,
text_y_pos=y_pos+((height-7)>>1); text_y_pos=y_pos+((height-7)>>1);
Print_in_window(text_x_pos,text_y_pos,title,title_color,MC_Light); Print_in_window(text_x_pos,text_y_pos,title,title_color,MC_Light);
#if !defined(NO_KEYBOARD)
if (undersc_letter) if (undersc_letter)
Window_rectangle(text_x_pos+((undersc_letter-1)<<3), Window_rectangle(text_x_pos+((undersc_letter-1)<<3),
text_y_pos+8,8,1,MC_Dark); text_y_pos+8,8,1,MC_Dark);
#else
(void)undersc_letter;
#endif
} }

View File

@ -61,6 +61,11 @@
#define MIN(a,b) ((a)<(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b))
#endif #endif
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
// We don't want to underline the keyboard shortcuts as there is no keyboard
#define NO_KEYBOARD
#endif
T_Toolbar_button Buttons_Pool[NB_BUTTONS]; T_Toolbar_button Buttons_Pool[NB_BUTTONS];
T_Menu_Bar Menu_bars[MENUBAR_COUNT] = T_Menu_Bar Menu_bars[MENUBAR_COUNT] =
{{MENU_WIDTH, 9, 1, 45, {NULL,NULL,NULL}, 20, BUTTON_HIDE }, // Status {{MENU_WIDTH, 9, 1, 45, {NULL,NULL,NULL}, 20, BUTTON_HIDE }, // Status
@ -994,9 +999,12 @@ void Print_in_window_underscore(short x,short y,const char * str,byte text_color
Print_char_in_window(x,y,*p++,text_color,background_color); Print_char_in_window(x,y,*p++,text_color,background_color);
x+=8; x+=8;
} }
if (undersc_letter) { #if !defined(NO_KEYBOARD)
if (undersc_letter)
Window_rectangle(x_pos+((undersc_letter-1)<<3),y+8,8,1,text_color); Window_rectangle(x_pos+((undersc_letter-1)<<3),y+8,8,1,text_color);
} #else
(void)undersc_letter;
#endif
Update_window_area(x_pos,y,x-x_pos,8); Update_window_area(x_pos,y,x-x_pos,8);
} }