From 04274e03dcb5054a57f12371ea9d161e0c911a3d Mon Sep 17 00:00:00 2001 From: pirro Date: Tue, 28 Feb 1995 10:30:50 +0000 Subject: [PATCH] Aggiunto userdata ai campi delle maschere git-svn-id: svn://10.65.10.50/trunk@1046 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/mask.cpp | 6 ++++++ include/mask.h | 4 ++++ include/maskfld.cpp | 8 +++++++- include/maskfld.h | 9 +++++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/include/mask.cpp b/include/mask.cpp index 0633d865d..c90b44df6 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -33,6 +33,12 @@ bool TMask::test_focus_change(WINDOW next) set_focus(); prev.set_focusdirty(FALSE); } + // NUOVO + else + { + if ( prev.focusdirty() ) + ok = on_dirty( prev ); + } } return ok; } diff --git a/include/mask.h b/include/mask.h index b25f68778..10705612b 100755 --- a/include/mask.h +++ b/include/mask.h @@ -47,6 +47,7 @@ class TMask : public TWindow TFilename _source_file; // Source file of the mask TFilename _workfile; // Name of savefile + long _lastpos; // last read offset on savefile real _exchange; // Current value exhange @@ -190,6 +191,9 @@ public: virtual const char* get_caption() const; virtual void set_caption(const char* c); + + virtual bool on_dirty( TMask_field& c ); + }; #endif // __MASK_H diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 602bbeea3..86a530e2d 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -1,4 +1,4 @@ -// $Id: maskfld.cpp,v 1.81 1995-02-17 09:16:51 villa Exp $ +// $Id: maskfld.cpp,v 1.82 1995-02-28 10:30:44 pirro Exp $ #include #include @@ -222,6 +222,12 @@ bool TMask_field::parse_item(TScanner& scanner) return TRUE; } + if ( scanner.key() == "CU") // CUSTOM DATA + { + _userdata.add(scanner.string()); + return TRUE; + } + if (scanner.key() == "ME") { if (_message.objptr(0) == 0) diff --git a/include/maskfld.h b/include/maskfld.h index 5aa825b24..15eceac72 100755 --- a/include/maskfld.h +++ b/include/maskfld.h @@ -1,4 +1,4 @@ -/* $Id: maskfld.h,v 1.24 1995-02-09 14:47:24 guy Exp $ */ +/* $Id: maskfld.h,v 1.25 1995-02-28 10:30:50 pirro Exp $ */ #ifndef __MASKFLD_H #define __MASKFLD_H @@ -40,6 +40,9 @@ class TMask_field : public TObject TBit_array _keys; // The keys the field belongs to TBit_array _groups; // The groups the field belongs to + // nuovo + TToken_string _userdata; // User Data + protected: // @DPROT static int _x, _y; // Coordinate of the control @@ -168,8 +171,10 @@ public: void set(const char* s); TString& get() const; + TToken_string& custom_data() { return _userdata }; + virtual const char* picture_data(const char* data, bool video); - virtual const char * warning() { return "";} + virtual const char* warning() { return "";} virtual bool autoload(const TRelation* r = NULL); bool autosave(TRelation* r = NULL) const;