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

Method AddGadget

ui/UIWindow.cpp:219–244  ·  view source on GitHub ↗

interface functions adds a UIObject to the interface's draw list.

Source from the content-addressed store, hash-verified

217// interface functions
218// adds a UIObject to the interface's draw list.
219void UIWindow::AddGadget(UIGadget *gadget) {
220 ASSERT(IsCreated());
221 ASSERT(gadget->IsCreated());
222
223 // perform a linked list add.
224 if (!m_GadgetHead) {
225 m_GadgetHead = gadget;
226 m_GadgetTail = m_GadgetHead;
227 } else {
228 m_GadgetTail->m_Next = gadget;
229 gadget->m_Prev = m_GadgetTail;
230 gadget->m_Next = NULL;
231 m_GadgetTail = gadget;
232 }
233
234 if (m_GadgetCur) {
235 m_GadgetCur->LostFocus();
236 m_GadgetCur = NULL;
237 }
238 m_ResetCurGadget = true;
239 m_CurGadgetInGroup = false;
240
241 gadget->m_Wnd = this;
242
243 gadget->OnAttachToWindow();
244}
245
246// removes a UIObject from the draw list.
247void UIWindow::RemoveGadget(UIGadget *gadget) {

Callers 1

CreateMethod · 0.45

Calls 3

IsCreatedMethod · 0.80
LostFocusMethod · 0.80
OnAttachToWindowMethod · 0.80

Tested by

no test coverage detected