Chapter 9 Windows, Screen Builder & Designing Menus


Windows are the presentation tools.  Windows enhance the appearance and use of screen in applications.  Window can be defined as:
Define Window <Window Name> Command.
Window name can be up to 10 characters long. 

Define window W1 from 1,1 to 15,50

Activating/Deactivating Window
Window can be activated or Deactivated by activate and deactivate commands.  Syntax:
Activate/Deactivate Window <Window Name>Command.

Activate Window W1
Deactivate Window W1

Hiding Window
Window can Hide by hide command.  Syntax:
Hide Window <Window Name> Command. 
Hide Window W1.

Physically Removing Window
Windows can be physically removed from the memory by release Window command :-
Release Window <Window Name> Command.
Release Window W1

Clearing All Windows
All Windows can be cleared by Clear Windows Command.

All Commands for Windows are:
Define Window            :           Define window W1 from 1,10 to 10,60.

Activate Window         :           Activate window W1

Deactivate Window     :           Deactivate window W1

Hide Window              :           Hide window W1

Release Window          :           Release window W1

Clear Window             :           Clear Window W1

Title
Windows can be assign title which appears on the top border of the window.  For example:
Define window W1 from 1,1 to 10,60 title “My Windows”
Activate Window W1.


Screen Builder
Screen Builder allows for current data-base environment with screen form to be saved.  Database environment includes all open database, all linkages established with set relation and set skip and also with selected work area. 

Screen Menu
Options on this menu allows to create or modify an input screen definition file quickly.  The options are as follows:

1.      Layout
Displays screen layout dialog where size and position of input screen can be defined.

2.      Size
Used to change height and width of the screen.

3.      Position
Position of screen can be changed.  Center option will center the screen in the middle of main FoxPro Window.

4.      Title
Used to specify text to appear in the screen title bar.

5.      Name
To name the screen.

6.      Options
Screen related options can be summarized as follows:

·         Code         :           Codes or programs can be added through this.
·         Color        :           A wall paper and color can be selected for the screen.
·         Font          :           To set default font for the text and objects on the screen.

Window Style
We can set screen borders and determine whether or not the screen can be moved closed and minimized.  The options or the window styles are as:

Type
Several options like user, system, dialog, alert and environment etc can be chosen to assign predefined attributes and borders for the screen.

Open all Code Snippets
This option opens program editing windows for all code snippets associated with the screen.

Show/Hide position
Displays in status bar the co-ordinates of mouse pointer and dimensions of the selected objects.

Ruler/Grid
Allows to set units of measurement for ruler and change size of alignment grid.

Snap to Grid
An invisible alignment grid is set on so that objects automatically aligned to nearest grid line when they are sized or moved.

Object Order
Opens object order dialog to adjust the order that the objects are accessed in the screen using keyboard.

Designing Menus
Menus in FoxPro can be created either by writing programs or by using Menu-Builder option.  Menu builder is used to link together the application components that we developed working in an command window, which makes them more accessible to users who do not much about computers or FoxPro.  It is mainly a tool for building FoxPro System Menus.  Menu can be created by Create Menu command in the command window. 


Create Menu <Menu Name>
Create Menu Tryone

Modify Menu <Menu Name>   (if menu is already is created)
Modify Menu Tryone


In Menu Design prompt column can be used to specify prompts to be used for each menu pads and pop-ups.  When menu system is generated, pads are displayed on the menu bar in the order in which they are appear in the prompt column.

Submenu
When menu pads are defined submenu is displayed on the result pop-up by default.

Command
It is chosen when menu bar has to carry out a specific command to be executed when the associated menu pad or option is chosen.

Pad Name
It is an option variable when defining prompts at menu bar level and bar # is an option when defining prompts at sub menu level.  In the generated code, menu pads are referred by name and option on a menu pop-up are referred by their number.

Procedure
Can be used to create or edit a procedure.  Procedure command need not be typed as FoxPro generates this command with unique procedure names.

Menu Options
When a prompt is defined for a menu pad or submenu option, the prompt options dialog can be activated.

Comments
Can be added for reference purpose.

Shortcut
Can be used to define short cut key.

Skip for
Can be used to create logical expression which will determine whether pad or option is disabled = (.T.) or enabled =(.F.)

Message
Can be given using message check box.

Pad Name
To specify Pad Name.

Try It
Can be used to preview the Menu

No comments:

Post a Comment