MCPcopy Create free account
hub / github.com/c3d/tao3D / checkBoxButtonTexture

Method checkBoxButtonTexture

tao/widget.cpp:12081–12106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12079
12080
12081Integer* Widget::checkBoxButtonTexture(Tree_p self,
12082 double w, double h, Text_p name,
12083 Text_p lbl, Text_p sel, Tree_p act)
12084// ----------------------------------------------------------------------------
12085// Make a texture out of a given checkbox button
12086// ----------------------------------------------------------------------------
12087{
12088 if (w < 16) w = 16;
12089 if (h < 16) h = 16;
12090
12091 // Get or build the current frame if we don't have one
12092 AbstractButtonSurface *surface = name->GetInfo<AbstractButtonSurface>();
12093 if (!surface)
12094 {
12095 surface = new CheckBoxSurface(name, this, +name->value);
12096 name->SetInfo<AbstractButtonSurface> (surface);
12097 }
12098
12099 // Resize to requested size, bind texture and save current infos
12100 surface->resize (w, h);
12101 uint texId = surface->bind(lbl, act, sel);
12102 layout->Add(new FillTexture(texId));
12103 GL.TextureSize (w, h);
12104
12105 return new Integer(texId, self->Position());
12106}
12107
12108
12109Tree_p Widget::pushButton(Tree_p self,

Callers

nothing calls this directly

Calls 4

TextureSizeMethod · 0.80
resizeMethod · 0.45
bindMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected