mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Merge the working bits of the resize patch, and fix a couple of things
that broke. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4441 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ba21e88032
commit
60b905b885
@ -65,15 +65,9 @@ void BufferView::buffer(Buffer * b)
|
||||
}
|
||||
|
||||
|
||||
void BufferView::resize(int xpos, int ypos, int width, int height)
|
||||
{
|
||||
pimpl_->resize(xpos, ypos, width, height);
|
||||
}
|
||||
|
||||
|
||||
void BufferView::resize()
|
||||
{
|
||||
pimpl_->resize();
|
||||
pimpl_->resizeCurrentBuffer();
|
||||
}
|
||||
|
||||
|
||||
@ -119,12 +113,6 @@ void BufferView::redoCurrentBuffer()
|
||||
}
|
||||
|
||||
|
||||
int BufferView::resizeCurrentBuffer()
|
||||
{
|
||||
return pimpl_->resizeCurrentBuffer();
|
||||
}
|
||||
|
||||
|
||||
void BufferView::cursorPrevious(LyXText * text)
|
||||
{
|
||||
pimpl_->cursorPrevious(text);
|
||||
|
@ -58,8 +58,6 @@ public:
|
||||
///
|
||||
void buffer(Buffer * b);
|
||||
///
|
||||
void resize(int, int, int, int);
|
||||
///
|
||||
void resize();
|
||||
///
|
||||
void redraw();
|
||||
@ -76,8 +74,6 @@ public:
|
||||
///
|
||||
void redoCurrentBuffer();
|
||||
///
|
||||
int resizeCurrentBuffer();
|
||||
///
|
||||
void cursorPrevious(LyXText *);
|
||||
///
|
||||
void cursorNext(LyXText *);
|
||||
|
@ -133,8 +133,8 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
|
||||
|
||||
// Setup the signals
|
||||
workarea().scrollDocView.connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1));
|
||||
workarea().workAreaExpose
|
||||
.connect(boost::bind(&BufferView::Pimpl::workAreaExpose, this));
|
||||
workarea().workAreaResize
|
||||
.connect(boost::bind(&BufferView::Pimpl::workAreaResize, this));
|
||||
workarea().workAreaButtonPress
|
||||
.connect(boost::bind(&BufferView::Pimpl::workAreaButtonPress, this, _1, _2, _3));
|
||||
workarea().workAreaButtonRelease
|
||||
@ -244,21 +244,6 @@ void BufferView::Pimpl::buffer(Buffer * b)
|
||||
}
|
||||
|
||||
|
||||
void BufferView::Pimpl::resize(int xpos, int ypos, int width, int height)
|
||||
{
|
||||
workarea().resize(xpos, ypos, width, height);
|
||||
update(bv_->text, SELECT);
|
||||
redraw();
|
||||
}
|
||||
|
||||
|
||||
void BufferView::Pimpl::resize()
|
||||
{
|
||||
if (buffer_)
|
||||
resizeCurrentBuffer();
|
||||
}
|
||||
|
||||
|
||||
void BufferView::Pimpl::redraw()
|
||||
{
|
||||
lyxerr[Debug::INFO] << "BufferView::redraw()" << endl;
|
||||
@ -288,7 +273,7 @@ void BufferView::Pimpl::redoCurrentBuffer()
|
||||
{
|
||||
lyxerr[Debug::INFO] << "BufferView::redoCurrentBuffer" << endl;
|
||||
if (buffer_ && bv_->text) {
|
||||
resize();
|
||||
resizeCurrentBuffer();
|
||||
owner_->updateLayoutChoice();
|
||||
}
|
||||
}
|
||||
@ -349,8 +334,6 @@ int BufferView::Pimpl::resizeCurrentBuffer()
|
||||
}
|
||||
}
|
||||
|
||||
updateScreen();
|
||||
|
||||
if (par) {
|
||||
bv_->text->selection.set(true);
|
||||
// At this point just to avoid the Delete-Empty-Paragraph-
|
||||
@ -916,7 +899,7 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y)
|
||||
}
|
||||
|
||||
|
||||
void BufferView::Pimpl::workAreaExpose()
|
||||
void BufferView::Pimpl::workAreaResize()
|
||||
{
|
||||
static int work_area_width;
|
||||
static unsigned int work_area_height;
|
||||
@ -930,7 +913,7 @@ void BufferView::Pimpl::workAreaExpose()
|
||||
if (buffer_ != 0) {
|
||||
if (widthChange) {
|
||||
// The visible LyXView need a resize
|
||||
owner_->view()->resize();
|
||||
resizeCurrentBuffer();
|
||||
|
||||
// Remove all texts from the textcache
|
||||
// This is not _really_ what we want to do. What
|
||||
@ -941,10 +924,9 @@ void BufferView::Pimpl::workAreaExpose()
|
||||
if (lyxerr.debugging())
|
||||
textcache.show(lyxerr, "Expose delete all");
|
||||
textcache.clear();
|
||||
// FIXME: this is aalready done in resizeCurrentBuffer() ??
|
||||
buffer_->resizeInsets(bv_);
|
||||
} else if (heightChange) {
|
||||
// Rebuild image of current screen
|
||||
updateScreen();
|
||||
// fitCursor() ensures we don't jump back
|
||||
// to the start of the document on vertical
|
||||
// resize
|
||||
|
@ -45,10 +45,6 @@ struct BufferView::Pimpl : public boost::signals::trackable {
|
||||
///
|
||||
void buffer(Buffer *);
|
||||
///
|
||||
void resize(int xpos, int ypos, int width, int height);
|
||||
///
|
||||
void resize();
|
||||
///
|
||||
void redraw();
|
||||
/// Return true if the cursor was fitted.
|
||||
bool fitCursor();
|
||||
@ -63,7 +59,7 @@ struct BufferView::Pimpl : public boost::signals::trackable {
|
||||
/// Update pixmap of screen
|
||||
void updateScreen();
|
||||
///
|
||||
void workAreaExpose();
|
||||
void workAreaResize();
|
||||
///
|
||||
void updateScrollbar();
|
||||
///
|
||||
|
@ -1,3 +1,11 @@
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* BufferView.h:
|
||||
* BufferView.C:
|
||||
* BufferView_pimpl.h:
|
||||
* BufferView_pimpl.C: clean up resize() stuff,
|
||||
and unnecessary updateScreen()s
|
||||
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* BufferView.h:
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* WorkArea.h: remove unused resize(..) and change name
|
||||
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* LyXKeySym.h:
|
||||
|
@ -46,8 +46,6 @@ public:
|
||||
/// return the height of the work area in pixels
|
||||
virtual int workHeight() const = 0;
|
||||
|
||||
/// FIXME: GUII
|
||||
virtual void resize(int xpos, int ypos, int width, int height) = 0;
|
||||
/// FIXME: GUII
|
||||
virtual void redraw() const = 0;
|
||||
|
||||
@ -67,8 +65,8 @@ public:
|
||||
/// fill the clipboard
|
||||
virtual void putClipboard(string const &) const = 0;
|
||||
|
||||
/// FIXME: GUII
|
||||
boost::signal0<void> workAreaExpose;
|
||||
/// work area dimensions have changed
|
||||
boost::signal0<void> workAreaResize;
|
||||
/// the scrollbar has changed
|
||||
boost::signal1<void, int> scrollDocView;
|
||||
/// a key combination has been pressed
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* QWorkArea.h: remove unused resize(...)
|
||||
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* QWorkArea.h: remove unused stuff
|
||||
|
@ -48,8 +48,6 @@ public:
|
||||
virtual int workWidth() const { return content_->width(); }
|
||||
/// return the height of the content pane
|
||||
virtual int workHeight() const { return content_->height(); }
|
||||
/// resize this widget
|
||||
virtual void resize(int xpos, int ypos, int width, int height);
|
||||
/// FIXME: makes no sense ?
|
||||
virtual void redraw() const { }
|
||||
///
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* XWorkArea.h:
|
||||
* XWorkArea.C: remove unused code, name change
|
||||
|
||||
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* XLyXKeySym.h:
|
||||
|
@ -256,33 +256,6 @@ XWorkArea::~XWorkArea()
|
||||
}
|
||||
|
||||
|
||||
void XWorkArea::resize(int xpos, int ypos, int width, int height)
|
||||
{
|
||||
fl_freeze_all_forms();
|
||||
|
||||
int const bw = int(abs(fl_get_border_width()));
|
||||
|
||||
// a box
|
||||
fl_set_object_geometry(backgroundbox, xpos, ypos, width - 15, height);
|
||||
|
||||
//
|
||||
// THE SCROLLBAR
|
||||
//
|
||||
fl_set_object_geometry(scrollbar, xpos + width - 15,
|
||||
ypos, 17, height);
|
||||
|
||||
// Create the workarea pixmap
|
||||
createPixmap(width - 15 - 2 * bw, height - 2 * bw);
|
||||
|
||||
// the free object
|
||||
fl_set_object_geometry(work_area, xpos + bw, ypos + bw,
|
||||
width - 15 - 2 * bw,
|
||||
height - 2 * bw);
|
||||
|
||||
fl_unfreeze_all_forms();
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
void destroy_object(FL_OBJECT * obj)
|
||||
{
|
||||
@ -407,7 +380,7 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
return 1;
|
||||
lyxerr[Debug::WORKAREA] << "Workarea event: DRAW" << endl;
|
||||
area->createPixmap(area->workWidth(), area->workHeight());
|
||||
area->workAreaExpose();
|
||||
area->workAreaResize();
|
||||
break;
|
||||
case FL_PUSH:
|
||||
if (!ev || ev->xbutton.button == 0) break;
|
||||
|
@ -34,8 +34,6 @@ public:
|
||||
///
|
||||
virtual int workHeight() const { return work_area->h; }
|
||||
///
|
||||
virtual void resize(int xpos, int ypos, int width, int height);
|
||||
///
|
||||
virtual void redraw() const {
|
||||
fl_redraw_object(work_area);
|
||||
fl_redraw_object(scrollbar);
|
||||
|
Loading…
Reference in New Issue
Block a user