1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-09 16:41:14 +02:00

Make ToolBar button setup functions public and static

This commit is contained in:
Paul Licameli 2016-05-28 22:54:51 -04:00
parent e6189aa851
commit fbf09d2130
6 changed files with 13 additions and 8 deletions

View File

@ -129,7 +129,7 @@ AButton *ControlToolBar::MakeButton(teBmps eEnabledUp, teBmps eEnabledDown, teBm
bool processdownevents,
const wxChar *label)
{
AButton *r = ToolBar::MakeButton(
AButton *r = ToolBar::MakeButton(this,
bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredHiliteLarge,
eEnabledUp, eEnabledDown, eDisabled,
wxWindowID(id),

View File

@ -105,7 +105,7 @@ AButton *EditToolBar::AddButton(
{
AButton *&r = mButtons[id];
r = ToolBar::MakeButton(
r = ToolBar::MakeButton(this,
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
eEnabledUp, eEnabledDown, eDisabled,
wxWindowID(id),

View File

@ -700,6 +700,7 @@ void ToolBar::MakeButtonBackgroundsSmall()
}
/// Makes a button and its four different state bitmaps
/// @param parent Parent window for the button.
/// @param eUp Background for when button is Up.
/// @param eDown Background for when button is Down.
/// @param eHilite Background for when button is Hilit.
@ -710,7 +711,8 @@ void ToolBar::MakeButtonBackgroundsSmall()
/// @param placement Placement position
/// @param processdownevents true iff button handles down events.
/// @param size Size of the background.
AButton * ToolBar::MakeButton(teBmps eUp,
AButton * ToolBar::MakeButton(wxWindow *parent,
teBmps eUp,
teBmps eDown,
teBmps eHilite,
teBmps eStandardUp,
@ -731,7 +733,7 @@ AButton * ToolBar::MakeButton(teBmps eUp,
wxImagePtr disable2 (OverlayImage(eUp, eDisabled, xoff, yoff));
AButton * button =
new AButton(this, id, placement, size, *up2, *hilite2, *down2,
new AButton(parent, id, placement, size, *up2, *hilite2, *down2,
*disable2, processdownevents);
return button;

View File

@ -121,9 +121,11 @@ class ToolBar /* not final */ : public wxPanel
virtual int GetInitialWidth() { return -1; }
virtual int GetMinToolbarWidth() { return GetInitialWidth(); }
virtual wxSize GetDockedSize() { return GetMinSize(); }
protected:
AButton *MakeButton(teBmps eUp,
public:
static
AButton *MakeButton(wxWindow *parent,
teBmps eUp,
teBmps eDown,
teBmps eHilite,
teBmps eStandardUp,
@ -144,6 +146,7 @@ class ToolBar /* not final */ : public wxPanel
teBmps eDisabled,
wxSize size);
protected:
void SetButton(bool down, AButton *button);
void MakeMacRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);

View File

@ -156,7 +156,7 @@ void ToolsToolBar::UpdatePrefs()
AButton * ToolsToolBar::MakeTool( teBmps eTool,
int id, const wxChar *label)
{
AButton *button = ToolBar::MakeButton(
AButton *button = ToolBar::MakeButton(this,
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
eTool, eTool, eTool,
wxWindowID(id),

View File

@ -147,7 +147,7 @@ AButton *TranscriptionToolBar::AddButton(
{
AButton *&r = mButtons[id];
r = ToolBar::MakeButton(
r = ToolBar::MakeButton(this,
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
eFore, eFore, eDisabled,
wxWindowID(id),