Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(CC) AircraftMenuSize CompassMenuSize and remove LKinclude_menusize.cpp

  • Loading branch information...
commit 413d7ab57173064c1c058531dcc87d7a54076b23 1 parent 19e0089
@pventafridda pventafridda authored
View
2  Common/Header/Globals.h
@@ -444,6 +444,8 @@ GEXTERN int ScreenScale;
GEXTERN bool ScreenIntScale;
// Used as a delimiter in MapWnd for clicks on screen.
GEXTERN int BottomBarY;
+GEXTERN int AircraftMenuSize;
+GEXTERN int CompassMenuSize;
// 091011 Used by TakeoffLanding inside Calculation.cpp - limited values careful
GEXTERN int time_in_flight;
View
23 Common/Source/Draw/MapWndProc.cpp
@@ -178,9 +178,11 @@ LRESULT CALLBACK MapWindow::MapWndProc (HWND hWnd, UINT uMsg, WPARAM wParam,
bool dontdrawthemap=(DONTDRAWTHEMAP);
bool mapmode8000=(MAPMODE8000);
- // Attention... this is duplicated inside Utils2, I am lazy
- // apparently only #include is duplicated, so no problems
- static int AIRCRAFTMENUSIZE=0, COMPASSMENUSIZE=0;
+ #if 0
+ if (DoInit[MDI_MAPWNDPROC]) {
+ DoInit[MDI_MAPWNDPROC]=false;
+ }
+ #endif
switch (uMsg)
{
@@ -433,18 +435,13 @@ LRESULT CALLBACK MapWindow::MapWndProc (HWND hWnd, UINT uMsg, WPARAM wParam,
break;
}
- // Process Active Icons
- if (DoInit[MDI_MAPWNDPROC]) {
- #include "./LKinclude_menusize.cpp"
- DoInit[MDI_MAPWNDPROC]=false;
- }
short topicon;
if (DrawBottom) topicon=MapRect.bottom-MapRect.top-BottomSize-14; // 100305
else
- topicon=MapRect.bottom-MapRect.top-AIRCRAFTMENUSIZE;
+ topicon=MapRect.bottom-MapRect.top-AircraftMenuSize;
-if ( (lparam_X > ((MapRect.right-MapRect.left)- AIRCRAFTMENUSIZE)) &&
+if ( (lparam_X > ((MapRect.right-MapRect.left)- AircraftMenuSize)) &&
(lparam_Y > topicon) ) {
// short click on aircraft icon
@@ -485,7 +482,7 @@ if ( (lparam_X > ((MapRect.right-MapRect.left)- AIRCRAFTMENUSIZE)) &&
// end aircraft icon check
}
if (mapmode8000) {
- if ( (lparam_X <= (MapRect.left + COMPASSMENUSIZE)) && (lparam_Y <= (MapRect.top+COMPASSMENUSIZE)) ) {
+ if ( (lparam_X <= (MapRect.left + CompassMenuSize)) && (lparam_Y <= (MapRect.top+CompassMenuSize)) ) {
if (!CustomKeyHandler(CKI_TOPLEFT)) {
// Well we better NOT play a click while zoomin in and out, because on slow
// devices it will slow down the entire process.
@@ -506,7 +503,7 @@ if ( (lparam_X > ((MapRect.right-MapRect.left)- AIRCRAFTMENUSIZE)) &&
if (ISPARAGLIDER) {
// Use the compass to pullup UTM informations to paragliders
- if ( (lparam_X > ((MapRect.right-MapRect.left)- COMPASSMENUSIZE)) && (lparam_Y <= MapRect.top+COMPASSMENUSIZE) ) {
+ if ( (lparam_X > ((MapRect.right-MapRect.left)- CompassMenuSize)) && (lparam_Y <= MapRect.top+CompassMenuSize) ) {
if ((dwInterval >= DOUBLECLICKINTERVAL) ) {
@@ -535,7 +532,7 @@ if ( (lparam_X > ((MapRect.right-MapRect.left)- AIRCRAFTMENUSIZE)) &&
// else {
// change in 2.3q: we let paragliders use the CK as well
{
- if ( (lparam_X > ((MapRect.right-MapRect.left)- COMPASSMENUSIZE)) && (lparam_Y <= MapRect.top+COMPASSMENUSIZE) ) {
+ if ( (lparam_X > ((MapRect.right-MapRect.left)- CompassMenuSize)) && (lparam_Y <= MapRect.top+CompassMenuSize) ) {
if (!CustomKeyHandler(CKI_TOPRIGHT)) {
#if 0
#ifndef DISABLEAUDIO
View
3  Common/Source/Globals.cpp
@@ -614,6 +614,9 @@ void Globals_Init(void) {
// Coordinate Y of bottombar area valid for click
BottomBarY=0;
+ // Set by InitLKScreen, used in Draw parts
+ AircraftMenuSize=0;
+ CompassMenuSize=0;
// ^ ADD NEW GLOBALS up here ^
View
2  Common/Source/LKInterface/LKInitScreen.cpp
@@ -208,6 +208,8 @@ void InitLKScreen() {
// Used by MapWndProc touch key ckecks to know if a key is on the bottombar
BottomBarY=(MapWindow::MapRect.bottom-MapWindow::MapRect.top)-BottomSize-NIBLSCALE(2);
+ AircraftMenuSize=NIBLSCALE(28)+14;
+ CompassMenuSize=AircraftMenuSize+NIBLSCALE(17);
} // End of LKInitScreen
View
8 Common/Source/LKInterface/VirtualKeys.cpp
@@ -25,11 +25,6 @@ int ProcessVirtualKey(int X, int Y, long keytime, short vkmode) {
#define VKTIMELONG 1500
#define DONTDRAWTHEMAP !MapWindow::mode.AnyPan()&&MapSpaceMode!=1
- #if 100228
- static int AIRCRAFTMENUSIZE=0;
- #else
- #define AIRCRAFTMENUSIZE NIBLSCALE(28)
- #endif
short yup, ydown;
static short sizeup;
short i, j;
@@ -68,9 +63,6 @@ int ProcessVirtualKey(int X, int Y, long keytime, short vkmode) {
// same for bottom navboxes: they do not exist in infobox mode
s_bottomY=(MapWindow::MapRect.bottom-MapWindow::MapRect.top)-BottomSize-NIBLSCALE(2); // bugfix era 15, troppo 090731
- #define _NOCOMPASSINCLUDE
- #include "./LKinclude_menusize.cpp"
-
longpress_yup=(short)((sizeup-BottomSize-TopSize)/3.7)+MapWindow::MapRect.top+TopSize;
longpress_ydown=(short)(MapWindow::MapRect.bottom-BottomSize-((sizeup-BottomSize)/3.7));
shortpress_yup=(short)((sizeup-BottomSize-TopSize)/2.7)+MapWindow::MapRect.top+TopSize;
View
8 Common/Source/LKinclude_menusize.cpp
@@ -1,8 +0,0 @@
-// LKinclude_menusize.cpp
-// This is included by MapWindow and Utils2
-// AIRCRAFTICONSIZE is used also in LKDrawLook as iconsize=NIBL(26)
-
- AIRCRAFTMENUSIZE=NIBLSCALE(28)+14;
- #ifndef _NOCOMPASSINCLUDE
- COMPASSMENUSIZE=AIRCRAFTMENUSIZE+NIBLSCALE(17);
- #endif
Please sign in to comment.
Something went wrong with that request. Please try again.