From cfb72fba44d5796ec3d5928a90f9a64fb84519c7 Mon Sep 17 00:00:00 2001 From: angelo Date: Wed, 17 Apr 1996 16:40:51 +0000 Subject: [PATCH] Aggiunti i metodi: make_new_item(), copy_to_form_item() e dup() ai TForm_item, per effettuare la copia di una sezione. Reso pretected il membro _section. Il tutto per l'errore MI3347. git-svn-id: svn://10.65.10.50/trunk@2746 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/form.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/include/form.h b/include/form.h index 6984cf190..12ceb331f 100755 --- a/include/form.h +++ b/include/form.h @@ -492,7 +492,7 @@ public: // @cmember Rimuove uno o tutti i campi da stampare (chiama ) void destroy_field(int n, bool c = TRUE) { _item.destroy(n, c); } - // @cmember Ritmuove tutti i campi da stampare (chiama ) + // @cmember Rimuove tutti i campi da stampare (chiama ) void destroy_fields() { _item.destroy(); } // @cmember Viene sostiuito il campo di posizione

col campo

(chiama ) @@ -569,7 +569,7 @@ public: // @cmember Annulla (setta a -1) l'offset delle colonne se COLUMNWISE void reset_tabs(); - // @cmember Opertatore di assegnamento + // @cmember Operatore di assegnamento const TPrint_section& operator=(const TPrint_section& ps) { return copy(ps); } // @cmember Costruttore @@ -598,8 +598,6 @@ class TForm_item : public TObject // @access:(INTERNAL) Private Member - // @cmember:(INTERNAL) Sezione da stampare (vedi ) - TPrint_section* _section; // @cmember:(INTERNAL) Flag del campo (vedi ) TForm_flags _flag; // @cmember:(INTERNAL) Gruppi a cui appartiene il campo @@ -611,6 +609,8 @@ class TForm_item : public TObject // @access Protected Member protected: + // @cmember:(INTERNAL) Sezione da stampare (vedi ) + TPrint_section* _section; // @cmember Identificatore del campo short _id; // @cmember Coordinata X (in caratteri) del campo @@ -658,9 +658,24 @@ protected: // @cmember Cerca nella definizione della variabile

e ne ritorna // l'

-esimo elemento (0=tipo, 1=valore, 2=descrizione) const char* get_special_item(const char* s, int n) const; - + + // @cmember Crea un item (TForm_date, TForm_list...) e ne restituisce il puntatore + // TForm_item. Va ridefinita per ogni classe derivata da TForm_item. + // N.B. il membro _section deve rimanere protected, altrimenti le varie + // make_new_item() non potranno essere compilate. + virtual TForm_item* make_new_item() const; + // @cmember Restituisce un puntatore a TForm_item, nel quale sono copiati tutti + // i membri del presente oggetto. Viene chiamata dalla + // All'interno di questa funzione vi e' una discriminazione sul tipo di classe + // affinche' possa creare un opportuno item (data, lista, numero, stringa...). + // E' ovvio che per tali ultimi casi e' necessario un cast. Chiama la + // per creare un nuovo item. + TForm_item* copy_to_form_item() const; + // @access Public Member public: + // @cmember Duplica un TForm_item. Chiama la + virtual TObject* dup() const; // @cmember Ritorna il numero identificatore del campo short id() const { return _id; }