Height of the text area of the Combobox
Moderators: CEGUI MVP, CEGUI Team
Height of the text area of the Combobox
Why the height of the text area of the Editbox of the Combobox is dependent of the height of the Default Font instead of the Font defined in the Combobox in the layout file ?
The font seem ok, but not the height of text area !
The font seem ok, but not the height of text area !
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Bonjour Eddie
Oups I forgot the essential!
Which version of the library? Last released one 0.5RC2
Which look are you using? the one given with (Taharez)
Are other looks affected? I focused only on Combo.
I had a very quick look at CeGUI::Combobox early this morning, and I noticed that in one of the first called method there is the initialisation of EditBox->setFont(getFont()) which initialise with the DefaultFont. (I don't remember the name of the method and I have not the source here, I'm at work!)
It might be a bit early to initialise the Font, but I did not have enough time to search more deeply inside the code.
I will let you look for it...
Oups I forgot the essential!
Which version of the library? Last released one 0.5RC2
Which look are you using? the one given with (Taharez)
Are other looks affected? I focused only on Combo.
I had a very quick look at CeGUI::Combobox early this morning, and I noticed that in one of the first called method there is the initialisation of EditBox->setFont(getFont()) which initialise with the DefaultFont. (I don't remember the name of the method and I have not the source here, I'm at work!)
It might be a bit early to initialise the Font, but I did not have enough time to search more deeply inside the code.
I will let you look for it...
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Thanks for the additional info
I looked briefly at some code yesterday and it appears that it should be working, but apparently it's not. I'll do some proper tests and hopefully get it fixed.
Having just written that, I actually have a strong suspicion that this could be a similar situation to something else that came up earlier in the week. Hmmmm. Very interesting
CE.
I looked briefly at some code yesterday and it appears that it should be working, but apparently it's not. I'll do some proper tests and hopefully get it fixed.
Having just written that, I actually have a strong suspicion that this could be a similar situation to something else that came up earlier in the week. Hmmmm. Very interesting
CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
I have now tested this, and can report that it's working as expected - the Editbox portion of the Combobox is sized correctly according to the font specified in a layout file.
So, you need to post the layout file, CEGUI.log, also which font are you using and which glyphs are being rendered. Any chance of a couple of screen shots?
So, you need to post the layout file, CEGUI.log, also which font are you using and which glyphs are being rendered. Any chance of a couple of screen shots?
Bonsoir Eddie,
Here are some results of the test I've performed.
First let me tell you the scheme:
Then an example of a font file: there three files with respectively size of 6, 8 and 12
Then here are the code of the initialisation of CeGUI system:
And the sherry on top of the cake, here are the three screen shots:
So as you can notice, the height of the coimbo is dependent of the Defaut Font size! and not the EditBox
You may find all other files here
I made the font TTF myself.
For the moment the look is like taharez, I'm waiting for "time" to make my own skin
Here are some results of the test I've performed.
First let me tell you the scheme:
Code: Select all
File : "GenesiaLookSkin.scheme.xml"
<?xml version="1.0" ?>
<GUIScheme Name="GenesiaLookSkin">
<Imageset Name="GenesiaLook" Filename="GenesiaLook.imageset.xml" />
<Font Name="genesia-12" Filename="genesia-12.font.xml" />
<Font Name="genesia-8" Filename="genesia-8.font.xml" />
<Font Name="genesia-6" Filename="genesia-6.font.xml" />
<LookNFeel Filename="GenesiaLook.looknfeel.xml" />
<LookNFeel Filename="StaticPlainImage.looknfeel.xml" />
<LookNFeel Filename="ComboBoxSmall.looknfeel.xml" />
<LookNFeel Filename="RadioPushButton.looknfeel.xml" />
<WindowRendererSet Filename="CEGUIFalagardWRBase" />
<FalagardMapping WindowType="GenesiaLook/Button" TargetType="CEGUI/PushButton" Renderer="Falagard/Button" LookNFeel="GenesiaLook/Button" />
- - - - - - - - - - - -
<!-- Quelques widgets spéciaux pour Genesia -->
<FalagardMapping WindowType="GenesiaLook/StaticPlainImage" TargetType="DefaultWindow" Renderer="Falagard/StaticImage"
LookNFeel="GenesiaLook/StaticPlainImage" />
<FalagardMapping WindowType="GenesiaLook/ComboSmallDropList" TargetType="CEGUI/ComboDropList" Renderer="Falagard/Listbox"
LookNFeel="GenesiaLook/ComboSmallDropList" />
<FalagardMapping WindowType="GenesiaLook/ComboBoxSmall" TargetType="CEGUI/Combobox"
Renderer="Falagard/Default" LookNFeel="GenesiaLook/ComboBoxSmall" />
<FalagardMapping WindowType="GenesiaLook/RadioPushButton" TargetType="CEGUI/RadioButton" Renderer="Falagard/ToggleButton"
LookNFeel="GenesiaLook/RadioPushButton" />
</GUIScheme>
Then an example of a font file: there three files with respectively size of 6, 8 and 12
Code: Select all
?xml version="1.0" ?>
<Font Name="genesia-6"
Filename="genesia.ttf"
Type="FreeType"
Size="6"
NativeHorzRes="800"
NativeVertRes="600"
AutoScaled="true"
AntiAlias="true"
/>
Then here are the code of the initialisation of CeGUI system:
Code: Select all
// CeGUI Initialisation
mGUI = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 0);
mGUISystem = new CEGUI::System(mGUI);
CEGUI::SchemeManager::getSingleton().loadScheme("GenesiaLookSkin.scheme.xml");
mGUISystem->setDefaultMouseCursor("GenesiaLook", "MouseArrow");
// Change the following with genesia-6 and genesia-8
mGUISystem->setDefaultFont("genesia-12");
mRootGuiSheet = CEGUI::WindowManager::getSingleton().createWindow("DefaultGUISheet", "root");
mGUISystem->setGUISheet(mRootGuiSheet);
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window *st, *win;
mGuiSheet = CEGUI::WindowManager::getSingleton().loadWindowLayout("TestFrench.xml");
Global::mKernel->getGUISystem()->getGUISheet()->addChildWindow(mGuiSheet);
win = wmgr.getWindow((CEGUI::utf8*)"Test/Window");
st = wmgr.getWindow((CEGUI::utf8*)"FontDefaut");
st->setText("Default font =" + win->getFont()->getProperty("Name"));
And the sherry on top of the cake, here are the three screen shots:
So as you can notice, the height of the coimbo is dependent of the Defaut Font size! and not the EditBox
You may find all other files here
I made the font TTF myself.
For the moment the look is like taharez, I'm waiting for "time" to make my own skin
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
In my point of view, I think that there is something inconsistent with Combo with regard to other widgets: it is the definition of the size.
Indeed, the height we give in the layout for the Combo is used for the height of the DropdownList.
I think it should have been used for the height of the Editbox instead.
And there should have been a Property such as "DropdownListHeight" which could define the Dropdownlist. This latter could also have a default value dependent of the font size such as "three ListItem".
It is just an idea...
Indeed, the height we give in the layout for the Combo is used for the height of the DropdownList.
I think it should have been used for the height of the Editbox instead.
And there should have been a Property such as "DropdownListHeight" which could define the Dropdownlist. This latter could also have a default value dependent of the font size such as "three ListItem".
It is just an idea...
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
I can confirm that the issue you are seeing here is indeed the result of a bug in the system - nothing to do with Combobox directly, but rather a side effect of something I failed to consider for part of the skinning system. (The usage of FontDim in the skin definition; this behaves properly in itself, but no call is made to Window::performChildWindowLayout when the font is later changed - thus causing the size of the component widget that relies on the font not to update).
For yourself, looking for an immediate fix or workaround, I suggest subscribing to the event Window::EventFontChanged and calling performChildWindowLayout yourself. You could do this on the global event set and just have it called for all windows - since fonts usually get changed rarely, the performance hit will be negligible.
For me, looking for a permanent and 'correct' fix, there are some other alternatives to consider
Anyway, thanks for this, the actual bug is something that could not have surfaced much at all, but has potential to be a major PITA depending on how people are using the skinning system, at least now we can fix it in time for 0.5.0 final
CE.
I can confirm that the issue you are seeing here is indeed the result of a bug in the system - nothing to do with Combobox directly, but rather a side effect of something I failed to consider for part of the skinning system. (The usage of FontDim in the skin definition; this behaves properly in itself, but no call is made to Window::performChildWindowLayout when the font is later changed - thus causing the size of the component widget that relies on the font not to update).
For yourself, looking for an immediate fix or workaround, I suggest subscribing to the event Window::EventFontChanged and calling performChildWindowLayout yourself. You could do this on the global event set and just have it called for all windows - since fonts usually get changed rarely, the performance hit will be negligible.
For me, looking for a permanent and 'correct' fix, there are some other alternatives to consider
Anyway, thanks for this, the actual bug is something that could not have surfaced much at all, but has potential to be a major PITA depending on how people are using the skinning system, at least now we can fix it in time for 0.5.0 final
CE.
Ok, thanks for that, but I've already done my own workaround.
Then what about the idea for the Combo widget to have the unifiedsize property dedicated for the Editbox and another property to define the height of the droplist ? This height could be given either in pixel or in a number of items we would want to see in the list (before scrollbar is visible).
in this way all widgets will be consistent as far as unifiedsize is concerned. It applies for the visible part of the widget, and it is used to set the widget on the sheet.
Then what about the idea for the Combo widget to have the unifiedsize property dedicated for the Editbox and another property to define the height of the droplist ? This height could be given either in pixel or in a number of items we would want to see in the list (before scrollbar is visible).
in this way all widgets will be consistent as far as unifiedsize is concerned. It applies for the visible part of the widget, and it is used to set the widget on the sheet.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
That is the "other" main design for a combo box. Now we have what we have it's not likely to change - especially since we intend to replace this one with something better.
The current Combobox is probably the widget that people hate the most for one reason or another
Lindquist is/will be doing new versions of the list type widgets, and has free rein on how he goes about it. Whether a change such as you suggest is in the works for that, I do not know.
CE.
The current Combobox is probably the widget that people hate the most for one reason or another
Lindquist is/will be doing new versions of the list type widgets, and has free rein on how he goes about it. Whether a change such as you suggest is in the works for that, I do not know.
CE.
I do not hate this Combobox, it is useful to make a choice among a list.
I agree that this one is already working as is depite some strange behaviours.
My proposition was only a consistency matter and if you have a chance to make some changes, it might be interesting to think about.
I must admit that all you have already done, I mean all this CeGUI system, is wonderful and very useful.
Congratulations...
I agree that this one is already working as is depite some strange behaviours.
My proposition was only a consistency matter and if you have a chance to make some changes, it might be interesting to think about.
I must admit that all you have already done, I mean all this CeGUI system, is wonderful and very useful.
Congratulations...
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Getting rid of the area-includes-droplist feature is something I would very much like to do. There are a lot of clipping/picking hacks in the library just to make that work! but... I wont be doing this for a while yet, as my life has turned out quite busy and will stay so for some months.
dont let that keep you from posting valuable constructive feedback on how we can improve it though
dont let that keep you from posting valuable constructive feedback on how we can improve it though
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 4 guests