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

Method OnAttachToWindow

Descent3/newui_core.cpp:2464–2478  ·  view source on GitHub ↗

when gadget is added to a window (AddGadget is called)

Source from the content-addressed store, hash-verified

2462
2463// when gadget is added to a window (AddGadget is called)
2464void newuiSlider::OnAttachToWindow() {
2465 int16_t bx = m_X, by = m_Y;
2466
2467 if (m_title) {
2468 by += m_title->height() + 5;
2469 bx += 2;
2470 }
2471
2472 m_minus_btn.Create(m_Wnd, -1, NEWUI_ARROW_LEFT, NULL, bx, by);
2473 m_minus_btn.SetFlag(UIF_NOTIFYMASTERSEL);
2474 AttachSlaveGadget(&m_minus_btn);
2475 m_plus_btn.Create(m_Wnd, -1, NEWUI_ARROW_RIGHT, NULL, bx + m_bar_bmp->width() - 24, by);
2476 m_plus_btn.SetFlag(UIF_NOTIFYMASTERSEL);
2477 AttachSlaveGadget(&m_plus_btn);
2478}
2479
2480// when gadget is detached from window
2481void newuiSlider::OnDetachFromWindow() {

Callers 1

AddGadgetMethod · 0.80

Calls 4

SetFlagMethod · 0.80
heightMethod · 0.45
CreateMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected