On 25-Jul-2001 Lars Gullik Bj�nnes wrote:
>| I also posted a question yesterday and did not get any answer! We NEED
>| freespacing mode in InsetERT (and maybe we could need it in other insets
>| too InsetNote comes in my mind for this!) Can I start introducing this
>| on LyXText basis?
>
> As I have said earlier, I belive that InsetText is really the wrong
> "backend" for InsetERT. There should be some "editor inset,
> InsetEditor" instead that works like a simple plain text editor.
>
> I also belive that the freespacing stuff is a hack to overcome that
> editor problem. So IMHO the freespacing stuff should be removed and a
> InsetEditor created.
Well if you can do this for 1.2.0 I would say go for it, but IMO you're
overlooking quite a lot of stuff (finally I made the InsetText and know
what to look at) and a lot of code duplication you won't have using a
single inset. Anyway we need this now. It's NOT a hack (just one bool)
it's NO file-format change doing it the way I said, so I'll propose a patch
for this and I'll only accept a "Stop" if you can come up with the propper
solution before we release 1.2.0.
>| One more thing. We need a check-function before Pasting text in any
>| region of LyX! Do you have an idea where to put such a function?
>
> What methods is in the pasting chain?
Well looking for this I've just seen that ?Jean-Marc? already inserted
some code in bool Paragraph::insertFromMinibuffer(pos) where he checks
for permitted insets (good move). Here we would also have to call a
function with the "character" and insert the "returned" one if !0.
Something like:
if (checkInsertChar(minbuffer_char, minibuffer_font))
insertChar(pos, minibuffer_char, minibuffer_font);
bool Paragraph::checkInsertChar(Paragraph::value_type & c, LyXFont & font)
{
if (pimpl_->inset_owner)
return pimpl_->inset_owner->checkInsertChar(c, font);
return true;
}
Should be easy and clean shouldn't it?
J�rgen
--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. J�rgen Vigna E-Mail: [EMAIL PROTECTED]
Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Only great masters of style can succeed in being obtuse.
-- Oscar Wilde
Most UNIX programmers are great masters of style.
-- The Unnamed Usenetter