+ViewViconSize::ViewViconSize(PreferencesWindow *pwindow,
+ AppearancePrefs *aprefs, int x, int y)
+ : BC_TumbleTextBox(aprefs,
+ pwindow->thread->preferences->vicon_size,
+ 16, 512, x, y, 80)
+
+{
+ this->pwindow = pwindow;
+ this->aprefs = aprefs;
+}
+
+int ViewViconSize::handle_event()
+{
+ int v = atoi(get_text());
+ bclamp(v, 16,512);
+ pwindow->thread->preferences->vicon_size = v;
+ return 1;
+}
+
+ViewViconColorMode::ViewViconColorMode(PreferencesWindow *pwindow, int x, int y)
+ : BC_PopupMenu(x, y, 100,
+ _(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]), 1)
+{
+ this->pwindow = pwindow;
+}
+ViewViconColorMode::~ViewViconColorMode()
+{
+}
+
+const char *ViewViconColorMode::vicon_color_modes[] = {
+ N_("Low"),
+ N_("Med"),
+ N_("High"),
+};
+
+void ViewViconColorMode::create_objects()
+{
+ for( int id=0,nid=sizeof(vicon_color_modes)/sizeof(vicon_color_modes[0]); id<nid; ++id )
+ add_item(new ViewViconColorModeItem(this, _(vicon_color_modes[id]), id));
+ handle_event();
+}
+
+int ViewViconColorMode::handle_event()
+{
+ set_text(_(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]));
+ return 1;
+}
+
+ViewViconColorModeItem::ViewViconColorModeItem(ViewViconColorMode *popup, const char *text, int id)
+ : BC_MenuItem(text)
+{
+ this->popup = popup;
+ this->id = id;
+}
+
+int ViewViconColorModeItem::handle_event()
+{
+ popup->set_text(get_text());
+ popup->pwindow->thread->preferences->vicon_color_mode = id;
+ return popup->handle_event();
+}
+