Compartir a través de


Enhancements to Visual FoxPro Designers

Visual FoxPro contains numerous improvements made to its designer tools.

  • Support for additional classes in the Class Designer
  • Form Designer enhancements
    • Data Environment Builder
    • XML Web Service Builder
    • Showing most recent control selected when setting tab order
    • No maximum limit for design area
    • Persisting state of Form Designer and Form Controls toolbar
  • Table Designer enhancements
    • Building expressions in Caption field
    • Using database container (DBC) captions as expressions
    • Autoincrementing field values in the Table Designer
  • Improvements for multi-table joins and the SQL SELECT command in the View and Query designers
  • Support for moving menus in the Menu Designer
  • Report design and printing enhancements

Support for Additional Classes in the Class Designer

Visual FoxPro includes enhanced class support as follows:

  • Visual FoxPro includes the DataEnvironment, Cursor, Relation, Page, Collection, CursorAdapter, XMLAdapter, XMLField, and XMLTable classes in the New Class dialog box for the Class Designer. All DataEnvironment, Cursor, Relation, Page, Collection, CursorAdapter, XMLAdapter, XMLField, and XMLTable properties, methods, and events are available as appropriate in the Properties window when the Class Designer is open.
  • Visual FoxPro adds language support to the CREATE CLASS and MODIFY CLASS commands for the DataEnvironment, Cursor, Relation, Page, Collection, CursorAdapter, XMLAdapter, XMLField, and XMLTable classes.

Form Designer Enhancements

Visual FoxPro includes the following enhancements to the Form Designer:

  • DataEnvironment Builder

    You can use the new DataEnvironment Builder to create a data environment and to use the capabilities of CursorAdapter objects. For more information, see DataEnvironment Builder.

  • XML Web Service Builder

    You can use the new XML Web Service Builder to bind an XML Web service to a control on a Visual FoxPro form or to an object, such as a cursor adapter in the form's data environment, without writing code. For more information, see XML Web Service Builder and Accessing XML Web Services.

  • Showing most recent control selected when setting tab order

    Visual FoxPro now highlights the most recent control selected when you are determining the tab order for moving between controls on a form in the Form Designer. Visual FoxPro shows the tab order of controls by labeling them with colored numbered boxes. In previous versions, after activating several new windows or applications, it was easy to lose track of the last control selected during the tab ordering process. For more information, see Setting Tab Order for Controls.

  • No maximum limit for design area

    The default setting for Maximum Design Area on the Forms tab in the Options dialog box is now None. By changing the previous 640 x 480 resolution setting for the viewing area, Visual FoxPro prevents the form from appearing cropped inside the Form Designer. For more information, see Forms Tab, Options Dialog Box and Setting the Design Area for a Form.

  • Form Controls toolbar

    The Form Controls toolbar does not automatically open if you modify a form or other container class that does not have a FoxUser.dbf record indicating that the toolbar should open.

Table Designer Enhancements

Visual FoxPro includes the following enhancements for the Table Designer:

  • Autoincrementing field values

    You can now set automatically incrementing field values for both DBC tables and free tables. To support the autoincrement feature, the Table Designer combines the free table and DBC table designers into one consistent, enhanced user interface (UI) that contains Fields, Indexes, and Table tabs. You can select the Integer (AutoInc) data type for a field and set the Step and NextValue values in the Table Designer. Depending on whether you create a DBC or free table, Visual FoxPro makes the appropriate UI elements available. For more information, see Fields Tab, Table Designer, Indexes Tab, Table Designer, and Table Tab, Table Designer.

  • Using database container (DBC) captions as expressions and building expressions in the Caption field

    Previous versions of Visual FoxPro used hardcoded captions, or labels, for DBCs and made localization difficult for users writing international applications.

    You can now build an expression in the Caption field on the Fields tab of the Table Designer or in the View Field Properties dialog box, which opens from the Query and View Designer, for tables that are part of a database container (DBC). Clicking the ellipsis (...) button opens the Expression Builder. Expressions cannot exceed 254 characters. If expressions exceed 254 characters, the caption defaults to the field name. For more information, see Fields Tab, Table Designer and View Field Properties Dialog Box.

    When you drag fields onto a form or report from one of the designers, Visual FoxPro uses the DBC caption, if one exists, and attempts to evaluate it. Visual FoxPro evaluates this expression at design time and run time. The Report Designer has also been modified to incorporate this enhancement, though it does not produce a label when a field is dragged onto the report.

    Note   Support for using expressions as field captions should be used only with DBC tables in applications running on Visual FoxPro 8.0 or later. In earlier versions, the expression appears as a string literal.

