-
- if (fast_selection || mono_video){
-
- /* selection only in one row ?*/
- if (text->toggle_cursor.y == text->toggle_end_cursor.y) {
-
- /* only if anything is visible */
- if (text->toggle_cursor.y - text->toggle_cursor.row->baseline - first < _height
- && text->toggle_cursor.y - text->toggle_cursor.row->baseline +
- text->toggle_cursor.row->height - first > 0) {
- top = text->toggle_cursor.y - text->toggle_cursor.row->baseline - first;
- bottom = top + text->toggle_cursor.row->height;
- if (top < 0) top = 0;
- if (bottom > _height) bottom = _height;
- XFillRectangle(fl_display, _window,
- getGC(gc_select),
- text->toggle_cursor.x+_offset_x,
- top+_offset_y,
- text->toggle_end_cursor.x -
- text->toggle_cursor.x,
- bottom - top);
- }
- } else {
- /* the toggle_cursor row first */
- /* only if anything is visible */
- if (text->toggle_cursor.y - text->toggle_cursor.row->baseline - first < _height
- && text->toggle_cursor.y - text->toggle_cursor.row->baseline +
- text->toggle_cursor.row->height - first > 0) {
- top = text->toggle_cursor.y - text->toggle_cursor.row->baseline - first;
- bottom = top + text->toggle_cursor.row->height;
- if (top<0)
- top = 0;
- if (bottom > _height)
- bottom = _height;
- XFillRectangle(fl_display, _window,
- getGC(gc_select),
- text->toggle_cursor.x+_offset_x,
- top+_offset_y,
- _width - text->toggle_cursor.x,
- bottom - top);
- }
-
- /* the main body */
-
- if (text->toggle_cursor.row->next !=
- text->toggle_end_cursor.row) {
- top = text->toggle_cursor.y
- - text->toggle_cursor.row->baseline
- + text->toggle_cursor.row->height;
- bottom = text->toggle_end_cursor.y
- - text->toggle_end_cursor.row->baseline;
-
- if (top - first < 0)
- top = first;
- if (bottom - first < 0)
- bottom = first;
-
- if (bottom - first > _height)
- bottom = first + _height;
- if (top - first > _height)
- top = first + _height;
-
- if (top != bottom) {
- XFillRectangle(fl_display, _window,
- getGC(gc_select),
- 0+_offset_x,
- top - first+_offset_y,
- _width,
- bottom - top);
- }
- }
-
- /* the toggle_end_cursor row last */
- if (text->toggle_end_cursor.y - text->toggle_end_cursor.row->baseline - first < _height
- && text->toggle_end_cursor.y - text->toggle_end_cursor.row->baseline +
- text->toggle_end_cursor.row->height - first > 0) {
- top = text->toggle_end_cursor.y
- - text->toggle_end_cursor.row->baseline
- - first;
- bottom = top
- + text->toggle_end_cursor.row->height;
- if (top<0)
- top = 0;
- if (bottom > _height)
- bottom = _height;
- XFillRectangle(fl_display, _window,
- getGC(gc_select),
- 0+_offset_x,
- top+_offset_y,
- text->toggle_end_cursor.x,
- bottom - top);
- }
- }
- } else {
- top = text->toggle_cursor.y
- - text->toggle_cursor.row->baseline;
- bottom = text->toggle_end_cursor.y
- - text->toggle_end_cursor.row->baseline
- + text->toggle_end_cursor.row->height;
-
- if (top - first < 0)
- top = first;
- if (bottom - first < 0)
- bottom = first;
-
- if (bottom - first > _height)
- bottom = first + _height;
- if (top - first > _height)
- top = first + _height;
-
- DrawFromTo(top - first, bottom - first);
- expose(0, top - first, _width, bottom - first - (top - first));
- }
-}
-
-
-
-void LyXScreen::drawTableLine(int baseline, int x, int length, bool on_off)
-{
- GC gc;
- if (on_off)
- gc = getGC(gc_thin_on_off_line);
- else
- gc = getGC(gc_copy);
- drawLine(gc,
- x,
- baseline,
- x + length,
- baseline);
-}
-
-
-void LyXScreen::drawVerticalTableLine(int x, int y1, int y2, bool on_off)
-{
- GC gc;
- if (on_off)
- gc = getGC(gc_thin_on_off_line);
- else
- gc = getGC(gc_copy);
- drawLine(gc,
- x,
- y1,
- x,
- y2);
-}
-
-
-void LyXScreen::drawFrame(int /*ft*/, int x, int y, int w, int h,
- FL_COLOR /*col*/, int /*b*/)
-{
-// Implement this using X11 calls, and the repaint problems are gone!
-// At least, I think that should do it since we only have them after
-// one of these buttons are displayed now! Lars, it seems you've hit the
-// nail :-) (Asger)
-// fl_winset(foreground);
-// fl_drw_frame(ft, x, y, w, h, col, b);
- // This should be changed to draw a button like frame, in the
- // mean time we'll just use a regular rectangle
-
- // I want the buttons back before 0.12. OK, this is very simple,
- // like what is done in xforms sources. (Ale)
-
- // This one is too dirty. Get rid of it.
- extern GC fl_gc;
-
- // Please comment this annonymous variable.
- int d = 2;
-
- // I think these calls to fl_color might make xforms sometimes
- // draw the wrong color on other objects.
- fl_color(FL_TOP_BCOL);
- XFillRectangle(fl_display, foreground, fl_gc, x-d, y-d, w+2*d, d);
- fl_color(FL_BOTTOM_BCOL);
- XFillRectangle(fl_display, foreground, fl_gc, x-d, y+h, w+2*d, d);
-
- // Now a couple of trapezoids
- XPoint pl[4], pr[4];
-
- pl[0].x = x-d; pl[0].y = y-d;
- pl[1].x = x-d; pl[1].y = y+h+d;
- pl[2].x = x; pl[2].y = y+h;
- pl[3].x = x; pl[3].y = y;