From cc780330cca9844c7d668fc33a63c00b04b738a9 Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 21 Jun 2002 02:58:54 +0000 Subject: [PATCH] resize/redraw changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4451 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 10 ++++++++++ src/frontends/qt2/QContentPane.C | 6 ++---- src/frontends/qt2/QLyXKeySym.h | 13 +++++++++++-- src/frontends/qt2/QWorkArea.C | 6 ------ src/frontends/qt2/QWorkArea.h | 2 -- src/frontends/qt2/qscreen.C | 2 ++ src/frontends/screen.C | 1 - 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index b725495186..19fa53aeb0 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,13 @@ +2002-06-21 John Levon + + * QContentPane.C: restore calls to workAreaResize() + + * QLyXKeySym.h: tidy + + * QWorkArea.h: remove redraw() + + * QWorkArea.C: remove resize() + 2002-06-20 John Levon * guiapi.C: createIndex() changed diff --git a/src/frontends/qt2/QContentPane.C b/src/frontends/qt2/QContentPane.C index 4274b91f8d..63642c8054 100644 --- a/src/frontends/qt2/QContentPane.C +++ b/src/frontends/qt2/QContentPane.C @@ -136,7 +136,7 @@ void QContentPane::resizeEvent(QResizeEvent *) } pixmap_->resize(width(), height()); - // FIXME wa_->workAreaResize(); + wa_->workAreaResize(); } @@ -144,9 +144,7 @@ void QContentPane::paintEvent(QPaintEvent * e) { if (!pixmap_.get()) { pixmap_.reset(new QPixmap(width(), height())); - // FIXME: hmm. We do this to get an /initial/ - // painting. So it's wrong. - // FIXME wa_->workAreaResize(); + wa_->workAreaResize(); return; } diff --git a/src/frontends/qt2/QLyXKeySym.h b/src/frontends/qt2/QLyXKeySym.h index 48651796dd..05147e103a 100644 --- a/src/frontends/qt2/QLyXKeySym.h +++ b/src/frontends/qt2/QLyXKeySym.h @@ -27,18 +27,21 @@ class QLyXKeySym : public LyXKeySym { public: QLyXKeySym(); + virtual ~QLyXKeySym() {} + + /// delayed constructor void set(int key, QString const & text); + /// set from a LyX symbolic name virtual void init(string const & symbolname); - virtual ~QLyXKeySym() {} - /// Is this a valid key? virtual bool isOK() const; /// Is this a modifier key only? virtual bool isModifier() const; + /// return the LyX symbolic name virtual string getSymbolName() const; /** @@ -51,7 +54,13 @@ public: virtual bool operator==(LyXKeySym const & k) const; private: + /// the Qt sym value int key_; + /** + * The generated text from the symbol. This will only be + * filled when the QLyXKeySym is used to pass a key press + * event, not when stored in a kbsequence etc. + */ QString text_; }; diff --git a/src/frontends/qt2/QWorkArea.C b/src/frontends/qt2/QWorkArea.C index f7a6c779e0..8cb8dde4dd 100644 --- a/src/frontends/qt2/QWorkArea.C +++ b/src/frontends/qt2/QWorkArea.C @@ -70,12 +70,6 @@ QWorkArea::~QWorkArea() } -void QWorkArea::resize(int xpos, int ypos, int width, int height) -{ - setGeometry(xpos, ypos, width, height); -} - - void QWorkArea::setScrollbarParams(int h, int pos, int line_h) { // do what cursor movement does (some grey) diff --git a/src/frontends/qt2/QWorkArea.h b/src/frontends/qt2/QWorkArea.h index d85d05a3d7..f991d358dc 100644 --- a/src/frontends/qt2/QWorkArea.h +++ b/src/frontends/qt2/QWorkArea.h @@ -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(); } - /// FIXME: makes no sense ? - virtual void redraw() const { } /// virtual void setScrollbarParams(int height, int pos, int line_height); diff --git a/src/frontends/qt2/qscreen.C b/src/frontends/qt2/qscreen.C index c7d7885ca1..116d66c4de 100644 --- a/src/frontends/qt2/qscreen.C +++ b/src/frontends/qt2/qscreen.C @@ -136,6 +136,8 @@ void QScreen::hideCursor() void QScreen::expose(int x, int y, int exp_width, int exp_height) { + lyxerr[Debug::GUI] << "expose " << exp_width << "x" << exp_height + << "+" << x << "+" << y << endl; owner_.getContent()->update(x, y, exp_width, exp_height); } diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 3322d112f5..a4b1f86afc 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -286,7 +286,6 @@ void LyXScreen::redraw(LyXText * text, BufferView * bv) cursor_visible_ = false; bv->showCursor(); } - } -- 2.39.2