MCPcopy Create free account
hub / github.com/audacity/audacity / CreateButton

Method CreateButton

src/toolbars/ToolBarButtons.cpp:64–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64AButton* ToolBarButtons::CreateButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int thisButtonId, const TranslatableString& label, bool toggle)
65{
66 auto& button = mButtons[thisButtonId];// ;
67 button = safenew AButton(mParent, thisButtonId + mFirstButtonId);
68 button->SetButtonType(AButton::FrameButton);
69 button->SetButtonToggles(toggle);
70 button->SetImages(
71 theTheme.Image(bmpRecoloredUpSmall),
72 theTheme.Image(bmpRecoloredUpHiliteSmall),
73 theTheme.Image(bmpRecoloredDownSmall),
74 theTheme.Image(bmpRecoloredHiliteSmall),
75 theTheme.Image(bmpRecoloredUpSmall));
76 button->SetIcons(theTheme.Image(eEnabledUp), theTheme.Image(eEnabledDown), theTheme.Image(eDisabled));
77 button->SetFrameMid(3);
78 button->SetLabel(label);
79 button->SetMinSize(wxSize { 25, 25 });
80 button->SetMaxSize(wxSize { 25, 25 });
81 return button;
82}
83
84void ToolBarButtons::SetEnabled(int id, bool state)
85{

Callers 2

AddButtonMethod · 0.80
AddButtonMethod · 0.80

Calls 6

SetButtonTypeMethod · 0.80
SetImagesMethod · 0.80
SetIconsMethod · 0.80
SetFrameMidMethod · 0.80
AButtonClass · 0.70
SetLabelMethod · 0.45

Tested by

no test coverage detected