Skip to content

Instantly share code, notes, and snippets.

@olilarkin
Created December 9, 2019 15:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olilarkin/bc53e26038104b5b66d9431bbdf5132b to your computer and use it in GitHub Desktop.
Save olilarkin/bc53e26038104b5b66d9431bbdf5132b to your computer and use it in GitHub Desktop.
mMakeGraphicsFunc = [&]() {
return MakeGraphics(*this, 300, 300, PLUG_FPS, 1.);
};
mLayoutFunc = [&](IGraphics* pGraphics) {
const IRECT b = pGraphics->GetBounds();
if(pGraphics->NControls())
{
pGraphics->GetBackgroundControl()->SetRECT(b);
pGraphics->GetControl(1)->SetRECT(b.GetCentredInside(100));
return;
}
pGraphics->AttachCornerResizer(EUIResizerMode::Scale, false);
pGraphics->AttachPanelBackground(COLOR_GRAY);
pGraphics->LoadFont("Roboto-Regular", ROBOTO_FN);
pGraphics->SetLayoutOnResize(true);
pGraphics->AttachControl(new IVRadioButtonControl(b.GetCentredInside(100),
[pGraphics](IControl* pCaller) {
int idx = dynamic_cast<IVRadioButtonControl*>(pCaller)->GetSelectedIdx();
pGraphics->Resize(300 + (idx * 200), 300 + (idx * 200), 1.f);
},
{"Small", "Medium", "Big"} ));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment