Re: wxEuphoria - Menu Font
- Posted by ghaberek (admin) Mar 12, 2012
- 1310 views
Thanks for the explanation.
Is there a work around worth experimenting with?
e.g. create a parent window, change the default font, etc., and then hide this window and create a child window which inherits all the new settings in the parent.
Only if you can update the C++ wrappers and euphoria wrappers and rebuild wxEuphoria. It's actually not very difficult (all things considered), but requires a bit of C++ knowledge. The problem is that you have to call a method that's part of the wxMenuItem class which is not currently wrapped.
Actually, the way to go here is probably to update the code for set_font to check the object type passed (wxWidgets has its own built-in RTTI system). Currently, it only operates on wxDC objects, but we could detect wxMenuItem objects and call the appropriate method. The code is in wxGraphics.cpp, if anyone is feeling up to it.
I thought about that. We should probably break it out to handle all the classes that support SetFont() instead of just wxDC.
Thank you all for your help and suggestions.
While I wait for the 2.9.3 dependent version of wxEuphoria, I will try to look for Windows only software that can programatically and interactively change the default fonts for the title and menu. If I find this in a DLL with documented API, that would be even better. Such a facility, I presume, will enable me to make the necessary connection to the DLL using Euphoria facilities.
Mixing third-party libraries with wxEuphoria (or wxWidgets itself) is going to be difficult at best. wxWidgets maintains its own C++ classes derived from wxObject. They are not directly compatible. You should be able to call get_handle() on any wxWindow and pass that through to your third-party library. But wxWidgets may be performing other "magic" in the background that could change the expected behavior of that library. YMMV
I feel that the application programmer should be able to have full control of the looks of the Window right from the beginning, without expecting the end-user to do special settings in the Windows Display settings through the Control Panel.
As an application programmer, I would prefer that I spoon feed the first window the way I think it should be and immediately allow the end-user to change the looks to the extent compatible with the software I am giving him.
All of the above comments apply to Microsoft Windows. I do not know Linux or Mac to make any comments.
Have you tried using wxAUI? (Advanced User Interface) It doesn't allow you full control over the user interface, but it certainly gives you a lot more customization than you would normally have with the vanilla widgets.
I am also working on "themes" for wxAUI, eventually...
-Greg