Lazarus

Programming => Packages and Libraries => RichMemo => Topic started by: pixelink on July 04, 2020, 04:28:52 pm

Title: [SOLVED] Font Size - Does Nothing
Post by: pixelink on July 04, 2020, 04:28:52 pm
Hi,

When I change a value in a font size combobox... nothing happens

I am converting the font size text to an integer.

What am I missing?

Code: Pascal  [Select][+][-]
  1. var
  2.  fnt   :  TFontParams;
  3. begin
  4.   txtNote1.GetTextAttributes(txtNote1.SelStart, fnt);
  5.   txtNote1.SetRangeParams (txtNote1.SelStart, txtNote1.SelLength,[tmm_Styles, tmm_Color],
  6.   '',StrToInt(cbFontSize.Text),clBlack,[],[]);


Thanks in advanced
Title: Re: Font Size - Does Nothing
Post by: pixelink on July 04, 2020, 05:09:42 pm
Okay... got this to work on normal button.
But it doesn't work on a combo box change event - generates an error

See here:
https://forum.lazarus.freepascal.org/index.php?board=71.0

Code that woks on button.

Code: Pascal  [Select][+][-]
  1. var
  2.   fnt : TFontParams;
  3. begin
  4.   fnt.Name:='';
  5.   fnt.Style:= []; //[fsBold or Italic];
  6.   fnt.Size:=24;
  7.  
  8.   txtNote1.SetTextAttributes(txtNote1.SelStart, txtNote1.SelLength, fnt);
  9.   txtNote1.SetFocus();
Title: Re: Font Size - Does Nothing
Post by: pixelink on July 04, 2020, 05:23:18 pm
Well... i found a workaround for the combobox.
Instead of using change event... I am using "onSelect"... that bypasses the error (or bug)
TinyPortal © 2005-2018