+#endif // EDIT_KEYFRAME
+
+
+
+
+
+
+
+
+
+
+KeyFramePresetsList::KeyFramePresetsList(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y,
+ int w,
+ int h)
+ : BC_ListBox(x,
+ y,
+ w,
+ h,
+ LISTBOX_TEXT,
+ thread->presets_data)
+{
+ this->thread = thread;
+ this->window = window;
+}
+
+int KeyFramePresetsList::selection_changed()
+{
+ int number = get_selection_number(0, 0);
+ if( number >= 0 ) {
+ strcpy(thread->preset_text, thread->preset_titles.get(number));
+ thread->is_factory = thread->is_factories.get(number);
+// show title without factory symbol in the textbox
+ window->preset_text->update(
+ thread->presets_data->get(number)->get_text());
+ window->update_editing();
+ }
+
+ return 0;
+}
+
+int KeyFramePresetsList::handle_event()
+{
+ thread->apply_preset(thread->preset_text, thread->is_factory);
+ window->set_done(0);
+ return 0;
+}
+
+
+KeyFramePresetsText::KeyFramePresetsText(KeyFrameThread *thread,
+ KeyFrameWindow *window, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, thread->preset_text)
+{
+ this->thread = thread;
+ this->window = window;
+}
+
+// user entered a title
+int KeyFramePresetsText::handle_event()
+{
+ strcpy(thread->preset_text, get_text());
+// once changed, it's now not a factory preset
+ thread->is_factory = 0;
+ window->update_editing();
+ return 0;
+}
+
+
+KeyFramePresetsDelete::KeyFramePresetsDelete(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y)
+ : BC_GenericButton(x, y, _("Delete"))
+{
+ this->thread = thread;
+ this->window = window;
+}
+
+int KeyFramePresetsDelete::handle_event()
+{
+ if( !thread->is_factory ) {
+ thread->delete_preset(thread->preset_text, thread->is_factory);
+ }
+ return 1;
+}
+
+
+KeyFramePresetsSave::KeyFramePresetsSave(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y)
+: BC_GenericButton(x, y, _("Save"))
+{
+ this->thread = thread;
+ this->window = window;
+}
+
+int KeyFramePresetsSave::handle_event()
+{
+ if( !thread->is_factory ) {
+ thread->save_preset(thread->preset_text, thread->is_factory);
+ }
+ return 1;
+}
+
+
+
+
+
+
+
+
+KeyFramePresetsApply::KeyFramePresetsApply(KeyFrameThread *thread,
+ KeyFrameWindow *window,
+ int x,
+ int y)
+ : BC_GenericButton(x, y, _("Apply"))
+{
+ this->thread = thread;
+ this->window = window;
+}
+
+int KeyFramePresetsApply::handle_event()
+{
+ thread->apply_preset(thread->preset_text, thread->is_factory);
+ return 1;
+}
+
+
+KeyFramePresetsOK::KeyFramePresetsOK(KeyFrameThread *thread,
+ KeyFrameWindow *window)