Opened 4 years ago

Closed 4 years 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


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.

Attachments (2)

ribbonbar.patch download (4.4 KB) - added by lpoujoulat 4 years ago.
ribbonbarb.patch download (6.6 KB) - added by lpoujoulat 4 years ago.

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by lpoujoulat

comment:1 Changed 4 years 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 4 years 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 4 years ago by lpoujoulat

comment:3 Changed 4 years ago by lpoujoulat

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

comment:4 Changed 4 years ago by VZ

In 76274:

(The changeset message doesn't reference this ticket)

comment:5 Changed 4 years ago by VZ

In 76275:

Document wxRibbonDisplayMode enum.

See #16133.

comment:6 Changed 4 years 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.