Visit Gigasoft's Web Site
ProEssentials v8 Help

Chapter 6: Original and Custom Parameter Sets

 

Note: generally obsolete content, you shouldn't have to know this!

 

Briefly

The Custom Parameter Set is an alternate set of properties that the end-user can adjust which supports the ability to quickly switch between the default-programmed state and any user-modified state. If NoCustomParms is set to FALSE, any time the end-user uses the customization dialog or popup menu, the Custom Parameter Set is invoked . The end-user can then click the "Original" button to switch between the programmed set and the end-user altered set. This feature can add complexity to your project if the implementation is adding its own end-user interfaces.

 

Recommendations

We hope to phase out and eventually replace the Custom Parameter Set with an alternate solution. The replacement will hopefully be backward compatible but its not certain. However, the bottom-line is that using the Custom Parameter Set has potential to complicate the implementation. Programmers new to ProEssentials who are writing a complex implementation should leave this feature disabled until their project is nearing completion. Then if desired, enable and evaluate how much work it will take to support.

 

When version 3 was released, we recommended that the property NoCustomParms be set to TRUE. This disabled the Custom parameter set and you won't have to consider any material in this section. If you set NoCustomParms to FALSE, then pay extra attention to the information below.

 

Version 5 now defaults NoCustomParms to TRUE. This means if porting from v3 to v6, your controls will automatically lose the "Original Button" and the Custom Parameter Set logic if it was enabled. You can add one line of code to set NoCustomParms back to FALSE if you want to preserve this logic in your projects.

The Specifics

 

If a property is a customizable property, it will have a Custom version for the property. For example, ViewingStyle is a customizable property (the customization dialog allows the user to adjust this property) and its Custom version is PEP_nCVIEWINGSTYLE. ViewingStyle belongs to the Original parameter set and PEP_nCVIEWINGSTYLE belongs to the Custom parameter set. When looking at a property in the reference material, it notes if it supports the Custom Parameter Set.  Look in the file "PEGRPAPI.H" for the property to see if a customizable version is defined starting with "C".

 

The property Custom is used to control which of the two parameter sets is used in producing the objects image. IF Custom is TRUE, then the Custom parameter set is used, otherwise, the Original parameter set is used. When the user uses a customization dialog or popup menu, the Custom parameter set is being adjusted and Custom will be set to TRUE.

 

If you and your users will be making customizations to the graph (AllowCustomization or AllowPopup are TRUE), you may want to make sure Custom is set to FALSE any time you make programmatic customizations. Or if you want to preserve any current user customizations, you can set both the original and customer versions as follows. This can be tedious setting both custom and original properties. Setting NoCustomParms to TRUE will free you from worrying about the custom parameter set and you can set regular properties as needed.

 

The following code examples set both the Original and Custom parameter versions of the ScrollingSubsets and TableWhat properties. These properties were chosen by random and show the basic concept.

 

C / C++ Example

The handle hWndPE specifies a ProEssentials object previously created.

 

// Setting Original versions //

PEnset(hWndPE, PEP_nSCROLLINGSUBSETS, 1);

PEnset(hWndPE, PEP_nTABLEWHAT, PETW_ALLSUBSETS);

 

// Setting Custom versions //

PEnset(hWndPE, PEP_nCSCROLLINGSUBSETS, 1);

PEnset(hWndPE, PEP_nCTABLEWHAT, PETW_ALLSUBSETS);

  

PEreinitializecustoms(hWndPE);

PEresetimage (hWndPE, 0, 0);

InvalidateRect(hWndPE, NULL, FALSE);

 

Visual Basic Example

The Graph Object Pego1 is located in a form.

 

'** Setting Original versions **'

Pego1.ScrollingSubsets = 1

Pego1.TableWhat = PETW_ALLSUBSETS

 

'** Setting Custom versions **'

result = PEnset(Pego1.hObject, PEP_nCSCROLLINGSUBSETS, 1)

result = PEnset(Pego1.hObject, PEP_nCTABLEWHAT, PETW_ALLSUBSETS)

  

Pego1.PEreinitializecustoms()

Pego1.PEresetimage(0,0)

Pego1.PEinvalidate()

 

To summarize, if NoCustomParms is FALSE and AllowCustomization or AllowPopup is TRUE, and you will also be making programmatic customizations, you need to be aware of Custom. If not, you may make property adjustments and not see the graph change to reflect those new property adjustments.