Enumerations & Some Handy Stand-Alone Service Objects
John Fauss
CODE AUTHOR
Posts: 7
John Fauss created the code: Enumerations & Some Handy Stand-Alone Service Objects
Have you ever wondered about the actual numeric value of PowerBuilder enumerations? Did you know that not all enumeration item values begin at zero, or that there are gaps in the numeric values for some enumerations? Now you can list the numeric equivalents to any PB enumeration.
A simple, single-window application has been created that will list all of the enumeration item name/value pairs for any enumerated type you select. The application uses the PB TypeDefinition and EnumerationDefinition objects to dynamically obtain this information, listing the name/value pairs in a DataWindow. The list can be sorted by either the item value or the item name by clicking on a column's heading. The list can also be printed. PowerBuilder versions 2017 through 2021 are supported.
But Wait, There's More...
As a bonus, the application contains stand-alone "service" objects adapted from the PowerBuilder Foundation Class (PFC) libraries. Included are: A window resize service, a DataWindow drop-down search service, and a DataWindow sort service. Each can be easily integrated into a non-PFC application.
The drop-down search service object contains two enhancements not currently available in the PFC: (1) The ability for the user to optionally enter a value that does not exist in the child DataWindow, and (2) the ability to optionally perform a case-sensitive search as an alternative to the standard case-insensitive search. Both of these features are controllable via object functions. A descendant DataWindow user object inherited from the base DataWindow control is included that demonstrates how easy it is to add this functionality to a non-PFC application.
The stand-alone DataWindow sort service does not include the drawing of sort direction markers nor does it include support for the display of any Sort specification dialog windows... features available in the PFC. A second descendant DataWindow user object inherited from the base DataWIndow control shows you how to include this service into a non-PFC application.
The stand-alone version of the window resize service includes all of the functionality available in the PFC version.
Step-by-step instructions on how to integrate each of these service objects into a non-PFC application are available in the code comments.
A simple, single-window application has been created that will list all of the enumeration item name/value pairs for any enumerated type you select. The application uses the PB TypeDefinition and EnumerationDefinition objects to dynamically obtain this information, listing the name/value pairs in a DataWindow. The list can be sorted by either the item value or the item name by clicking on a column's heading. The list can also be printed. PowerBuilder versions 2017 through 2021 are supported.
But Wait, There's More...
As a bonus, the application contains stand-alone "service" objects adapted from the PowerBuilder Foundation Class (PFC) libraries. Included are: A window resize service, a DataWindow drop-down search service, and a DataWindow sort service. Each can be easily integrated into a non-PFC application.
The drop-down search service object contains two enhancements not currently available in the PFC: (1) The ability for the user to optionally enter a value that does not exist in the child DataWindow, and (2) the ability to optionally perform a case-sensitive search as an alternative to the standard case-insensitive search. Both of these features are controllable via object functions. A descendant DataWindow user object inherited from the base DataWindow control is included that demonstrates how easy it is to add this functionality to a non-PFC application.
The stand-alone DataWindow sort service does not include the drawing of sort direction markers nor does it include support for the display of any Sort specification dialog windows... features available in the PFC. A second descendant DataWindow user object inherited from the base DataWIndow control shows you how to include this service into a non-PFC application.
The stand-alone version of the window resize service includes all of the functionality available in the PFC version.
Step-by-step instructions on how to integrate each of these service objects into a non-PFC application are available in the code comments.
This message has an attachment file.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.