struct App : TopWindow { typedef App CLASSNAME; EditString s; Label l; App(){ Add(s.HSizePosZ(5,5).TopPosZ(5,25)); Add(l.HSizePosZ(5,5).TopPosZ(35,25)); s.WhenAction << THISBACK(DoSomething); } void DoSomething(){ l.SetLabel("Length: "+IntStr(AsString(~s).GetCharCount())); } };
bool Key(dword key, int count){ // bool MyApp::Key(dword key, int count){ if (key == K_RETURN && Point1.HasFocus()) { Point1Action(); return true; } if (key == K_RETURN && Point2.HasFocus()) { Point2Action(); return true; } if (key == K_RETURN && Distance.HasFocus()) { DistanceAction(); return true; } if (key == K_RETURN && Angle1.HasFocus()) { Angle1Action(); return true; } if (key == K_RETURN && Angle2.HasFocus()) { Angle2<<="OK a2"; return true; } if (key == K_RETURN && timezone.HasFocus()) { String TZ; TZ = ~timezone; tz = (int)atof(TZ); // tz = (int)atof(~timezone); return true; } }
Quote: |
U++ produces great user experience in applications. |
dolik.rce wrote on Sun, 02 December 2012 08:56 |
The general idea is that it is called whenever the "value" of the widget changes. |