Mike has explained how to set MemberClass/Memberclasslibrary. The concept is not only implemented for Pageframes, also for grids, thus this isn't named more specific to only allow page classes, but members of a pageframe are pages, nothing else qualifies. The container idea is on a totally different page (pun intended), it's a totally different alternative solution, should you not like the memberclass idea.
In regard of the empty page with + tab. Yes, the memberclass appraoch will already let page2 be such a page WITH controls, but why bother. The moment the user activates the + page you only need to change its caption as it already is a page waiting for data to display and you only need to set its data bindings. The next page you create can be like this one, already having the controls to display the next search result, but with caption +, As the + page never is seen, it doesn't need to be empty. If you think about this as waste of memoery, think about how much RAM todays computers have, but not too long. This concern would be totally unnecessary.
If you want a last page to always remain empty, rather use the container idea. Each page then can have no container, or the container, even different containers are possible. You may also use pageframe.addobject to add your page class and can simply specify the pageclass to use as parameter, not setting memberclass and memberclasslibrary at all. Likewise the objects you can add have to be rooted in the native page class, but could then easily be a class differing per page, if you extend the search capability of your form to produce different types of search results needing different UI designs.
Stanlyn said:
I intend to handle the different data sessions from the same table by using "select fields from table where xxxx into cursor curDataX'). Where X equals the originally assigned page number. Each session must be data independent regarding filters, sorts and selection.
Get your terminology correct. What you create with a query is a cursor and it is created in an empty workarea with an alias - the name of the workarea - in the same session as source data is coming from, never in a different session.
There is nothing to fix in the query and your design to name the results with a suffix count, you just have to name things correctly, or your talking about problems always will not produce the right outcome for you, this is talking past each other.
A separate session means a whole new set of workareas, when you query in one session your result will be in the same session, always, there is no crossing of sessions, that's why they are allowing the same form (SCX or class) to run multiple times each having a private datasession, without the need for changing code to handle individual alias names. So - just by the way - showing the different results in a set of forms with each private datasession would allow you to always create the same cursor name (in form init, for example) and have identical bindings, yet another sort order and record pointer, as you have with a separate workarea, too. You could also put all these forms into one place with tabs by docking them, docking tabs will by default appear at the bottom, but this set of forms would surely be separate from the search form with the inpuit controls of filter criteria data, so you might stick with your pageframe.
Anyway, the main instrument is a class you can reuse. The subclassed controls are just the basis of such compositions as containers or pages, which on the next level can be combined with each other. OOP does only start with subclassed base controls, this is not the end of it. Anytime you want any composition of two or more things you already have and add further code to combine these "things" and let them interact with each other, you do this as a new class. For example it makes total sense to have a container with your first level subclassed label and any other of your first level subclassed controls (yourtextbox, youreditbox, yourcombobox, etc) to have all the basic controls with a labels, like the checkbox control has natively, the container base class for all these label+subclass control combinations could have setting label.caption to the caption text in the current user language, for example, so you only write that code once in the "anycontrolwithlabel" container class only containing the label itself.
On a later level you put together containers or pages or base class forms with these controls rather than base or your first level subclasses. So controls appearing on an end user form are likely neither native base controls nor you first level subclass but part of third, fourth or fifth level classes. You also don't cook with neutrons and protons and electrons, but with higher level ingredients. Microsoft just provided the atoms.
To show a valid hierarchy:
[pre]
textbox (VFP base control)
|
+-anytextbox (first inheritance level)
label
|
+-anylabel (first inheritance level)
textbox (VFP base control)
|
+-anytextbox (first inheritance level)
editboxbox (VFP base control)
|
+-anyeditbox (first inheritance level)
container
|
+--anycontainer (first inheritance level)
|
+--labelledcontrolcontainer (second inheritance level)
| (with anylabel control inside and space for any other control, init code to internationalize the anylabel.caption)
|
+--labelledtextbox (third inheritance level)
| (inherits anylabel and adds anytextbox)
|
+--labellededitbox (third inheritance level)
| (inherits anylabel and adds anyeditbox)
|
+---...
.
.
page (VFP base control)
|
+--anypage (first inheritance level)
|
+--searchresultpage (second inheritance level)
with labelledtextbox1,2,3, labellededitox1,2,3, etc or named with their purpose rather, or field name of data they bind.
[/pre]
That doesn't mean it's a rule to only only add one further control/sub object per inheritance level, but the higher the inheritance level, the more specialized the lower the inheritance level, the lower the usefulness as a member class on the final class levels and end user forms. Once you have labelledcontrols classes you will neither put native controls on a form you design, nor the first level "any"control classes, unless you really just want a basic control without a label. But even then you may set the visible of the label .f. or the caption to empty string to get there, because features needed throughout any form and control are not implemented on the any level.
The first "any" level is merely there to put in code/behaviour you need in any and whatever specialization. There are very few things, that belong there, but certainly workarounds of bugs, behaviour you want differnt from VFFP native behaviour or such things. So the first level mainly has the purpose you can add code and properties all further inheritance levels inherit and only is necessary, because you can't change the VFP native controls, your changes can only start at your first inheritance level. Prefixing this level with "any" makes clear changes on this level really affect any further level down the inheritance chain.
I hope this will give you a better idea of how to continue from having the first level subclasses. Any level of inheritance should address one major topic and you start combining higherr level classes only, otherwise you lose the ability to affect the compositions in the base levels. It would make no sense at all to base a datefrom/to control with two date textboxes using native textboxes, you compose this from ayntextboxes at least, maybe even two labelledtextboxes containers to be able to afffect this complex control via changing the base classes. One main thing the labelledcontainer with the anylabel inside it eneables you to do, for example, is have one and only one single place to define font and fontsize for any label in your forms. This is, where the strength of OOP shows later. It's a cumbersome and tedious thing to prepare all these levels before you start implementing your final goals, but it's worth it.
Bye, Olaf.