Opened 6 months ago

Closed 6 months ago

#16133 closed defect (fixed)

wxRibbonBar::ShowPanels() problem

Reported by: lpoujoulat Owned by: VZ
Priority: normal Milestone:
Component: GUI-all Version: dev-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

When calling wxRibbonBar::ShowPanels(false) or HidePanels() the panel no more auto expand on clicking a tab; it's necessary to use the expand button to get it back.

This comes from ShowPanels() not updating the m_ribbon_state field to reflect the display state.

Notice that ShowPanels() does not provide a way to tell if it should be shown as just expanded, or pinned.

I'm working on a patch for this.
Regards
Laurent

Attachments (2)

ribbonbar.patch download (4.4 KB) - added by lpoujoulat 6 months ago.
ribbonbarb.patch download (6.6 KB) - added by lpoujoulat 6 months ago.

Download all attachments as: .zip

Change History (8)

Changed 6 months ago by lpoujoulat

comment:1 Changed 6 months ago by lpoujoulat

  • Patch set

Attached a patch that make sure the display state of the ribbon bar is consistent with it's internal state. It also adds an extra parameter to ShowPanels() to allow choosing between expanded or pinning the panels.

comment:2 Changed 6 months ago by vadz

Sorry, I'm as usual against the use of multiple bool parameters. IMNSHO calls such as ShowPanels(true, false) or ShowPanels(false, true) are completely unreadable as you simply can't have any idea about what they do.

I don't know this code well, so I could be totally off, but why not just add SetPanelState(wxRibbonDisplayMode)? Or maybe we could even replace the bool argument of the existing ShowPanels() with an enum covering all the possibilities and backwards compatible with the existing use?

Changed 6 months ago by lpoujoulat

comment:3 Changed 6 months ago by lpoujoulat

Ok, I just attached a new version of the patch with an overloaded ShowPanel(). I hope it's ok.
Regards
Laurent

comment:4 Changed 6 months ago by VZ

In 76274:

Document wxRibbonDisplayMode enum.

See #16133.

comment:5 Changed 6 months ago by VZ

In 76275:

Document wxRibbonDisplayMode enum.

See #16133.

comment:6 Changed 6 months ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76277:

Add more precise wxRibbonBar::ShowPanels() overload.

The existing overload taking bool didn't allow to specify whether the panel
should be just expanded or expanded and pinned, add a new one supporting this.

Also fix a bug with not updating the ribbon state in the old method.

Closes #16133.

Note: See TracTickets for help on using tickets.