mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-02 08:10:39 +00:00
Marko's GNOME patch, some modifications to this, some fixes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@976 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0ed115d608
commit
33f1a7576f
39
ChangeLog
39
ChangeLog
@ -1,3 +1,42 @@
|
||||
2000-08-17 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* src/frontends/gnome/Menubar_pimpl.C (openByName): put this function
|
||||
in the implementation part.
|
||||
(composeUIInfo): don't show optional menu-items.
|
||||
|
||||
* src/lyxfunc.C (getStatus): use insets LyXText if the_locking_inset.
|
||||
|
||||
* src/insets/insettext.C (UpdateLocal): call to LyXView::showState()
|
||||
|
||||
* src/bufferview_funcs.C (CurrentState): fixed to show also the
|
||||
text-state when in a text-inset.
|
||||
|
||||
* src/frontends/kde/GUIRunTime_pimpl.C: include xforms for now.
|
||||
|
||||
2000-08-17 Marko Vendelin <markov@ioc.ee>
|
||||
* src/frontends/gnome/FormIndex.C
|
||||
* src/frontends/gnome/FormIndex.h
|
||||
* src/frontends/gnome/FormToc.C
|
||||
* src/frontends/gnome/FormToc.h
|
||||
* src/frontends/gnome/dialogs
|
||||
* src/frontends/gnome/diatoc_callbacks.c
|
||||
* src/frontends/gnome/diatoc_callbacks.h
|
||||
* src/frontends/gnome/diainsertindex_callbacks.h
|
||||
* src/frontends/gnome/diainsertindex_callbacks.c
|
||||
* src/frontends/gnome/diainsertindex_interface.c
|
||||
* src/frontends/gnome/diainsertindex_interface.h
|
||||
* src/frontends/gnome/diatoc_interface.h
|
||||
* src/frontends/gnome/diatoc_interface.c
|
||||
* src/frontends/gnome/Makefile.am: Table of Contents and
|
||||
Insert Index dialogs implementation for Gnome frontend
|
||||
|
||||
* src/frontends/gnome/GUIRunTime_pimpl.C: fix some small bugs
|
||||
|
||||
* src/frontends/gnome/Menubar_pimpl.C: remove historical comments
|
||||
|
||||
* src/frontends/gnome/diainserturl_interface.c: make the dialog
|
||||
resizable
|
||||
|
||||
2000-08-17 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/frontends/xforms/GUIRunTime_pimpl.C: constructor and
|
||||
|
@ -27,7 +27,10 @@ src/filedlg.C
|
||||
src/FontLoader.C
|
||||
src/form1.C
|
||||
src/frontends/gnome/FormPrint.C
|
||||
src/frontends/gnome/FormToc.C
|
||||
src/frontends/kde/FormCopyright.C
|
||||
src/frontends/kde/FormUrl.C
|
||||
src/frontends/kde/formurldialog.C
|
||||
src/frontends/xforms/FormCitation.C
|
||||
src/frontends/xforms/form_citation.C
|
||||
src/frontends/xforms/FormCopyright.C
|
||||
|
@ -253,8 +253,15 @@ string CurrentState(BufferView * bv)
|
||||
if (bv->available()) {
|
||||
// I think we should only show changes from the default
|
||||
// font. (Asger)
|
||||
LyXText *text = 0;
|
||||
|
||||
if (bv->the_locking_inset)
|
||||
text = bv->the_locking_inset->getLyXText(bv);
|
||||
if (!text)
|
||||
text = bv->text;
|
||||
|
||||
Buffer * buffer = bv->buffer();
|
||||
LyXFont font = bv->text->real_current_font;
|
||||
LyXFont font = text->real_current_font;
|
||||
LyXFont const & defaultfont =
|
||||
textclasslist
|
||||
.TextClass(buffer->params.textclass)
|
||||
@ -262,14 +269,14 @@ string CurrentState(BufferView * bv)
|
||||
font.reduce(defaultfont);
|
||||
state = _("Font: ") + font.stateText(&buffer->params);
|
||||
// The paragraph depth
|
||||
int depth = bv->text->GetDepth();
|
||||
int depth = text->GetDepth();
|
||||
if (depth > 0)
|
||||
state += string(_(", Depth: ")) + tostr(depth);
|
||||
// The paragraph spacing, but only if different from
|
||||
// buffer spacing.
|
||||
if (!bv->text->cursor.par()->spacing.isDefault()) {
|
||||
if (!text->cursor.par()->spacing.isDefault()) {
|
||||
Spacing::Space cur_space =
|
||||
bv->text->cursor.par()->spacing.getSpace();
|
||||
text->cursor.par()->spacing.getSpace();
|
||||
state += _(", Spacing: ");
|
||||
switch (cur_space) {
|
||||
case Spacing::Single:
|
||||
@ -283,7 +290,7 @@ string CurrentState(BufferView * bv)
|
||||
break;
|
||||
case Spacing::Other:
|
||||
state += _("Other (");
|
||||
state += tostr(bv->text->cursor.par()->spacing.getValue());
|
||||
state += tostr(text->cursor.par()->spacing.getValue());
|
||||
state += ")";
|
||||
break;
|
||||
case Spacing::Default:
|
||||
|
158
src/frontends/gnome/FormIndex.C
Normal file
158
src/frontends/gnome/FormIndex.C
Normal file
@ -0,0 +1,158 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
|
||||
#include "gettext.h"
|
||||
#include "Dialogs.h"
|
||||
#include "FormIndex.h"
|
||||
#include "LyXView.h"
|
||||
#include "buffer.h"
|
||||
#include "lyxfunc.h"
|
||||
|
||||
extern "C" {
|
||||
#include "diainsertindex_interface.h"
|
||||
#include "support.h"
|
||||
}
|
||||
|
||||
#include <gtk--/base.h>
|
||||
|
||||
#include "gettext.h"
|
||||
#include "Dialogs.h"
|
||||
#include "FormIndex.h"
|
||||
#include "LyXView.h"
|
||||
#include "buffer.h"
|
||||
#include "form_index.h"
|
||||
#include "lyxfunc.h"
|
||||
|
||||
FormIndex::FormIndex(LyXView * lv, Dialogs * d)
|
||||
: lv_(lv), d_(d), u_(0), h_(0), ih_(0), inset_(0), dialog_(NULL)
|
||||
{
|
||||
// let the dialog be shown
|
||||
// These are permanent connections so we won't bother
|
||||
// storing a copy because we won't be disconnecting.
|
||||
d->showIndex.connect(slot(this, &FormIndex::showInset));
|
||||
d->createIndex.connect(slot(this, &FormIndex::createInset));
|
||||
}
|
||||
|
||||
|
||||
FormIndex::~FormIndex()
|
||||
{
|
||||
hide();
|
||||
}
|
||||
|
||||
void FormIndex::showInset( InsetCommand * const inset )
|
||||
{
|
||||
if( dialog_!=NULL || inset == 0 ) return;
|
||||
|
||||
inset_ = inset;
|
||||
ih_ = inset_->hide.connect(slot(this, &FormIndex::hide));
|
||||
|
||||
params = inset->params();
|
||||
show();
|
||||
}
|
||||
|
||||
void FormIndex::createInset( string const & arg )
|
||||
{
|
||||
if( dialog_!=NULL ) return;
|
||||
|
||||
params.setFromString( arg );
|
||||
show();
|
||||
}
|
||||
|
||||
void FormIndex::show()
|
||||
{
|
||||
if (!dialog_)
|
||||
{
|
||||
GtkWidget * pd = create_DiaInsertIndex();
|
||||
|
||||
dialog_ = Gtk::wrap(pd);
|
||||
keyword_ = Gtk::wrap( GNOME_ENTRY( lookup_widget(pd, "keyword") ) );
|
||||
|
||||
b_ok = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_ok") ) );
|
||||
b_cancel = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_cancel") ) );
|
||||
|
||||
b_ok->clicked.connect(slot(this, &FormIndex::apply));
|
||||
b_ok->clicked.connect(dialog_->destroy.slot());
|
||||
b_cancel->clicked.connect(dialog_->destroy.slot());
|
||||
dialog_->destroy.connect(slot(this, &FormIndex::free));
|
||||
|
||||
u_ = d_->updateBufferDependent.connect(slot(this, &FormIndex::update));
|
||||
h_ = d_->hideBufferDependent.connect(slot(this, &FormIndex::hide));
|
||||
|
||||
if (!dialog_->is_visible()) dialog_->show_all();
|
||||
|
||||
update(); // make sure its up-to-date
|
||||
}
|
||||
else
|
||||
{
|
||||
Gdk_Window dialog_win(dialog_->get_window());
|
||||
dialog_win.raise();
|
||||
}
|
||||
}
|
||||
|
||||
void FormIndex::update()
|
||||
{
|
||||
if (dialog_ != NULL &&
|
||||
lv_->view()->available())
|
||||
{
|
||||
keyword_->get_entry()->set_text(params.getContents().c_str());
|
||||
|
||||
bool sens = (!(lv_->buffer()->isReadonly()));
|
||||
|
||||
keyword_->set_sensitive(sens);
|
||||
b_ok->set_sensitive(sens);
|
||||
}
|
||||
}
|
||||
|
||||
void FormIndex::hide()
|
||||
{
|
||||
if (dialog_!=NULL) dialog_->destroy();
|
||||
}
|
||||
|
||||
void FormIndex::free()
|
||||
{
|
||||
if (dialog_!=NULL)
|
||||
{
|
||||
dialog_ = NULL;
|
||||
u_.disconnect();
|
||||
h_.disconnect();
|
||||
inset_ = 0;
|
||||
ih_.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void FormIndex::apply()
|
||||
{
|
||||
if( lv_->buffer()->isReadonly() ) return;
|
||||
|
||||
params.setContents( keyword_->get_entry()->get_text() );
|
||||
|
||||
if( inset_ != 0 )
|
||||
{
|
||||
// Only update if contents have changed
|
||||
if( params != inset_->params() )
|
||||
{
|
||||
inset_->setParams( params );
|
||||
lv_->view()->updateInset( inset_, true );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_->getLyXFunc()->Dispatch( LFUN_INDEX_INSERT,
|
||||
params.getAsString().c_str() );
|
||||
}
|
||||
}
|
80
src/frontends/gnome/FormIndex.h
Normal file
80
src/frontends/gnome/FormIndex.h
Normal file
@ -0,0 +1,80 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#ifndef FORMINDEX_H
|
||||
#define FORMINDEX_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "DialogBase.h"
|
||||
#include "LString.h"
|
||||
#include "support/utility.hpp"
|
||||
#include "insets/insetcommand.h"
|
||||
|
||||
#include <gtk--/widget.h>
|
||||
#include <gnome--/entry.h>
|
||||
#include <gtk--/label.h>
|
||||
|
||||
/** This class provides an Gnome implementation of the FormIndex Dialog.
|
||||
*/
|
||||
class FormIndex : public DialogBase, public noncopyable {
|
||||
public:
|
||||
///
|
||||
FormIndex(LyXView *, Dialogs *);
|
||||
///
|
||||
~FormIndex();
|
||||
private:
|
||||
/// Slot launching dialog to (possibly) create a new inset
|
||||
void createInset( string const & );
|
||||
/// Slot launching dialog to an existing inset
|
||||
void showInset( InsetCommand * const );
|
||||
|
||||
/// Update dialog before showing it
|
||||
virtual void update();
|
||||
/// Apply from dialog (modify or create inset)
|
||||
virtual void apply();
|
||||
/// Explicitly free the dialog.
|
||||
void free();
|
||||
/// Create the dialog if necessary, update it and display it.
|
||||
void show();
|
||||
/// Hide the dialog.
|
||||
void hide();
|
||||
|
||||
/** Which LyXFunc do we use?
|
||||
We could modify Dialogs to have a visible LyXFunc* instead and
|
||||
save a couple of bytes per dialog.
|
||||
*/
|
||||
LyXView * lv_;
|
||||
/** Which Dialogs do we belong to?
|
||||
Used so we can get at the signals we have to connect to.
|
||||
*/
|
||||
Dialogs * d_;
|
||||
/// pointer to the inset passed through showInset (if any)
|
||||
InsetCommand * inset_;
|
||||
/// the nitty-griity. What is modified and passed back
|
||||
InsetCommandParams params;
|
||||
/// Update connection.
|
||||
Connection u_;
|
||||
/// Hide connection.
|
||||
Connection h_;
|
||||
/// inset::hide connection.
|
||||
Connection ih_;
|
||||
|
||||
/// Real GUI implementation.
|
||||
Gtk::Widget * dialog_;
|
||||
Gnome::Entry * keyword_;
|
||||
Gtk::Button * b_ok;
|
||||
Gtk::Button * b_cancel;
|
||||
};
|
||||
|
||||
#endif
|
269
src/frontends/gnome/FormToc.C
Normal file
269
src/frontends/gnome/FormToc.C
Normal file
@ -0,0 +1,269 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
|
||||
#include "gettext.h"
|
||||
#include "Dialogs.h"
|
||||
#include "FormToc.h"
|
||||
#include "LyXView.h"
|
||||
#include "form_toc.h"
|
||||
#include "lyxtext.h"
|
||||
|
||||
extern "C" {
|
||||
#include "diatoc_interface.h"
|
||||
#include "support.h"
|
||||
}
|
||||
|
||||
#include <gtk--/base.h>
|
||||
#include <gtk--/button.h>
|
||||
#include <gtk--/label.h>
|
||||
#include <gtk--/scrolledwindow.h>
|
||||
#include <gtk--/menu.h>
|
||||
#include <gtk--/menuitem.h>
|
||||
|
||||
using SigC::bind;
|
||||
|
||||
FormToc::FormToc(LyXView * lv, Dialogs * d)
|
||||
: lv_(lv), d_(d), u_(0), h_(0), ih_(0), inset_(0), dialog_(NULL), ignore_callback_(false)
|
||||
{
|
||||
// let the dialog be shown
|
||||
// These are permanent connections so we won't bother
|
||||
// storing a copy because we won't be disconnecting.
|
||||
d->showTOC.connect(slot(this, &FormToc::showInset));
|
||||
d->createTOC.connect(slot(this, &FormToc::createInset));
|
||||
}
|
||||
|
||||
|
||||
FormToc::~FormToc()
|
||||
{
|
||||
hide();
|
||||
}
|
||||
|
||||
void FormToc::showInset( InsetCommand * const inset )
|
||||
{
|
||||
if( dialog_!=NULL || inset == 0 ) return;
|
||||
|
||||
inset_ = inset;
|
||||
ih_ = inset_->hide.connect(slot(this, &FormToc::hide));
|
||||
|
||||
params = inset->params();
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
void FormToc::createInset( string const & arg )
|
||||
{
|
||||
if( dialog_!=NULL ) return;
|
||||
|
||||
params.setFromString( arg );
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
void FormToc::show()
|
||||
{
|
||||
Gtk::Button * b_refresh;
|
||||
Gtk::Button * b_close;
|
||||
Gtk::ScrolledWindow *scrolled_window;
|
||||
|
||||
if (!dialog_)
|
||||
{
|
||||
GtkWidget * pd = create_DiaToc();
|
||||
|
||||
dialog_ = Gtk::wrap( GNOME_DIALOG(pd) );
|
||||
choice_ = Gtk::wrap( GTK_OPTION_MENU( lookup_widget(pd, "choice") ) );
|
||||
scrolled_window = Gtk::wrap( GTK_SCROLLED_WINDOW( lookup_widget(pd, "scrolledwindow") ) );
|
||||
|
||||
list_ = manage( new Gtk::List() );
|
||||
scrolled_window->add_with_viewport(*list_);
|
||||
|
||||
// fill choice
|
||||
Gtk::MenuItem * e;
|
||||
|
||||
choice_->get_menu()->items().clear();
|
||||
|
||||
e = manage( new Gtk::MenuItem(N_("Table of Contents")) );
|
||||
e->activate.connect(bind<Buffer::TocType>(slot(this, &FormToc::changeList), Buffer::TOC_TOC));
|
||||
choice_->get_menu()->append( *e );
|
||||
|
||||
e = manage( new Gtk::MenuItem(N_("List of Figures")) );
|
||||
e->activate.connect(bind<Buffer::TocType>(slot(this, &FormToc::changeList), Buffer::TOC_LOF));
|
||||
choice_->get_menu()->append( *e );
|
||||
|
||||
e = manage( new Gtk::MenuItem(N_("List of Tables")) );
|
||||
e->activate.connect(bind<Buffer::TocType>(slot(this, &FormToc::changeList), Buffer::TOC_LOT));
|
||||
choice_->get_menu()->append( *e );
|
||||
|
||||
e = manage( new Gtk::MenuItem(N_("List of Algorithms")) );
|
||||
e->activate.connect(bind<Buffer::TocType>(slot(this, &FormToc::changeList), Buffer::TOC_LOA));
|
||||
choice_->get_menu()->append( *e );
|
||||
|
||||
// wrap buttons and connect slots
|
||||
b_refresh = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_refresh") ) );
|
||||
b_close = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_close") ) );
|
||||
|
||||
b_refresh->clicked.connect(slot(this, &FormToc::update));
|
||||
b_close->clicked.connect(dialog_->destroy.slot());
|
||||
dialog_->destroy.connect(slot(this, &FormToc::free));
|
||||
|
||||
u_ = d_->updateBufferDependent.connect(slot(this, &FormToc::update));
|
||||
h_ = d_->hideBufferDependent.connect(slot(this, &FormToc::hide));
|
||||
|
||||
if (!dialog_->is_visible()) dialog_->show_all();
|
||||
|
||||
update(); // make sure its up-to-date
|
||||
}
|
||||
else
|
||||
{
|
||||
Gdk_Window dialog_win(dialog_->get_window());
|
||||
dialog_win.raise();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FormToc::update()
|
||||
{
|
||||
Buffer::TocType type;
|
||||
string wintitle;
|
||||
|
||||
if (dialog_ != NULL &&
|
||||
!lv_->view()->available())
|
||||
{
|
||||
wintitle = N_( "*** No Document ***");
|
||||
dialog_->set_title(wintitle);
|
||||
list_->items().clear();
|
||||
|
||||
Gtk::ListItem * l = manage( new Gtk::ListItem(wintitle) );
|
||||
list_->items().push_back( *l );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (dialog_ != NULL &&
|
||||
lv_->view()->available())
|
||||
{
|
||||
|
||||
int selection = 0;
|
||||
|
||||
if( params.getCmdName() == "tableofcontents" )
|
||||
{
|
||||
type = Buffer::TOC_TOC;
|
||||
wintitle = N_("Table of Contents");
|
||||
selection = 0;
|
||||
}
|
||||
else if( params.getCmdName() == "listoffigures" )
|
||||
{
|
||||
type = Buffer::TOC_LOF;
|
||||
wintitle = N_("List of Figures");
|
||||
selection = 1;
|
||||
}
|
||||
else if( params.getCmdName() == "listofalgorithms" )
|
||||
{
|
||||
type = Buffer::TOC_LOA;
|
||||
wintitle = N_("List of Algorithms");
|
||||
selection = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = Buffer::TOC_LOT;
|
||||
wintitle = N_("List of Tables");
|
||||
selection = 2;
|
||||
}
|
||||
|
||||
ignore_callback_ = true;
|
||||
choice_->set_history(selection);
|
||||
ignore_callback_ = false;
|
||||
|
||||
list_->items().clear();
|
||||
|
||||
dialog_->set_title(wintitle);
|
||||
|
||||
vector<Buffer::TocItem> toclist = (lv_->view()->buffer()->getTocList())[type];
|
||||
|
||||
Gtk::ListItem * item;
|
||||
|
||||
vector<Buffer::TocItem>::const_iterator end = toclist.end();
|
||||
for (vector<Buffer::TocItem>::const_iterator it = toclist.begin();
|
||||
it != end; ++it)
|
||||
{
|
||||
item = manage( new Gtk::ListItem(string(4*(*it).depth,' ')+(*it).str) );
|
||||
item->select.connect(bind<Buffer::TocItem>(slot(this,&FormToc::apply), (*it)));
|
||||
list_->add( *item );
|
||||
}
|
||||
}
|
||||
|
||||
dialog_->show_all();
|
||||
}
|
||||
|
||||
void FormToc::apply(Buffer::TocItem tg)
|
||||
{
|
||||
if (!lv_->view()->available()) return;
|
||||
|
||||
lv_->view()->beforeChange();
|
||||
lv_->view()->text->SetCursor( lv_->view(), tg.par, 0 );
|
||||
lv_->view()->text->sel_cursor = lv_->view()->text->cursor;
|
||||
lv_->view()->update(BufferView::SELECT|BufferView::FITCUR);
|
||||
}
|
||||
|
||||
void FormToc::changeList(Buffer::TocType type)
|
||||
{
|
||||
if (!ignore_callback_)
|
||||
{
|
||||
switch (type) {
|
||||
case Buffer::TOC_TOC :
|
||||
{
|
||||
params.setCmdName("tableofcontents");
|
||||
break;
|
||||
}
|
||||
case Buffer::TOC_LOF :
|
||||
{
|
||||
params.setCmdName("listoffigures");
|
||||
break;
|
||||
}
|
||||
case Buffer::TOC_LOT :
|
||||
{
|
||||
params.setCmdName("listoftabels");
|
||||
break;
|
||||
}
|
||||
case Buffer::TOC_LOA :
|
||||
{
|
||||
params.setCmdName("listofalgorithms");
|
||||
break;
|
||||
}
|
||||
};
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void FormToc::hide()
|
||||
{
|
||||
if (dialog_!=NULL) dialog_->destroy();
|
||||
}
|
||||
|
||||
void FormToc::free()
|
||||
{
|
||||
if (dialog_!=NULL)
|
||||
{
|
||||
dialog_ = NULL;
|
||||
u_.disconnect();
|
||||
h_.disconnect();
|
||||
inset_ = 0;
|
||||
ih_.disconnect();
|
||||
}
|
||||
}
|
||||
|
86
src/frontends/gnome/FormToc.h
Normal file
86
src/frontends/gnome/FormToc.h
Normal file
@ -0,0 +1,86 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#ifndef FORMTOC_H
|
||||
#define FORMTOC_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "DialogBase.h"
|
||||
#include "LString.h"
|
||||
#include "support/utility.hpp"
|
||||
#include "insets/insetcommand.h"
|
||||
#include "buffer.h"
|
||||
|
||||
#include <gnome--/dialog.h>
|
||||
#include <gtk--/optionmenu.h>
|
||||
#include <gtk--/list.h>
|
||||
|
||||
/** This class provides an Gnome implementation of the FormToc Dialog.
|
||||
*/
|
||||
class FormToc : public DialogBase, public noncopyable {
|
||||
public:
|
||||
///
|
||||
FormToc(LyXView *, Dialogs *);
|
||||
///
|
||||
~FormToc();
|
||||
private:
|
||||
/// Slot launching dialog to (possibly) create a new inset
|
||||
void createInset( string const & );
|
||||
/// Slot launching dialog to an existing inset
|
||||
void showInset( InsetCommand * const );
|
||||
|
||||
/// Update dialog before showing it
|
||||
virtual void update();
|
||||
/// Explicitly free the dialog.
|
||||
void free();
|
||||
/// Create the dialog if necessary, update it and display it.
|
||||
void show();
|
||||
/// Hide the dialog.
|
||||
void hide();
|
||||
/// move cursor in LyXView
|
||||
void apply(Buffer::TocItem);
|
||||
/// change type of the list
|
||||
void changeList(Buffer::TocType);
|
||||
|
||||
/** Which LyXFunc do we use?
|
||||
We could modify Dialogs to have a visible LyXFunc* instead and
|
||||
save a couple of bytes per dialog.
|
||||
*/
|
||||
LyXView * lv_;
|
||||
/** Which Dialogs do we belong to?
|
||||
Used so we can get at the signals we have to connect to.
|
||||
*/
|
||||
Dialogs * d_;
|
||||
/// pointer to the inset passed through showInset (if any)
|
||||
InsetCommand * inset_;
|
||||
/// the nitty-griity. What is modified and passed back
|
||||
InsetCommandParams params;
|
||||
/// Update connection.
|
||||
Connection u_;
|
||||
/// Hide connection.
|
||||
Connection h_;
|
||||
/// inset::hide connection.
|
||||
Connection ih_;
|
||||
|
||||
/// Real GUI implementation.
|
||||
Gnome::Dialog * dialog_;
|
||||
|
||||
Gtk::OptionMenu * choice_;
|
||||
|
||||
Gtk::List * list_;
|
||||
|
||||
bool ignore_callback_;
|
||||
};
|
||||
|
||||
#endif
|
@ -15,12 +15,16 @@
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
#include "GUIRunTime_pimpl.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <gnome--/main.h>
|
||||
|
||||
using std::endl;
|
||||
|
||||
extern bool finised;
|
||||
extern bool finished;
|
||||
|
||||
void GUIRunTime::Pimpl::processEvents()
|
||||
{
|
||||
|
@ -40,6 +40,10 @@ libgnome_la_SOURCES = \
|
||||
FormPrint.h \
|
||||
FormUrl.C \
|
||||
FormUrl.h \
|
||||
FormIndex.C \
|
||||
FormIndex.h \
|
||||
FormToc.C \
|
||||
FormToc.h \
|
||||
Menubar_pimpl.C \
|
||||
Menubar_pimpl.h \
|
||||
mainapp.C \
|
||||
@ -53,7 +57,15 @@ libgnome_la_SOURCES = \
|
||||
diainserturl_callbacks.c \
|
||||
diainserturl_interface.c \
|
||||
diainserturl_callbacks.h \
|
||||
diainserturl_interface.h
|
||||
diainserturl_interface.h \
|
||||
diainsertindex_callbacks.c \
|
||||
diainsertindex_interface.c \
|
||||
diainsertindex_callbacks.h \
|
||||
diainsertindex_interface.h \
|
||||
diatoc_callbacks.c \
|
||||
diatoc_interface.c \
|
||||
diatoc_callbacks.h \
|
||||
diatoc_interface.h
|
||||
|
||||
# These still have to be added. Sooner or later. ARRae-20000411
|
||||
# GUI_defaults.C \
|
||||
|
@ -85,8 +85,11 @@ void Menubar::Pimpl::set(string const & menu_name)
|
||||
void Menubar::Pimpl::callback(int action)
|
||||
{
|
||||
// Dispatch action OR record action to local variable (see connectWidgetToAction)
|
||||
if (!ignore_action_) owner_->getLyXFunc()->Dispatch(action);
|
||||
else action_ = action;
|
||||
if (!ignore_action_) {
|
||||
Pimpl::update();
|
||||
owner_->getLyXFunc()->Dispatch(action);
|
||||
} else
|
||||
action_ = action;
|
||||
}
|
||||
|
||||
void Menubar::Pimpl::composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus)
|
||||
@ -148,7 +151,12 @@ void Menubar::Pimpl::composeUIInfo(string const & menu_name, vector<Gnome::UI::I
|
||||
else gitem = Gnome::UI::Item(label, cback, lyxaction.helpText(item.action()));
|
||||
}
|
||||
|
||||
// DON'T KNOW HOW TO TOGGLE/UNTOGGLE IT (Marko)
|
||||
// first handle optional entries.
|
||||
if (item.optional() && (flag & LyXFunc::Disabled)) {
|
||||
lyxerr[Debug::GUI]
|
||||
<< "Skipping optional item " << item.label() << endl;
|
||||
break;
|
||||
}
|
||||
if ((flag & LyXFunc::ToggleOn) || (flag & LyXFunc::ToggleOff))
|
||||
gitem = Gnome::UI::ToggleItem(label, cback, lyxaction.helpText(item.action()));
|
||||
|
||||
@ -235,7 +243,6 @@ void Menubar::Pimpl::update()
|
||||
if ( flag & (LyXFunc::Disabled | LyXFunc::Unknown) ) gtk_widget_set_sensitive(wa.widget_, false);
|
||||
else gtk_widget_set_sensitive(wa.widget_, true);
|
||||
|
||||
//don't know how to toggle/untoggle GtkCheckMenuItem
|
||||
if ( flag & LyXFunc::ToggleOn )
|
||||
{
|
||||
ignore_action_=true;
|
||||
@ -251,3 +258,8 @@ void Menubar::Pimpl::update()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Menubar::Pimpl::openByName(string const & name)
|
||||
{
|
||||
// Pimpl::update();
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
///
|
||||
void set(string const &);
|
||||
/// Opens a top-level submenu given its name
|
||||
void openByName(string const &) {}
|
||||
void openByName(string const &);
|
||||
/// update the state of menuitems
|
||||
void update();
|
||||
|
||||
|
19
src/frontends/gnome/diainsertindex_callbacks.c
Normal file
19
src/frontends/gnome/diainsertindex_callbacks.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "diainsertindex_callbacks.h"
|
||||
#include "diainsertindex_interface.h"
|
||||
#include "support.h"
|
||||
|
11
src/frontends/gnome/diainsertindex_callbacks.h
Normal file
11
src/frontends/gnome/diainsertindex_callbacks.h
Normal file
@ -0,0 +1,11 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#include <gnome.h>
|
||||
|
100
src/frontends/gnome/diainsertindex_interface.c
Normal file
100
src/frontends/gnome/diainsertindex_interface.c
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "diainsertindex_callbacks.h"
|
||||
#include "diainsertindex_interface.h"
|
||||
#include "support.h"
|
||||
|
||||
GtkWidget*
|
||||
create_DiaInsertIndex (void)
|
||||
{
|
||||
GtkWidget *DiaInsertIndex;
|
||||
GtkWidget *dialog_vbox1;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *label;
|
||||
GtkWidget *keyword;
|
||||
GtkWidget *combo_entry1;
|
||||
GtkWidget *dialog_action_area1;
|
||||
GtkWidget *button_ok;
|
||||
GtkWidget *button_cancel;
|
||||
|
||||
DiaInsertIndex = gnome_dialog_new (_("Insert Index"), NULL);
|
||||
gtk_object_set_data (GTK_OBJECT (DiaInsertIndex), "DiaInsertIndex", DiaInsertIndex);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (DiaInsertIndex), 2);
|
||||
GTK_WINDOW (DiaInsertIndex)->type = GTK_WINDOW_DIALOG;
|
||||
gtk_window_set_policy (GTK_WINDOW (DiaInsertIndex), TRUE, TRUE, FALSE);
|
||||
|
||||
dialog_vbox1 = GNOME_DIALOG (DiaInsertIndex)->vbox;
|
||||
gtk_object_set_data (GTK_OBJECT (DiaInsertIndex), "dialog_vbox1", dialog_vbox1);
|
||||
gtk_widget_show (dialog_vbox1);
|
||||
|
||||
hbox1 = gtk_hbox_new (FALSE, 2);
|
||||
gtk_widget_ref (hbox1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertIndex), "hbox1", hbox1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hbox1);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox1), 2);
|
||||
|
||||
label = gtk_label_new (_("Keyword"));
|
||||
gtk_widget_ref (label);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertIndex), "label", label,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
|
||||
|
||||
keyword = gnome_entry_new ("diainsertindex_keyword");
|
||||
gtk_widget_ref (keyword);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertIndex), "keyword", keyword,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (keyword);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), keyword, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (keyword), 2);
|
||||
|
||||
combo_entry1 = gnome_entry_gtk_entry (GNOME_ENTRY (keyword));
|
||||
gtk_widget_ref (combo_entry1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertIndex), "combo_entry1", combo_entry1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (combo_entry1);
|
||||
GTK_WIDGET_SET_FLAGS (combo_entry1, GTK_CAN_DEFAULT);
|
||||
|
||||
dialog_action_area1 = GNOME_DIALOG (DiaInsertIndex)->action_area;
|
||||
gtk_object_set_data (GTK_OBJECT (DiaInsertIndex), "dialog_action_area1", dialog_action_area1);
|
||||
gtk_widget_show (dialog_action_area1);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area1), 8);
|
||||
|
||||
gnome_dialog_append_button (GNOME_DIALOG (DiaInsertIndex), GNOME_STOCK_BUTTON_OK);
|
||||
button_ok = g_list_last (GNOME_DIALOG (DiaInsertIndex)->buttons)->data;
|
||||
gtk_widget_ref (button_ok);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertIndex), "button_ok", button_ok,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (button_ok);
|
||||
GTK_WIDGET_SET_FLAGS (button_ok, GTK_CAN_DEFAULT);
|
||||
|
||||
gnome_dialog_append_button (GNOME_DIALOG (DiaInsertIndex), GNOME_STOCK_BUTTON_CANCEL);
|
||||
button_cancel = g_list_last (GNOME_DIALOG (DiaInsertIndex)->buttons)->data;
|
||||
gtk_widget_ref (button_cancel);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertIndex), "button_cancel", button_cancel,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (button_cancel);
|
||||
GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
|
||||
|
||||
gtk_widget_grab_focus (combo_entry1);
|
||||
gtk_widget_grab_default (combo_entry1);
|
||||
return DiaInsertIndex;
|
||||
}
|
||||
|
5
src/frontends/gnome/diainsertindex_interface.h
Normal file
5
src/frontends/gnome/diainsertindex_interface.h
Normal file
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
GtkWidget* create_DiaInsertIndex (void);
|
@ -43,7 +43,7 @@ create_DiaInsertUrl (void)
|
||||
gtk_object_set_data (GTK_OBJECT (DiaInsertUrl), "DiaInsertUrl", DiaInsertUrl);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (DiaInsertUrl), 2);
|
||||
GTK_WINDOW (DiaInsertUrl)->type = GTK_WINDOW_DIALOG;
|
||||
gtk_window_set_policy (GTK_WINDOW (DiaInsertUrl), FALSE, FALSE, FALSE);
|
||||
gtk_window_set_policy (GTK_WINDOW (DiaInsertUrl), TRUE, TRUE, FALSE);
|
||||
|
||||
dialog_vbox1 = GNOME_DIALOG (DiaInsertUrl)->vbox;
|
||||
gtk_object_set_data (GTK_OBJECT (DiaInsertUrl), "dialog_vbox1", dialog_vbox1);
|
||||
@ -100,6 +100,7 @@ create_DiaInsertUrl (void)
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaInsertUrl), "combo_entry1", combo_entry1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (combo_entry1);
|
||||
GTK_WIDGET_SET_FLAGS (combo_entry1, GTK_CAN_DEFAULT);
|
||||
|
||||
name = gnome_entry_new ("diainserturl_name");
|
||||
gtk_widget_ref (name);
|
||||
@ -151,7 +152,8 @@ create_DiaInsertUrl (void)
|
||||
gtk_widget_show (button_cancel);
|
||||
GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
|
||||
|
||||
gtk_widget_grab_default (button_ok);
|
||||
gtk_widget_grab_focus (combo_entry1);
|
||||
gtk_widget_grab_default (combo_entry1);
|
||||
gtk_window_add_accel_group (GTK_WINDOW (DiaInsertUrl), accel_group);
|
||||
|
||||
return DiaInsertUrl;
|
||||
|
141
src/frontends/gnome/dialogs/diainsertindex.glade
Normal file
141
src/frontends/gnome/dialogs/diainsertindex.glade
Normal file
@ -0,0 +1,141 @@
|
||||
<?xml version="1.0"?>
|
||||
<GTK-Interface>
|
||||
|
||||
<project>
|
||||
<name>insertindex</name>
|
||||
<program_name>insertindex</program_name>
|
||||
<directory></directory>
|
||||
<source_directory>src</source_directory>
|
||||
<pixmaps_directory>pixmaps</pixmaps_directory>
|
||||
<language>C</language>
|
||||
<gnome_support>True</gnome_support>
|
||||
<gettext_support>True</gettext_support>
|
||||
<output_main_file>False</output_main_file>
|
||||
<output_support_files>False</output_support_files>
|
||||
<output_build_files>False</output_build_files>
|
||||
<main_source_file>diainsertindex_interface.c</main_source_file>
|
||||
<main_header_file>diainsertindex_interface.h</main_header_file>
|
||||
<handler_source_file>diainsertindex_callbacks.c</handler_source_file>
|
||||
<handler_header_file>diainsertindex_callbacks.h</handler_header_file>
|
||||
</project>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDialog</class>
|
||||
<name>DiaInsertIndex</name>
|
||||
<border_width>2</border_width>
|
||||
<title>Insert Index</title>
|
||||
<type>GTK_WINDOW_DIALOG</type>
|
||||
<position>GTK_WIN_POS_NONE</position>
|
||||
<modal>False</modal>
|
||||
<allow_shrink>True</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
<auto_close>False</auto_close>
|
||||
<hide_on_close>False</hide_on_close>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDialog:vbox</child_name>
|
||||
<name>dialog-vbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>8</spacing>
|
||||
<child>
|
||||
<padding>4</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkHButtonBox</class>
|
||||
<child_name>GnomeDialog:action_area</child_name>
|
||||
<name>dialog-action_area1</name>
|
||||
<layout_style>GTK_BUTTONBOX_END</layout_style>
|
||||
<spacing>8</spacing>
|
||||
<child_min_width>85</child_min_width>
|
||||
<child_min_height>27</child_min_height>
|
||||
<child_ipad_x>7</child_ipad_x>
|
||||
<child_ipad_y>0</child_ipad_y>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>True</fill>
|
||||
<pack>GTK_PACK_END</pack>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>button_ok</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>button_cancel</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox1</name>
|
||||
<border_width>2</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label</name>
|
||||
<label>Keyword</label>
|
||||
<justify>GTK_JUSTIFY_LEFT</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeEntry</class>
|
||||
<name>keyword</name>
|
||||
<border_width>2</border_width>
|
||||
<history_id>diainsertindex_keyword</history_id>
|
||||
<max_saved>10</max_saved>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<child_name>GnomeEntry:entry</child_name>
|
||||
<name>combo-entry1</name>
|
||||
<can_default>True</can_default>
|
||||
<has_default>True</has_default>
|
||||
<can_focus>True</can_focus>
|
||||
<has_focus>True</has_focus>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
<text></text>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
</GTK-Interface>
|
@ -27,8 +27,8 @@
|
||||
<type>GTK_WINDOW_DIALOG</type>
|
||||
<position>GTK_WIN_POS_NONE</position>
|
||||
<modal>False</modal>
|
||||
<allow_shrink>False</allow_shrink>
|
||||
<allow_grow>False</allow_grow>
|
||||
<allow_shrink>True</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
<auto_close>False</auto_close>
|
||||
<hide_on_close>False</hide_on_close>
|
||||
@ -66,7 +66,6 @@
|
||||
<class>GtkButton</class>
|
||||
<name>button_ok</name>
|
||||
<can_default>True</can_default>
|
||||
<has_default>True</has_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
|
||||
</widget>
|
||||
@ -182,7 +181,10 @@
|
||||
<class>GtkEntry</class>
|
||||
<child_name>GnomeEntry:entry</child_name>
|
||||
<name>combo-entry1</name>
|
||||
<can_default>True</can_default>
|
||||
<has_default>True</has_default>
|
||||
<can_focus>True</can_focus>
|
||||
<has_focus>True</has_focus>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
|
138
src/frontends/gnome/dialogs/diatoc.glade
Normal file
138
src/frontends/gnome/dialogs/diatoc.glade
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0"?>
|
||||
<GTK-Interface>
|
||||
|
||||
<project>
|
||||
<name>diatoc</name>
|
||||
<program_name>diatoc</program_name>
|
||||
<directory></directory>
|
||||
<source_directory>src</source_directory>
|
||||
<pixmaps_directory>pixmaps</pixmaps_directory>
|
||||
<language>C</language>
|
||||
<gnome_support>True</gnome_support>
|
||||
<gettext_support>True</gettext_support>
|
||||
<output_main_file>False</output_main_file>
|
||||
<output_support_files>False</output_support_files>
|
||||
<output_build_files>False</output_build_files>
|
||||
<main_source_file>diatoc_interface.c</main_source_file>
|
||||
<main_header_file>diatoc_interface.h</main_header_file>
|
||||
<handler_source_file>diatoc_callbacks.c</handler_source_file>
|
||||
<handler_header_file>diatoc_callbacks.h</handler_header_file>
|
||||
</project>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDialog</class>
|
||||
<name>DiaToc</name>
|
||||
<border_width>2</border_width>
|
||||
<title>Table of Contents</title>
|
||||
<type>GTK_WINDOW_TOPLEVEL</type>
|
||||
<position>GTK_WIN_POS_NONE</position>
|
||||
<modal>False</modal>
|
||||
<allow_shrink>True</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
<auto_close>False</auto_close>
|
||||
<hide_on_close>False</hide_on_close>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDialog:vbox</child_name>
|
||||
<name>dialog-vbox2</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>8</spacing>
|
||||
<child>
|
||||
<padding>4</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkHButtonBox</class>
|
||||
<child_name>GnomeDialog:action_area</child_name>
|
||||
<name>dialog-action_area1</name>
|
||||
<layout_style>GTK_BUTTONBOX_END</layout_style>
|
||||
<spacing>8</spacing>
|
||||
<child_min_width>85</child_min_width>
|
||||
<child_min_height>27</child_min_height>
|
||||
<child_ipad_x>7</child_ipad_x>
|
||||
<child_ipad_y>0</child_ipad_y>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>True</fill>
|
||||
<pack>GTK_PACK_END</pack>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>button_refresh</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Refresh</label>
|
||||
<stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>button_close</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow</name>
|
||||
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkViewport</class>
|
||||
<name>viewport1</name>
|
||||
<width>522</width>
|
||||
<height>289</height>
|
||||
<shadow_type>GTK_SHADOW_IN</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkOptionMenu</class>
|
||||
<name>choice</name>
|
||||
<border_width>2</border_width>
|
||||
<can_focus>True</can_focus>
|
||||
<items>DUMMY
|
||||
</items>
|
||||
<initial_choice>0</initial_choice>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
</GTK-Interface>
|
19
src/frontends/gnome/diatoc_callbacks.c
Normal file
19
src/frontends/gnome/diatoc_callbacks.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "diatoc_callbacks.h"
|
||||
#include "diatoc_interface.h"
|
||||
#include "support.h"
|
||||
|
11
src/frontends/gnome/diatoc_callbacks.h
Normal file
11
src/frontends/gnome/diatoc_callbacks.h
Normal file
@ -0,0 +1,11 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 2000 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#include <gnome.h>
|
||||
|
105
src/frontends/gnome/diatoc_interface.c
Normal file
105
src/frontends/gnome/diatoc_interface.c
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "diatoc_callbacks.h"
|
||||
#include "diatoc_interface.h"
|
||||
#include "support.h"
|
||||
|
||||
GtkWidget*
|
||||
create_DiaToc (void)
|
||||
{
|
||||
GtkWidget *DiaToc;
|
||||
GtkWidget *dialog_vbox2;
|
||||
GtkWidget *vbox1;
|
||||
GtkWidget *scrolledwindow;
|
||||
GtkWidget *viewport1;
|
||||
GtkWidget *choice;
|
||||
GtkWidget *choice_menu;
|
||||
GtkWidget *glade_menuitem;
|
||||
GtkWidget *dialog_action_area1;
|
||||
GtkWidget *button_refresh;
|
||||
GtkWidget *button_close;
|
||||
|
||||
DiaToc = gnome_dialog_new (_("Table of Contents"), NULL);
|
||||
gtk_object_set_data (GTK_OBJECT (DiaToc), "DiaToc", DiaToc);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (DiaToc), 2);
|
||||
gtk_window_set_policy (GTK_WINDOW (DiaToc), TRUE, TRUE, FALSE);
|
||||
|
||||
dialog_vbox2 = GNOME_DIALOG (DiaToc)->vbox;
|
||||
gtk_object_set_data (GTK_OBJECT (DiaToc), "dialog_vbox2", dialog_vbox2);
|
||||
gtk_widget_show (dialog_vbox2);
|
||||
|
||||
vbox1 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_ref (vbox1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaToc), "vbox1", vbox1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (vbox1);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_vbox2), vbox1, TRUE, TRUE, 0);
|
||||
|
||||
scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_ref (scrolledwindow);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaToc), "scrolledwindow", scrolledwindow,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (scrolledwindow);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow, TRUE, TRUE, 0);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
|
||||
viewport1 = gtk_viewport_new (NULL, NULL);
|
||||
gtk_widget_ref (viewport1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaToc), "viewport1", viewport1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (viewport1);
|
||||
gtk_container_add (GTK_CONTAINER (scrolledwindow), viewport1);
|
||||
gtk_widget_set_usize (viewport1, 522, 289);
|
||||
|
||||
choice = gtk_option_menu_new ();
|
||||
gtk_widget_ref (choice);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaToc), "choice", choice,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (choice);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), choice, FALSE, FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (choice), 2);
|
||||
choice_menu = gtk_menu_new ();
|
||||
glade_menuitem = gtk_menu_item_new_with_label (_("DUMMY"));
|
||||
gtk_widget_show (glade_menuitem);
|
||||
gtk_menu_append (GTK_MENU (choice_menu), glade_menuitem);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (choice), choice_menu);
|
||||
|
||||
dialog_action_area1 = GNOME_DIALOG (DiaToc)->action_area;
|
||||
gtk_object_set_data (GTK_OBJECT (DiaToc), "dialog_action_area1", dialog_action_area1);
|
||||
gtk_widget_show (dialog_action_area1);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area1), 8);
|
||||
|
||||
gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (DiaToc),
|
||||
_("Refresh"), GNOME_STOCK_PIXMAP_REFRESH);
|
||||
button_refresh = g_list_last (GNOME_DIALOG (DiaToc)->buttons)->data;
|
||||
gtk_widget_ref (button_refresh);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaToc), "button_refresh", button_refresh,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (button_refresh);
|
||||
GTK_WIDGET_SET_FLAGS (button_refresh, GTK_CAN_DEFAULT);
|
||||
|
||||
gnome_dialog_append_button (GNOME_DIALOG (DiaToc), GNOME_STOCK_BUTTON_CLOSE);
|
||||
button_close = g_list_last (GNOME_DIALOG (DiaToc)->buttons)->data;
|
||||
gtk_widget_ref (button_close);
|
||||
gtk_object_set_data_full (GTK_OBJECT (DiaToc), "button_close", button_close,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (button_close);
|
||||
GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
|
||||
|
||||
return DiaToc;
|
||||
}
|
||||
|
5
src/frontends/gnome/diatoc_interface.h
Normal file
5
src/frontends/gnome/diatoc_interface.h
Normal file
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
GtkWidget* create_DiaToc (void);
|
@ -16,8 +16,12 @@
|
||||
#endif
|
||||
|
||||
#include "GUIRunTime_pimpl.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <kapp.h>
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
using std::endl;
|
||||
|
||||
extern bool finished;
|
||||
|
@ -423,6 +423,7 @@ void InsetText::UpdateLocal(BufferView * bv, UpdateCodes what, bool mark_dirty)
|
||||
if ((need_update != CURSOR) || (TEXT(bv)->status != LyXText::UNCHANGED) ||
|
||||
TEXT(bv)->selection)
|
||||
bv->updateInset(this, mark_dirty);
|
||||
bv->owner()->showState();
|
||||
if (old_par != cpar(bv)) {
|
||||
bv->owner()->setLayout(cpar(bv)->GetLayout());
|
||||
old_par = cpar(bv);
|
||||
|
@ -620,7 +620,13 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
|
||||
|
||||
if (buf) {
|
||||
func_status box = LyXFunc::ToggleOff;
|
||||
LyXFont font = owner->view()->text->real_current_font;
|
||||
LyXFont font;
|
||||
if (owner->view()->the_locking_inset &&
|
||||
owner->view()->the_locking_inset->getLyXText(owner->view()))
|
||||
font = owner->view()->the_locking_inset->
|
||||
getLyXText(owner->view())->real_current_font;
|
||||
else
|
||||
font = owner->view()->text->real_current_font;
|
||||
switch (action) {
|
||||
case LFUN_EMPH:
|
||||
if (font.emph() == LyXFont::ON)
|
||||
|
Loading…
Reference in New Issue
Block a user