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

Simple panel showing either an "expand" or "collapse" icon, state switches when clicked. More...

#include <expand_icon.h>

Inheritance diagram for ExpandableIcon:

Public Member Functions

 ExpandableIcon (wxWindow *parent, std::function< void(bool)> on_toggle)
 Create a new expandable icon.
 
bool IsCollapsed () const
 

Protected Member Functions

void Toggle ()
 

Protected Attributes

bool m_is_collapsed
 
wxBitmap m_collapse_bitmap
 
wxBitmap m_expand_bitmap
 
wxStaticBitmap * m_static_bitmap
 
std::function< void(bool)> m_on_toggle
 

Detailed Description

Simple panel showing either an "expand" or "collapse" icon, state switches when clicked.

The panel is small, roughly the size of one or two characters.

Definition at line 35 of file expand_icon.h.

Constructor & Destructor Documentation

◆ ExpandableIcon()

ExpandableIcon::ExpandableIcon ( wxWindow *  parent,
std::function< void(bool)>  on_toggle 
)

Create a new expandable icon.

Parameters
parentContaining window
on_toggleCallback invoked when user clicks the panel. The bool argument reflects the new state, true if it is collapsed.

Member Function Documentation

◆ IsCollapsed()

bool ExpandableIcon::IsCollapsed ( ) const
inline

Definition at line 45 of file expand_icon.h.

Member Data Documentation

◆ m_collapse_bitmap

wxBitmap ExpandableIcon::m_collapse_bitmap
protected

Definition at line 49 of file expand_icon.h.

◆ m_expand_bitmap

wxBitmap ExpandableIcon::m_expand_bitmap
protected

Definition at line 50 of file expand_icon.h.

◆ m_is_collapsed

bool ExpandableIcon::m_is_collapsed
protected

Definition at line 48 of file expand_icon.h.

◆ m_on_toggle

std::function<void(bool)> ExpandableIcon::m_on_toggle
protected

Definition at line 52 of file expand_icon.h.

◆ m_static_bitmap

wxStaticBitmap* ExpandableIcon::m_static_bitmap
protected

Definition at line 51 of file expand_icon.h.


The documentation for this class was generated from the following file: