textbox click policy prefs
[goodguy/history.git] / cinelerra-5.1 / cinelerra / interfaceprefs.C
index 58aef4973aad16fc6daf2e54bef188257c921289..fb58b22eea391a89394bb338bf8850096a4c029b 100644 (file)
@@ -140,9 +140,21 @@ void InterfacePrefs::create_objects()
        UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1);
        add_subwindow(ver_win);
        y1 += ver_win->get_h() + 5;
+       BD_WarnRoot *bdwr_win = new BD_WarnRoot(pwindow, x1, y1);
+       add_subwindow(bdwr_win);
+       y1 += bdwr_win->get_h() + 5;
        PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
        add_subwindow(pop_win);
-       y1 += pop_win->get_h() + 25;
+       y1 += pop_win->get_h() + 5;
+       ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1);
+       add_subwindow(focus_activate);
+       y1 += focus_activate->get_h() + 5;
+       DeactivateFocusPolicy *focus_deactivate = new DeactivateFocusPolicy(pwindow, x1, y1);
+       add_subwindow(focus_deactivate);
+       y1 += focus_deactivate->get_h() + 5;
+
+       if( y < y1 ) y = y1;
+       y += 10;
 
        add_subwindow(new BC_Bar(5, y,  get_w() - 10));
        y += 5;
@@ -711,6 +723,19 @@ int UseWarnVersion::handle_event()
        return 1;
 }
 
+BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
+       _("Create Bluray warns if not root"))
+{
+       this->pwindow = pwindow;
+}
+
+int BD_WarnRoot::handle_event()
+{
+       pwindow->thread->preferences->bd_warn_root = get_value();
+       return 1;
+}
+
 PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
  : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup,
        _("Popups activate on button up"))
@@ -724,6 +749,39 @@ int PopupMenuBtnup::handle_event()
        return 1;
 }
 
+ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0,
+       _("Click to activate text focus"))
+{
+       this->pwindow = pwindow;
+}
+
+int ActivateFocusPolicy::handle_event()
+{
+       if( get_value() )
+               pwindow->thread->preferences->textbox_focus_policy |= CLICK_ACTIVATE;
+       else
+               pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_ACTIVATE;
+       return 1;
+}
+
+DeactivateFocusPolicy::DeactivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_DEACTIVATE) != 0,
+       _("Click to deactivate text focus"))
+{
+       this->pwindow = pwindow;
+}
+
+int DeactivateFocusPolicy::handle_event()
+{
+       if( get_value() )
+               pwindow->thread->preferences->textbox_focus_policy |= CLICK_DEACTIVATE;
+       else
+               pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_DEACTIVATE;
+       return 1;
+}
+
+
 
 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
  : BC_CheckBox(x,