if text = NULL, no text printed out.
| 144 | |
| 145 | // if text = NULL, no text printed out. |
| 146 | void 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 |
| 165 | void UIButton::SetStateItem(int state, UIItem *item) { |
nothing calls this directly
no test coverage detected