Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Can I add the ActiveForm(s) to the Window Menu
Message
 
À
29/06/2007 12:17:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01236819
Message ID:
01236847
Vues:
38
This message has been marked as the solution to the initial question of the thread.
>>>I am working on a "converted" application that is part old Fox 2.5 code and part VFP9 code. We are having some issues with forms dropping behind the screen. I'd like to have active forms show up in the Window menu to allow users to reset focus. Is there anyway to use VFP's native ability to add Forms to the menu?
>>>
>>>Thanks, Jeff
>>
>>Just tested it.
>>Create a PAD and in options set PAD NAME to be _msm_windo
>>All opened forms will go there automaticaly.
>
>I just tried it as a pad and as a submenu and coudn't get the forms to appear. I am adding it to a custom menu. I have added the showall and cycle pads and they work but won't add form names.


My mistake, the POPUP menu must be named _mwindow not the PAD
That work for me:
CreateMenu()
oForm = CREATEOBJECT([Form1])
oForm.Show(1)
READ EVENTS
SET SYSMENU TO DEFAULT


FUNCTION CreateMenu()
*       *********************************************************
*       *                                                         
*       * 29.06.2007 ã.             MENU1.MPR              19:19:07  
*       *                                                         
*       *********************************************************
*       *                                                         
*       * Author's Name                                           
*       *                                                         
*       * Copyright (C) 2007 Company Name                         
*       * Address                                                 
*       * City,     Zip                                           
*       *                                                         
*       * Description:                                            
*       * This PROGRAM was automatically generated BY GENMENU.    
*       *                                                         
*       *********************************************************


*       *********************************************************
*       *                                                         
*       *                      Menu Definition                    
*       *                                                         
*       *********************************************************
*

SET SYSMENU TO
SET SYSMENU AUTOMATIC


DEFINE PAD _msm_windo OF _MSYSMENU PROMPT "\<Window" COLOR SCHEME 3 ;
    NEGOTIATE  RIGHT, LEFT ;
    KEY ALT+W, "" ;
    MESSAGE "Manipulates windows, displays Command and Data Session windows"
ON PAD _msm_windo OF _MSYSMENU ACTIVATE POPUP _mwindow

**************************
***** THIS           *****
**************************
DEFINE POPUP _mwindow MARGIN RELATIVE SHADOW COLOR SCHEME 4

DEFINE BAR _mwi_cascade OF _mwindow PROMPT "Ca\<scade" ;
    PICTRES _mwi_cascade ;
    MESSAGE "Arranges windows as cascading tiles"
DEFINE BAR _mwi_arran OF _mwindow PROMPT "\<Arrange All" ;
    PICTRES _mwi_arran ;
    MESSAGE "Arranges windows as non-overlapping tiles"
DEFINE BAR _mwi_sp100 OF _mwindow PROMPT "\-" ;
    PICTRES _mwi_sp100
DEFINE BAR _mwi_dockable OF _mwindow PROMPT "Doc\<kable" ;
    PICTRES _mwi_dockable ;
    MESSAGE "Enable docking of this window"
DEFINE BAR _mwi_hide OF _mwindow PROMPT "\<Hide" ;
    PICTRES _mwi_hide ;
    MESSAGE "Hides the active window"
DEFINE BAR _mwi_hidea OF _mwindow PROMPT "Hide All" ;
    PICTRES _mwi_hidea ;
    MESSAGE "Hides all windows"
DEFINE BAR _mwi_showa OF _mwindow PROMPT "Sh\<ow All" ;
    PICTRES _mwi_showa ;
    MESSAGE "Shows all hidden windows"
DEFINE BAR _mwi_sp200 OF _mwindow PROMPT "\-" ;
    PICTRES _mwi_sp200
DEFINE BAR _mwi_clear OF _mwindow PROMPT "Clea\<r" ;
    PICTRES _mwi_clear ;
    MESSAGE "Clears text from the application workspace or the current output window"
DEFINE BAR _mwi_rotat OF _mwindow PROMPT "C\<ycle" ;
    KEY CTRL+F1, "Ctrl+F1" ;
    PICTRES _mwi_rotat ;
    MESSAGE "Cycles through all open windows"
DEFINE BAR _mwi_sp200 OF _mwindow PROMPT "\-" ;
    PICTRES _mwi_sp200
DEFINE BAR _mwi_cmd OF _mwindow PROMPT "\<Command Window" ;
    KEY CTRL+F2, "Ctrl+F2" ;
    PICTRES _mwi_cmd ;
    MESSAGE "Displays the Command window"
DEFINE BAR _mwi_view OF _mwindow PROMPT "\<Data Session" ;
    PICTRES _mwi_view ;
    MESSAGE "Displays the Data Session window"
DEFINE BAR _mwi_properties OF _mwindow PROMPT "\<Properties Window" ;
    PICTRES _mwi_properties ;
    MESSAGE "Display the Properties window"
RETURN



**************************************************
*-- Form:         form1 (d:\works\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   06/29/07 07:19:07 PM
*
DEFINE CLASS form1 AS form


    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"


    PROCEDURE Destroy
        CLEAR EVENTS
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform