MCPcopy Create free account
hub / github.com/Card-Forge/forge / initButton

Method initButton

forge-gui-mobile/src/forge/toolbox/FDialog.java:133–143  ·  view source on GitHub ↗
(int index, String text, FEventHandler command)

Source from the content-addressed store, hash-verified

131 protected abstract float layoutAndGetHeight(float width, float maxHeight);
132
133 protected void initButton(int index, String text, FEventHandler command) {
134 FButton button = getButton(index);
135 if (button == null) { return; }
136
137 button.setText(text);
138 button.setCommand(command);
139 button.setEnabled(true);
140 if (button == btnMiddle) { //allow middle button to be sized to fit text
141 button.setWidth(button.getAutoSizeBounds().width * 1.25f);
142 }
143 }
144
145 protected FButton getButton(int index) {
146 if (index >= buttonCount) { return null; }

Callers 13

VAssignCombatDamageMethod · 0.80
VAssignGenericAmountMethod · 0.80
VYieldOptionsMethod · 0.80
RevealDialogMethod · 0.80
GuiDownloaderMethod · 0.80
FFileChooserMethod · 0.80
DualListBoxMethod · 0.80
FOptionPaneMethod · 0.80
FSideboardDialogMethod · 0.80
AddBasicLandsDialogMethod · 0.80

Calls 6

getButtonMethod · 0.95
setTextMethod · 0.95
setCommandMethod · 0.95
setEnabledMethod · 0.95
getAutoSizeBoundsMethod · 0.95
setWidthMethod · 0.80

Tested by

no test coverage detected