@@ -4,7 +4,7 @@ using namespace Menu;
44bool prompt::hasTitle (navNode& nav) const {return (nav.target ->has (showTitle)||(nav.root ->showTitle &&!nav.target ->has (noTitle)));}
55
66idx_t prompt::printRaw (menuOut& out,idx_t len) const {
7- trace (Serial<<" prompt::printRaw" <<endl);
7+ trace (Serial<<" prompt::printRaw" <<endl; print_P (Serial, getText (),len) );
88 return print_P (out,getText (),len);
99}
1010
@@ -155,26 +155,31 @@ bool menuNode::changed(const navNode &nav,const menuOut& out,bool sub) {
155155 bool appd=is ((systemStyles)(_asPad|_parentDraw));
156156 if (dirty) return true ;
157157 if (appd) {
158+ trace (Serial<<" appd!" <<endl;);
158159 for (int i=0 ;i<sz ();i++)
159160 if (operator [](i).changed (nav,out,false ))
160161 return true ;
161162 } else {
163+ trace (Serial<<*this <<" !appd" <<endl;);
162164 if (!(nav.target ==this &&sub)) return dirty;// second hand check, just report self
163165 idx_t level=nav.root ->level ;
164166 if (parentDraw ())
165167 return nav.root ->path [level-1 ].target ->changed (nav.root ->path [level-1 ],out,sub);
166168 idx_t my=out.maxY ()-((has (showTitle)||(nav.root ->showTitle &&!has (noTitle)))?1 :0 );
167- idx_t t=out.tops [level];
169+ trace (Serial<<" target:" <<*nav.root ->navFocus <<" " <<nav.root ->navFocus ->has (_parentDraw)<<endl);
170+ idx_t t=out.tops [level-nav.root ->navFocus ->has (_parentDraw)];
171+ trace (Serial<<" t:" <<t<<endl;);
168172 if (sub) for (int i=0 ;i<my;i++,t++) {
169173 if (t>=sz ()) break ;
174+ trace (Serial<<" checking:" <<operator [](t)<<endl);
170175 if (operator [](t).changed (nav,out,false )) return true ;
171176 }
172177 }
173178 return false ;
174179}
175180
176181void menuNode::clearChanged (const navNode &nav,const menuOut& out,bool sub) {
177- trace (Serial<<endl<<* this << " menuOut::clearChanged " <<nav);
182+ trace (Serial<<" menuOut::clearChanged " <<nav);
178183 dirty=false ;
179184 if (is ((systemStyles)(_asPad|_parentDraw))) {
180185 for (int i=0 ;i<sz ();i++)
@@ -185,7 +190,7 @@ void menuNode::clearChanged(const navNode &nav,const menuOut& out,bool sub) {
185190 if (parentDraw ())
186191 return nav.root ->path [level-1 ].target ->clearChanged (nav.root ->path [level-1 ],out,sub);
187192 idx_t my=out.maxY ()-((has (showTitle)||(nav.root ->showTitle &&!has (noTitle)))?1 :0 );
188- idx_t t=out.tops [level];
193+ idx_t t=out.tops [level-nav. root -> navFocus -> has (_parentDraw) ];
189194 for (idx_t i=0 ;i<my;i++,t++) {// only signal visible
190195 if (t>=sz ()) break ;// menu ended
191196 operator [](t).clearChanged (nav,out,false );
0 commit comments