Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MRow(), Mcol()
Message
De
17/12/2012 12:51:03
 
 
À
17/12/2012 12:48:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
01559848
Message ID:
01559918
Vues:
60
>How to add width and height in above command?
>
>Popup must be according to the width of shape1
>Same as height of popup should be equal to shape1
>
>Please review


Why?
oTest = CREATEOBJECT("Form1")
oTest.Show(1)

**************************************************
*-- Form:         form1 (d:\all_zapl\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   12/17/12 01:47:08 PM
*
DEFINE CLASS form1 AS form


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


    ADD OBJECT command1 AS commandbutton WITH ;
        Top = 154, ;
        Left = 49, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "ClickMe", ;
        Name = "Command1"


    ADD OBJECT shape1 AS shape WITH ;
        Top = 14, ;
        Left = 175, ;
        Height = 108, ;
        Width = 153, ;
        Anchor=15,;
        Name = "Shape1"


     PROCEDURE Command1.Click
            DEFINE POPUP shortcut SHORTCUT RELATIVE;
            FROM _pix2fox(thisform.Shape1.Top,"V"), _pix2fox(thisform.Shape1.Left,"H");
            TO _pix2fox(thisform.Shape1.Top+thisform.Shape1.Height,"V"), _pix2fox(thisform.Shape1.Left+thisform.Shape1.Width,"H");
            IN WINDOW (thisform.Name)
            DEFINE BAR _med_cut OF shortcut PROMPT "Cu\<t" ;
                KEY CTRL+X, "Ctrl+X" ;
                MESSAGE "Removes the selection and places it onto the Clipboard"
            DEFINE BAR _med_copy OF shortcut PROMPT "\<Copy" ;
                KEY CTRL+C, "Ctrl+C" ;
                MESSAGE "Copies the selection onto the Clipboard"
            DEFINE BAR _med_paste OF shortcut PROMPT "\<Paste" ;
                KEY CTRL+V, "Ctrl+V" ;
                MESSAGE "Pastes the contents of the Clipboard"
            DEFINE BAR 4 OF shortcut PROMPT "\-"
            DEFINE BAR _med_undo OF shortcut PROMPT "\<Undo" ;
                KEY CTRL+Z, "Ctrl+Z" ;
                MESSAGE "Undoes the last command or action"
            DEFINE BAR _med_redo OF shortcut PROMPT "Re\<do" ;
                KEY CTRL+R, "Ctrl+R" ;
                MESSAGE "Repeats the last command or action"
            DEFINE BAR 7 OF shortcut PROMPT "\-"
            DEFINE BAR _med_slcta OF shortcut PROMPT "Se\<lect All" ;
                KEY CTRL+A, "Ctrl+A" ;
                MESSAGE "Selects all text or items in the current window"

            ACTIVATE POPUP shortcut
     ENDPROC 

ENDDEFINE
*
*-- EndDefine: form1
**************************************************


*** From http://support.microsoft.com/kb/106161
FUNCTION _pix2fox
      PARAMETER m.apixel,m.dimension
      RETURN m.apixel/FONTMETRIC(IIF(UPPER(m.dimension) = "H",6,1))
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
Répondre
Fil
Voir

Click here to load this message in the networking platform