trichview.com

trichview.support




Re: Item numbers


Return to index


Author

Message

Benedikt Weber

Posted: 05/06/2002 10:50:51


I only have a problem when the user deletes the table. How can I make an

item unmodifiable or undeleteable? Or how can I at least detect, whether the

item is still there and my pinter is valid?


Benedikt


"Benedikt Weber" <[email protected]> wrote in message

news:[email protected]...

> It's a statistics program that does some calculations and shows the result

> as tables and charts in a report. The user should be able to write some

> descriptive text into the report. When the calculation is changed, the

> program should update the numbers in the tables but leave the user input

> unchanged.

>

> The following code seems to work. Each time the Button is pressed, the

> values of table are adjusted. And it work even if some text is inserted

> manually into the document. Any other (better) suggestions?

>

> In Unit1.h

> ------------

>

> private: // User declarations

>     double first_entry;

>     TRVTableItemInfo* link_to_table;

>

>

> In Unit1.cpp

> --------------

>

>

//--------------------------------------------------------------------------

> -

> __fastcall TForm1::TForm1(TComponent* Owner)

>     : TForm(Owner), first_entry(0)

> {

>     link_to_table= new TRVTableItemInfo(2,4,RichViewEdit1->RVData);

>     RichViewEdit1->AddItem("table",link_to_table);

> }

>

>

//--------------------------------------------------------------------------

> -

>

> void __fastcall TForm1::Button1Click(TObject *Sender)

> {

>     ++first_entry;

>     for (int i=0;i<2; ++i){

>         for (int j=0; j<4; ++j) {

>             link_to_table->Cells[i][j]->Clear();

>             link_to_table->Cells[i][j]->AddNL(i*10+first_entry+j,0,0);

>         }

>     }

>     link_to_table->Changed();

>     RichViewEdit1->Format();

> }

>

//--------------------------------------------------------------------------

> -

>

>

>

> "Sergey Tkachenko" <[email protected]> wrote in message

> news:[email protected]...

> > All items are numbered sequentially, from 0 to ItemCount-1.

> > RichView does not store item numbers, item numbers are actual position

of

> > item in the internal lists of items.

> > So if you insert/delete items, numbers of others change.

> >

> > But as for items of table cells, they are not items of root document

(only

> > table is an item of it), they are items of subdocuments (each cell is a

> > subdocument)

> > (there is a special class allowing to number all items sequentially,

> > including all item of tables (it is undocumented, but I can explain, if

> you

> > need).

> >

> > There are several possible approaches to storing links to items.

> > Can you give more details about your problem?

> >

> >

> > > I would like to use RichViewEdit for a report where some of the text

can

> > be

> > > entered and modified by the user but other text (numbers in tables) is

> > > generated by the program.

> > >

> > > As I see it, I should be able to have a link to the items that were

> > > generated by the program, so they can be updated. One possibility

would

> be

> > > to save the item numbers. How the items numbered. What happens when a

> user

> > > inserts a new item in the editor? Do the other numbers change? Or is

it

> > > possible to just keep pointers to items and modify the items through

> these

> > > pointers?

> > >

> > > Benedikt

> > >

> > >

> >

> >

>

>





Powered by ABC Amber Outlook Express Converter