dimanche 22 février 2015

wxWidgets toolbar text alignment


I am trying to add static text to my wxWidgets toolbar, but I can't figure out how to horizontally align it.


The code I am using is:



wxToolBar *m_toolbar;
wxStaticText *txt;

m_toolbar = CreateToolBar();
m_toolbar->SetToolBitmapSize( wxSize( 24, 24 ) );

txt = new wxStaticText( m_toolbar
, wxID_ANY
, "Sample Text"
, wxDefaultPosition
, wxDefaultSize
, wxALIGN_CENTRE );


m_toolbar->AddControl(txt);


I have seen a few posts about creating a custom version of wxStaticText::DoGetBestSize() but that hasn't helped either.




Aucun commentaire:

Enregistrer un commentaire