OpenCPN Partial API docs
Loading...
Searching...
No Matches
ExpandablePanel Class Reference

An ExpandIcon together with a child window. More...

#include <expand_panel.h>

Inheritance diagram for ExpandablePanel:

Public Member Functions

 ExpandablePanel (wxWindow *parent, wxWindow *child, std::function< void()> on_resize=[] {})
 Single step constructor.
 ExpandablePanel (wxWindow *parent)
 First part of two step create.
void Create (wxWindow *child, std::function< void()> on_resize=[] {})
 Second part of two step creation.
wxWindow * GetIcon () const
 Return the ExpandableIcon reflecting expanded/collapsed state.
wxWindow * GetChild () const
 Return the managed window which is shown or hidden.
void EnableChild (bool enable)
 Enable/disable showing the child.
void Collapse ()
 Show collapsed icon and hide child.

Protected Member Functions

void OnClick (bool collapse) const

Detailed Description

An ExpandIcon together with a child window.

The child window is hidden or shown depending on the ExpandIcon state.

Example: auto* a_panel = new wxPanel(this, ...); auto advanced_ctrl = new ExpandablePanel(this, a_panel, [&] { GetParent()->Layout(); }); some_sizer->Add(advanced_ctrl, wxSizerFlags()); some_sizer->Add(m_advanced_panel, wxSizerFlags());

Definition at line 40 of file expand_panel.h.

Constructor & Destructor Documentation

◆ ExpandablePanel() [1/2]

ExpandablePanel::ExpandablePanel ( wxWindow * parent,
wxWindow * child,
std::function< void()> on_resize = [] {} )

Single step constructor.

Parameters
parentContaining window
childManaged window, hidden/showń depending on ExpandIcon state
on_resizeCallback invoked when child becomes hidden or shown.

◆ ExpandablePanel() [2/2]

ExpandablePanel::ExpandablePanel ( wxWindow * parent)

First part of two step create.

Parameters
parentContaining window.

Member Function Documentation

◆ Create()

void ExpandablePanel::Create ( wxWindow * child,
std::function< void()> on_resize = [] {} )

Second part of two step creation.

Parameters
childWindow to be hidden/shown
on_resizeCallback invoked when child becomes hidden or shown

◆ GetChild()

wxWindow * ExpandablePanel::GetChild ( ) const
inline

Return the managed window which is shown or hidden.

Definition at line 67 of file expand_panel.h.

◆ GetIcon()

wxWindow * ExpandablePanel::GetIcon ( ) const
inline

Return the ExpandableIcon reflecting expanded/collapsed state.

Definition at line 64 of file expand_panel.h.


The documentation for this class was generated from the following file:
  • /home/runner/work/main/main/opencpn/libs/gui/include/libgui/expand_panel.h