S c i e n t i f i c A r t s
WorkLife Requirements Purchase FAQ Documentation WLFW Blog ?
 

Package Programming Palette

The Palette

For the buttons and executable commands that are described n this section to work it is assumed that you have installed A WorkLife FrameWork™ and have loaded it.  This can be done either from the Load WorkLife Framework button on the supplied palette, by executing the command Needs["Diary`Diary`"], or by clicking on the following button:

"packageprogrammingpalette_1.gif"

By clicking on the on the Package Programming button on the All Palettes Palette, you will open the Package Programming Palette.  You can also open the Package Programming Palette for the $CurrentPackageNotebook, if it is open, by executing:

"packageprogrammingpalette_2.gif"

The Package Programming Palette has various administrative buttons for creating function templates in the current package.  Functions are generally placed into categories by the user.  This is a means of organizing one's code and navigating back and forth within a package's programming notebook. In the illustrative example in the picture below there are three categories: General, GraphicsDisplay, and PaletteButtonCells.  Every package notebook has a General category.  In this illustration the user has created the two additional categories.

"packageprogrammingpalette_3.gif"

The Package Programming Palette

The Palette Buttons

For the buttons and executable commands that are described n this section to work it is assumed that you have installed A WorkLife FrameWork™ and have loaded it.  This can be done either from the Load WorkLife Framework button on the supplied palette, by executing the command Needs["Diary`Diary`"], or by clicking on the following button:

"packageprogrammingpalette_4.gif"

"packageprogrammingpalette_5.gif"

Opens the Packages Palette.  This Palette can also be opened by executing:

"packageprogrammingpalette_6.gif"

"packageprogrammingpalette_7.gif"

Opens the Programming Palette.  This Palette can also be opened by executing:

"packageprogrammingpalette_8.gif"

"packageprogrammingpalette_9.gif"

Opens up the Current Package if there is one.  The current package programming notebook file is given by $CurrentPackageNotebookFile.  If the current package programming notebook is open its notebook object is given by $CurrentPackageNotebook.

"packageprogrammingpalette_10.gif"

Opens up a dialog to add a new function category to the current package.  

The dialog that is opened looks like:

"packageprogrammingpalette_11.gif"

Dialog to Add a New Function Category to the Current Package

"packageprogrammingpalette_12.gif"

The Change Function Name button opens a dialog that allows you to change a function's name in the current package.  When the function's name has been changed via clicking the Change Function Name button in the dialog, a Find and Replace window opens to allow you to search and replace instances of the function name in the package.

The initial dialog that is opened looks like:

"packageprogrammingpalette_13.gif"

Dialog to Change a Function's name in the Current Package

"packageprogrammingpalette_14.gif"

The Newfn ⊙ button opens a dialog to name and create a new function template below the function code that the cursor is currently located in. A template for a usage message is also created in the usage messages section for the category that the function has been created in so that the function will be exported from the package.  

The dialog that is opened looks like:

"packageprogrammingpalette_15.gif"

Dialog to Add a New Function to the Current Package Below the Insertion Location

The No Usage button creates a function template but does not create a usage message template for that function.  Therefore, in this case, the function is not exported by the package.

"packageprogrammingpalette_16.gif"

This button toggles open and closed the sub-palette containing the administrative buttons for navigating and creating functions that are in the General category of the package.

All packages at least have a General category of functions.  The General category is created when the package is first created.  Other categories can be added using the Add Function Category button above and its resulting dialog.

"packageprogrammingpalette_17.gif"

The Usage button moves the insertion point in the current package's notebook to the beginning of the Usage messages section for the General category.  The Functions button moves the insertion point in the current package's notebook to the beginning of the Functions code section for the General category.

"packageprogrammingpalette_18.gif"

The Newfn and No Usage buttons here operate in a way that is similar to those described above.  However the function and usage templates that are created are placed in the section of the programming notebook where the General category items are placed.

The dialog that is opened looks like:

"packageprogrammingpalette_19.gif"

Dialog to Add a New Function to the Current Package in the General category

"packageprogrammingpalette_20.gif"

In this category, GraphicsDisplay (which, in this illustration, the user has created), the following buttons have the same meaning and use as in the General category above.

"packageprogrammingpalette_21.gif"

"packageprogrammingpalette_22.gif"

"packageprogrammingpalette_23.gif"

In this category, PaletteButtonsCells (which, in this illustration, the user has created), the following buttons have the same meaning and use as in the General category above.

"packageprogrammingpalette_24.gif"

"packageprogrammingpalette_25.gif"

Copyright ©, 2005→2009 Scientific Arts, LLC. All rights  reserved.

Copyright ©, 2005-2009 Scientific Arts, LLC