Problem with the visiblity of wxFilePickerCtrl in wxDevC++ Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
jayarathina
In need of some credit
In need of some credit
Posts: 7
Joined: Fri May 10, 2013 7:03 am
Location: India
Contact:

Problem with the visiblity of wxFilePickerCtrl in wxDevC++

Post by jayarathina »

Hi,
I am using wxDevC++ 7.4.2.569 I created a new Form project and added the following in this order:
  1. wxPanel
  2. wxFlexGridSizer
  3. wxStaticText
  4. wxFilePickerCtrl
But when I run the program, the output I get is:
Image
As you can see the browse button is hidden. But when I re-size the window during execution, I find the file picker to be visible with the browse button as expected.

I tried Refresh() and Update() after Center(), but it did not work. Any idea why this happens? and how to make it appear on start itself?
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Problem with the visiblity of wxFilePickerCtrl in wxDevC

Post by jgrzybowski »

It is quite possible, that the problem is in set up parameters of wxFlexGridSizer, not in wxFilePickerCtrl. Or wxPanel is created too small for showing whole picker control. For test try to use wxBoxSizer instead of wxFlexGridSizer without any panels:
1)New wxFrame;
2)Put wxBoxSizer which should fulfill whole frame;
3)Put your controls on selected wxBoxSizer
Regards, Jarek
jayarathina
In need of some credit
In need of some credit
Posts: 7
Joined: Fri May 10, 2013 7:03 am
Location: India
Contact:

Re: Problem with the visiblity of wxFilePickerCtrl in wxDevC

Post by jayarathina »

jgrzybowski wrote:It is quite possible, that the problem is in set up parameters of wxFlexGridSizer, not in wxFilePickerCtrl. Or wxPanel is created too small for showing whole picker control. For test try to use wxBoxSizer instead of wxFlexGridSizer without any panels:
1)New wxFrame;
2)Put wxBoxSizer which should fulfill whole frame;
3)Put your controls on selected wxBoxSizer
Regards, Jarek
I tried wxBoxSizer before and it did make the "browse" button visible. But my form has more elements, and I don't want them to be horizontally (or vertically ) aligned one by one. That will not look good.

There is a lot for space for wxPanel and I don't think it is small. I don't have to re-size the window to a great extent to make it visible, rather just move for few pixels and then back to original size, it refreshes and shows the browse button.

What option of wxFlexGridSizer might affect this? Is there any other option available?
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Problem with the visiblity of wxFilePickerCtrl in wxDevC

Post by jgrzybowski »

I do not have enough experience in wxFlexGridSizer, but wxPanel in your solution seems to be not necessary. If someone has invented grid sizer to arrange controls in grid/table view, probably additional panels are not needed? More complicated structure of controls can be also created using several panels each with box sizer, see the picture from wxWidget book in last post from this topic:
http://forums.wxwidgets.org/viewtopic.php?f=28&t=37361
Regards, Jarek
jayarathina
In need of some credit
In need of some credit
Posts: 7
Joined: Fri May 10, 2013 7:03 am
Location: India
Contact:

Re: Problem with the visiblity of wxFilePickerCtrl in wxDevC

Post by jayarathina »

jgrzybowski wrote:I do not have enough experience in wxFlexGridSizer, but wxPanel in your solution seems to be not necessary. If someone has invented grid sizer to arrange controls in grid/table view, probably additional panels are not needed? More complicated structure of controls can be also created using several panels each with box sizer, see the picture from wxWidget book in last post from this topic:
http://forums.wxwidgets.org/viewtopic.php?f=28&t=37361
Regards, Jarek
I am a Java programmer, I used the Panel with the same mentality as in Java. :oops: Any way removing wxPanel did help, thanks a lot. :D :)
Post Reply