Added wxFLP_SMALL and wxDIRP_SMALL styles for wx{File,Dir}PickerCtrl.
These styles allow to use a smaller browse button as the standard one takes too much space, often leaving too little of it for the more important text control part. Notice that both styles are, in fact, equal to wxPB_SMALL but only file and directory pickers currently use it as it doesn't make sense for the colour and font pickers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -54,8 +54,24 @@ bool wxGenericFileDirButton::Create(wxWindow *parent,
|
||||
{
|
||||
m_pickerStyle = style;
|
||||
|
||||
// If the special wxPB_SMALL flag is used, ignore the provided label and
|
||||
// use the shortest possible label and the smallest possible button fitting
|
||||
// it.
|
||||
long styleButton = 0;
|
||||
wxString labelButton;
|
||||
if ( m_pickerStyle & wxPB_SMALL )
|
||||
{
|
||||
labelButton = _("...");
|
||||
styleButton = wxBU_EXACTFIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
labelButton = label;
|
||||
}
|
||||
|
||||
// create this button
|
||||
if ( !wxButton::Create(parent, id, label, pos, size, 0, validator, name) )
|
||||
if ( !wxButton::Create(parent, id, labelButton,
|
||||
pos, size, styleButton, validator, name) )
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxGenericFileButton creation failed") );
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user