Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TComboBox - how to change font?


This question is answered.


Permlink Replies: 22 - Last Post: Jul 3, 2014 12:07 PM Last Post By: John Frazier
Michael Leahy

Posts: 239
Registered: 5/9/07
TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2014 8:14 AM
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to choose the font either.

How do change the font for a TComboBox?
John Frazier


Posts: 726
Registered: 2/17/00
Re: TComboBox - how to change font?
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2014 1:15 PM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android? There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP! Style creation steps vary a little for FM Mobile.
~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 16, 2014 1:35 PM   in response to: John Frazier in response to: John Frazier
John Frazier wrote:
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android? There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP! Style creation steps vary a little for FM Mobile.
~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)

Hey John,

thank you very much for your detailed reply which has, for me, once again boiled down to my lack of knowledge of StyleBooks. They're still confusing me.

It is indeed a desktop app intended for Windows and Mac.

I tried your step by step approach. I reached this step...

Set for StyleBook property to StyleBook

...and was stymied. I tried setting the Form's Stylebook property to StyleBook1 (the default name of the StyleBook dropped on the form) and completed the remaining steps. The TComboBox's font did not change in the box or in the dropdown.

What might I still be missing?
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2014 9:14 AM   in response to: John Frazier in response to: John Frazier
John Frazier wrote:
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android? There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP! Style creation steps vary a little for FM Mobile.
~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)

Thanks, John.

I cannot figure out this step:

Set for StyleBook property to StyleBook

Neither the StyleBook1 nor the TComboBox1 have a "StyleBook" property. (I tried setting the Form's StyleBook property to StyleBook1.)

After doing the remaining steps I added items to the ComboBox but they do not change to the font I chose for the TText of the StyleBook's listboxitemstyle: TLayout.
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font?
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2014 11:21 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

John Frazier wrote:
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those
items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android?
There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it
should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP! Style
creation steps vary a little for FM Mobile. ~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a
fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same
look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)

Thanks, John.

I cannot figure out this step:

Set for StyleBook property to StyleBook

Neither the StyleBook1 nor the TComboBox1 have a "StyleBook" property. (I tried setting the
Form's StyleBook property to StyleBook1.)

After doing the remaining steps I added items to the ComboBox but they do not change to the font
I chose for the TText of the StyleBook's listboxitemstyle: TLayout.

Michael,
I followed Johns directions (two differences though) and the result was as expected. See the
attachements group for a message with same topic, for images.
First difference: you are using XE4, I am using XE5.
Second difference: The listboxitemstyle.text is a TActiveStyleTextObject and not TText as John said.

In my test I changed the color property to Crimson and the Font.Style to fsItalic and fsUnderline.

When you worked through the style creation process, was there any deviations from what John said.

--
Tom Brunberg
firstname.lastname@welho.com
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2014 3:42 PM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

John Frazier wrote:
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those
items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android?
There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it
should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP! Style
creation steps vary a little for FM Mobile. ~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a
fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same
look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)

Thanks, John.

I cannot figure out this step:

Set for StyleBook property to StyleBook

Neither the StyleBook1 nor the TComboBox1 have a "StyleBook" property. (I tried setting the
Form's StyleBook property to StyleBook1.)

After doing the remaining steps I added items to the ComboBox but they do not change to the font
I chose for the TText of the StyleBook's listboxitemstyle: TLayout.

Michael,
I followed Johns directions (two differences though) and the result was as expected. See the
attachements group for a message with same topic, for images.
First difference: you are using XE4, I am using XE5.
Second difference: The listboxitemstyle.text is a TActiveStyleTextObject and not TText as John said.

In my test I changed the color property to Crimson and the Font.Style to fsItalic and fsUnderline.

When you worked through the style creation process, was there any deviations from what John said.

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom.

In XE4 it is indeed a TText as John said.

The deviation is what I described above. The instruction to...

Set for StyleBook property to StyleBook

...doesn't make any sense. What property of what component? The ComboBox has no such property.
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2014 4:03 PM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

Tom Brunberg wrote:
Michael Leahy wrote:

John Frazier wrote:
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those
items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android?
There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it
should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP!
Style creation steps vary a little for FM Mobile. ~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a
fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same
look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)

