mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-04 16:42:57 +00:00
read changelog
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@557 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3923262592
commit
56e007b94e
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2000-02-15 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/toolbar.C (set): use fl_set_object_helper for the tooltop
|
||||
(bubble tip), this removes our special handling of this.
|
||||
|
||||
* Remove all code that is unused now that we have the new
|
||||
workarea. (Code that are not active when NEW_WA is defined.)
|
||||
|
||||
* Make the uses of XSync not conditionalized on define USE_XSYNC.
|
||||
|
||||
2000-02-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* src/lyxfunc.C (Dispatch): fix LFUN_LAYOUT when giving a
|
||||
|
1080
src/BufferView.C
1080
src/BufferView.C
File diff suppressed because it is too large
Load Diff
@ -21,8 +21,6 @@
|
||||
#include "LaTeX.h"
|
||||
#include "undo.h"
|
||||
|
||||
#define NEW_WA 1
|
||||
|
||||
class LyXView;
|
||||
class Buffer;
|
||||
class LyXScreen;
|
||||
@ -43,19 +41,12 @@ public:
|
||||
///
|
||||
Painter & painter();
|
||||
#endif
|
||||
#ifdef NEW_WA
|
||||
///
|
||||
WorkArea * getWorkArea() { return workarea; }
|
||||
#else
|
||||
///
|
||||
FL_OBJECT * getWorkArea() { return work_area; }
|
||||
#endif
|
||||
///
|
||||
void buffer(Buffer * b);
|
||||
#ifdef NEW_WA
|
||||
///
|
||||
void resize(int, int, int, int);
|
||||
#endif
|
||||
///
|
||||
void resize();
|
||||
///
|
||||
@ -195,23 +186,14 @@ private:
|
||||
|
||||
/// Update pixmap of screen
|
||||
void updateScreen();
|
||||
#ifdef NEW_WA
|
||||
///
|
||||
void workAreaExpose();
|
||||
///
|
||||
void ScrollUpOnePage();
|
||||
///
|
||||
void ScrollDownOnePage();
|
||||
#else
|
||||
///
|
||||
int workAreaExpose();
|
||||
///
|
||||
void ScrollUpOnePage(long /*time*/);
|
||||
///
|
||||
void ScrollDownOnePage(long /*time*/);
|
||||
#endif
|
||||
///
|
||||
void create_view(int, int, int, int);
|
||||
void create_view();
|
||||
///
|
||||
Inset * checkInsetHit(int & x, int & y);
|
||||
///
|
||||
@ -220,8 +202,6 @@ private:
|
||||
int ScrollDown(long time);
|
||||
|
||||
public:
|
||||
|
||||
#ifdef NEW_WA
|
||||
///
|
||||
bool focus() const;
|
||||
///
|
||||
@ -234,28 +214,20 @@ public:
|
||||
void ScrollCB(double);
|
||||
/// A callback for the down arrow in the scrollbar.
|
||||
void DownCB(long time, int button);
|
||||
#else
|
||||
/// A callback for the up arrow in the scrollbar.
|
||||
static void UpCB(FL_OBJECT * ob, long);
|
||||
/// A callback for the slider in the scrollbar.
|
||||
static void ScrollCB(FL_OBJECT * ob, long);
|
||||
|
||||
/// A callback for the down arrow in the scrollbar.
|
||||
static void DownCB(FL_OBJECT * ob, long);
|
||||
#endif
|
||||
|
||||
///
|
||||
static void CursorToggleCB(FL_OBJECT * ob, long);
|
||||
#if 0
|
||||
/** Work area free object handler
|
||||
*/
|
||||
static int work_area_handler(FL_OBJECT *, int event,
|
||||
FL_Coord, FL_Coord, int key, void *xev);
|
||||
#endif
|
||||
|
||||
///
|
||||
void SetState();
|
||||
|
||||
private:
|
||||
#ifdef NEW_WA
|
||||
///
|
||||
void WorkAreaMotionNotify(int x, int y, unsigned int state);
|
||||
///
|
||||
@ -264,27 +236,6 @@ private:
|
||||
void WorkAreaButtonRelease(int x, int y, unsigned int button);
|
||||
///
|
||||
void WorkAreaSelectionNotify(Window win, XEvent * event);
|
||||
#else
|
||||
///
|
||||
int WorkAreaMotionNotify(FL_OBJECT * ob,
|
||||
Window win,
|
||||
int w, int h,
|
||||
XEvent * ev, void * d);
|
||||
///
|
||||
int WorkAreaButtonPress(FL_OBJECT * ob,
|
||||
Window win,
|
||||
int w, int h,
|
||||
XEvent * ev, void * d);
|
||||
///
|
||||
int WorkAreaButtonRelease(FL_OBJECT * ob,
|
||||
Window win,
|
||||
int w, int h,
|
||||
XEvent * ev, void * d);
|
||||
///
|
||||
int WorkAreaSelectionNotify(FL_OBJECT *, Window win,
|
||||
int /*w*/, int /*h*/,
|
||||
XEvent * event, void * /*d*/);
|
||||
#endif
|
||||
///
|
||||
LyXView * owner_;
|
||||
///
|
||||
@ -297,16 +248,6 @@ private:
|
||||
bool lyx_focus;
|
||||
///
|
||||
bool work_area_focus;
|
||||
#ifndef NEW_WA
|
||||
///
|
||||
FL_OBJECT * work_area;
|
||||
///
|
||||
FL_OBJECT * scrollbar;
|
||||
///
|
||||
FL_OBJECT * button_down;
|
||||
///
|
||||
FL_OBJECT * button_up;
|
||||
#endif
|
||||
///
|
||||
FL_OBJECT * figinset_canvas;
|
||||
///
|
||||
@ -315,10 +256,8 @@ private:
|
||||
BackStack backstack;
|
||||
///
|
||||
int last_click_x, last_click_y;
|
||||
#ifdef NEW_WA
|
||||
///
|
||||
WorkArea * workarea;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -337,8 +337,6 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM * fl, void * xev)
|
||||
LyXView * view = static_cast<LyXView*>(fl->u_vdata);
|
||||
int retval = 0; // 0 means XForms should have a look at this event
|
||||
|
||||
#define USE_XSYNC 1
|
||||
#ifdef USE_XSYNC
|
||||
XKeyEvent * xke = static_cast<XKeyEvent*>(xev);
|
||||
static Time last_time_pressed = 0;
|
||||
static Time last_time_released = 0;
|
||||
@ -346,36 +344,23 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM * fl, void * xev)
|
||||
static unsigned int last_key_released = 0;
|
||||
static unsigned int last_state_pressed = 0;
|
||||
static unsigned int last_state_released = 0;
|
||||
#endif
|
||||
|
||||
// funny. Even though the raw_callback is registered with KeyPressMask,
|
||||
// also KeyRelease-events are passed through:-(
|
||||
// [It seems that XForms puts them in pairs... (JMarc)]
|
||||
if (static_cast<XEvent*>(xev)->type == KeyPress
|
||||
#ifdef NEW_WA
|
||||
&& view->bufferview->focus()
|
||||
&& view->bufferview->active())
|
||||
#else
|
||||
&& view->bufferview->getWorkArea()->focus
|
||||
&& view->bufferview->getWorkArea()->active)
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_XSYNC
|
||||
last_time_pressed = xke->time;
|
||||
last_key_pressed = xke->keycode;
|
||||
last_state_pressed = xke->state;
|
||||
#endif
|
||||
retval = view->getLyXFunc()
|
||||
->processKeyEvent(static_cast<XEvent*>(xev));
|
||||
}
|
||||
#ifdef USE_XSYNC
|
||||
else if (static_cast<XEvent*>(xev)->type == KeyRelease
|
||||
#ifdef NEW_WA
|
||||
&& view->bufferview->focus()
|
||||
&& view->bufferview->active())
|
||||
#else
|
||||
&& view->bufferview->getWorkArea()->focus
|
||||
&& view->bufferview->getWorkArea()->active)
|
||||
#endif
|
||||
{
|
||||
last_time_released = xke->time;
|
||||
last_key_released = xke->keycode;
|
||||
@ -396,7 +381,6 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM * fl, void * xev)
|
||||
// purging of XEvents can cause any harm...after some testing
|
||||
// I can see no problems, but I'd like other reports too.
|
||||
}
|
||||
#endif
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -186,10 +186,10 @@ lyx_SOURCES = \
|
||||
vspace.C \
|
||||
vspace.h
|
||||
|
||||
lyx_main.o: lyx_main.C lyx_main.h config.h version.h debug.h gettext.h \
|
||||
lyx_gui.h lyx_gui_misc.h lyxrc.h support/path.h support/filetools.h \
|
||||
bufferlist.h support/FileInfo.h lastfiles.h intl.h \
|
||||
lyxserver.h layout.h gettext.h
|
||||
lyx_main.o: lyx_main.C lyx_main.h config.h version.h lyx_gui.h \
|
||||
lyx_gui_misc.h lyxrc.h support/path.h support/filetools.h \
|
||||
bufferlist.h debug.h support/FileInfo.h lastfiles.h intl.h \
|
||||
lyxserver.h layout.h gettext.h kbmap.h
|
||||
$(CXXCOMPILE) -DLYX_DIR=\"$(pkgdatadir)\" \
|
||||
-DTOP_SRCDIR=\"$(top_srcdir)\" -c $(top_srcdir)/src/lyx_main.C
|
||||
|
||||
|
@ -22,9 +22,7 @@
|
||||
#include "support/lstrings.h"
|
||||
#include "BufferView.h"
|
||||
|
||||
#ifdef NEW_WA
|
||||
FL_OBJECT * figinset_canvas;
|
||||
#endif
|
||||
|
||||
static inline
|
||||
void waitForX()
|
||||
|
@ -85,34 +85,6 @@ public:
|
||||
}
|
||||
///
|
||||
Pixmap getPixmap() const { return workareapixmap; }
|
||||
///
|
||||
//Signal2<long, int> up;
|
||||
///
|
||||
//Signal2<long, int> down;
|
||||
///
|
||||
//Signal1<double> scroll;
|
||||
///
|
||||
//Signal0 expose;
|
||||
///
|
||||
//Signal3<int, int, unsigned int> buttonPress;
|
||||
///
|
||||
//Signal3<int, int, unsigned int> buttonRelease;
|
||||
///
|
||||
//Signal3<int, int, unsigned int> motion;
|
||||
///
|
||||
//Signal0 focus;
|
||||
///
|
||||
//Signal0 unfocus;
|
||||
///
|
||||
//Signal0 enter;
|
||||
///
|
||||
//Signal0 leave;
|
||||
///
|
||||
//Signal3<int, int, unsigned int> doubleclick;
|
||||
///
|
||||
//Signal3<int, int, unsigned int> trippleclick;
|
||||
///
|
||||
//Signal2<Window, XEvent *> selection;
|
||||
/// xforms callback
|
||||
static int work_area_handler(FL_OBJECT *, int event,
|
||||
FL_Coord, FL_Coord,
|
||||
|
@ -514,24 +514,39 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
|
||||
}
|
||||
// now the rest - draw within (x, y, x+wid, y+hg)
|
||||
switch (modtype) {
|
||||
case ACUTE: // acute
|
||||
case ACUTE: // acute 0xB4
|
||||
{
|
||||
#if 0
|
||||
pain.line(int(x2), int(y + hg),
|
||||
int(x2 + hg35), y + hg35);
|
||||
#else
|
||||
pain.text(x2 - font.width(0xB4) / 2, baseline,
|
||||
char(0xB4), font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case GRAVE: // grave
|
||||
case GRAVE: // grave 0x60
|
||||
{
|
||||
#if 0
|
||||
pain.line(int(x2), int(y + hg),
|
||||
int(x2 - hg35), y + hg35);
|
||||
#else
|
||||
pain.text(x2 - font.width(0x60) / 2, baseline,
|
||||
char(0x60), font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case MACRON: // macron
|
||||
{
|
||||
#if 0
|
||||
pain.line(int(x2 - wid * 0.4),
|
||||
int(y + hg),
|
||||
int(x2 + wid * 0.4),
|
||||
int(y + hg));
|
||||
#else
|
||||
pain.text(x2 - font.width(0xAF) / 2, baseline,
|
||||
char(0xAF), font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case TILDE: // tilde
|
||||
@ -557,20 +572,26 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
|
||||
#else
|
||||
pain.text(x2 - font.width('~') / 2,
|
||||
baseline - font.ascent('~'),
|
||||
"~", 1, font);
|
||||
'~', font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case UNDERBAR: // underbar
|
||||
case UNDERBAR: // underbar 0x5F
|
||||
{
|
||||
#if 0
|
||||
pain.line(int(x2 - wid * 0.4),
|
||||
y + hg / 2.0,
|
||||
int(x2 + wid * 0.4),
|
||||
y + hg / 2.0);
|
||||
#else
|
||||
pain.text(x2 - font.width(0x5F) / 2, baseline,
|
||||
char(0x5F), font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case CEDILLA: // cedilla
|
||||
{
|
||||
#if 0
|
||||
int xp[4], yp[4];
|
||||
|
||||
xp[0] = int(x2);
|
||||
@ -586,6 +607,11 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
|
||||
yp[3] = y + int(hg);
|
||||
|
||||
pain.lines(xp, yp, 4);
|
||||
#else
|
||||
pain.text(x2 - font.width(0xB8) / 2, baseline,
|
||||
char(0xB8), font);
|
||||
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case UNDERDOT: // underdot
|
||||
@ -606,9 +632,14 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
|
||||
|
||||
case CIRCLE: // circle
|
||||
{
|
||||
#if 0
|
||||
pain.arc(int(x2 - (hg / 2.0)),
|
||||
y + (hg / 2.0), hg, hg , 0,
|
||||
360 * 64);
|
||||
#else
|
||||
pain.text(x2 - font.width(0xB0) / 2, baseline,
|
||||
char(0xB0), font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case TIE: // tie
|
||||
@ -694,18 +725,23 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
|
||||
}
|
||||
#else
|
||||
pain.text(x2 - font.width('¨') / 2, baseline,
|
||||
"¨", 1, font);
|
||||
'¨', font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case CIRCUMFLEX: // circumflex
|
||||
{
|
||||
#if 0
|
||||
int xp[3], yp[3];
|
||||
|
||||
xp[0] = int(x2 - hg35); yp[0] = y + int(hg);
|
||||
xp[1] = int(x2); yp[1] = int(y + hg35);
|
||||
xp[2] = int(x2 + hg35); yp[2] = y + int(hg);
|
||||
pain.lines(xp, yp, 3);
|
||||
#else
|
||||
pain.text(x2 - font.width(0x5E) / 2, baseline,
|
||||
char(0x5E), font);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case OGONEK: // ogonek
|
||||
|
@ -244,7 +244,8 @@ void AllowInput()
|
||||
if (fd_form_character->form_character->visible)
|
||||
XUndefineCursor(fl_display,
|
||||
fd_form_character->form_character->window);
|
||||
#ifndef NEW_WA
|
||||
#if 0
|
||||
// What to do about this? (Lgb)
|
||||
if (current_view->getWorkArea()->belowmouse)
|
||||
SetXtermCursor(current_view->owner()->getForm()->window);
|
||||
#endif
|
||||
|
@ -266,13 +266,9 @@ bool LyXFindReplace1::SearchCB(bool fForward)
|
||||
result = false;
|
||||
}
|
||||
|
||||
#ifdef NEW_WA
|
||||
if (current_view->focus())
|
||||
current_view->getScreen()->ShowCursor();
|
||||
#else
|
||||
if (current_view->getWorkArea()->focus)
|
||||
current_view->getScreen()->ShowCursor();
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -663,19 +663,11 @@ string LyXFunc::Dispatch(int ac,
|
||||
case LFUN_CENTER: // this is center and redraw.
|
||||
owner->view()->beforeChange();
|
||||
if (owner->view()->text->cursor.y >
|
||||
#ifdef NEW_WA
|
||||
owner->view()->getWorkArea()->height() / 2)
|
||||
#else
|
||||
owner->view()->getWorkArea()->h / 2)
|
||||
#endif
|
||||
{
|
||||
owner->view()->getScreen()->
|
||||
Draw(owner->view()->text->cursor.y -
|
||||
#ifdef NEW_WA
|
||||
owner->view()->getWorkArea()->height() / 2
|
||||
#else
|
||||
owner->view()->getWorkArea()->h / 2
|
||||
#endif
|
||||
);
|
||||
} else { // <=
|
||||
owner->view()->getScreen()->
|
||||
@ -2017,19 +2009,11 @@ string LyXFunc::Dispatch(int ac,
|
||||
// Recenter screen
|
||||
owner->view()->beforeChange();
|
||||
if (owner->view()->text->cursor.y >
|
||||
#ifdef NEW_WA
|
||||
owner->view()->getWorkArea()->height() / 2
|
||||
#else
|
||||
owner->view()->getWorkArea()->h / 2
|
||||
#endif
|
||||
) {
|
||||
owner->view()->getScreen()->
|
||||
Draw(owner->view()->text->cursor.y -
|
||||
#ifdef NEW_WA
|
||||
owner->view()->getWorkArea()->height() / 2
|
||||
#else
|
||||
owner->view()->getWorkArea()->h / 2
|
||||
#endif
|
||||
);
|
||||
} else { // <=
|
||||
owner->view()->getScreen()->
|
||||
|
@ -31,8 +31,6 @@ typedef unsigned short Dimension;
|
||||
|
||||
class BufferView;
|
||||
|
||||
#define NEW_WA 1
|
||||
|
||||
/** The class LyXScreen is used for the main Textbody.
|
||||
Concretely, the screen is held in a pixmap. This pixmap is kept up to
|
||||
date and used to optimize drawing on the screen.
|
||||
@ -42,9 +40,7 @@ class LyXScreen {
|
||||
public:
|
||||
///
|
||||
LyXScreen(BufferView *, Window window,
|
||||
#ifdef NEW_WA
|
||||
Pixmap p,
|
||||
#endif
|
||||
Dimension width,
|
||||
Dimension height,
|
||||
Dimension offset_x,
|
||||
|
@ -46,12 +46,8 @@ void MiniBuffer::ExecutingCB(FL_OBJECT * ob, long)
|
||||
{
|
||||
MiniBuffer * obj = static_cast<MiniBuffer*>(ob->u_vdata);
|
||||
lyxerr.debug() << "Getting ready to execute: " << obj->cur_cmd << endl;
|
||||
#ifdef NEW_WA
|
||||
obj->owner->view()->focus(true);
|
||||
#else
|
||||
fl_set_focus_object(obj->owner->getForm(),
|
||||
obj->owner->view()->getWorkArea());
|
||||
#endif
|
||||
|
||||
if (obj->cur_cmd.empty()) {
|
||||
obj->Init();
|
||||
return ;
|
||||
@ -104,12 +100,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, FL_Coord, FL_Coord,
|
||||
case 27:
|
||||
case XK_Escape:
|
||||
// Abort
|
||||
#ifdef NEW_WA
|
||||
mini->owner->view()->focus(true);
|
||||
#else
|
||||
fl_set_focus_object(mini->owner->getForm(),
|
||||
mini->owner->view()->getWorkArea());
|
||||
#endif
|
||||
mini->Init();
|
||||
return 1;
|
||||
case 13:
|
||||
|
17
src/screen.C
17
src/screen.C
@ -49,9 +49,7 @@ GC createGC()
|
||||
|
||||
// Constructor
|
||||
LyXScreen::LyXScreen(BufferView * o, Window window,
|
||||
#ifdef NEW_WA
|
||||
Pixmap p,
|
||||
#endif
|
||||
Dimension width,
|
||||
Dimension height,
|
||||
Dimension offset_x,
|
||||
@ -68,14 +66,8 @@ LyXScreen::LyXScreen(BufferView * o, Window window,
|
||||
screen_refresh_y = -1;
|
||||
|
||||
/* create the foreground pixmap */
|
||||
#ifdef NEW_WA
|
||||
foreground = p;
|
||||
#else
|
||||
foreground = XCreatePixmap (fl_display,
|
||||
fl_root,
|
||||
_width, _height,
|
||||
fl_get_visual_depth());
|
||||
#endif
|
||||
|
||||
cursor_pixmap = 0;
|
||||
cursor_pixmap_x = 0;
|
||||
cursor_pixmap_y = 0;
|
||||
@ -90,12 +82,7 @@ LyXScreen::LyXScreen(BufferView * o, Window window,
|
||||
|
||||
|
||||
// Destructor
|
||||
LyXScreen::~LyXScreen()
|
||||
{
|
||||
#ifndef NEW_WA
|
||||
XFreePixmap(fl_display, foreground);
|
||||
#endif
|
||||
}
|
||||
LyXScreen::~LyXScreen() {}
|
||||
|
||||
|
||||
void LyXScreen::Redraw()
|
||||
|
@ -4,6 +4,8 @@ LIBS =
|
||||
ETAGS_ARGS = --c++
|
||||
INCLUDES = -I${srcdir}/../
|
||||
|
||||
EXTRA_DIST = lyxstring.C lyxstring.h regex.c lyxregex.h
|
||||
|
||||
if USE_LYXSTRING
|
||||
LYXSTRING = lyxstring.C lyxstring.h
|
||||
endif
|
||||
|
@ -93,6 +93,7 @@
|
||||
#include "layout_std.xpm"
|
||||
#include "build.xpm"
|
||||
|
||||
|
||||
// this one is not "C" because combox callbacks are really C++ %-|
|
||||
extern void LayoutsCB(int, void *);
|
||||
extern char const ** get_pixmap_from_symbol(char const * arg, int, int);
|
||||
@ -122,7 +123,9 @@ Toolbar::Toolbar(Toolbar const &rct, LyXView *o, int x, int y)
|
||||
: owner(o), sxpos(x), sypos(y)
|
||||
{
|
||||
combox = 0;
|
||||
#if FL_REVISION < 89
|
||||
bubble_timer = 0;
|
||||
#endif
|
||||
reset();
|
||||
|
||||
// extracts the toolbar struct form rct.
|
||||
@ -136,6 +139,7 @@ Toolbar::Toolbar(Toolbar const &rct, LyXView *o, int x, int y)
|
||||
}
|
||||
|
||||
|
||||
#if FL_REVISION < 89
|
||||
// timer-cb for bubble-help (Matthias)
|
||||
void Toolbar::BubbleTimerCB(FL_OBJECT *, long data)
|
||||
{
|
||||
@ -180,6 +184,7 @@ extern "C" int C_Toolbar_BubblePost(FL_OBJECT * ob, int event,
|
||||
{
|
||||
return Toolbar::BubblePost(ob, event, 0, 0, key, xev);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Toolbar::activate()
|
||||
@ -212,7 +217,11 @@ void Toolbar::deactivate()
|
||||
|
||||
void Toolbar::ToolbarCB(FL_OBJECT * ob, long ac)
|
||||
{
|
||||
#if FL_REVISION >= 89
|
||||
Toolbar * t = static_cast<Toolbar*>(ob->u_vdata);
|
||||
#else
|
||||
Toolbar * t = reinterpret_cast<Toolbar*>(ob->u_ldata);
|
||||
#endif
|
||||
|
||||
string res = t->owner->getLyXFunc()->Dispatch(int(ac));
|
||||
if(!res.empty())
|
||||
@ -287,10 +296,12 @@ void Toolbar::set(bool doingmain)
|
||||
fl_addto_form(owner->getForm());
|
||||
}
|
||||
|
||||
#if FL_REVISION < 89
|
||||
// add the time if it don't exist
|
||||
if (bubble_timer == 0)
|
||||
bubble_timer = fl_add_timer(FL_HIDDEN_TIMER,
|
||||
xpos, ypos, 0, 0, "Timer");
|
||||
#endif
|
||||
|
||||
while(item != 0) {
|
||||
switch(item->action){
|
||||
@ -328,6 +339,14 @@ void Toolbar::set(bool doingmain)
|
||||
fl_set_pixmapbutton_focus_outline(obj, 0);
|
||||
|
||||
// set the bubble-help (Matthias)
|
||||
#if FL_REVISION >= 89
|
||||
// Set the tooltip
|
||||
fl_set_object_helper(obj, item->help.c_str());
|
||||
// The toolbar that this object belongs too.
|
||||
obj->u_vdata = this;
|
||||
|
||||
|
||||
#else
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning This is dangerous!
|
||||
#endif
|
||||
@ -337,6 +356,7 @@ void Toolbar::set(bool doingmain)
|
||||
obj->u_ldata = reinterpret_cast<long>(this);
|
||||
|
||||
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
|
||||
#endif
|
||||
|
||||
fl_set_pixmapbutton_data(obj, const_cast<char**>(item->pixmap));
|
||||
item = item->next;
|
||||
@ -487,8 +507,7 @@ void Toolbar::add(int action, bool doclean)
|
||||
// adds an item to the list
|
||||
if (pixmap != 0
|
||||
|| action == TOOL_SEPARATOR
|
||||
|| action == TOOL_LAYOUTS)
|
||||
{
|
||||
|| action == TOOL_LAYOUTS) {
|
||||
newItem = new toolbarItem;
|
||||
newItem->action = action;
|
||||
newItem->pixmap = pixmap;
|
||||
@ -503,9 +522,6 @@ void Toolbar::add(int action, bool doclean)
|
||||
} else
|
||||
toollist = newItem;
|
||||
}
|
||||
//if (action == TOOL_LAYOUTS) {
|
||||
// combox = new Combox(FL_COMBOX_DROPLIST);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,9 @@ public:
|
||||
owner = 0;
|
||||
sxpos = 0;
|
||||
sypos = 0;
|
||||
#if FL_REVISION < 89
|
||||
bubble_timer = 0;
|
||||
#endif
|
||||
combox = 0;
|
||||
reset();
|
||||
init(); // set default toolbar.
|
||||
@ -88,11 +90,14 @@ public:
|
||||
|
||||
///
|
||||
static void ToolbarCB(FL_OBJECT *, long);
|
||||
|
||||
#if FL_REVISION < 89
|
||||
///
|
||||
static void BubbleTimerCB(FL_OBJECT *, long);
|
||||
///
|
||||
static int BubblePost(FL_OBJECT * ob, int event,
|
||||
FL_Coord mx, FL_Coord my, int key, void * xev);
|
||||
#endif
|
||||
|
||||
private:
|
||||
///
|
||||
@ -111,7 +116,7 @@ private:
|
||||
///
|
||||
char const ** pixmap;
|
||||
///
|
||||
toolbarItem(){
|
||||
toolbarItem() {
|
||||
next = 0;
|
||||
action = LFUN_NOACTION;
|
||||
icon = 0;
|
||||
@ -132,8 +137,10 @@ private:
|
||||
toolbarItem * toollist;
|
||||
///
|
||||
LyXView * owner;
|
||||
#if FL_REVISION < 89
|
||||
///
|
||||
FL_OBJECT * bubble_timer;
|
||||
#endif
|
||||
/// Starting position
|
||||
int sxpos, sypos;
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user