From 780df3a0799eee25180e1e6430fcbcf0a9080dc7 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 11 Dec 1995 17:36:57 +0000 Subject: [PATCH] Aggiunta gestione di get e set_picture ai form items git-svn-id: svn://10.65.10.50/trunk@2272 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/form.cpp | 65 ++++++++++++++++++++++++++++-------------------- include/form.h | 9 ++++--- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/include/form.cpp b/include/form.cpp index 58353d833..cdcefe2f5 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -663,6 +663,18 @@ bool TForm_item::edit(TMask& m) return dirty; } +const TString& TForm_item::picture() const +{ + CHECK(0, "Can't get the picture of a generic form item!"); + return _prompt; +} + +void TForm_item::set_picture(const char*) +{ + CHECK(0, "Can't set the picture of a generic form item!"); +} + + /////////////////////////////////////////////////////////// // TForm_subsection /////////////////////////////////////////////////////////// @@ -866,14 +878,13 @@ protected: virtual const char* get() const; bool set(const char*); - const TString& picture() const { return _picture; } - TFieldref& field(int i) const { return (TFieldref&)_field[i]; } void put_paragraph(const char* s); public: + virtual const TString& picture() const { return _picture; } + virtual void set_picture(const char* p) { _picture = p; } - void set_picture(const char* p) { _picture = p; } virtual bool edit(TMask& m); TForm_string(TPrint_section* section) : TForm_item(section) {} virtual ~TForm_string() {} @@ -1030,7 +1041,7 @@ void TForm_string::put_paragraph(const char* s) _effective_height= i - (_prompt.not_empty() ? 1 : 0); } else - string_at(-1, _y, s); + string_at(-1, _y, s); } @@ -2782,30 +2793,30 @@ bool TForm::write_profile() void TForm::init() { - _relation= NULL; - _cursor= NULL; - _rel_desc= NULL; - _isnew= FALSE; - _fontname= "Roman 17cpi"; - _fontsize= 12; - _x= 0; - _y= 0; - _char_to_pos= '\0'; - _ipx= 0; - _ipy= 0; - _fpx= 0; - _arrange= TRUE; - _fink= "+,+,+,+,+,+,+,+,+,-,|"; - _fink.separator(','); - _dirty= FALSE; + _relation= NULL; + _cursor= NULL; + _rel_desc= NULL; + _isnew= FALSE; + _fontname= "Roman 17cpi"; + _fontsize= 12; + _x= 0; + _y= 0; + _char_to_pos= '\0'; + _ipx= 0; + _ipy= 0; + _fpx= 0; + _arrange= TRUE; + _fink= "+,+,+,+,+,+,+,+,+,-,|"; + _fink.separator(','); + _dirty= FALSE; } void TForm::read(const char* name, const char* code, int lev, const char* desc) { - _name= name; - _code= code; - _editlevel= lev; - _desc= desc; + _name= name; + _code= code; + _editlevel= lev; + _desc= desc; main_app().begin_wait(); @@ -2872,13 +2883,13 @@ void TForm::read(const char* name, const char* code, int lev, const char* desc) TForm::TForm() { - init(); + init(); } TForm::TForm(const char* name, const char* code, int lev, const char* desc) { - init(); - read(name, code, lev, desc); + init(); + read(name, code, lev, desc); } TForm::~TForm() diff --git a/include/form.h b/include/form.h index a85387366..9869675dd 100755 --- a/include/form.h +++ b/include/form.h @@ -134,8 +134,8 @@ class TForm : public TObject bool ps_change_number_format(TPrint_section& s, int w, int dec, const char* p); protected: - void init(); // inizializza il form - void read(const char* form, const char * code = "", int editlevel = 0, const char* desc = ""); // carica il form dal file specificato + void init(); // inizializza il form + void read(const char* form, const char * code = "", int editlevel = 0, const char* desc = ""); // carica il form dal file specificato // H = Header, B = Body, F = Footer, R = Relation TPrint_section& section(char s = 'B', word page = 1); @@ -295,7 +295,10 @@ public: virtual const char* get() const { return _prompt; } virtual bool set(const char* s) { _prompt = s; return TRUE; } - const char* prompt() const { return _prompt; } + const TString& prompt() const { return _prompt; } + + virtual const TString& picture() const; // Da' CHECK + virtual void set_picture(const char*); // Da' CHECK TPrint_section& section() const { return *_section; } TForm& form() const { return _section->form(); }