CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Changing font size

by ScottWGast » 04 Nov 2014 17:33

I don't have Teamviewer, but I have used GotoMeeting in the past with you guys...

I think I have to wait a little bit anyway, my internet connection has been very erratic this morning and I'm trying to get the internet provider to fix it...

In the mean time, I will see if I can put together a little demo of the problem.

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 04 Nov 2014 17:35

Hi ScottWGast,

I can send you my test demo for you check.

UPDATE: attached test project.

Best Regards.
You do not have the required permissions to view the files attached to this post.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 04 Nov 2014 18:01

Alexander,

Thanks for your little test project. As expected, I was unable to duplicate the problem... I will dig around in my code and see if I can figure out why it's happening in my code and not in the simple demo code.

Thanks again.

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by ScottWGast » 04 Nov 2014 18:54

Hey Alexander,

I've figured out why the .Font.Size does / does not render correctly!

If Font.Enabled is set to True while in the IDE, then changing the .Font.Size does not work...

I've attached a modified CGFrame.pas/.dfm that demonstrates the issue.

Thanks!

Scott

CGFrame.zip
CGFrame.zip
You do not have the required permissions to view the files attached to this post.
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 05 Nov 2014 12:18

Hi ScottWGast,

In your case, you need typecast the container to affect the inner control.

delphi code
procedure TIWCGJQFrame5.SetEditFont(Container: TIWCGJQContainer; Parent: TWinControl);
begin
Container.Parent := Parent;
Container.StyleRenderOptions.RenderFont := True;
if Container is TIWCGJQCustomEdit then
begin
TIWCGJQCustomEdit(Container).Font.Enabled := True;
TIWCGJQCustomEdit(Container).Font.Size := 20;
end;
end;


Same procedure to MemoEx & SpinEdit.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 05 Nov 2014 15:01

Alexander,

Yes, that is what I ended up doing before I figured out that if I set the Font.Enabled = False in the IDE and set .Font.Enabled = True at runtime the .Font.Size was updatable at runtime. I'm not sure why if the .Font.Enabled = True in the IDE, the .Font.Size (on the Edit, for example) does not render a new .Font.Size at runtime.

Anyway, it's all figured out!

Thanks,
Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 05 Nov 2014 15:25

Hi Scott,

I'm not sure why if the .Font.Enabled = True in the IDE, the .Font.Size (on the Edit, for example) does not render a new .Font.Size at runtime.


Try to set Font.Enabled = True and Font.Size = 15 in the IDE, works as expected.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 05 Nov 2014 16:27

Alexander,

Yes, if I set both the .Font.Enabled = True and the .Font.Size = 15 in the IDE, it works as expected.

The issue is that I need to set the .Font.Size at runtime... so if the .Font.Enabled is set to True in the IDE, then setting the .Font.Size at runtime does not work as expected (on the TIWCGJQEdit component).

Of course, all of this is true only when the TIWCGJQEdit component is cast as TIWCGJQContainer... which is what I'm doing because all of the various edit components (Edit, Checkbox, ComboBox, etc) that I'm using inherit from Container.

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 05 Nov 2014 16:55

Hi ScottWGast,

Well, you can always check the class in your method and make typecast (as in my example).

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 6 guests

Contact Us.