mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 17:11:17 +02:00
Make ToolBar button setup functions public and static
This commit is contained in:
parent
e6189aa851
commit
fbf09d2130
@ -129,7 +129,7 @@ AButton *ControlToolBar::MakeButton(teBmps eEnabledUp, teBmps eEnabledDown, teBm
|
|||||||
bool processdownevents,
|
bool processdownevents,
|
||||||
const wxChar *label)
|
const wxChar *label)
|
||||||
{
|
{
|
||||||
AButton *r = ToolBar::MakeButton(
|
AButton *r = ToolBar::MakeButton(this,
|
||||||
bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredHiliteLarge,
|
bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredHiliteLarge,
|
||||||
eEnabledUp, eEnabledDown, eDisabled,
|
eEnabledUp, eEnabledDown, eDisabled,
|
||||||
wxWindowID(id),
|
wxWindowID(id),
|
||||||
|
@ -105,7 +105,7 @@ AButton *EditToolBar::AddButton(
|
|||||||
{
|
{
|
||||||
AButton *&r = mButtons[id];
|
AButton *&r = mButtons[id];
|
||||||
|
|
||||||
r = ToolBar::MakeButton(
|
r = ToolBar::MakeButton(this,
|
||||||
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
||||||
eEnabledUp, eEnabledDown, eDisabled,
|
eEnabledUp, eEnabledDown, eDisabled,
|
||||||
wxWindowID(id),
|
wxWindowID(id),
|
||||||
|
@ -700,6 +700,7 @@ void ToolBar::MakeButtonBackgroundsSmall()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Makes a button and its four different state bitmaps
|
/// 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 eUp Background for when button is Up.
|
||||||
/// @param eDown Background for when button is Down.
|
/// @param eDown Background for when button is Down.
|
||||||
/// @param eHilite Background for when button is Hilit.
|
/// @param eHilite Background for when button is Hilit.
|
||||||
@ -710,7 +711,8 @@ void ToolBar::MakeButtonBackgroundsSmall()
|
|||||||
/// @param placement Placement position
|
/// @param placement Placement position
|
||||||
/// @param processdownevents true iff button handles down events.
|
/// @param processdownevents true iff button handles down events.
|
||||||
/// @param size Size of the background.
|
/// @param size Size of the background.
|
||||||
AButton * ToolBar::MakeButton(teBmps eUp,
|
AButton * ToolBar::MakeButton(wxWindow *parent,
|
||||||
|
teBmps eUp,
|
||||||
teBmps eDown,
|
teBmps eDown,
|
||||||
teBmps eHilite,
|
teBmps eHilite,
|
||||||
teBmps eStandardUp,
|
teBmps eStandardUp,
|
||||||
@ -731,7 +733,7 @@ AButton * ToolBar::MakeButton(teBmps eUp,
|
|||||||
wxImagePtr disable2 (OverlayImage(eUp, eDisabled, xoff, yoff));
|
wxImagePtr disable2 (OverlayImage(eUp, eDisabled, xoff, yoff));
|
||||||
|
|
||||||
AButton * button =
|
AButton * button =
|
||||||
new AButton(this, id, placement, size, *up2, *hilite2, *down2,
|
new AButton(parent, id, placement, size, *up2, *hilite2, *down2,
|
||||||
*disable2, processdownevents);
|
*disable2, processdownevents);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
|
@ -121,9 +121,11 @@ class ToolBar /* not final */ : public wxPanel
|
|||||||
virtual int GetInitialWidth() { return -1; }
|
virtual int GetInitialWidth() { return -1; }
|
||||||
virtual int GetMinToolbarWidth() { return GetInitialWidth(); }
|
virtual int GetMinToolbarWidth() { return GetInitialWidth(); }
|
||||||
virtual wxSize GetDockedSize() { return GetMinSize(); }
|
virtual wxSize GetDockedSize() { return GetMinSize(); }
|
||||||
protected:
|
|
||||||
|
|
||||||
AButton *MakeButton(teBmps eUp,
|
public:
|
||||||
|
static
|
||||||
|
AButton *MakeButton(wxWindow *parent,
|
||||||
|
teBmps eUp,
|
||||||
teBmps eDown,
|
teBmps eDown,
|
||||||
teBmps eHilite,
|
teBmps eHilite,
|
||||||
teBmps eStandardUp,
|
teBmps eStandardUp,
|
||||||
@ -144,6 +146,7 @@ class ToolBar /* not final */ : public wxPanel
|
|||||||
teBmps eDisabled,
|
teBmps eDisabled,
|
||||||
wxSize size);
|
wxSize size);
|
||||||
|
|
||||||
|
protected:
|
||||||
void SetButton(bool down, AButton *button);
|
void SetButton(bool down, AButton *button);
|
||||||
|
|
||||||
void MakeMacRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);
|
void MakeMacRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);
|
||||||
|
@ -156,7 +156,7 @@ void ToolsToolBar::UpdatePrefs()
|
|||||||
AButton * ToolsToolBar::MakeTool( teBmps eTool,
|
AButton * ToolsToolBar::MakeTool( teBmps eTool,
|
||||||
int id, const wxChar *label)
|
int id, const wxChar *label)
|
||||||
{
|
{
|
||||||
AButton *button = ToolBar::MakeButton(
|
AButton *button = ToolBar::MakeButton(this,
|
||||||
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
||||||
eTool, eTool, eTool,
|
eTool, eTool, eTool,
|
||||||
wxWindowID(id),
|
wxWindowID(id),
|
||||||
|
@ -147,7 +147,7 @@ AButton *TranscriptionToolBar::AddButton(
|
|||||||
{
|
{
|
||||||
AButton *&r = mButtons[id];
|
AButton *&r = mButtons[id];
|
||||||
|
|
||||||
r = ToolBar::MakeButton(
|
r = ToolBar::MakeButton(this,
|
||||||
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
||||||
eFore, eFore, eDisabled,
|
eFore, eFore, eDisabled,
|
||||||
wxWindowID(id),
|
wxWindowID(id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user