0
votes

I'm trying to create custom control in wxWidgets that will look like this:

custom control

It contatins wxTextCtrl and wxBitmapButton. It's rather easy to create it, but my goal is to create scalable control that will look the same in XP, Vista, Win 7, Win 8, Mac OS X.

Usually native controls adjust their size when user changes font size in OS (125%, 150%, 200%). In my case such control should increase size of wxTextCtrl and increase size of wxBitmapButton and image in this button.

That's why my questions are:

  1. How can I create scalable Image in wxBitmapButton? (maybe I should use vector images like .svg? )

  2. How can I recognize that I should increase image size in wxBitmapButton?

I'm not going to use native controls, because I want them to look the same in all OSs

1

1 Answers

0
votes

There is currently no portable way to react to the system font size changes in wxWidgets so the best you can do is to respect the font size in effect during your program start up. And for this it's enough to simply use GetTextExtent() or GetChar{Height,Width}() methods of either wxWindow or wxDC instead of hard coding the values in pixels in your program.