Yea, that works. All is good now.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu const int vertical_control_separator = 100;
tgui::Scrollbar::Ptr scrollbar(gui);
scrollbar->load(THEME_CONFIG_FILE);
scrollbar->setVerticalScroll(true);
scrollbar->setPosition(20, 20);
scrollbar->setSize(18, 256);
scrollbar->setMaximum(127);
scrollbar->setLowValue(8);
tgui::Knob::Ptr knob(gui);
knob->load("data/widgets/Knob/Knob.conf");
knob->setPosition(55, 235);
knob->setSize(40, 40);
knob->setStartRotation(127);
knob->setValue(0);
knob->setEndRotation(-128);
/* Callback handling*/
#define Knob_CALLBACK_ID 10
#define KnobScroll_CALLBACK_ID 20
bool invert_Knob_SYNC=false;
knob->bindCallback(tgui::Knob::ValueChanged);
knob->setCallbackId(Knob_CALLBACK_ID +1);
syncbox->bindCallback(tgui::Checkbox::Checked);
syncbox->bindCallback(tgui::Checkbox::Unchecked);
syncbox->setCallbackId(Knob_CALLBACK_ID + 9);
scrollbar->bindCallback(tgui::Scrollbar::ValueChanged);
scrollbar->setCallbackId(KnobScroll_CALLBACK_ID + 1);
int value;
switch(callback.id)
{
// Knobs
case Knob_CALLBACK_ID + 1:
{
value=knob->getValue();
if (invert_Knob_SYNC == true) scrollbar->setValue(value / 3); // works but sync is flipped
else scrollbar->setValue((128 - 8) - (value / 3)); // default ( offset fixed)
break;
}
case Knob_CALLBACK_ID + 9:
{
invert_Knob_SYNC = !invert_Knob_SYNC;
break;
}
case KnobScroll_CALLBACK_ID + 1:
{
value = scrollbar->getValue();
if (invert_Knob_SYNC == true) knob8->setValue(value * 3); // works but sync is flipped
//else knob->setValue(? ); // broken
break;
}
Unhandled exception at 0x0FC3FA96 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Exception thrown at 0x0FC3FA96 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Unhandled exception at 0x00E82707 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Exception thrown at 0x00E82707 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.