Recent

Author Topic: TCalcEdit does not work...  (Read 4159 times)

vrull

  • Full Member
  • ***
  • Posts: 118
TCalcEdit does not work...
« on: June 20, 2008, 10:53:52 am »
at least, as I expect.
Lazarus 0.9.24, target LCL Widget type - GTK2. I place a CalcEdit widget on the form and compile the test application. When  I try to type inside the widget, nothing happens. If I click the Calculator button, it appears on the screen, allowing to enter numbers and do some calculations, then I click OK (a button on the calculator form), it goes away, but the CalcEdit control remains empty.

I coded onAcceptValue event, like this:
Code: [Select]
procedure TFormEntry.ceAmountAcceptValue(Sender: TObject; var AValue: Double;
  var AAction: Boolean);
begin
  (Sender as TCalcEdit).AsFloat := aValue; // first attempt, nothing
  ceAmount.Text := FloatToStr(AValue);     // added later with no luck either
  AAction := false;   // don't see any difference caused by this parameter
writeln(AValue); // this shows what I saw in the Calculator window, great!
end;

with no luck.
I noticed, when I move the mouse over this control, the cursor disappears, like it goes under the control.

Any ideas?

vrull

  • Full Member
  • ***
  • Posts: 118
Why
« Reply #1 on: June 22, 2008, 10:13:18 pm »
The reason for this odd behaviour was the changes in Control's Font attributes. I changed Font.Style to [fsBold] and this caused the problem.
As far as I found this applies to TCalcEdit, TCalendarEdit, TEditButton.

 

TinyPortal © 2005-2018