wxFilePicker textctrl width
-
- Super wx Problem Solver
- Posts: 488
- Joined: Fri Oct 27, 2006 4:35 pm
- Location: Paris, France
- Contact:
wxFilePicker textctrl width
Is it possible to specify the width of the textctrl of filepicker (& dirpicker)?
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: wxFilePicker textctrl width
The overall initial width of the wxFilePicker is passed as parameter to its constructor. After, it will be subject to change if it's for example impacted by a sizer behavior. About repartition between the text control andd the button, I think the text control will take the remaining room not necessary for the button (to handle its label).
--
EDIT: Notice you can reach the underlying controls through wxPickerBase::GetPickerCtrl and GetTextCtrl...
--
EDIT: Notice you can reach the underlying controls through wxPickerBase::GetPickerCtrl and GetTextCtrl...
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: wxFilePicker textctrl width
Hi,
Are you talking about the generic version of those controls?
Probably not as they most likely reflect the native one...
Thank you.
Are you talking about the generic version of those controls?
Probably not as they most likely reflect the native one...
Thank you.
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: wxFilePicker textctrl width
It has to be verified platform by patform, ONEEYEMAN. For example, in the current doc about wxPickerBase:GetPickerCtrl(), I read:ONEEYEMAN wrote:Are you talking about the generic version of those controls?
Probably not as they most likely reflect the native one...
wxMSW is one of the platforms where the generic implementation of wxFilePickerCtrl is used...
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: wxFilePicker textctrl width
I'm trying to do the same thing... make the text wider. In the attached picture, make the box next to the Browse button be much wider.
The auto-generated code is...
FilePickerCtrl1 = new wxFilePickerCtrl(Panel1, ID_FILEPICKERCTRL1, wxEmptyString, wxEmptyString, wxEmptyString, wxPoint(128,80), wxDefaultSize, wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_FILEPICKERCTRL1"));
Any/all help is highly appreciated.
Thanks.
The auto-generated code is...
FilePickerCtrl1 = new wxFilePickerCtrl(Panel1, ID_FILEPICKERCTRL1, wxEmptyString, wxEmptyString, wxEmptyString, wxPoint(128,80), wxDefaultSize, wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_FILEPICKERCTRL1"));
Any/all help is highly appreciated.
Thanks.
Re: wxFilePicker textctrl width
Just passs something like wxSize(300,-1) (or whatever fits best for you) instead of wxDefaultSize.
Use the source, Luke!
Re: wxFilePicker textctrl width
Already tried that. Unfortunately, it's the Browse button that gets resized, not the text input dialog box. The button also becomes inoperable.
FilePickerCtrl1 = new wxFilePickerCtrl(Panel1, ID_FILEPICKERCTRL1, wxEmptyString, wxEmptyString, wxEmptyString, wxPoint(128,80), wxSize(300,25)/*wxDefaultSize*/, wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_FILEPICKERCTRL1"));
There doesn't seem to be a wxGenericFilePicerCtrl() I could try, either.
Thanks for help and any/all additional help.
FilePickerCtrl1 = new wxFilePickerCtrl(Panel1, ID_FILEPICKERCTRL1, wxEmptyString, wxEmptyString, wxEmptyString, wxPoint(128,80), wxSize(300,25)/*wxDefaultSize*/, wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL, wxDefaultValidator, _T("ID_FILEPICKERCTRL1"));
There doesn't seem to be a wxGenericFilePicerCtrl() I could try, either.
Thanks for help and any/all additional help.
Re: wxFilePicker textctrl width
This did the trick. Thanks.
FilePickerCtrl1->SetSize(wxSize(500,25));
FilePickerCtrl1->SetSize(wxSize(500,25));