Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / label doesn't fit button

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. label doesn't fit button
#5408
Posted by: 2004-11-16 16:45:48
Hi,

I want to set an button label to font weight bold. when I do this by using
 
 button->SetFont(wxFont(12, wxDEFAULT, wxNORMAL, wxNORMAL)); 

the label is indeed bold but it doesn't fit to the buttonsize anymore. How can I make the button to update his size? I tried several things like adding the button to a sizer and than calling
Layout();
It doesn't work.

Who knows how to handle it?

thanks,
mvp
Message2. Re: label doesn't fit button
#5530
Posted by: NinjaNL 2004-12-04 19:56:12
	wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
	this->SetSizer(WxBoxSizer1);
	this->SetAutoLayout(TRUE);

	WxButton1 =  new wxButton(this, ID_WXBUTTON1, _("have to have  a long title") , wxDefaultPosition, wxDefaultSize );
	WxButton1->SetFont(wxFont(8, wxSWISS ,wxNORMAL,wxBOLD,FALSE));
	WxBoxSizer1->Add(WxButton1,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);

	GetSizer()->Fit(this);
	GetSizer()->SetSizeHints(this);
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0