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;
+ TextboxFocusPolicy *focus_policy = new TextboxFocusPolicy(pwindow, x1, y1);
+ add_subwindow(focus_policy);
+ y1 += focus_policy->get_h() + 5;
+
+ if( y < y1 ) y = y1;
+ y += 10;
add_subwindow(new BC_Bar(5, y, get_w() - 10));
y += 5;
return 1;
}
+TextboxFocusPolicy::TextboxFocusPolicy(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->textbox_focus_policy,
+ _("Click to deactivate text focus"))
+{
+ this->pwindow = pwindow;
+}
+
+int TextboxFocusPolicy::handle_event()
+{
+ pwindow->thread->preferences->textbox_focus_policy = get_value();
+ return 1;
+}
+
+
ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
: BC_CheckBox(x,
PreferencesWindow *pwindow;
};
+class TextboxFocusPolicy : public BC_CheckBox
+{
+public:
+ TextboxFocusPolicy(PreferencesWindow *pwindow, int x, int y);
+ int handle_event();
+ PreferencesWindow *pwindow;
+};
+
class AndroidPIN : public BC_TextBox
{
public:
warn_version = 1;
bd_warn_root = 1;
popupmenu_btnup = 1;
+ textbox_focus_policy = LEAVE_DEACTIVATE;
dvd_yuv420p_interlace = 0;
// Default brender asset
warn_version = that->warn_version;
bd_warn_root = that->bd_warn_root;
popupmenu_btnup = that->popupmenu_btnup;
+ textbox_focus_policy = that->textbox_focus_policy;
dvd_yuv420p_interlace = that->dvd_yuv420p_interlace;
renderfarm_nodes.remove_all_objects();
renderfarm_ports.remove_all();
warn_version = defaults->get("WARN_VERSION", warn_version);
bd_warn_root = defaults->get("BD_WARN_ROOT", bd_warn_root);
popupmenu_btnup = defaults->get("POPUPMENU_BTNUP", popupmenu_btnup);
+ textbox_focus_policy = defaults->get("TEXTBOX_FOCUS_POLICY", textbox_focus_policy);
dvd_yuv420p_interlace = defaults->get("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
use_brender = defaults->get("USE_BRENDER", use_brender);
brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment);
defaults->update("WARN_VERSION", warn_version);
defaults->update("BD_WARN_ROOT", bd_warn_root);
defaults->update("POPUPMENU_BTNUP", popupmenu_btnup);
+ defaults->update("TEXTBOX_FOCUS_POLICY", textbox_focus_policy);
defaults->update("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
- brender_asset->save_defaults(defaults,
- "BRENDER_",
- 1,
- 1,
- 1,
- 0,
- 0);
+ brender_asset->save_defaults(defaults, "BRENDER_", 1, 1, 1, 0, 0);
defaults->update("USE_BRENDER", use_brender);
defaults->update("BRENDER_FRAGMENT", brender_fragment);
defaults->update("USE_RENDERFARM", use_renderfarm);
int bd_warn_root;
// popup menus activate on button release
int popupmenu_btnup;
+// textbox focus policy: click, leave
+ int textbox_focus_policy;
// use dvd yuv420p interlace format
int dvd_yuv420p_interlace;
BC_Signals::set_catch_segv(mwindow->preferences->trap_sigsegv);
BC_Signals::set_catch_intr(mwindow->preferences->trap_sigintr);
BC_WindowBase::get_resources()->popupmenu_btnup = mwindow->preferences->popupmenu_btnup;
+ BC_WindowBase::get_resources()->textbox_focus_policy = mwindow->preferences->textbox_focus_policy;
if( mwindow->preferences->trap_sigsegv || mwindow->preferences->trap_sigintr ) {
BC_Trace::enable_locks();
}
tooltip_delay = 1000;
tooltip_bg_color = YELLOW;
tooltips_enabled = 1;
+ textbox_focus_policy = LEAVE_DEACTIVATE;
filebox_margin = 110;
dirbox_margin = 90;
int tooltip_delay;
int tooltip_bg_color;
int tooltips_enabled;
+ int textbox_focus_policy;
int audiovideo_color;
draw_border();
flash(1);
}
- if( !suggestions_popup )
+ if( !suggestions_popup &&
+ top_level->get_resources()->textbox_focus_policy == LEAVE_DEACTIVATE )
deactivate();
return 0;
}
return 1;
}
else
- if(active && suggestions_popup && (!yscroll || !yscroll->is_event_win()))
- {
- if( suggestions_popup->button_press_event() )
- return suggestions_popup->handle_event();
+ if( active ) {
+ if( suggestions_popup && (!yscroll || !yscroll->is_event_win())) {
+ if( suggestions_popup->button_press_event() )
+ return suggestions_popup->handle_event();
+ }
+ else if( top_level->get_resources()->textbox_focus_policy == CLICK_DEACTIVATE )
+ deactivate();
}
return 0;
#define MIDDLE_BUTTON 2
#define RIGHT_BUTTON 3
+// textbox deactivate policy
+#define LEAVE_DEACTIVATE 0
+#define CLICK_DEACTIVATE 1
// Use single thread for all windows.
// This is a bad idea because it's very slow. Windows which share the same