Re: question about cursor

2008-03-13 Thread Stefan Schimanski
Am 13.03.2008 um 18:31 schrieb Andre Poenitz: On Thu, Mar 13, 2008 at 01:07:14AM +0100, Stefan Schimanski wrote: This works: if (cmd.x < xo(cur.bv()) + ADD_TO_TABULAR_WIDTH || cmd.x > xo(cur.bv()) + tabular.width()) { row_type r = 0; int h = yo(cur.bv()) - tabular.rowA

Re: question about cursor

2008-03-13 Thread Andre Poenitz
On Thu, Mar 13, 2008 at 01:07:14AM +0100, Stefan Schimanski wrote: > This works: > > if (cmd.x < xo(cur.bv()) + ADD_TO_TABULAR_WIDTH > || cmd.x > xo(cur.bv()) + tabular.width()) { > row_type r = 0; > int h = yo(cur.bv()) - tabular.rowAscent(0); > for (;r < tabular.rowCount()

Re: question about cursor

2008-03-13 Thread Edwin Leuven
Stefan Schimanski wrote: This works: great, thanks!

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
This works: if (cmd.x < xo(cur.bv()) + ADD_TO_TABULAR_WIDTH || cmd.x > xo(cur.bv()) + tabular.width()) { row_type r = 0; int h = yo(cur.bv()) - tabular.rowAscent(0); for (;r < tabular.rowCount() && cmd.y > h; ++r) { h += tabular.rowAscent(r);

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: White board? The text background? some padding defined by ADD_TO_TABULAR_WIDTH at the beginning of InsetTabular.cpp

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: Look in BufferView::mouseEventDispatch: Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x, cmd.y); So only the inset below the cursor will get the event. it s getting the event alright, you're clicking on the white border the attached patch incr

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 13.03.2008 um 00:42 schrieb Edwin Leuven: Stefan Schimanski wrote: Why should the table get this mouse event after all if the mouse is not over the table, but left on it? there is a white border around it White board? The text background? Stefan

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: Why should the table get this mouse event after all if the mouse is not over the table, but left on it? there is a white border around it

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Look in BufferView::mouseEventDispatch: Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x, cmd.y); So only the inset below the cursor will get the event. Stefan Am 13.03.2008 um 00:37 schrieb Stefan Schimanski: Am 13.03.2008 um 00:23 schrieb Edwin Leuven: Stefan Sch

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 13.03.2008 um 00:23 schrieb Edwin Leuven: Stefan Schimanski wrote: Can you send me a complete patch of your changes? attached. it defines a new lfun that selects a row (once you're in tabular) the part that doesn't work is this: // SELECT ROW if (cmd.x < xo(cur.bv()) + ADD_TO_TABULAR

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: Can you send me a complete patch of your changes? attached. it defines a new lfun that selects a row (once you're in tabular) the part that doesn't work is this: // SELECT ROW if (cmd.x < xo(cur.bv()) + ADD_TO_TABULAR_WIDTH || cmd.x > xo(cur.bv()) + tabular.width(

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 13.03.2008 um 00:07 schrieb Edwin Leuven: Stefan Schimanski wrote: Do a cur.bv().cursor() = cur; or something similar. doesn't do diddly either Can you send me a complete patch of your changes? Stefan

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: Do a cur.bv().cursor() = cur; or something similar. doesn't do diddly either

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 12.03.2008 um 23:58 schrieb Edwin Leuven: Stefan Schimanski wrote: What do you want to do exactly? select a table row when you click in front of it while the cursor is outside the table i added the following in InsetTabular::doDispatch when handling case LFUN_MOUSE_PRESS: // SELEC

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: What do you want to do exactly? select a table row when you click in front of it while the cursor is outside the table i added the following in InsetTabular::doDispatch when handling case LFUN_MOUSE_PRESS: // SELECT ROW if (cmd.x < xo(cur.bv()) + ADD_TO_TABULAR_WI

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 12.03.2008 um 23:43 schrieb Edwin Leuven: Stefan Schimanski wrote: So you have to push the inset of the table on the cursor: cur.push(theTableInset); tried that too, doesn't work either... What do you want to do exactly? Maybe it's what Andre was suggesting: you have to make sure that

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: So you have to push the inset of the table on the cursor: cur.push(theTableInset); tried that too, doesn't work either...

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 12.03.2008 um 23:33 schrieb Edwin Leuven: Stefan Schimanski wrote: Look in InsetMathNest::handleNest(...). I do exactly this for math. i already tried something like like that, and now did this: cur.idx() = tabular.getFirstCellInRow(r); cur.pos() = 0; cur.resetAnchor(); cur.idx() = tabul

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: Look in InsetMathNest::handleNest(...). I do exactly this for math. i already tried something like like that, and now did this: cur.idx() = tabular.getFirstCellInRow(r); cur.pos() = 0; cur.resetAnchor(); cur.idx() = tabular.getLastCellInRow(r); cur.pos() = cur.lastpos(

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 12.03.2008 um 21:43 schrieb Edwin Leuven: Stefan Schimanski wrote: * go to first cell * go to last cell and how do i do this? Look in InsetMathNest::handleNest(...). I do exactly this for math. Stefan

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Edwin Leuven wrote: Stefan Schimanski wrote: * go to first cell * go to last cell and how do i do this? difficult or trivial?

Re: question about cursor

2008-03-12 Thread Andre Poenitz
On Wed, Mar 12, 2008 at 09:23:59PM +0100, Edwin Leuven wrote: > i am trying to get some row selection code working in insettabular, but am > baffled by this cursor business > > the scenario is the following: > > the cursor is outside the tabular > > at the moment, on mouse press, i check in front

Re: question about cursor

2008-03-12 Thread Edwin Leuven
Stefan Schimanski wrote: * go to first cell * go to last cell and how do i do this? thanks again!

Re: question about cursor

2008-03-12 Thread Stefan Schimanski
Am 12.03.2008 um 21:23 schrieb Edwin Leuven: i am trying to get some row selection code working in insettabular, but am baffled by this cursor business the scenario is the following: the cursor is outside the tabular at the moment, on mouse press, i check in front of what row i click this

question about cursor

2008-03-12 Thread Edwin Leuven
i am trying to get some row selection code working in insettabular, but am baffled by this cursor business the scenario is the following: the cursor is outside the tabular at the moment, on mouse press, i check in front of what row i click this i do in InsetTabular::doDispatch now i want to