Audacity  3.0.3
Public Member Functions | Protected Attributes | List of all members
ToolBarDialog Class Referencefinal

A dialog based container for ExpandingToolBars providing modal based operations. More...

#include <ExpandingToolBar.h>

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

Public Member Functions

 ToolBarDialog (wxWindow *parent, wxWindowID id, const TranslatableString &name={}, const wxPoint &pos=wxDefaultPosition)
 
 ~ToolBarDialog ()
 
void Fit () override
 
void SetChild (ExpandingToolBar *child)
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Protected Attributes

ExpandingToolBarmChild
 

Detailed Description

A dialog based container for ExpandingToolBars providing modal based operations.

Definition at line 147 of file ExpandingToolBar.h.

Constructor & Destructor Documentation

◆ ToolBarDialog()

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

Definition at line 739 of file ExpandingToolBar.cpp.

742  :
743  wxDialogWrapper(parent, id, name, pos, wxSize(1, 1),
744 // Workaround for bug in __WXMSW__. No close box on a wxDialog unless wxSYSTEM_MENU is used.
745 #ifdef __WXMSW__
746  wxSYSTEM_MENU |
747 #endif
748  wxCAPTION|wxCLOSE_BOX),
749  mChild(NULL)
750 {
751 }

◆ ~ToolBarDialog()

ToolBarDialog::~ToolBarDialog ( )

Definition at line 753 of file ExpandingToolBar.cpp.

754 {
755 }

Member Function Documentation

◆ Fit()

void ToolBarDialog::Fit ( )
override

Definition at line 766 of file ExpandingToolBar.cpp.

767 {
768  if (mChild) {
769  wxSize childSize = mChild->GetBestSize();
770 
771  // Take into account the difference between the content
772  // size and the frame size
773  wxSize curContentSize = GetClientSize();
774  wxSize curFrameSize = GetSize();
775  wxSize newFrameSize = childSize + (curFrameSize - curContentSize);
776 
777  SetSizeHints(newFrameSize, newFrameSize);
778  SetSize(newFrameSize);
779  }
780 }

References mChild.

Referenced by SetChild().

Here is the caller graph for this function:

◆ SetChild()

void ToolBarDialog::SetChild ( ExpandingToolBar child)

Definition at line 757 of file ExpandingToolBar.cpp.

758 {
759  mChild = child;
760  if (mChild && mChild->GetParent() != this)
761  mChild->Reparent(this);
762 
763  Fit();
764 }

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* ToolBarDialog::mChild
protected

Definition at line 164 of file ExpandingToolBar.h.

Referenced by Fit(), and SetChild().


The documentation for this class was generated from the following files:
name
const TranslatableString name
Definition: Distortion.cpp:98
ToolBarDialog::mChild
ExpandingToolBar * mChild
Definition: ExpandingToolBar.h:164
ToolBarDialog::Fit
void Fit() override
Definition: ExpandingToolBar.cpp:766
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84