From 588c69442fe9069f6fa78c3ac197c86b7bfc8baf Mon Sep 17 00:00:00 2001 From: DiSlord Date: Mon, 6 Jul 2020 20:41:00 +0300 Subject: [PATCH] not need display menu on keyboard input (so add really full screen keyboard) move size definitions to header --- nanovna.h | 16 +++++++++++++++- ui.c | 14 -------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/nanovna.h b/nanovna.h index 8cf0bb2..5568b0a 100644 --- a/nanovna.h +++ b/nanovna.h @@ -321,7 +321,7 @@ extern uint16_t _grid_y; #define MENU_FORM_WIDTH 256 // Num Input height at bottom -#define NUM_INPUT_HEIGHT 30 +#define NUM_INPUT_HEIGHT 32 extern int16_t area_width; extern int16_t area_height; @@ -346,6 +346,20 @@ extern const uint16_t numfont16x22[]; #define NUM_FONT_GET_WIDTH 16 #define NUM_FONT_GET_HEIGHT 22 +#if 1 +#define KP_WIDTH ((LCD_WIDTH) / 4)// numeric keypad button width +#define KP_HEIGHT ((LCD_HEIGHT - NUM_INPUT_HEIGHT) / 4) // numeric keypad button height +// Key x, y position (0 - 15) on screen +#define KP_GET_X(posx) ((posx) * KP_WIDTH) // numeric keypad left +#define KP_GET_Y(posy) ((posy) * KP_HEIGHT) // numeric keypad top +#else +#define KP_WIDTH (LCD_HEIGHT/5) +#define KP_HEIGHT (LCD_HEIGHT/5) +// Key x, y position (0 - 15) on screen +#define KP_GET_X(posx) ((posx)*KP_WIDTH + (LCD_WIDTH-MENU_BUTTON_WIDTH-5-KP_WIDTH*4)) +#define KP_GET_Y(posy) ((posy)*KP_HEIGHT + 12 ) +#endif + #define S_DELTA "\004" #define S_DEGREE "\037" #define S_SARROW "\030" diff --git a/ui.c b/ui.c index a88cf13..3f66690 100644 --- a/ui.c +++ b/ui.c @@ -1277,20 +1277,6 @@ menu_invoke(int item) } } -#if 1 -#define KP_WIDTH ((LCD_WIDTH - MENU_BUTTON_WIDTH) / 4)// numeric keypad button width -#define KP_HEIGHT ((LCD_HEIGHT - NUM_INPUT_HEIGHT) / 4) // numeric keypad button height -// Key x, y position (0 - 15) on screen -#define KP_GET_X(posx) ((posx) * KP_WIDTH) // numeric keypad left -#define KP_GET_Y(posy) ((posy) * KP_HEIGHT) // numeric keypad top -#else -#define KP_WIDTH (LCD_HEIGHT/5) -#define KP_HEIGHT (LCD_HEIGHT/5) -// Key x, y position (0 - 15) on screen -#define KP_GET_X(posx) ((posx)*KP_WIDTH + (LCD_WIDTH-MENU_BUTTON_WIDTH-5-KP_WIDTH*4)) -#define KP_GET_Y(posy) ((posy)*KP_HEIGHT + 12 ) -#endif - #ifdef __VNA__ // Key names #define KP_0 0