Note that there are some explanatory texts on larger screens.

plurals
  1. POusing TEdit and TUpDown with assosiation
    text
    copied!<p>I am creating an Delphi 2007 application, using Tnt components (Compenents with unicode). I have a form with:</p> <pre><code>edit : TTntEdit; updown : TTntUpDown </code></pre> <p>settings for thouse components are:</p> <pre><code>edit.OnKeyPressed := edKeyPress; edit.OnKExit := edExit; updown.Max := 900; updown.Min := 300; updown.Assosiate := edit; updown.onClick := updownClick; procedure TForm.edKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then begin Key := #0; SetValue(edit, updown, some_global_variable ); end; end; procedure TForm.edExit(Sender: TObject); begin SetValue(edit, updown, some_global_variable); end; procedure TForm.SetValue(ED: tTntEdit;UD: tUpDown;var CardValue: real); var rVal : real; begin if MainForm.CheckRealStr(ED.Text,rVal,'.') or MainForm.CheckRealStr(ED.Text,rVal,',') then begin if rVal &lt;= (UD.Min/10) then rVal := (UD.Min/10); if rVal &gt;= (UD.Max/10) then rVal := (UD.Max/10); CardValue := rVal; UD.Position := Round(CardValue*10); ED.Text := FormatFloat('0.0', UD.Position/10 ); end else ED.Text := FormatFloat('0.0', UD.Position/10 ); end; procedure TForm.updownClick(Sender: TObject; Button: TUDBtnType); begin edit.Text := FormatFloat('0.0', updown.Position/10 ); end; </code></pre> <p>As you can see, UpDown might have position between 300 and 900, thats mean that edit.Text is from '30.0' to '90,0'. If Text is set to 89.8 and we use up arrow of updown to increase it's position, then text in edit will change as follows: '89.9'->'90.0'->'900' and stopes. When edit.text is changing from '90.0' to '900', updownClick event is not even called! </p> <p>So here is my questions:</p> <ol> <li>why value '900' appears;</li> <li>why updownClick event is not called;</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload