MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Create

Method Create

ui/UIButton.cpp:146–162  ·  view source on GitHub ↗

if text = NULL, no text printed out.

Source from the content-addressed store, hash-verified

144
145// if text = NULL, no text printed out.
146void UIButton::Create(UIWindow *parent, int id, UIItem *item, int x, int y, int w, int h, int flags) {
147 if (item) {
148 m_Items[UI_BTS_DISABLED] = item->CopyUIItem();
149 m_Items[UI_BTS_INACTIVE] = item->CopyUIItem();
150 m_Items[UI_BTS_HILITE] = item->CopyUIItem();
151 m_Items[UI_BTS_ACTIVATED] = item->CopyUIItem();
152 }
153
154 SetColor(UI_BTS_DISABLED, GR_DARKGRAY);
155 SetColor(UI_BTS_INACTIVE, GR_DARKGRAY);
156 SetColor(UI_BTS_HILITE, GR_RGB(128, 128, 128));
157 SetColor(UI_BTS_ACTIVATED, GR_RGB(128, 128, 128));
158
159 m_State = UI_BTS_INACTIVE; // current state of button.
160
161 UIGadget::Create(parent, id, x, y, w, h, flags);
162}
163
164// sets the background bitmap for a specified button state
165void UIButton::SetStateItem(int state, UIItem *item) {

Callers

nothing calls this directly

Calls 3

ClearFlagMethod · 0.80
GR_RGBFunction · 0.50
CopyUIItemMethod · 0.45

Tested by

no test coverage detected