Commit 080ecbb9 authored by Over_score's avatar Over_score

Fixing upper/lower case catalog issue

parent 7717ca03
......@@ -283,8 +283,7 @@ void btnPressed(void *notUsed, void *data) {
refreshRegisterLine(REGISTER_Y);
}
// ===== Special key: Enter ===================================================================
if(item == ITM_ENTER && calcMode != CM_NORMAL && calcMode != CM_NIM) {
if(item == ITM_ENTER) {
if(calcMode == CM_AIM) {
calcModeNormal();
showAlphaMode();
......@@ -309,7 +308,7 @@ void btnPressed(void *notUsed, void *data) {
refreshStack();
}
else if(calcMode == CM_TAM) {
addItemToBuffer(ITM_ENTER);
}
......@@ -514,6 +513,36 @@ void btnPressed(void *notUsed, void *data) {
else if(item == KEY_UP) {
if(calcMode == CM_NORMAL || calcMode == CM_AIM || calcMode == CM_NIM) {
if(softmenuStackPointer > 0 && softmenuStack[softmenuStackPointer - 1].softmenu != MY_ALPHA_MENU) {
int16_t sm = softmenu[softmenuStack[softmenuStackPointer - 1].softmenu].menuId;
if((sm == -MNU_alpha_omega || sm == -MNU_a_z || sm == -MNU_ALPHAintl) && alphaCase == AC_LOWER) {
alphaCase = AC_UPPER;
showAlphaMode();
softmenuStack[softmenuStackPointer - 1].softmenu--; // Switch to the upper case menu
showSoftmenuCurrentPart();
}
else {
itemShift = alphaSelectionMenu == ASM_NONE ? 18 : 6;
if((softmenuStack[softmenuStackPointer - 1].firstItem + itemShift) < softmenu[softmenuStack[softmenuStackPointer-1].softmenu].numItems) {
softmenuStack[softmenuStackPointer - 1].firstItem += itemShift;
showSoftmenuCurrentPart();
}
else {
softmenuStack[softmenuStackPointer - 1].firstItem = 0;
showSoftmenuCurrentPart();
}
if(alphaSelectionMenu == ASM_CNST) lastCnstMenuPos = softmenuStack[softmenuStackPointer - 1].firstItem;
else if(alphaSelectionMenu == ASM_FCNS) lastFcnsMenuPos = softmenuStack[softmenuStackPointer - 1].firstItem;
}
}
else {
if(alphaCase != AC_UPPER) {
alphaCase = AC_UPPER;
showAlphaMode();
}
}
/* if(softmenuStackPointer > 0 && softmenuStack[softmenuStackPointer - 1].softmenu != MY_ALPHA_MENU) {
itemShift = alphaSelectionMenu == ASM_NONE ? 18 : 6;
if((softmenuStack[softmenuStackPointer - 1].firstItem + itemShift) < softmenu[softmenuStack[softmenuStackPointer-1].softmenu].numItems) {
......@@ -531,7 +560,7 @@ void btnPressed(void *notUsed, void *data) {
else if(calcMode == CM_AIM) {
alphaCase = AC_UPPER;
showAlphaMode();
}
}*/
}
else if(calcMode == CM_TAM) {
......@@ -577,6 +606,37 @@ void btnPressed(void *notUsed, void *data) {
else if(item == KEY_DOWN) {
if(calcMode == CM_NORMAL || calcMode == CM_AIM || calcMode == CM_NIM) {
if(softmenuStackPointer > 0 && softmenuStack[softmenuStackPointer - 1].softmenu != MY_ALPHA_MENU) {
int16_t sm = softmenu[softmenuStack[softmenuStackPointer - 1].softmenu].menuId;
if((sm == -MNU_ALPHA_OMEGA || sm == -MNU_A_Z || sm == -MNU_ALPHAINTL) && alphaCase == AC_UPPER) {
alphaCase = AC_LOWER;
showAlphaMode();
softmenuStack[softmenuStackPointer - 1].softmenu++; // Switch to the lower case menu
showSoftmenuCurrentPart();
}
else {
itemShift = alphaSelectionMenu == ASM_NONE ? 18 : 6;
if((softmenuStack[softmenuStackPointer - 1].firstItem - itemShift) >= 0) {
softmenuStack[softmenuStackPointer - 1].firstItem -= itemShift;
showSoftmenuCurrentPart();
}
else {
softmenuStack[softmenuStackPointer - 1].firstItem = (softmenu[softmenuStack[softmenuStackPointer-1].softmenu].numItems/6 - 1) / (itemShift/6) * itemShift; // doesn't work if numItems is not a multiple of 6
showSoftmenuCurrentPart();
}
if(alphaSelectionMenu == ASM_CNST) lastCnstMenuPos = softmenuStack[softmenuStackPointer - 1].firstItem;
else if(alphaSelectionMenu == ASM_FCNS) lastFcnsMenuPos = softmenuStack[softmenuStackPointer - 1].firstItem;
}
}
else {
if(alphaCase != AC_LOWER) {
alphaCase = AC_LOWER;
showAlphaMode();
}
}
/* if(calcMode == CM_NORMAL || calcMode == CM_AIM || calcMode == CM_NIM) {
if(softmenuStackPointer > 0 && softmenuStack[softmenuStackPointer - 1].softmenu != MY_ALPHA_MENU) {
itemShift = alphaSelectionMenu == ASM_NONE ? 18 : 6;
......@@ -595,7 +655,7 @@ void btnPressed(void *notUsed, void *data) {
else if(calcMode == CM_AIM) {
alphaCase = AC_LOWER;
showAlphaMode();
}
}*/
}
else if(calcMode == CM_TAM) {
......
......@@ -211,7 +211,6 @@ const int16_t menu_Orthog[] = { ITM_HN, ITM_Ln,
ITM_HNP, ITM_NULL, ITM_NULL, ITM_NULL, ITM_NULL, ITM_NULL };
// Following menu is UPPER CASE for lower case: +80
const int16_t menu_alpha_INTL[] = { CHR_A_MACRON, CHR_A_ACUTE, CHR_A_BREVE, CHR_A_GRAVE, CHR_A_DIARESIS, CHR_A_TILDE,
CHR_A_CIRC, CHR_A_RING, CHR_AE, CHR_A_OGONEK, CHR_C_ACUTE, CHR_C_CARON,
CHR_C_CEDILLA, CHR_D_STROKE, CHR_D_CARON, CHR_E_MACRON, CHR_E_ACUTE, CHR_E_BREVE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment