Dear LyX Developers,

Because I had a few minutes today, I thought I would sit down and spend
some time working on a pet LyX project (which are nowhere near ready for
submission to the list).  For one of those projects, I threw together a
very simple dock widget that would allow me to test a few modifications
that I have made.  However (much to my embarrassment), I can't remember
how to add a new widget to LyX's GUI.

>From looking at the source, I have managed to puzzle out a few of the
steps:

1.) You have to create a DockWidget container (forgive me if I use the
wrong terms) similar to GuiToc, GuiProgressView or GuiViewSource.  I
have done this, basing the code on GuiToc.

GuiTestMod::GuiTestMod(GuiView & parent, Qt::DockWidgetArea area,
Qt::WindowFlags flags)
        : DockView(parent, "testmod", qt_("Testmod"), area, flags),
is_closing_(false)

2.) You need to add an entry in GuiView.cpp, which can call
dialog->prepareView()

if ((dialog = findOrBuild(testmod", true)))
                dialog->prepareView();

3.) You need to add a relevant entry in stdmenus.inc so that it can be
accessed from the Ui.

...
Item "TestMod Dialog" "dialog-toggle testmod"
...

With these modifications I can compile the source without errors
(updated from SVN this morning) and run the most recent version of LyX,
but I am unable to toggle my dialog.  In the progress dialog,
"dialog-toggle testmod" appears when the menu is activated, but nothing
happens.  I must be missing something.  Is there a step that I skipped
or is it necessary to add a reference to another file/class that I have
overlooked?

About six months ago, when I first started working on LyX-Outline, I
tried to do this same thing and struggled with it at that time as well.
Any help would be greatly appreciated.

Cheers,

Rob Oakes

Reply via email to