NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
ProportionalSplitterWindow Class Reference

This class represents a splitter window, which can controlled using a floating point proportion instead of absolute values. More...

#include <wxProportionalSplitterWindow.h>

Inheritance diagram for ProportionalSplitterWindow:
Collaboration diagram for ProportionalSplitterWindow:

Public Member Functions

 ProportionalSplitterWindow ()
 Default constructor. More...
 
 ProportionalSplitterWindow (wxWindow *parent, wxWindowID id=wxID_ANY, float proportion=0.5f, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSP_3D)
 Construct a proportional splitter window using a set of parameters. More...
 
virtual bool SplitHorizontally (wxWindow *window1, wxWindow *window2, float proportion=0)
 Split this window horizontally using the selected porportion. More...
 
virtual bool SplitVertically (wxWindow *window1, wxWindow *window2, float proportion=0)
 Split this window vertically using the selected porportion. More...
 
void SetSashPositionFloat (float proportion)
 Set the sash position using a floating point proportion. More...
 
void OnSize (wxSizeEvent &event)
 Handle the window size event. Will automatically adapt the sash position to achieve a multiple of a character height in window space. More...
 
void OnSashPosChanged (wxSplitterEvent &event)
 Handle the size event, when the sash position has been changed. Will automatically adapt the sash position to achieve a multiple of a character height in window space. More...
 
float GetSplitPercentage ()
 Return the current splitting proportion. More...
 
void SetCharHeigth (int _charheight)
 Change the character height in pixels. More...
 

Private Types

enum  { MIN_PANE_SIZE = 1 }
 

Private Member Functions

bool isHorizontal () const
 Return true, if the splitter is horizontal. More...
 
float parentSize () const
 Return the free space of the parent as a floating point number. Considers the orientation of the splitter. More...
 
int initSplitSize (float proportion, bool isHorizontal)
 Calculates the initial sash position after splitting the window. More...
 

Private Attributes

float splitPercent_
 
int m_charHeight
 
bool m_defaultHeight
 

Detailed Description

This class represents a splitter window, which can controlled using a floating point proportion instead of absolute values.

Definition at line 24 of file wxProportionalSplitterWindow.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MIN_PANE_SIZE 

Definition at line 26 of file wxProportionalSplitterWindow.h.

Constructor & Destructor Documentation

◆ ProportionalSplitterWindow() [1/2]

ProportionalSplitterWindow::ProportionalSplitterWindow ( )
inline

Default constructor.

Definition at line 32 of file wxProportionalSplitterWindow.h.

◆ ProportionalSplitterWindow() [2/2]

ProportionalSplitterWindow::ProportionalSplitterWindow ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
float  proportion = 0.5f,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxSP_3D 
)
inline

Construct a proportional splitter window using a set of parameters.

Parameters
parentwxWindow*
idwxWindowID
proportionfloat
posconst wxPoint&
sizeconst wxSize&
stylelong

Definition at line 47 of file wxProportionalSplitterWindow.h.

References m_charHeight, m_defaultHeight, MIN_PANE_SIZE, OnSashPosChanged(), OnSize(), and splitPercent_.

Here is the call graph for this function:

Member Function Documentation

◆ GetSplitPercentage()

float ProportionalSplitterWindow::GetSplitPercentage ( )
inline

Return the current splitting proportion.

Returns
float

Definition at line 182 of file wxProportionalSplitterWindow.h.

References splitPercent_.

Referenced by NumeReWindow::OnClose(), NumeReWindow::OnOptions(), NumeReWindow::toggleConsole(), and NumeReWindow::toggleHistory().

◆ initSplitSize()

int ProportionalSplitterWindow::initSplitSize ( float  proportion,
bool  isHorizontal 
)
inlineprivate

Calculates the initial sash position after splitting the window.

Parameters
proportionfloat
isHorizontalbool
Returns
int

Definition at line 237 of file wxProportionalSplitterWindow.h.

References isHorizontal(), m_charHeight, m_defaultHeight, parentSize(), mu::rint(), and splitPercent_.

Referenced by SetSashPositionFloat(), SplitHorizontally(), and SplitVertically().

