Audacity 3.2.0
Public Member Functions | Protected Attributes | List of all members
ToolBarFrame Class Referencefinal

A miniframe based container for ExpandingToolBars providing modeless presentation. More...

#include <ExpandingToolBar.h>

Inheritance diagram for ToolBarFrame:
[legend]
Collaboration diagram for ToolBarFrame:
[legend]

Public Member Functions

 ToolBarFrame (wxWindow *parent, wxWindowID id, const wxString &name={}, const wxPoint &pos=wxDefaultPosition)
 
 ~ToolBarFrame ()
 
void Fit () override
 
void SetChild (ExpandingToolBar *child)
 

Protected Attributes

ExpandingToolBarmChild
 

Detailed Description

A miniframe based container for ExpandingToolBars providing modeless presentation.

Definition at line 169 of file ExpandingToolBar.h.

Constructor & Destructor Documentation

◆ ToolBarFrame()

ToolBarFrame::ToolBarFrame ( wxWindow *  parent,
wxWindowID  id,
const wxString &  name = {},
const wxPoint &  pos = wxDefaultPosition 
)

Definition at line 789 of file ExpandingToolBar.cpp.

792 :
793 wxMiniFrame(parent, id, name, pos, wxSize(1, 1),
794// Workaround for bug in __WXMSW__. No close box on a miniframe unless wxSYSTEM_MENU is used.
795#ifdef __WXMSW__
796 wxSYSTEM_MENU |
797#endif
798 wxCAPTION|wxCLOSE_BOX),
799 mChild(NULL)
800{
801}
const TranslatableString name
Definition: Distortion.cpp:74
ExpandingToolBar * mChild

◆ ~ToolBarFrame()

ToolBarFrame::~ToolBarFrame ( )

Definition at line 803 of file ExpandingToolBar.cpp.

804{
805}

Member Function Documentation

◆ Fit()

void ToolBarFrame::Fit ( )
override

Definition at line 816 of file ExpandingToolBar.cpp.

817{
818 if (mChild) {
819 wxSize childSize = mChild->GetBestSize();
820
821 // Take into account the difference between the content
822 // size and the frame size
823 wxSize curContentSize = GetClientSize();
824 wxSize curFrameSize = GetSize();
825 wxSize newFrameSize = childSize + (curFrameSize - curContentSize);
826
827 SetSizeHints(newFrameSize, newFrameSize);
828 SetSize(newFrameSize);
829 }
830}

References mChild.

Referenced by SetChild().

Here is the caller graph for this function:

◆ SetChild()

void ToolBarFrame::SetChild ( ExpandingToolBar child)

Definition at line 807 of file ExpandingToolBar.cpp.

808{
809 mChild = child;
810 if (mChild && mChild->GetParent() != this)
811 mChild->Reparent(this);
812
813 Fit();
814}
void Fit() override

References Fit(), and mChild.

Referenced by ExpandingToolBar::OnSize().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mChild

ExpandingToolBar* ToolBarFrame::mChild
protected

Definition at line 186 of file ExpandingToolBar.h.

Referenced by Fit(), and SetChild().


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