i am building a desktop GUI using wxWidgets-3.1.3 on 3 platforms: Windows, Mac and Linux.
The home page is as attached, which just shows 3 tile buttons. Each button has a statictext description below and a bitmap in the button.
However, when I build on Windows and Linux, bitmap pictures are able to show in the middle of the button. When i tried to build using XCode on mac, the position of the bitmaps get distorted as shown. I know the root cause is because the bitmap Direction is wxLEFT by default.
I have tried:
adding wxBU_NOTEXT style to each button, but it doesn't work.
I need this UI by next week. So any help will be much appreciated !
wxImage::AddHandler(new wxPNGHandler);
wxBitmap DataValidationIcon = wxBITMAP_PNG_FROM_DATA(Data_Validation);
wxBitmap ActiveIdleIcon = wxBITMAP_PNG_FROM_DATA(Active_Idle);
wxBitmap SDKDemoIcon = wxBITMAP_PNG_FROM_DATA(SDK_Demo);
DataValidationBtn->SetBitmap(DataValidationIcon);
ActiveIdleBtn->SetBitmap(ActiveIdleIcon);
SDKDemoBtn->SetBitmap(SDKDemoIcon);
You don't show the code creating
SDKDemoBtn
, so I am not sure how do you create it and whether you use any alignment styles. But in any/the worst case, you can always dynamically generate a bitmap of your button size containing the real bitmap centred inside it usingwxImage::Paste()
.