Improvements for Multi-Table Joins and the SQL SELECT Command in the Query and View Designers

Visual FoxPro enhances its Query and View designers by improving how it constructs multi-table joins and handles user-defined SQL SELECT commands. The Query and View designers contains the following enhancements:

  • Fields tab

    You can select all available tables and their fields by choosing the asterisk (*), all fields in a particular table by choosing table.*, or individual fields for your query or view. Your selections appear in the SELECT statement in the SQL window when you click View SQL or choose View SQL on the Query menu.

    You can also manually specify an asterisk, table.*, or a comma-delimited list of fields for the SELECT statement in the SQL window. For example, you can specify the SQL statement as SELECT * FROM or SELECTfield1, field2, ... FROM. Your preferences are preserved during loading or generation of the query or view.

    You can include the same field multiple times in the SELECT list.

    Visual FoxPro automatically copies a field name into the Expression Builder when it is selected in the Available Fields list. Therefore, you can easily use the field name to build your expression or add a field name alias by typing it after the field name in the Expression Builder.

    A sequential field number now appears with the field name in the View Field Properties dialog box, which appears when you click the Properties button on the Fields tab.

    For more information, see Fields Tab, Query and View Designers and View Field Properties Dialog Box.

  • Join tab

    The Join tab provides the new Left Table and Right Table columns. You can specify the new Cross Join type in the Join type column. A cross join matches each record in the left table with all records in the right table. Therefore, you can set a cross join only for the left table, which cannot be a Previous join. The View Designer does not add cross joins for newly added tables, so you must add the join manually if you want to specify a position for the table.

    You can specify a priority for join and logical operations using the new Priority column.

    You can now edit the expressions that appear in Field Name and Value columns on the Join tab when they appear in the Expression builder after you select <Expression> from the Field Name or Value list. The Criteria column includes the new Is True logical operation.

    For more information, see Join Tab, Query and View Designers.

  • Filter tab

    The Filter tab supports subqueries. You can load and save a query or view with a subquery in the WHERE clause. You can select the new Exists and Is True logical operations in the Criteria column. You can specify a priority for logical operations using the new Priority column.

    Visual FoxPro no longer includes the Case button. Instead, you can use the UPPER( ), LOWER( ), and PROPER( ) functions.

    For more information, see Filter Tab, Query and View Designers

  • Order By tab

    You can select fields that are not included in the SELECT list. For more information, see Order By Tab, Query and View Designers.

  • Group By tab

    You can now specify a priority for logical operations using the new Priority column in the Having dialog box. For more information, see Having Dialog Box.

  • Miscellaneous tab

    You can select Force join to add a FORCE keyword to specify that tables are joined in the order in which they appear in the FROM clause.

    Visual FoxPro replaces the Cross tabulate check box with a button and includes the Report and Label buttons. Clicking these buttons merely adds the appropriate line of code after the query's SQL statement. No reparsing of the commands occurs when the query is reloaded. You can change or add to this code.

    Note   It is possible to add multiple conflicting options by clicking these buttons multiple times. The Query Designer will attempt to warn you and provide the option to remove the previous command if it is the first conflict found. You should make sure that only the desired optional code appears in the query.

    For more information, see Miscellaneous Tab, Query and View Designers.

  • The View Designer correctly loads and generates any FROM clause with or without the JOIN option, using parentheses where needed in the ON clause.

  • Visual FoxPro provides "two-way" editing support in the Query and View designers.

    You can edit the SQL SELECT statement for queries and views and view properties that are set by DBSETPROP( ) calls in the SQL window and load the changes back into designer window.

    For more information, see Customizing Queries Using SQL SELECT Statements and Customizing Views Using SQL SELECT Statements.

  • Instead of using the automatically generated alias when you add a table or view, you can specify an alias for the table or view by typing it in the Alias box that appears in the Add Table or View dialog box.

  • Removals from the Query/View Designer:

    • Filter tab and Having dialog box

      Visual FoxPro no longer includes the Case button for matching text casing of criteria in the Example field. Instead, you can use the UPPER( ), LOWER( ), or PROPER( ) functions as needed.

    • Query Destination dialog box in Query Designer

      Visual FoxPro no longer includes the Report, Graph, and Label buttons, which supported non-SQL clauses.

    • Miscellaneous tab

      Visual FoxPro no longer includes the Cross tabulate check box.

