@@ -154,22 +154,31 @@ Used textField::printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len
154154// menuNode - any menu object that has a list of members
155155//
156156// //////////////////////////////////////////////////////////////////////////////
157- bool menuNode::changed (const navNode &nav,const menuOut& out,bool sub) {
157+ bool menuNode::changed (const navNode &nav,const menuOut& out,bool sub, bool test ) {
158158 trace (Serial<<*this <<" menuNode::changed" <<endl);
159- if (dirty) return true ;
159+ if (dirty) {
160+ trace (if (test) Serial<<" just dirty!" <<endl);
161+ return true ;
162+ }
160163 bool appd=has ((systemStyles)(_asPad|_parentDraw));
161164 if (appd) {
162165 trace (Serial<<" appd!" <<endl;);
163166 for (int i=0 ;i<sz ();i++)
164- if (operator [](i).changed (nav,out,false ))
167+ if (operator [](i).changed (nav,out,false ,test)) {
168+ trace (if (test) Serial<<" APPD! " <<operator [](i).type ()<<endl);
165169 return true ;
170+ }
166171 } else {
167172 trace (Serial<<*this <<" !appd" <<endl;);
168- if (!(nav.target ==this &&sub)) return dirty;// second hand check, just report self
173+ if (!(nav.target ==this &&sub)) {
174+ trace (if (test&&dirty) Serial<<" indirect!" <<endl);
175+ return dirty;// second hand check, just report self
176+ }
169177 idx_t level=nav.root ->level ;
170178 if (parentDraw ()) {
171179 trace (Serial<<" return changed of parent-draw element" <<endl);
172- return nav.root ->path [level-1 ].target ->changed (nav.root ->path [level-1 ],out,sub);
180+ trace (if (test) Serial<<" parentDraw()!" <<endl);
181+ return nav.root ->path [level-1 ].target ->changed (nav.root ->path [level-1 ],out,sub,test);
173182 }
174183 // idx_t tit=hasTitle(nav.root->path[lev])?1:0;//TODO: this might not be correct.. checking
175184 idx_t my=out.maxY ()-((has (showTitle)||(nav.root ->showTitle &&!has (noTitle)))?1 :0 );
@@ -181,7 +190,10 @@ bool menuNode::changed(const navNode &nav,const menuOut& out,bool sub) {
181190 if (sub) for (int i=0 ;i<my;i++,t++) {
182191 if (t>=sz ()) break ;
183192 trace (Serial<<" checking:" <<operator [](t)<<endl);
184- if (operator [](t).changed (nav,out,false )) return true ;
193+ if (operator [](t).changed (nav,out,false ,test)) {
194+ trace (if (test) Serial<<" sub changed!" <<endl);
195+ return true ;
196+ }
185197 }
186198 }
187199 return false ;
@@ -206,6 +218,16 @@ void menuNode::clearChanged(const navNode &nav,const menuOut& out,bool sub) {
206218 operator [](t).clearChanged (nav,out,false );
207219 }
208220 }
221+ #ifdef DEBUG
222+ if (changed (nav,out,sub,true )) {
223+ Serial<<" ERROR clear changed fail!" <<endl;
224+ Serial<<*this <<endl;
225+ Serial<<" level:" <<nav.root ->level <<endl;
226+ Serial<<" type:" <<type ()<<endl;
227+ Serial.flush ();
228+ while (1 );
229+ }
230+ #endif
209231}
210232
211233// //////////////////////////////////////////////////////////////////////////////
0 commit comments