Class: BasicPanel

Properties  Events  Methods    Index of Classes

Provides a top-level window for applications that is independent of all other windows

Hierarchy

cObject
---cUIObject
------DfBaseObject
---------DfBaseWindow
------------DfBaseUIWindow
---------------DfBaseContainer
------------------DfBaseDialog
---------------------DfBasePanel
------------------------BasicPanel
---------------------------AppPanel

Library: Windows Application Class Library

Package: Windows.pkg

Mixins: Standard_Container_Mixin Panel_Mixin Standard_Object_Mixin Label_Mixin dfAuto_Locate_Mixin Shadow_Mixin Bitmap_Support_Mixin Modal_Mixin DefaultActionButton_Mixin RGB_Support_Temp_Mixin Help_Mixin

Description

The BasicPanel container class provides a top-level window for applications that is independent of all other windows. While BasicPanel objects can be used for creating simple non-MDI programs (usually test programs), objects are usually not based directly on this class. The descendant class, Panel, is normally used for instantiation. By default, an object of this class has icons for maximize and minimize, a resizable border, system-menu icon, and a caption bar.

Sample

 
Object MyPanel is a BasicPanel
    Set Size to 100 150
    Set Label to "My Test Panel"
 
    Object F1 is a form
        Set Location to 10 70
        Set Size to 13 40
        Set Label to "Name:"
    End_Object
 
    Object Dlg1 is a Container3D
        Set Size to 30 130
        Set Location to 25 10
 
        Object F2 is a form
            Set Location to 10 70
            Set Size to 13 30
            Set Label to "Id:"
        End_Object
 
    End_Object
 
End_Object
 
Send Activate of MyPanel
Start_UI


Syntax

Use dfbase

 Object object_name  is a BasicPanel
    set size to height width
    set locate_mode to  LocateMode
    set label to title
 
    set Border_style to borderMode 
    set Maximize_icon to true|false 
    set Minimize_icon to true|false 
    set location to vertical horizontal
    set Caption_bar to true|false 
    set Icon to to IconFileName 
    set SysMenu_icon to true|false 
    :
End_Object


Of Special Note

A typical application in DataFlex will consist of a single main panel that contains visual components that are bound within this panel. These components (which will comprise most of your application) consist of menus, tool bars, status bars, and a client area. The client area will contain a number of views (dialogs that are bound within the client area). This describes a typical Windows MDI (Multiple-Document Interface) application structure. Additional panels may be used which are not bound to the main panel (i.e., they can be moved off the main panel). These tend to be popup objects and will be non-modal tool panels or modal panels. Specialized classes, all descendants of the DFBasePanel class, exist for main, tool, and modal panels (Panel, ToolPanel, and ModalPanel). The Panel class (a subclass of the AppPanel, which is a subclass of BasicPanel) is used to create a main-panel object. Although objects can be based on the BasicPanel class, its main purpose is that of an intermediate class.

Caption Bar Label

The text that will appear in a panel's caption bar is set with the Label property.

This label will also appear in the Windows task list. Normally your main-panel object should be the only entry in the Windows task list. If you need to create a panel that does not appear on the task list, you should base your object on the ToolPanel or ModalPanel class.

Resizing a Panel

When an object of this class is resized by users, this object sends the onResize message to itself. This message is supplied with no definition as a "hook" procedure to use when some action, such as resizing child objects, is desired on resizing of this object.

Locating a Panel

The location of a panel is determined by the properties location and locate_mode. The defaut "smart" locate_mode will cause the panel to be centered on the screen unless a location is explicitly set. When no location is set, the panel is centered-usually a good default.

Tool Bars, Status Bars, Client-area IDs

Properties are defined in this class to hold the object IDs of a child tool bar, status, bar and client area. None of these components is directly supported by this class and their property values should all be zero. These properties exist so that child objects may obtain these IDs and react accordingly. For example, a form placed inside this object will see that there is no status bar object for this object and not attempt to display status help. Full support for tool bar, status bars and client areas is added to AppPanel, which adds an MDI-support layer. This capability is inherited in turn by Panel.

Exiting the Application

When a program is about to be closed, several messages are sent to the program's panel object. First, a verification function (verify_exit_application) is sent. It is the responsibility of the panel to determine if it is appropriate to exit the application and return a zero value to close, and a non-zero value to stop the close. Once it has been determined that the application can be closed, a notification message is sent to the panel (notify_exit_application) indicating that the program will be closed. It is the responsibility of the panel to perform any special closedown activities. Both of these messages do nothing in this class. These behaviors are augmented in the AppPanel and Panel subclasses.