PFC Programmer's Reference Manual

Exclusive Excerpt from PFC Programmer's Reference Manual, by Richard Brooks

Appendices by Sharon Weinstrom Buntz, Jason Cohen, Glenn G. D’mello, Ken Howe, Greg Schultz and Brian Suter; List: $37.95, Published by Manning, ISBN # 1-88-477755-4

 

...The following are the ending sections of Appendix J - pfc_w_master,
written by Sharon Weinstrom Buntz

 

And what about the changes to pfc_w_master in the PFC 6.0 Release ?

As we mentioned earlier, the changes in thePFC 6.0 Release for pfc_w_master are drastic enough (and not finalized as of this writing) to merit leaving them out of the detailed discussions of every instance variable, event and function. Trying to weave the new ones in and talk about all of the changes would be too confusing anyway.

So, as hard as it is now to say with any certainty or any clear knowledge of what will actually be released in the next version, it is important to try ~ as you will probably be reading this after 6.0 is out.

The information contained below is current as of PFC 6.0 Beta 4 - Sept, 1997 to the best of my knowledge. To try to make this as useful and accurate as possible, I have obtained some help from the PFC Development Team themselves. However, they are very busy working on it even as I try to write about it!

So now, let’s take a quick look at what’s projected for the future 6.0 release of the PFC for pfc_w_master.

 


  1. In thePFC 6.0 Release, the Save Process in pfc_w_master will be dramatically enhanced…

of_SetUpdateObjects ( powerobject apo_objects[ ] ) returns integer

to specify on which objects and in what order the pfc_Save event will perform the updates, versus just defaulting to using the control array

-or-

pfc_SaveObjects ( powerobject apo_objects[ ] ) returns integer

to specify the objects and the order, and to also trigger pfc_Save; used for special, extra or separate save processes to augment the main one

So you would call the of_SetUpdateObjects( ) function when you need to change the content and/or the order of the controls that will be updated by the normal pfc_Save process. This content and order is then "remembered" so that whenever the normal pfc_Save process is triggered - pfc_Save knows what to update and in what order to update.

So you would trigger the new pfc_SaveObjects event to fire off a special save process that will specifically update only those controls which you pass to it, in the order that you pass them.

of_AcceptText( )
of_UpdatesPending( )
of_Validation( )
of_UpdatePrep( )
of_Update( )
of_PostUpdate( )

So each object is responsible for how to accomplish these tasks, for themselves, as well as any of their "components". Having these set of functions, an object now implements the coined phrase "Self-Updating Object Application Programming Interface (SUO API)". The following PFC objects now include these "self-updating objects" functions:

DataWindow
DataStore
ListView
*
TreeView
*
Tab
UserObject
Window

* Note: These 6.0 ListView and TreeView objects are new, separate PFC LV & TV objects which have the SUO API. This is for upwards compatibility issues. If you use these new objects, you no longer have to override events to have your ListViews and TreeViews update! Another option is to add the SUO API to your existing ListView and TreeView PFE layer objects (see next bullet), and change your pfc_w_master's pfc_save-related scripts.)

For example, if you were to create a Self-Updating Multi-Line Edit control (MLE) by adding the SUO API functions to it; And then you were to place that control on your window; Then, using the default processing, PFC will pick it up and include in the normal pfc_save process.

I suppose this may be because
there is no SUO API of_PreUpdate( ) equivalent of the window’s pfc_PreUpdate
as there is an SUO API of_PostUpdate( ) equivalent of the window’s
pfc_PostUpdate
instead, it uses SUO API of_UpdatePrep( ) equivalent of the window’s
pfc_UpdatePrep
which comes before the window’s
pfc_PreUpdate

 


  1. Next, in thePFC 6.0 Release, there will be a new "Most Recently Used (MRU) Window" Service.

(so that the MRU service knows how to store the key)
For example, you may wish to include the window name and any special parameters to pass for retrieval arguments

(to be done near the opening and/or near the closing of the window)

 


  1. Also, in thePFC 6.0 Release, the use of Constants makes our code more readable, especially when used to interpret return codes or to pass our arguments…
Public:
Constant Integer NO_ACTION = 0
Constant Integer CONTINUE_ACTION = 0
Constant Integer PREVENT_ACTION = 1

 


  1. Some other things worth mentioning in thePFC 6.0 Release are some exciting new visual user objects that can be placed on any pfc_w_master window…

u_st_SplitBar SplitBar

Now your application can have the "Explorer" look and feel, or
you can allow the user to easily maximize their window real estate.
You can use multiple splitbars on your window, and they work
in conjunction with the resize service

u_ProgressBar Progress Bar

Handier than its ActiveX counterparts

u_Calculator Calculator

Best suited for its DataWindow column uses,
but it can be placed on a window as well

u_Calendar Calendar

Best suited for its DataWindow column uses,
but it can be placed on a window as well,
possibly to select a processing period or something

 


  1. Furthermore, in thePFC 6.0 Release take note of a few enhancements to a couple of the pfc_w_master Window-related services…

n_cst_Resize Window Resize Service

New way to specify percentages of how to resize/move an object,
so you can have more control over how objects are resized & moved…
For example, if there is a main control that is more important,
that control can stretch faster than the others.

For example, before, there was no way to have two objects, side by side, stretch proportionally as the window stretches. You had to stretch one and move the other, but you couldn't stretch them both... With this enhancement, now you will be able to do this. Plus, you can say which one should stretch faster.

Sorry, the following enhancement to the existing n_cst_WinSrv_SheetManager is no longer targeted as of this writing for the PFC 6.0 Release; it was dropped. Perhaps it will be included in a later release or perhaps it was abandoned for some other reason. I don’t know.
n_cst_WinSrv_SheetManager Window Sheet Manager Service

Option to limit the total number of sheets which can be opened
Option to limit the number of sheets specified by class, title,etc

 


  1. And, lastly, in thePFC 6.0 Release, there is a new of_MessageBox( ) function in pfc_w_master. This function simply displays a PowerScript MessageBox. However its advantage is that you may manipulate the MessageBox prior to its actual display in any way that you need, to support multi-languages, append extra info, skip it or log it, etc. It takes all of the MessageBox arguments, plus an extra argument for the ID of the message…

of_MessageBox ( string as_id, string as_title, string as_text, icon ae_icon, button ae_button, integer ai_default) returns integer

Please note that this new function is encapsulated into other appropriate objects as well, such as the new pfc_n_base (ancestor of all non-visual user objects). Think of it along the same lines as the of_GetParentWindow( ) functions, which can be done on any of 23 different controls, such as a DataWindow, a Tab, a TabPage, a DataWindow on a TabPage within a Tab, a CommandButton - whatever, and it still comes back with the window that it sits upon.

Also, please note that this of_MessageBox( ) function is different from, and should not be confused with, the Error Service’s gnv_app.inv_error.of_Message( ) function.


Appendix Summary

Hopefully, this has given you a thorough understanding of the Great, Great GrandDaddy of all PFC windows, pfc_w_master.

We have covered the 5.0.0# hierarchy and the functionality of your windows in detail. And we have given you a heads up on what is projected for thePFC 6.0 Release as well. We hope you have found this information useful, and we hope that you can easily flip back here as a quick reference in the future.

If you have any questions or feedback on any of this, please feel free to drop me a line at sbuntz@texas.net . I will look forward to hearing from you. In honor of my commitment to quality and my efforts to not spread any misinformation, I will keep any corrections and/or clarifications available online at http://www.pfccheatsheet.com/ . (And if it ends up being elsewhere, there will at least be a pointer to it from there.) Because we live in an age now where things are rapidly changing. And even so, there is no longer one person, or even a small group of people, who really understand and know everything there is now to know.


About the Author

Sharon Weinstrom Buntz is a CPD Professional who works for NewData Strategies (NDS), a company which provides "high-technology" software, consulting and education services. Sharon is currently a PFC/PowerBuilder mentor at Education Service Center (ESC), Region 20 in San Antonio, Texas.

Her "Cheat Sheet" for PFC/PowerBuilder "Help" is available for your assistance and convenience at:
http://www.pfccheatsheet.com/

Another PFC resource to keep bookmarked is Boris Gasin’s (of Advent 2000, Inc.) PFC Guide at:
http://www.pfcguide.com/

And don't forget Rik Brooks' Dojo at:
http://www.pics.com/byte/dojo.htm

Please feel free to send Sharon an email at sbuntz@texas.net .

Sharon is forever grateful to the PFC Development Team and the other PFC experts that helped her create, compile and edit this appendix, especially Claudio Quant, Mark Overbey, Brian Grimm, Boris Gasin, Andrew "Brez" Bereznak, Steve Benfield, John Olson, Jon Credit, Bob Fields, Gregory R. George, Ken Howe, Jill Moritz, Judy Cote and Michael Campbell.

And, of course, Sharon would like to thank Rik Brooks for giving her this wonderful opportunity to be a part of this helpful PFC book. Rik is a true pleasure to work with and learn from.

Her heart also goes out to the wonderful people at ESC and NDS who have worked with Sharon, together learning all about the PFC… Linda Sweet, David Terry, Emilio Flores, Mike Uhl, John McCauley, Dan Perez, Al Holden, Ching-Shen Chen, Ching-Shyong Li, Crystal Fox, Jesse Morales, Laura Ellison, Michael Stehling, Robert Okruhlik, Robert Pruski, Roland Gonzales, Thomas Evans, Robbie Hollis, Brenda Hutzler, Gwen Bolden, Joyce McDonald, Lesa Garcia, Paul Rector, Beth Rehn and, again, her wonderful and talented mentor Judy Cote.

Next, Sharon has not forgotten all of her PFC friends on the pfcsig mail list, the pfc-users mail list and the Powersoft newsgroups. The people there so graciously share all of their PFC wisdom and knowledge with other PFCers. And it is a most beautiful experience to be a part of that team spirit that makes anything possible. Hats off to all of them!

And, last but not least… switching now to first person <g>… I would like to personally thank all of my family, my puppies and my husband, John, for all of their love, patience and support... especially while I was submerged <s>.

 

 

 

Click Here to visit our sponsor - DW Book

Visit our sponsors

Click Here to visit our sponsor - XPEDITER/SQL

 

Go to Home Page Home

Where to Go Know where to go

Site Map Work smarter, not harder

Search Answers at your fingertips

   Turn Off MenuTurn On Menu  Contact WebmasterYour Comments   Your New Home

 

Cheat Sheet for PFC/PB Help Home  |  Top