Support for Moving Menus in the Menu Designer

You can easily move existing menus, submenus, and menu bars in the Menu Designer by using the Move Item button. In previous versions of Visual FoxPro, you could not easily move items such as menu bars after you created a new menu or made changes to an existing one. For more information, see Menu and Shortcut Designers and Move Item Dialog Box.

Report Design and Printing Enhancements

Visual FoxPro includes the following report design and printing capabilities.

Enhancements to the Report Designer

  • You can now specify whether page footers and page headers stretch or shrink to accommodate their contents by leaving the Constant band height check box cleared in the Page Footer and Page Header dialog boxes. Previously, this check box could not be cleared. The height adjusts automatically when using stretchable fields.
  • You can have stretchable and floating fields in page footers and the Summary band. For more information, see Page Footer Dialog Box and Page Header Dialog Box.
  • You can choose whether to include the page header and footer when printing the report Summary band. To specify this behavior, click Title/Summary on the Report menu when the Report Designer is open and select the Page header and Page footer check boxes. For more information, see Title/Summary Dialog Box.
  • You can choose whether to save printer settings to the appropriate memo fields in the reports header record. To make this choice, select Printer Environment from the Report menu when the Report Designer is open. Your selection persists on the Reports tab in the Options dialog box, and your settings persist for each report.

Reports Tab in Options Dialog Box

On the new Reports tab in the Options dialog box, you can perform the following tasks for new reports created in the Report Designer:

  • Set global defaults such as show grid lines, snap to grid, and horizontal/vertical grid spacing.
  • Choose report options such as use private data sessions, save the printer environment, and use database container (DBC) field captions when you drop fields onto a report.
  • Show position of the grid.
  • Set initial ruler scale and default font for reports.

For more information, see Reports Tab, Options Dialog Box.

Page X of Y Numbering

You can set up Page X of Y numbering in reports using the new _PAGETOTAL system variable. For more information, see _PAGETOTAL System Variable.

Preventing Resetting of Page Numbers

You can specify that Visual FoxPro does not reset the _PAGENO and _PAGETOTAL variables by using the NORESET keyword in the REPORT command.

For more information, see REPORT Command.

Enable Duplex Printing and Chain Multiple Reports

You can specify that printing does not continue on a new sheet at the end of printing a report by using the NOPAGEEJECT keyword in the REPORT command. Therefore, you can enable duplex printing to continue on the reverse side of a previous report. You can also chain multiple reports using NOPAGEEJECT.

For more information, see REPORT Command.

Disable the Run-Time Printing Dialog Box

You can disable the run-time printing dialog box by using the NODIALOG keyword in the REPORT command. For more information, see REPORT Command.

Determine Report Preview Mode

You can determine whether a report is being printed or appears in preview mode using the new SYS(2040) - Detect Report Status function, which returns a value of 0, 1, or 2 and respectively specifies that no active report exists, the report is in preview mode, or the report is being printed.

See Also

What's New in Visual FoxPro 8.0 | Language Enhancements | Data Features Enhancements | Miscellaneous Enhancements | Behavior Changes Since Visual FoxPro 7.0