Thanks, John.

I cannot figure out this step:

Set for StyleBook property to StyleBook

Neither the StyleBook1 nor the TComboBox1 have a "StyleBook" property. (I tried setting the
Form's StyleBook property to StyleBook1.)

After doing the remaining steps I added items to the ComboBox but they do not change to the
font I chose for the TText of the StyleBook's listboxitemstyle: TLayout.

Michael,
I followed Johns directions (two differences though) and the result was as expected. See the
attachements group for a message with same topic, for images.
First difference: you are using XE4, I am using XE5.
Second difference: The listboxitemstyle.text is a TActiveStyleTextObject and not TText as John
said.

In my test I changed the color property to Crimson and the Font.Style to fsItalic and
fsUnderline.

When you worked through the style creation process, was there any deviations from what John
said.

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom.

In XE4 it is indeed a TText as John said.

The deviation is what I described above. The instruction to...

Set for StyleBook property to StyleBook

...doesn't make any sense. What property of what component? The ComboBox has no such property.

John transferred his thoughts too fast to his fingers and they dropped a few keystrokes.
It should probably read 'Set forms StyleBook property to StyleBook1'

The forms stylebook property must be set, for any changes in the stylebook to have effect.
So, try again, hopefully it now works.

--
Tom Brunberg
firstname.lastname@welho.com
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 20, 2014 1:28 PM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

Tom Brunberg wrote:
Michael Leahy wrote:

John Frazier wrote:
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those
items to choose the font either.

How do change the font for a TComboBox?

You need to be specific here as the answers can vary. FireMonkey Desktop, iOS, or Android?
There are a lot of nuances when dealing with font resources.

I don't have XE4 installed currently (XE5 is latest) so steps may vary a bit. For this, it
should be the same.

~~File | Close All
~~File | New | FireMonkey Desktop | HD

Create a custom style you can reuse in many forms and apps <--PREFERRED
~~Tools | Bitmap Style Designer
~~File | Save As | "Save as Type"=*.style
~~Give it a name and save some place you remember :) **This is for FireMonkey DESKTOP!
Style creation steps vary a little for FM Mobile. ~~Close Bitmap Style Designer
~~Drop a TComboBox on form
~~Drop a TStyleBook on form
~~Set for StyleBook property to StyleBook
~~Double-click StyleBook to go to style editor
~~Click "Load" and navigate to .style file we created above
~~In Structure pane in upper left, expand "listboxitemstyle: TLayout"
~~Select "text: TText"
~~In Object Inspector change Color or Font Properties as you wish
~~Click "Apply and Close" to go back to form and see changes in ComboBox (basically it is a
fancier ListBox, right?)

Reuse that StyleBook in any FireMonkey form or app in your development and always have same
look and feel.
--
John Frazier (Embarcadero Newsgroup Admin)

Thanks, John.

I cannot figure out this step:

Set for StyleBook property to StyleBook