Here is the call graph for this function:

◆ isHorizontal()

bool ProportionalSplitterWindow::isHorizontal ( ) const
inlineprivate

Return true, if the splitter is horizontal.

Returns
bool

Definition at line 208 of file wxProportionalSplitterWindow.h.

Referenced by initSplitSize(), parentSize(), and SetSashPositionFloat().

◆ OnSashPosChanged()

void ProportionalSplitterWindow::OnSashPosChanged ( wxSplitterEvent &  event)
inline

Handle the size event, when the sash position has been changed. Will automatically adapt the sash position to achieve a multiple of a character height in window space.

Parameters
eventwxSplitterEvent&
Returns
void

Definition at line 161 of file wxProportionalSplitterWindow.h.

References m_charHeight, m_defaultHeight, parentSize(), mu::rint(), and splitPercent_.

Referenced by ProportionalSplitterWindow().

Here is the call graph for this function:

◆ OnSize()

void ProportionalSplitterWindow::OnSize ( wxSizeEvent &  event)
inline

Handle the window size event. Will automatically adapt the sash position to achieve a multiple of a character height in window space.

Parameters
eventwxSizeEvent&
Returns
void

Definition at line 130 of file wxProportionalSplitterWindow.h.

References m_charHeight, m_defaultHeight, parentSize(), mu::rint(), and splitPercent_.

Referenced by ProportionalSplitterWindow().

Here is the call graph for this function:

◆ parentSize()

float ProportionalSplitterWindow::parentSize ( ) const
inlineprivate

Return the free space of the parent as a floating point number. Considers the orientation of the splitter.

Returns
float

Definition at line 221 of file wxProportionalSplitterWindow.h.

References isHorizontal().

Referenced by initSplitSize(), OnSashPosChanged(), and OnSize().

Here is the call graph for this function:

◆ SetCharHeigth()

void ProportionalSplitterWindow::SetCharHeigth ( int  _charheight)
inline

Change the character height in pixels.

Parameters
_charheightint
Returns
void

Definition at line 194 of file wxProportionalSplitterWindow.h.

References m_charHeight.

Referenced by NumeReWindow::NumeReWindow(), and NumeReWindow::OnOptions().

◆ SetSashPositionFloat()

void ProportionalSplitterWindow::SetSashPositionFloat ( float  proportion)
inline

Set the sash position using a floating point proportion.

Parameters
proportionfloat
Returns
void

Definition at line 114 of file wxProportionalSplitterWindow.h.

References initSplitSize(), and isHorizontal().

Referenced by NumeReWindow::NumeReWindow(), and NumeReWindow::OnOptions().

Here is the call graph for this function:

◆ SplitHorizontally()

virtual bool ProportionalSplitterWindow::SplitHorizontally ( wxWindow *  window1,
wxWindow *  window2,
float  proportion = 0 
)
inlinevirtual

Split this window horizontally using the selected porportion.

Parameters
window1wxWindow*
window2wxWindow*
proportionfloat
Returns
bool

Definition at line 84 of file wxProportionalSplitterWindow.h.

References initSplitSize().

Referenced by NumeReWindow::toggleConsole(), and NumeReWindow::UpdateTerminalNotebook().

Here is the call graph for this function:

◆ SplitVertically()

virtual bool ProportionalSplitterWindow::SplitVertically ( wxWindow *  window1,
wxWindow *  window2,
float  proportion = 0 
)
inlinevirtual

Split this window vertically using the selected porportion.

Parameters
window1wxWindow*
window2wxWindow*
proportionfloat
Returns
bool

Definition at line 100 of file wxProportionalSplitterWindow.h.

References initSplitSize().

Referenced by NumeReWindow::toggleHistory(), and NumeReWindow::UpdateTerminalNotebook().

Here is the call graph for this function:

Member Data Documentation

◆ m_charHeight

int ProportionalSplitterWindow::m_charHeight
private

◆ m_defaultHeight

bool ProportionalSplitterWindow::m_defaultHeight
private

◆ splitPercent_

float ProportionalSplitterWindow::splitPercent_
private

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