次の方法で共有


Application Functionality and the Application Framework

Before discussing the general options available for your Application, let's take a quick look at how the application works:

Application Startup – Applications often have a Splash screen that displays during startup, showing information about the application. The Application Builder controls both the screen itself and information contained within it.

User Login - When the application first launches, it might prompt the user to enter a login id and password. You can set this option in the Application Builder.

Quick Start – You might want to display a dialog box of available documents for the user to select from immediately after startup. You can set this option in the Application Builder.

Opening Forms – One of the primary functions of a database application is data input. Visual FoxPro accomplishes this in forms. The application framework uses a metaphor similar to that of Microsoft Office where the application is document-centric. The application framework provides a standard File Open menu item that runs your form, displaying existing data from your datasource. The framework also provides a File New menu that displays a form containing a new (blank) record.

**Note   **If you are adding your own forms to the framework, you will need to manually specify the action of a form when launched from the File New menu. Forms generated by the Application Builder and Form Wizard automatically handle new record insertions for you.

Editing Records – During an editing session, the application framework provides much of the common database functionality for you. If you attempt to close the application while a buffer contains unsaved data, the application will prompt you to save changes first. This functionality is handled when you attempt to close a form or application. There is also a Navigation toolbar and Go menu that lets you:

  • Navigate between records.
  • Search for a record.
  • Sort records on a certain field (both ascending and descending).
  • Filter the data set.

Printing – If you have an open data input form, you can select the Print menu option, which prompts you with a selection of output options for the current data source. These include the following:

  • Print or Preview the list of data.
  • Export to a new file format such as a Microsoft Excel worksheet (.xls) file, text (.txt) file, and so on.
  • Output to HTML.

Running Reports – The Print Reports menu option displays a dialog box of available reports for you to run. Once you select a report, the output dialog box opens to provide the following options:

  • Print or Preview the report.
  • Output to a text file.
  • Output to HTML.

Favorites – The application framework supports a Favorites menu common to many web applications today. Because you can have multiple users if you choose the User Login option, items that appear in the Favorites menu are context sensitive to the user. The Favorites menu can contain any common Visual FoxPro document such as a Form, Report, Label or Program file. In addition, you can also click on the Browse button to select other types of documents such as Word, Excel, and HTML files.

Miscellaneous – The application framework also supports some common Windows application features. These include:

  • A Window menu that lets you cascade and arrange your open windows.
  • An About dialog box and Help file menu items. The contents of the About dialog box can be set in the Application Builder.
  • An Options dialog box that lets a user configure the environment.
  • The Visual FoxPro Macro recorder so the user can record commonly used tasks.
  • Login and Change Password dialog boxes options.

Application Maintenance and Debugging – The framework detects whether the application is being run under the Visual FoxPro runtime version or full development version. If run under full development version, a Program menu is displayed for debugging purposes. The menu items include many of the common Visual FoxPro debugging tools such as Debugger, Command window, and Class Browser.

The application also contains excellent error handling. The error handler writes details of the cause of the error and state of the application to a log table. The user can access the error log by choosing the Error log option of the application Tools menu.

Here is a summary of the application contents provided through the menus:

Menu Options
File New, Open, Close, Save, Revert, Print, Print Reports, Print Setup, Quick Start, User Login, and Exit
Edit Undo, Redo, Cut, Copy, Paste, Clear, Select All, Find, Find Again, Replace
Tools Macros, Error Logs, Options, Change Password
Program Do, Cancel, Resume, Suspend, Compile, Debugger, Data Session, Command window, Class Browser
Favorites Add to Favorites, Clear Favorites
Window Cascade, Arrange All, Cycle
Help Help, About

Editing Menus

The application framework is designed to run without any need for the user to ever modify a menu. The framework will choose the appropriate menu for your application based on the type selected: Normal, Module, or Top-Level. However, this should not prevent you from modifying any of these menus if your application needs demand more than what the default menu offers. The application framework will run the menu fine with your modifications.

Customizing the Application Framework

You can use the Application Builder General, Credit, and Advanced tabs to change characteristics of the application framework.

Use the General tab to change common application settings such as friendly name, application image, application type, icon, common dialog boxes such as Splash screen, About, Quick Start, and User Login dialog boxes

Use the Credits tab to provide information that will appear in the Splash screen and About dialog box of your application. These settings, can include author and company name, application version, copyright, and trademark.

Use the Advanced tab to specify a Help file and default data directory for your application. You can also choose to eliminate the standard toolbar and a Favorites menu from your application.

It is important to remember that while the Application Builder is reentrant, changes made through the Builder will not appear in the application until it is rebuilt.

See Also

Managing Documents with Application Builder | Application Framework Files and Classes Example | Application Builder