xBrowse - SaveState()/RestoreState() - Persistent objects

xBrowse - SaveState()/RestoreState() - Persistent objects

Postby frose » Wed Apr 29, 2009 12:42 pm

Hi to all,

As far as I can see, the xBrowse methods SaveState() and RestoreState() are only functional for simple browses. If there are more complex ones with selected columns, with code blocks for <bStrData> not only defined for a field, with differentiated color definitions for columns and/or for cells, freezed columns, etc. these functions fails.

If I'm wrong, please help to clarify.

If I’m right, the following question comes up:

xHarbour has the abstract base class ‘HBPersistent()’. Here is the description from the help file:
The HBPersistent() class is an abstract class for the creation of persistent objects. When user-defined classes should become persistent, they must inherit from HBPersistent() which provides methods for converting an object to/from a binary string and/or file on disk.
All instance variables declared with the PERSISTANT attribute are preserved and re-assigned when a persistent object is converted to a binary string and back to the Object data type.
Note: if code blocks are stored in instance variables of a persistent object, the same restrictions apply as outlined with function HB_Serialize().

With HBPersistent() it should be possible to create an extended TXBrowse class with all involved instance variables having the PERSISTENT attribute.

Unfortunately my OOP know-how is very poor :oops:, so without assistance I'm not able to realize this topic by myself.

Perhaps someone else has implemented this or a similar feature in one of his projects and is willing to share the source?

Or FivTech has this feature already on his road map? If not, put it on it :)

Perhaps it's opportune to implement this feature also in other classes or even in the window class, so we have the advantage of persistent objects not only for TXBrowse?

By the way: My old console app, which I want to migrate to FiveWin, has just this feature for dialog boxes. It's based on the 3-party tool called "SAA-CUA-Bausteine für Clipper 5.01", (C)opyright 1991,1992 by Ivo Wessel!
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: xBrowse - SaveState()/RestoreState() - Persistent objects

Postby frose » Sun May 03, 2009 8:09 am

Solved.

In my test app <nRowHeight> was NIL, so RestoreSave( cState ) has done nothing!
Adding e.g. 'oBrw:nRowHeight := 18' solves it!
Can't understand the reason of this 'pitfall'

Persistent objects no issue here?

Why?
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Giovany Vecchi, Google [Bot] and 72 guests