Discussion:
wxFilePickerCtrl width
(too old to reply)
beckerde
2009-05-13 11:44:06 UTC
Permalink
Is there a way to make a wxFilePickerCtrl widget wider on a dialog ?
I create it, but it seems to use always a default size.
The code I have is as follows:

m_NomArchFue = new wxFilePickerCtrl( itemDialog1, ID_FILECTRL,
wxEmptyString, wxEmptyString, _T("*.TXT"), wxDefaultPosition,
wxSize(400, -1), wxFLP_DEFAULT_STYLE );

itemFlexGridSizer3->Add(m_NomArchFue, 1,
wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

Platform: wxGTK2, Fedora 10.
Tested with wxGTK-2.8.8, 2.8.9, 2.8.10 and 2.9.0-RC3

kind regards

Domingo Becker
Dave Silvia
2009-05-13 13:10:18 UTC
Permalink
Hi!

I use:


ExhibitPanelSubSizer = new wxBoxSizer(wxHORIZONTAL);
ExhibitPanelSizer->Add(ExhibitPanelSubSizer, 0, wxGROW|wxALL, 5);

ExhibitPanelSubSizer->Add(FileSelectCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

And the FileSelectCtrl (wxFilePickerCtrl) varies in size as the window is changed by the user. Also, it's the only control in the ExhibitPanelSubSizer (wxBoxSizer H) with a stretch factor that is non-zero, so it gets the lion's share all the time.

Perhaps it has to do with the wxFlexGridSizer? I don't think it allows for such things as stretch factors, since it has growable columns/rows.

If it's at all possible, without committing sacrilege on your design, try switching to a wxBoxSizer?;)

HTH:

thx,
Dave S.

Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/

wxWidgets Code Exchange
http://wxcodex.net/
Post by beckerde
Is there a way to make a wxFilePickerCtrl widget wider on a dialog ?
I create it, but it seems to use always a default size.
m_NomArchFue = new wxFilePickerCtrl( itemDialog1, ID_FILECTRL,
wxEmptyString, wxEmptyString, _T("*.TXT"), wxDefaultPosition,
wxSize(400, -1), wxFLP_DEFAULT_STYLE );
itemFlexGridSizer3->Add(m_NomArchFue, 1,
wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
Platform: wxGTK2, Fedora 10.
Tested with wxGTK-2.8.8, 2.8.9, 2.8.10 and 2.9.0-RC3
kind regards
Domingo Becker
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
Loading...