Neither the StyleBook1 nor the TComboBox1 have a "StyleBook" property. (I tried setting the
Form's StyleBook property to StyleBook1.)

After doing the remaining steps I added items to the ComboBox but they do not change to the
font I chose for the TText of the StyleBook's listboxitemstyle: TLayout.

Michael,
I followed Johns directions (two differences though) and the result was as expected. See the
attachements group for a message with same topic, for images.
First difference: you are using XE4, I am using XE5.
Second difference: The listboxitemstyle.text is a TActiveStyleTextObject and not TText as John
said.

In my test I changed the color property to Crimson and the Font.Style to fsItalic and
fsUnderline.

When you worked through the style creation process, was there any deviations from what John
said.

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom.

In XE4 it is indeed a TText as John said.

The deviation is what I described above. The instruction to...

Set for StyleBook property to StyleBook

...doesn't make any sense. What property of what component? The ComboBox has no such property.

John transferred his thoughts too fast to his fingers and they dropped a few keystrokes.
It should probably read 'Set forms StyleBook property to StyleBook1'

The forms stylebook property must be set, for any changes in the stylebook to have effect.
So, try again, hopefully it now works.

--
Tom Brunberg
firstname dot lastname at welho dot com

Hey Tom,

In my original post I mentioned that this is the step I could not figure out - and that I had guessed he meant setting the Form's Stylebook property to StyleBook1.

That's what I tried for that step and still the font does not change for the ComboBox. All other steps were done without a hitch.

Any other ideas about why this doesn't work?
John Frazier


Posts: 726
Registered: 2/17/00
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 20, 2014 5:45 PM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
In XE4 it is indeed a TText as John said.

The deviation is what I described above. The instruction to...

Set for StyleBook property to StyleBook

...doesn't make any sense. What property of what component? The ComboBox has no such property.

John transferred his thoughts too fast to his fingers and they dropped a few keystrokes.
It should probably read 'Set forms StyleBook property to StyleBook1'

The forms stylebook property must be set, for any changes in the stylebook to have effect.
So, try again, hopefully it now works.

I intentionally left off the "1" to be generic. If anything I should have said "Set StyleBook property of the form to the StyleBook we just created". The OP got that part right but didn't reveal any clues I saw about what is failing. Some day I'd like to do a few videos but simply do not have the time as you can tell by my sparse presence here. :(

OP, can you "Load" some other style from the styles directory we provide and set form StyleBook property and get that to show up? Make sure to get the basics working first. If that works, great, go back into Style Designer and try to save that style as your own name... now modify the property you want and see if the change takes as you would expect? From that you should be able to figure out what you missed.

Make sure when you "Load" a style it is relevant for your target like desktop, iOS, Android so at least it has the proper pieces to modify. This is how I started learning styles originally and what I still do to quickly to find out what property modifies which element in the UI. Better to see a completed StyleBook we provide first to get a guide.
--
John Frazier (Embarcadero Newsgroup Admin)
Linden ROTH

Posts: 467
Registered: 11/3/11
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2014 3:37 PM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:
In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to choose the font either.

How do change the font for a TComboBox?

Michael

The sad truth is at the moment if you're not up to date you are going to have issues the FMX changes are on a exponential curve where XE4 is around the 1:1 point ie XE2 was functionally UNuseable XE4 just usable while the differences between XE5 and XE6 are much smaller and functionally they are more stable

Also XE4 will not support Android / iOS7 (let alone iOS8) etc

Sorry But it the truth

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"

Edited by: Linden ROTH on Jun 20, 2014 1:32 PM
woops UNuseable
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 22, 2014 4:53 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to
choose the font either.

How do change the font for a TComboBox?

Hi Michael,
Here's a new test now with XE4 to rule out differencies with later versions:

Without a stylebook:
Caveat: font settings are not seen in the dropdown list, they are seen
only in the button area.
New FMX desktop application
Drop a TComboBox on the form
Right-click on the ComboBox, select Items editor
Top right side, make sure the Dropdown has TListBoxItem selected
Click three times on Add Item to create ListBoxItem1 .. ListBoxItem3
In the list on the left side, select ListBoxItem1
Verify that ListBoxItem1 is selected also in Object Inspector (OI)
In OI open the Font property and change as you wish
Return to the Items editor and select next item
Repeat font changes
Repeat above for the last item
Close Items designer
Run the application and note that the font settings take
effect in the button area, but not in the drop down list.

With a style book, created already before:
Delete the ComboBox in the previous test, just to start guaranteed fresh.
Drop a TComboBox on the form
This time I added items by selecting the Items property in OI
In th string list editor add three items, Item 1, Item 2 and Item 3
Close the items editor.
Drop a StyleBook on the form
Set the forms Stylebook property to the dropped Stylebook1
Double click StyleBook1
Load a style from a .style file created before,
(I used one I created before following Johns method, and called 'XE4Test.style')
Locate and open listboxitemstyle: TLayout
Select text: TText
In OI, change font properties as needed
Close the style editor with 'Apply and Close' button
Run the application.
Size, font and the fsBold, fsItalic, fsUnderline and fsStrikeOut properties follow
what was set in the stylebook, but not color.
Back to the StyleBook and listboxitemstyle: TLayout and text: TText
There is a subitem 'coloranimation: TColorAnimation' and even though
it's Enabled property is 'False', it seems to play a role!
Changing it's StopValue to Crimson indeed changes the color of the items
in the combobox at runtime. Since the trigger for the animation is 'IsSelected'
the color changes from black (StartValue) to Crimson when an item is selected
in the dropdown list.

Anyway, It seems to me the font of ComboBox items can be changed in two different
ways in XE4, either with or without a stylebook.

Regards

--
Tom Brunberg
firstname.lastname@welho.com
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 22, 2014 1:48 PM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

In XE4 I have a TCombobox. There is no font property.

I add some strings to the Items property of the TComboBox but there is no place in those items to
choose the font either.

How do change the font for a TComboBox?

Hi Michael,
Here's a new test now with XE4 to rule out differencies with later versions:

Without a stylebook:
Caveat: font settings are not seen in the dropdown list, they are seen
only in the button area.
New FMX desktop application
Drop a TComboBox on the form
Right-click on the ComboBox, select Items editor
Top right side, make sure the Dropdown has TListBoxItem selected
Click three times on Add Item to create ListBoxItem1 .. ListBoxItem3
In the list on the left side, select ListBoxItem1
Verify that ListBoxItem1 is selected also in Object Inspector (OI)
In OI open the Font property and change as you wish
Return to the Items editor and select next item
Repeat font changes
Repeat above for the last item
Close Items designer
Run the application and note that the font settings take
effect in the button area, but not in the drop down list.

With a style book, created already before:
Delete the ComboBox in the previous test, just to start guaranteed fresh.
Drop a TComboBox on the form
This time I added items by selecting the Items property in OI
In th string list editor add three items, Item 1, Item 2 and Item 3
Close the items editor.
Drop a StyleBook on the form
Set the forms Stylebook property to the dropped Stylebook1
Double click StyleBook1
Load a style from a .style file created before,
(I used one I created before following Johns method, and called 'XE4Test.style')
Locate and open listboxitemstyle: TLayout
Select text: TText
In OI, change font properties as needed
Close the style editor with 'Apply and Close' button
Run the application.
Size, font and the fsBold, fsItalic, fsUnderline and fsStrikeOut properties follow
what was set in the stylebook, but not color.
Back to the StyleBook and listboxitemstyle: TLayout and text: TText
There is a subitem 'coloranimation: TColorAnimation' and even though
it's Enabled property is 'False', it seems to play a role!
Changing it's StopValue to Crimson indeed changes the color of the items
in the combobox at runtime. Since the trigger for the animation is 'IsSelected'
the color changes from black (StartValue) to Crimson when an item is selected
in the dropdown list.

Anyway, It seems to me the font of ComboBox items can be changed in two different
ways in XE4, either with or without a stylebook.

Regards

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom.

I did discover what you pointed out in the example without Stylebooks. That approach is unusable for me because, as you say, the font in the dropdown list of the ComboBox does not change.

I followed your steps with the StyleBook but the font still does not change at design time or at runtime. I'm guessing that because the size does change that we're assuming the font has changed. Could you try WindDings to confirm that it is changing for you?

I am using a very custom font (like WingDings) and it is essential that the font appears in both the ComboBox (button area) and in the dropdown list.

I have confirmed this in 32 Windows and OS X with the 'WindDings' font.

Edited by: Michael Leahy on Jun 22, 2014 6:21 PM
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 22, 2014 6:36 PM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

I did discover what you pointed out in the example without Stylebooks. That approach is unusable
for me because, as you say, the font in the dropdown list of the ComboBox does not change.

I followed your steps with the StyleBook but the font still does not change at design time or at
runtime. I'm guessing that because the size does change that we're assuming the font has changed.
Could you try WindDings to confirm that it is changing for you?

I am using a very custom font (like WingDings) and it is essential that the font appears in both
the ComboBox (button area) and in the dropdown list.

I have confirmed this in 32 Windows and OS X with the 'WindDings' font.

Michael,
I tried the stylebook approach with Symbol, Webdings, Wingdings, Wingdings2 and Wingdings3 and they
all worked for me. I'm only testing with Win7 as I don't have a mac.
Have you tested your font with, for example, a TLabel, where you can change the font directly?

--
Tom Brunberg
firstname dot lastname at welho dot com

Edited by: Tom Brunberg on Jun 23, 2014 4:39 AM

Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 23, 2014 12:57 PM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

I did discover what you pointed out in the example without Stylebooks. That approach is unusable
for me because, as you say, the font in the dropdown list of the ComboBox does not change.

I followed your steps with the StyleBook but the font still does not change at design time or at
runtime. I'm guessing that because the size does change that we're assuming the font has changed.
Could you try WindDings to confirm that it is changing for you?

I am using a very custom font (like WingDings) and it is essential that the font appears in both
the ComboBox (button area) and in the dropdown list.

I have confirmed this in 32 Windows and OS X with the 'WindDings' font.

Michael,
I tried the stylebook approach with Symbol, Webdings, Wingdings, Wingdings2 and Wingdings3 and they
all worked for me. I'm only testing with Win7 as I don't have a mac.
Have you tested your font with, for example, a TLabel, where you can change the font directly?

--
Tom Brunberg


Hey Tom,

thanks for suggesting this as it points to something more general than the TComboBox.

I placed a TLabel on the form. I changed its font to WebDings. The StyledSettings ssFamily automagically turned to False as it should. However, the font did not change at design time or at runtime.

Windows 7 with XE4, both on a regular box and on a VM on a Mac.
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 12:04 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

Tom Brunberg wrote:
Michael Leahy wrote:

I did discover what you pointed out in the example without Stylebooks. That approach is
unusable for me because, as you say, the font in the dropdown list of the ComboBox does not
change.

I followed your steps with the StyleBook but the font still does not change at design time or
at runtime. I'm guessing that because the size does change that we're assuming the font has
changed. Could you try WindDings to confirm that it is changing for you?

I am using a very custom font (like WingDings) and it is essential that the font appears in
both the ComboBox (button area) and in the dropdown list.

I have confirmed this in 32 Windows and OS X with the 'WindDings' font.

Michael,
I tried the stylebook approach with Symbol, Webdings, Wingdings, Wingdings2 and Wingdings3 and
they all worked for me. I'm only testing with Win7 as I don't have a mac.
Have you tested your font with, for example, a TLabel, where you can change the font directly?

--
Tom Brunberg


Hey Tom,

thanks for suggesting this as it points to something more general than the TComboBox.

I placed a TLabel on the form. I changed its font to WebDings. The StyledSettings ssFamily
automagically turned to False as it should. However, the font did not change at design time or at
runtime.

Windows 7 with XE4, both on a regular box and on a VM on a Mac.

Michael,
Are you saying that the label doesn't show the symbols (glyfs) of the Webdings font? For example,
if the text property contains 'Label1', (as it does by default when you drop the first TLabel on a
form), the second symbol is not shown as a checkmark and the third symbol as a bicycle? Instead the
label shows the text 'Label1'?

Then, please zip the .dpr, .pas and .dfm (as text) of your test project and post the zip file to
the attachments group so I can take a look at those.

--
Tom Brunberg
firstname.lastname@welho.com
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 6:29 AM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

Tom Brunberg wrote:
Michael Leahy wrote:

I did discover what you pointed out in the example without Stylebooks. That approach is
unusable for me because, as you say, the font in the dropdown list of the ComboBox does not
change.

I followed your steps with the StyleBook but the font still does not change at design time or
at runtime. I'm guessing that because the size does change that we're assuming the font has
changed. Could you try WindDings to confirm that it is changing for you?

I am using a very custom font (like WingDings) and it is essential that the font appears in
both the ComboBox (button area) and in the dropdown list.

I have confirmed this in 32 Windows and OS X with the 'WindDings' font.

Michael,
I tried the stylebook approach with Symbol, Webdings, Wingdings, Wingdings2 and Wingdings3 and
they all worked for me. I'm only testing with Win7 as I don't have a mac.
Have you tested your font with, for example, a TLabel, where you can change the font directly?

--
Tom Brunberg


Hey Tom,

thanks for suggesting this as it points to something more general than the TComboBox.

I placed a TLabel on the form. I changed its font to WebDings. The StyledSettings ssFamily
automagically turned to False as it should. However, the font did not change at design time or at
runtime.

Windows 7 with XE4, both on a regular box and on a VM on a Mac.

Michael,
Are you saying that the label doesn't show the symbols (glyfs) of the Webdings font? For example,
if the text property contains 'Label1', (as it does by default when you drop the first TLabel on a
form), the second symbol is not shown as a checkmark and the third symbol as a bicycle? Instead the
label shows the text 'Label1'?

Then, please zip the .dpr, .pas and .dfm (as text) of your test project and post the zip file to
the attachments group so I can take a look at those.

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom.

Yes, this is exactly what I mean. I've only seen the glyphs of my custom font (or those of WingDings) when using the XE6 trial. Both of my machines and copies of XE4 fail to change fonts of components.

I would drop all of this and move to XE6 but XE6 broke BTree Filer beyond my ability to port it. (It was a huge effort to get BTree Filer running on XE4.)

I didn't see where to post .zip files so I put the project you requested here chessopeningsoftware.s3.amazonaws.com/mikesteststyle.zip

The forum evidently censors links. I found the Attachments group and posted it there in reply to Tom's message with previous attachments.

Edited by: Michael Leahy on Jun 24, 2014 6:34 AM
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 8:57 AM   in response to: Michael Leahy in response to: Michael Leahy
This is odd because I downloaded you project and ran it in XE4, Windows 8.1 and it works as expected, as can be seen here:
http://someimage.com/8EShAr7

You have the label font family set to Wingdings and also you have the stylebook1 labelstyle font family set to Wingdings. I can turn on and off StyleSettings [ssFamily] and it works as expected.
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font? [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 9:11 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

The forum evidently censors links. I found the Attachments group and posted it there in reply to
Tom's message with previous attachments.

Edited by: Michael Leahy on Jun 24, 2014 6:34 AM

Hi Mike,
Your project is received and tested and the Wingdings symbols show up as expected.
So, there seems to be nothing wrong in your project.

Although you said that your own font (as well as Wingdings) work in XE6 Trial, I tend
to lean towards a problem in your font setups in both the PC and VM (on the MAC).
Maybe (just maybe) caused by the installation of your special font, or uninstallation
of some application, as suggested by the link below.

Since Wingdings is a common one (or should be) for both of us, let's pursue that
one a little more.
Open up Notepad, then select "Format - Font ..." from the menu and select
Wingdings and type some text. Do you see Wingding symbols?
If not, then this may help:
http://www.deseret-tech.com/journal/windows-7-font-fix/
or Google for "windows 7 font problem", there's a lot of other links.

Be careful though, some links lead to .reg files, and do not blindly
apply those without examining the content first (right-click on the link,
select "save as" and then examine with a standard editor).

If Notepad shows the Wingding symbols ok, then I'm currently out of ideas,
except that you could check whether QC 115209 applies to you (unfortunately
not fixed before XE5).

I will return to the matter, if something else comes to my mind.

Regards

--
Tom Brunberg
firstname.lastname@welho.com
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font? [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 10:12 AM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

The forum evidently censors links. I found the Attachments group and posted it there in reply to
Tom's message with previous attachments.

Edited by: Michael Leahy on Jun 24, 2014 6:34 AM

Hi Mike,
Your project is received and tested and the Wingdings symbols show up as expected.
So, there seems to be nothing wrong in your project.

Although you said that your own font (as well as Wingdings) work in XE6 Trial, I tend
to lean towards a problem in your font setups in both the PC and VM (on the MAC).
Maybe (just maybe) caused by the installation of your special font, or uninstallation
of some application, as suggested by the link below.

Since Wingdings is a common one (or should be) for both of us, let's pursue that
one a little more.
Open up Notepad, then select "Format - Font ..." from the menu and select
Wingdings and type some text. Do you see Wingding symbols?
If not, then this may help:
http://www.deseret-tech.com/journal/windows-7-font-fix/
or Google for "windows 7 font problem", there's a lot of other links.

Be careful though, some links lead to .reg files, and do not blindly
apply those without examining the content first (right-click on the link,
select "save as" and then examine with a standard editor).

If Notepad shows the Wingding symbols ok, then I'm currently out of ideas,
except that you could check whether QC 115209 applies to you (unfortunately
not fixed before XE5).

I will return to the matter, if something else comes to my mind.

Regards

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom.

Notepad does show the WingDings font. This problem occurred on the VM under OS X before I added my custom font so adding the custom font could not have caused this problem.

QC 115209 quite possibly applies to both my Windows machine and to my VM running Windows on the Mac.

I downloaded AppMethod today and took the same steps you outlined. It worked fine, showing my custom font. The problem there is that all TComboBox's now use my custom font. I just need one TComboBox to use that font. Looks like I'll be upgrading to XE6 or AppMethod.

How do I get only one TComboBox to use a style with a custom font for both the button area and dropdown list while leaving other TComboBox's alone?
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font? [Edit] [Edit]
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 26, 2014 6:17 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

I downloaded AppMethod today and took the same steps you outlined. It worked fine, showing my
custom font. The problem there is that all TComboBox's now use my custom font. I just need one
TComboBox to use that font. Looks like I'll be upgrading to XE6 or AppMethod.

How do I get only one TComboBox to use a style with a custom font for both the button area and
dropdown list while leaving other TComboBox's alone?

Hi Mike,
After some tracing through the source code, I found that it is actually quite easy (as usual, once
you know ;)). We almost were there earlier, but missed the crucial property.
Anyway here goes, without a style book:
New FM HD desktop application.

Drop a TComboBox on the form and add items in the old way by editing the items: TStrings property.
This Combo now has standard font etc.

Drop another TComboBox on the form
Add items by right clicking and selecting 'Add TListBoxItem'
Select a ListBoxItem in the structure view
In the OI scroll down to TextSettings and change the Font Family to Wingdings
Make sure StyledSettings Family is False
Repeat with the other ListboxItems

Finally, what makes the dropdown work with the new font settings is the DropDownKind property of
the ComboBox. It's 'Native' by default, but change it to 'Custom'.

But nothing is perfect, the size calculation of the dropdown is wrong by one pixel, which forces
the vertical scrollbar to show even if all items would fit in the dropdown.

--
Tom Brunberg
firstname.lastname@welho.com
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: TComboBox - how to change font? [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 26, 2014 8:07 AM   in response to: Tom Brunberg in response to: Tom Brunberg
Tom Brunberg wrote:
Michael Leahy wrote:

I downloaded AppMethod today and took the same steps you outlined. It worked fine, showing my
custom font. The problem there is that all TComboBox's now use my custom font. I just need one
TComboBox to use that font. Looks like I'll be upgrading to XE6 or AppMethod.

How do I get only one TComboBox to use a style with a custom font for both the button area and
dropdown list while leaving other TComboBox's alone?

Hi Mike,
After some tracing through the source code, I found that it is actually quite easy (as usual, once
you know ;)). We almost were there earlier, but missed the crucial property.
Anyway here goes, without a style book:
New FM HD desktop application.

Drop a TComboBox on the form and add items in the old way by editing the items: TStrings property.
This Combo now has standard font etc.

Drop another TComboBox on the form
Add items by right clicking and selecting 'Add TListBoxItem'
Select a ListBoxItem in the structure view
In the OI scroll down to TextSettings and change the Font Family to Wingdings
Make sure StyledSettings Family is False
Repeat with the other ListboxItems

Finally, what makes the dropdown work with the new font settings is the DropDownKind property of
the ComboBox. It's 'Native' by default, but change it to 'Custom'.

But nothing is perfect, the size calculation of the dropdown is wrong by one pixel, which forces
the vertical scrollbar to show even if all items would fit in the dropdown.

--
Tom Brunberg
firstname dot lastname at welho dot com

Thanks, Tom. I tried this in AppMethod and it worked just as you said. The last piece of the puzzle was indeed the 'Custom' setting of the DropDownKind. I hope that setting doesn't mess up things on the Mac and iOS.

I also saw the one pixel error and the resulting rogue scrollbar. If you can think of a workaround for that I'd be grateful.
John Frazier


Posts: 726
Registered: 2/17/00
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 3, 2014 11:40 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:
The forum evidently censors links. I found the Attachments group and posted it there in reply to Tom's message with previous attachments.

Should not. Unless it is a malformed URL, it should automagically turn into a link. I do not specifically censor ANYTHING here. However if posts disappear it may be due to rules being broken and TeamB axed the post. To clarify, this is not "censorship" as some people like to throw that cute word around (not referring to you), merely keeping some modicum of order. I allow WAY more latitude here than many corporations. :)

http://my.little.pony.com

https://iambatman.org

ftp://download.me

http://this should be a big fail.com

http://this%20should%20be%20better.com <-- valid URL for forums... but illegal because URLs cannot have spaces silly

^^ Seems some random testing looks ok to me.

Your URL looks correct to me if you post the whole thing correctly:
**UPDATE: It worked to first time and failed subsequent... weird looks like a bug to me. Oh well, just stick a space in and tell folks to remove should be easy enough like so:

http://chessopeningsoftware.s3.amazonaws.com/ mikesteststyle.zip

I thought there might be something more to it so was playing with URL and tried to stick a www. on the front and got and XML error. I think the forum software sees whatever XML EC2 is using as not ok and then ignores it. IOW the EC2 server is doing some clever redirect and it is not truly a normal link to a zip file.

One thing I might add about uploads and forum rules and mysterious disappearing posts... Make darn sure you are not posting something you are not legally allowed to distribute. Copyright violations are not allowed no matter how trivial it may seem. Font files... are often owned and licensed by somebody for money. I don't know if yours was good/bad/indifferent, just make sure it is a freely openly distributable element to avoid any question. Personally I use http://dafont.com quite a bit for my projects.
--
John Frazier (Embarcadero Newsgroup Admin)
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: TComboBox - how to change font? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 12:52 AM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

I placed a TLabel on the form. I changed its font to WebDings. The StyledSettings ssFamily
automagically turned to False as it should. However, the font did not change at design time or at
runtime.

Michael,
Also, add the .style file that you have been testing with, to the zip I mentioned in my previous
post.

--
Tom Brunberg
firstname.lastname@welho.com
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02