Opened 7 years ago

Last modified 6 years ago

#13603 confirmed defect

wxWizard does not show its content if the page added to GetPageAreaSizer is not the one initially shown

Reported by: aasselin Owned by:
Priority: normal Milestone:
Component: GUI-all Version: stable-latest
Keywords: wxWizardSizer Cc:
Blocked By: Blocking:
Patch: no


the problem happens when GetPageAreaSizer()->Add(first_page) is used, and the page finally used to start is not that page.

the problem happens because the wxSizerItem::IsShown() function test each item _actually added_ to the sizer, thus if the first_page is not actually the one shown, all the items are hidden and the sizer item is considered hidden (and get size of 0,0)

I initially thought there was an easy solution implementing IsShown() on the sizer and returning always true, but unfortunately there is no such function on the sizer.
we could extract the small portion of code in wxSizerItem::IsShown() case Item_Sizer: into a virtual function IsShown() on the wxSizer class and override it in wxWizardSizer.

Attachments (1)

demonstrate-wizard-first-page-pb.patch download (2.7 KB) - added by aasselin 7 years ago.
patch to the sample demonstrating the problem when starting on second page (added an option in options menu)

Download all attachments as: .zip

Change History (3)

comment:1 Changed 7 years ago by vadz

  • Milestone changed from 2.9.3 to 3.0
  • Status changed from new to confirmed

Extracting the function could work but we'd need to find some name for it because IsShown() is already used for something else.

I wonder if wxRESERVE_SPACE_EVEN_IF_HIDDEN could be somehow used here?

The trouble is that I don't have any code to reproduce this so it's all quite vague to me, if you could make a patch to the minimal or wizard sample allowing me to debug the problem and test the solution it would be very helpful. TIA!

Changed 7 years ago by aasselin

patch to the sample demonstrating the problem when starting on second page (added an option in options menu)

comment:2 Changed 6 years ago by vadz

  • Milestone 3.0 deleted

I won't have time to look at this before 3.0 unfortunately.

Note: See TracTickets for help on using tickets.