On 01-Apr-2000 Dekel Tsur wrote:
> I'm considering of adding a new inset (InsetNumber) for the purpose of
> entering numbers in Right-To-Left text: when you press a digit key, instead
> of inserting the digit into the current paragraph, a InsetNumber is inserted
> and the digit is inserted to the inset.
> 

I really don't see the advantage of such an inset? Could you enlighten me?

> I've implemented this inset as a derived class of InsetText. In this process,
> I've encountered several bugs in InsetText. Before I list them, I want to
> ask general question about the text inset:
> 
> 1. What is its purpose? Is it supposed to replace the LyXText class?
> 

No! In contrary I really would like LyXText to format the insettext in future!
Just now LyXText is quite a mess and has to be cleaned up. So consider the
InsetText just in a transitional state! (I would like to code the InsetTabular
soon and so substitute the LyXTable and so we can clean up LyXText a LOT :)

> 2. Is it in a usable state? (if not, I can make the InsetNumber a derived
> class of InsetFormula).
> 

Well you may try but I guess that InsetFormula is more instable then InsetText
and I guess the whole MathInsets should be recoded ;) (and as much as I know
Alejandro was working on this last time I heard from him - long time ago -
WHERE ARE YOU ALEJANDRO!)

> The bugs:
> 
> 1. The cursor has wrong position after inserting/deleting a character
> (try a putting an text inset in a right aligned paragraph).
> The problem is that in InsetText::UpdateLocal, the cursor positioned is
> recomputed before the x position of the inset is recomputed.
> Here is a fix:
> 
> --- /home/dekel/lyx/src/insets/insettext.C    Fri Mar 31 14:02:32 2000
> +++ insets/insettext.C        Sat Apr  1 01:42:47 2000
> @@ -1308,9 +1308,10 @@ void InsetText::UpdateLocal(BufferView *
>      if (flag) {
>       computeTextRows(bv->painter(), xpos);
>       computeBaselines(top_baseline);
> -     resetPos(bv);
>      }
>      bv->updateInset(this, flag);
> +    if (flag)
> +     resetPos(bv);
>      ShowInsetCursor(bv);
>  }
> 

Ok this is good and I'll fix this. Thanks!

> 2. In InsetText::LocalDispatch, there are two lines
>     par->SetFont(actpos,real_current_font);
> (after inserting a char) but I think they should be
>     SetCharFont(actpos,current_font);
> 

Maybe I'll have a look!

> 3. If you put a text inset in a Title paragraph, the display font inside 
> the inset is still the default font (instead of being a large bold font).
> 

Well I really don't know but I'll have a look to!

> Also, if you change the font of a selection containing a text inset, the
> display font inside the inset doesn't change.

This should not be done!

GENERAL NOTE: InsetText should NOT be used as is. This means it should be
              used only as derived class for some special stuff. Special
              stuff is it should be used to implement some features like
              minipages, tabulars, footnotes, marginnotes etc.

Greets Jürgen

P.S.: I'm surely happy if someone helps me to fix all the bugs still present
      in InsetText (well let's say missing features as all of you know my
      code doesn't have bugs ;)

-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Dr. Jürgen Vigna                      E-Mail: [EMAIL PROTECTED]
Italienallee 13/N                     Tel:    +39-0471-450260
I-39100 Bozen                         Fax:    +39-0471-450296
ITALY                                 Web:    http://www.sad.it/~jug

Short people get rained on last.

-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Reply via email to