@@ -396,18 +396,6 @@ void PsuAppContext::stateManagment() {
396
396
}
397
397
}
398
398
399
- bool PsuAppContext::isActiveWidget (const WidgetCursor &widgetCursor) {
400
- if (getActivePageId () == PAGE_ID_TOUCH_CALIBRATION) {
401
- if (touch::getEventType () != EVENT_TYPE_TOUCH_NONE) {
402
- if (widgetCursor.widget ->type == WIDGET_TYPE_TEXT && isTouchPointActivated ()) {
403
- return true ;
404
- }
405
- }
406
- }
407
-
408
- return false ;
409
- }
410
-
411
399
int PsuAppContext::getMainPageId () {
412
400
return PAGE_ID_MAIN;
413
401
}
@@ -831,17 +819,17 @@ void PsuAppContext::showUncaughtScriptExceptionMessage() {
831
819
}
832
820
833
821
void TextInputParams::onSet (char *value) {
834
- popPage ();
835
-
836
822
g_psuAppContext.m_textInputParams .m_input = value;
837
823
g_psuAppContext.m_inputReady = true ;
838
- }
839
824
840
- void TextInputParams::onCancel () {
841
825
popPage ();
826
+ }
842
827
828
+ void TextInputParams::onCancel () {
843
829
g_psuAppContext.m_textInputParams .m_input = nullptr ;
844
830
g_psuAppContext.m_inputReady = true ;
831
+
832
+ popPage ();
845
833
}
846
834
847
835
const char *PsuAppContext::textInput (const char *label, size_t minChars, size_t maxChars, const char *value) {
@@ -866,17 +854,17 @@ void PsuAppContext::doShowTextInput() {
866
854
}
867
855
868
856
void NumberInputParams::onSet (float value) {
869
- popPage ();
870
-
871
857
g_psuAppContext.m_numberInputParams .m_input = value;
872
858
g_psuAppContext.m_inputReady = true ;
873
- }
874
859
875
- void NumberInputParams::onCancel () {
876
860
popPage ();
861
+ }
877
862
863
+ void NumberInputParams::onCancel () {
878
864
g_psuAppContext.m_numberInputParams .m_input = NAN;
879
865
g_psuAppContext.m_inputReady = true ;
866
+
867
+ popPage ();
880
868
}
881
869
882
870
float PsuAppContext::numberInput (const char *label, Unit unit, float min, float max, float value) {
@@ -909,18 +897,18 @@ void PsuAppContext::doShowNumberInput() {
909
897
}
910
898
911
899
void IntegerInputParams::onSet (float value) {
912
- popPage ();
913
-
914
900
g_psuAppContext.m_integerInputParams .m_input = (int32_t )value;
915
901
g_psuAppContext.m_integerInputParams .canceled = false ;
916
902
g_psuAppContext.m_inputReady = true ;
917
- }
918
903
919
- void IntegerInputParams::onCancel () {
920
904
popPage ();
905
+ }
921
906
907
+ void IntegerInputParams::onCancel () {
922
908
g_psuAppContext.m_integerInputParams .canceled = true ;
923
909
g_psuAppContext.m_inputReady = true ;
910
+
911
+ popPage ();
924
912
}
925
913
926
914
bool PsuAppContext::integerInput (const char *label, int32_t min, int32_t max, int32_t &value) {
@@ -1063,10 +1051,10 @@ int PsuAppContext::getExtraLongTouchActionHook(const WidgetCursor &widgetCursor)
1063
1051
}
1064
1052
1065
1053
void MenuInputParams::onSet (int value) {
1066
- popPage ();
1067
-
1068
1054
g_psuAppContext.m_menuInputParams .m_input = value;
1069
1055
g_psuAppContext.m_inputReady = true ;
1056
+
1057
+ popPage ();
1070
1058
}
1071
1059
1072
1060
int PsuAppContext::menuInput (const char *label, MenuType menuType, const char **menuItems) {
@@ -1123,12 +1111,11 @@ void SelectParams::enumDefinition(DataOperationEnum operation, const WidgetCurso
1123
1111
}
1124
1112
1125
1113
void SelectParams::onSelect (uint16_t value) {
1126
- popPage ();
1127
-
1128
1114
g_psuAppContext.m_selectParams .m_input = value;
1129
1115
g_psuAppContext.m_inputReady = true ;
1130
- }
1131
1116
1117
+ popPage ();
1118
+ }
1132
1119
1133
1120
void PsuAppContext::doShowSelect () {
1134
1121
pushSelectFromEnumPage (SelectParams::enumDefinition, m_selectParams.m_defaultSelection , nullptr , SelectParams::onSelect, false , true );
@@ -1150,22 +1137,17 @@ bool PsuAppContext::canExecuteActionWhenTouchedOutsideOfActivePage(int pageId, i
1150
1137
return false ;
1151
1138
}
1152
1139
1153
- void PsuAppContext::updatePage (int i, WidgetCursor &widgetCursor) {
1154
- AppContext::updatePage (i, widgetCursor);
1155
-
1140
+ void PsuAppContext::pageRenderCustom (int i, WidgetCursor &widgetCursor) {
1156
1141
if (getActivePageId () == PAGE_ID_TOUCH_CALIBRATION_YES_NO || getActivePageId () == PAGE_ID_TOUCH_CALIBRATION_YES_NO_CANCEL) {
1157
1142
auto eventType = touch::getEventType ();
1158
1143
if (eventType == EVENT_TYPE_TOUCH_DOWN || eventType == EVENT_TYPE_TOUCH_MOVE) {
1159
- display::selectBuffer (m_pageNavigationStack[m_pageNavigationStackPointer].displayBufferIndex );
1160
1144
int x = MIN (MAX (touch::getX (), 1 ), eez::display::getDisplayWidth () - 2 );
1161
1145
int y = MIN (MAX (touch::getY (), 1 ), eez::display::getDisplayHeight () - 2 );
1162
1146
eez::display::setColor (255 , 255 , 255 );
1163
1147
eez::display::fillRect (x - 1 , y - 1 , x + 1 , y + 1 );
1164
1148
}
1165
1149
} else if (getActivePageId () == PAGE_ID_TOUCH_TEST) {
1166
1150
if (g_findCallback == nullptr ) {
1167
- display::selectBuffer (m_pageNavigationStack[i].displayBufferIndex );
1168
-
1169
1151
if (get (widgetCursor, DATA_ID_TOUCH_CALIBRATED_PRESSED).getInt ()) {
1170
1152
int x = MIN (MAX (get (widgetCursor, DATA_ID_TOUCH_CALIBRATED_X).getInt (), 1 ), eez::display::getDisplayWidth () - 2 );
1171
1153
int y = MIN (MAX (get (widgetCursor, DATA_ID_TOUCH_CALIBRATED_Y).getInt (), 1 ), eez::display::getDisplayHeight () - 2 );
0 commit comments