mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
Add GTK bibitem dialog
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10761 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
465b672789
commit
9ee46b846e
@ -1,3 +1,8 @@
|
||||
2006-01-21 John Spray <spray@lyx.org>
|
||||
|
||||
* GBibItem.[Ch], glade/bibitem.glade: Add the bibitem dialog
|
||||
* Dialogs.C, Makefile.am, glade/Makefile.am: Use GBibItem
|
||||
|
||||
2006-01-20 Bernhard Reiter <ockham@gmx.net>
|
||||
|
||||
* GCitation.[Ch], glade/citation.glade: Add the citation dialog
|
||||
|
@ -60,7 +60,7 @@
|
||||
#include "GAboutlyx.h"
|
||||
#include "GText.h"
|
||||
#include "GMathDelim.h"
|
||||
#include "FormBibitem.h"
|
||||
#include "GBibItem.h"
|
||||
#include "FormBibtex.h"
|
||||
#include "GBox.h"
|
||||
#include "FormBranch.h"
|
||||
@ -189,9 +189,9 @@ Dialogs::DialogPtr Dialogs::build(string const & name)
|
||||
dialog->setView(new GAboutlyx(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "bibitem") {
|
||||
dialog->bc().view(new xformsBC(dialog->bc()));
|
||||
dialog->bc().view(new GBC(dialog->bc()));
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormBibitem(*dialog));
|
||||
dialog->setView(new GBibItem(*dialog));
|
||||
dialog->bc().bp(new OkCancelReadOnlyPolicy);
|
||||
} else if (name == "bibtex") {
|
||||
dialog->bc().view(new xformsBC(dialog->bc()));
|
||||
|
85
src/frontends/gtk/GBibItem.C
Normal file
85
src/frontends/gtk/GBibItem.C
Normal file
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* \file GBibItem.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author John Spray
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
// Too hard to make concept checks work with this file
|
||||
#ifdef _GLIBCXX_CONCEPT_CHECKS
|
||||
#undef _GLIBCXX_CONCEPT_CHECKS
|
||||
#endif
|
||||
#ifdef _GLIBCPP_CONCEPT_CHECKS
|
||||
#undef _GLIBCPP_CONCEPT_CHECKS
|
||||
#endif
|
||||
|
||||
#include "GBibItem.h"
|
||||
#include "ControlCommand.h"
|
||||
#include "ghelpers.h"
|
||||
|
||||
#include <libglademm.h>
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
GBibItem::GBibItem(Dialog & parent)
|
||||
: GViewCB<ControlCommand, GViewGladeB>(parent, _("Bibliography Entry Settings"), false)
|
||||
{}
|
||||
|
||||
|
||||
void GBibItem::doBuild()
|
||||
{
|
||||
string const gladeName = findGladeFile("bibitem");
|
||||
xml_ = Gnome::Glade::Xml::create(gladeName);
|
||||
|
||||
Gtk::Button * button;
|
||||
xml_->get_widget("Cancel", button);
|
||||
setCancel(button);
|
||||
xml_->get_widget("OK", button);
|
||||
setOK(button);
|
||||
|
||||
xml_->get_widget("Key", keyentry_);
|
||||
xml_->get_widget("Label", labelentry_);
|
||||
|
||||
keyentry_->signal_changed().connect(
|
||||
sigc::mem_fun(*this, &GBibItem::changed));
|
||||
labelentry_->signal_changed().connect(
|
||||
sigc::mem_fun(*this, &GBibItem::changed));
|
||||
|
||||
bcview().addReadOnly(keyentry_);
|
||||
bcview().addReadOnly(labelentry_);
|
||||
}
|
||||
|
||||
|
||||
void GBibItem::update()
|
||||
{
|
||||
bc().refreshReadOnly();
|
||||
|
||||
keyentry_->set_text (controller().params().getContents());
|
||||
labelentry_->set_text (controller().params().getOptions());
|
||||
}
|
||||
|
||||
|
||||
void GBibItem::apply()
|
||||
{
|
||||
controller().params().setContents(keyentry_->get_text());
|
||||
controller().params().setOptions(labelentry_->get_text());
|
||||
}
|
||||
|
||||
void GBibItem::changed()
|
||||
{
|
||||
if (keyentry_->get_text().size() > 0)
|
||||
bc().valid(TRUE);
|
||||
else
|
||||
bc().valid(FALSE);
|
||||
}
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
40
src/frontends/gtk/GBibItem.h
Normal file
40
src/frontends/gtk/GBibItem.h
Normal file
@ -0,0 +1,40 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file GBibItem.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author John Spray
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#ifndef GBIBITEM_H
|
||||
#define GBIBITEM_H
|
||||
|
||||
#include "GViewBase.h"
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
class ControlCommand;
|
||||
|
||||
/** This class provides a GTK+ implementation of the BibItem Dialog.
|
||||
*/
|
||||
class GBibItem : public GViewCB<ControlCommand, GViewGladeB> {
|
||||
public:
|
||||
GBibItem(Dialog & parent);
|
||||
private:
|
||||
virtual void apply();
|
||||
virtual void doBuild();
|
||||
virtual void update();
|
||||
void changed();
|
||||
|
||||
Gtk::Entry * keyentry_;
|
||||
Gtk::Entry * labelentry_;
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
||||
|
||||
#endif // GBIBITEM_H
|
@ -31,6 +31,8 @@ libgtk_la_SOURCES = \
|
||||
GAboutlyx.h \
|
||||
GBC.C \
|
||||
GBC.h \
|
||||
GBibItem.C \
|
||||
GBibItem.h \
|
||||
GBox.C \
|
||||
GBox.h \
|
||||
GChanges.C \
|
||||
@ -135,7 +137,6 @@ xforms_objects = \
|
||||
../xforms/Color.lo \
|
||||
../xforms/combox.lo \
|
||||
../xforms/fdesign_base.lo \
|
||||
../xforms/FormBibitem.lo \
|
||||
../xforms/FormBibtex.lo \
|
||||
../xforms/FormBranch.lo \
|
||||
../xforms/FormBrowser.lo \
|
||||
|
@ -6,6 +6,7 @@ gladedir = $(pkgdatadir)/glade
|
||||
dist_glade_DATA = \
|
||||
aboutlyx.glade \
|
||||
box.glade \
|
||||
bibitem.glade \
|
||||
changes.glade \
|
||||
character.glade \
|
||||
citation.glade \
|
||||
|
190
src/frontends/gtk/glade/bibitem.glade
Normal file
190
src/frontends/gtk/glade/bibitem.glade
Normal file
@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkDialog" id="dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">dialog1</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="has_separator">False</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="Cancel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-6</property>
|
||||
<accelerator key="Escape" modifiers="0" signal="clicked"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="OK">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="has_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-5</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTable" id="table1">
|
||||
<property name="border_width">12</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Key:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">Key</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="Key">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="Label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Label:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">Label</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
Loading…
Reference in New Issue
Block a user