Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing sexy marketable interfaces
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01015059
Message ID:
01015189
Views:
29
I think that utilizing MDI and dockable forms, menus, and toolbars is a pretty good start to making a cool interface. You get so much for so little work. Here's a working simplistic example in VFP 9 (cut-n-paste the below code into a prg and run it... make repeated selections from the Create Forms menu to bring up different elements of the pretend application - select Exit from the menu when finished).
PUBLIC colForms
colForms = NEWOBJECT("Collection")

ON SHUTDOWN CANCEL

DO CreateMenu

READ EVENTS
RELEASE colForms

SET SYSMENU TO DEFAULT

PROCEDURE CreateMenu
    SET SYSMENU TO
    SET SYSMENU AUTOMATIC

    DEFINE PAD CreateForm OF _MSYSMENU PROMPT "\<Create Forms" COLOR SCHEME 3 ;
        KEY ALT+C, ""

    ON PAD CreateForm OF _MSYSMENU ACTIVATE POPUP FormMenu

    DEFINE POPUP FormMenu MARGIN RELATIVE SHADOW COLOR SCHEME 4

    DEFINE BAR 1 OF FormMenu PROMPT "\<MDI Form"
    DEFINE BAR 2 OF FormMenu PROMPT "\<Dockable Form"
    DEFINE BAR 3 OF FormMenu PROMPT "\<Toolbar"
    DEFINE BAR 4 OF FormMenu PROMPT "E\<xit"

    ON SELECTION BAR 1 OF FormMenu ;
        DO CreateMDIForm
    ON SELECTION BAR 2 OF FormMenu ;
        DO CreateDockableForm
    ON SELECTION BAR 3 OF FormMenu ;
        DO CreateToolBar
    ON SELECTION BAR 4 OF FormMenu ;
        CLEAR EVENTS
ENDPROC

PROCEDURE CreateMDIForm
    colForms.add(NEWOBJECT("clsMDIForm"))
    DO SetupandShowForm
ENDPROC

PROCEDURE CreateDockableForm
    colForms.add(NEWOBJECT("clsDockForm"))
    DO SetupandShowForm
ENDPROC

PROCEDURE SetupandShowForm
    WITH colForms.item(colForms.count)
        .name = SYS(2015)
        .Caption = .name
        .Show(2)
    ENDWITH
ENDPROC

PROCEDURE CreateToolbar
    colForms.add(NEWOBJECT("clsToolbar"))
    DO SetupandShowForm
ENDPROC

DEFINE CLASS clsMDIForm as Form
    Autocenter = .T.
    MDIFORM = .T.
ENDDEFINE

DEFINE CLASS clsDockForm as Form
    Dockable = 1
ENDDEFINE

DEFINE CLASS clsToolbar as Toolbar
    ADD OBJECT Command1 AS CommandButton WITH height = 27, width = 27
    ADD OBJECT Separator1 as Separator WITH style = 1
    ADD OBJECT Command2 AS CommandButton WITH height = 27, width = 27
    ADD OBJECT Command3 AS CommandButton WITH height = 27, width = 27
    ADD OBJECT Separator2 as Separator WITH style = 1
    ADD OBJECT Combo1 as Combobox WITH  height = 27, width = 100
ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform