Пример #1
0
FindBar::FindBar(Window& parent, Glib::RefPtr<Gtk::Builder>& builder):
    window_(parent) {

    build_widgets(builder);
    _connect_signals();

    find_bar_->show();
    find_bar_->set_reveal_child(false);
}
Пример #2
0
GtkWidget *gui_navbar_versekey_editor_new(EDITOR *editor)
{
#ifdef USE_GTKBUILDER
	GtkBuilder *gxml;
#else
	GladeXML *gxml;
#endif
#ifdef HAVE_GTK_34
	GtkWidget *eventbox;
#endif

	gchar *glade_file =
	    gui_general_user_file("navbar_versekey" UI_SUFFIX, FALSE);
	g_return_val_if_fail((glade_file != NULL), NULL);
	XI_message(("%s", glade_file));

/* build the widget */
#ifdef USE_GTKBUILDER
	gxml = gtk_builder_new();
	gtk_builder_add_from_file(gxml, glade_file, NULL);
#else
	gxml = glade_xml_new(glade_file, "navbar", NULL);
#endif
	editor->navbar.dialog = TRUE;
	editor->navbar.module_name =
	    g_string_new(settings.MainWindowModule);
	editor->navbar.key = g_string_new(settings.currentverse);

	editor->navbar.navbar = UI_GET_ITEM(gxml, "navbar");
	editor->navbar.button_history_back =
	    UI_GET_ITEM(gxml, "button_history_back");
	editor->navbar.button_history_next =
	    UI_GET_ITEM(gxml, "button_history_foward");
	editor->navbar.button_history_menu =
	    UI_GET_ITEM(gxml, "togglebutton_history_list");

	editor->navbar.button_sync =
	    UI_GET_ITEM(gxml, "togglebutton_sync");
	gtk_widget_show(editor->navbar.button_sync);
	gtk_widget_set_tooltip_text(editor->navbar.button_sync,
				    _("Synchronize this window's scrolling with the main window"));
	editor->navbar.button_book_up = UI_GET_ITEM(gxml, "eventbox9");
	editor->navbar.button_book_down = UI_GET_ITEM(gxml, "eventbox6");
	editor->navbar.button_chapter_up = UI_GET_ITEM(gxml, "eventbox8");
	editor->navbar.button_chapter_down =
	    UI_GET_ITEM(gxml, "eventbox4");
	editor->navbar.button_verse_up = UI_GET_ITEM(gxml, "eventbox7");
	editor->navbar.button_verse_down = UI_GET_ITEM(gxml, "eventbox1");

	editor->navbar.arrow_book_up_box = UI_GET_ITEM(gxml, "image13");
	editor->navbar.arrow_book_up = UI_GET_ITEM(gxml, "image12");
	editor->navbar.arrow_book_down_box = UI_GET_ITEM(gxml, "image15");
	editor->navbar.arrow_book_down = UI_GET_ITEM(gxml, "image14");
	editor->navbar.arrow_chapter_up_box = UI_GET_ITEM(gxml, "image9");
	editor->navbar.arrow_chapter_up = UI_GET_ITEM(gxml, "image8");
	editor->navbar.arrow_chapter_down_box =
	    UI_GET_ITEM(gxml, "image11");
	editor->navbar.arrow_chapter_down = UI_GET_ITEM(gxml, "image10");
	editor->navbar.arrow_verse_up_box = UI_GET_ITEM(gxml, "image7");
	editor->navbar.arrow_verse_up = UI_GET_ITEM(gxml, "image6");
	editor->navbar.arrow_verse_down_box = UI_GET_ITEM(gxml, "image16");
	editor->navbar.arrow_verse_down = UI_GET_ITEM(gxml, "image5");

	editor->navbar.button_book_menu =
	    UI_GET_ITEM(gxml, "togglebutton_book");
	editor->navbar.button_chapter_menu =
	    UI_GET_ITEM(gxml, "togglebutton_chapter");
	editor->navbar.button_verse_menu =
	    UI_GET_ITEM(gxml, "togglebutton_verse");
	editor->navbar.lookup_entry = UI_GET_ITEM(gxml, "entry_lookup");
	editor->navbar.label_book_menu = UI_GET_ITEM(gxml, "label_book");
	editor->navbar.label_chapter_menu =
	    UI_GET_ITEM(gxml, "label_chapter");
	editor->navbar.label_verse_menu = UI_GET_ITEM(gxml, "label_verse");

#ifdef HAVE_GTK_34
	eventbox = UI_GET_ITEM(gxml, "eventbox_book");
	g_signal_connect((gpointer)eventbox, "scroll_event",
			 G_CALLBACK(on_button_verse_menu_book_scroll_event), editor);

	eventbox = UI_GET_ITEM(gxml, "eventbox_chapter");
	g_signal_connect((gpointer)eventbox, "scroll_event",
			 G_CALLBACK(on_button_verse_menu_chapter_scroll_event),
			 editor);

	eventbox = UI_GET_ITEM(gxml, "eventbox_verse");
	g_signal_connect((gpointer)eventbox, "scroll_event",
			 G_CALLBACK(on_button_verse_menu_verse_scroll_event),
			 editor);
#endif
	_connect_signals(editor->navbar, editor);

	return editor->navbar.navbar;
}