Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Define bar with a check box
Message
 
 
À
13/05/2018 13:57:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01659960
Message ID:
01659962
Vues:
38
Thank you, Yousfi.

>
>*this example is from foxhelp.see CNTBAR() 
>*it use 'set mark to' (see also foxhelp)
>*You must name this program <b>CNTBAR.PRG</b> mandatory
>
>
>
>SET DEFA TO ADDBS(JUSTPATH(SYS(16,1)))
>SET SYSMENU TO DEFA
>SET TALK OFF
>DEFINE PAD PADENV OF _MSYSMENU PROMPT 'E\<nvironment';
>    KEY ALT+R, 'ALT+R'
>ON PAD PADENV OF _MSYSMENU ACTIVATE POPUP POPENV
>DEFINE POPUP POPENV MARGIN RELATIVE COLOR SCHEME 4
>DEFINE BAR 1 OF POPENV PROMPT '\<Status Bar'
>DEFINE BAR 2 OF POPENV PROMPT '\<Clock'
>DEFINE BAR 3 OF POPENV PROMPT '\<Extended Video'
>DEFINE BAR 4 OF POPENV PROMPT 'St\<icky'
>DEFINE BAR 5 OF POPENV PROMPT '\<Restore vfp menu'
>
>ON SELECTION POPUP POPENV DO ENVIROPOP IN CNTBAR.PRG
>FOR I = 1 TO CNTBAR('popEnv')
>DO CASE
>CASE PRMBAR('popEnv', I) = 'Status Bar'
>IF _WINDOWS OR _MAC
>SET MARK OF BAR I OF POPENV TO SET('STATUS BAR') = 'ON'
>ELSE
>SET MARK OF BAR I OF POPENV TO SET('STATUS') = 'ON'
>ENDIF
>CASE PRMBAR('popEnv', I) = 'Clock'
>SET MARK OF BAR I OF POPENV TO  SET('CLOCK') = 'ON'
>CASE PRMBAR('popEnv', I) = 'Extended Video'
>SET MARK OF BAR I OF POPENV TO  SROW( ) > 25
>CASE PRMBAR('popEnv', I) = 'Sticky'
>SET MARK OF BAR I OF POPENV TO  SET('STICKY') = 'ON'
>ENDCASE
>ENDFOR
>
>PROCEDURE ENVIROPOP
>    DO CASE
>    CASE PROMPT() = 'Status'
>    IF MRKBAR('popEnv', BAR( ))
>    DO CASE
>    CASE _WINDOWS OR _MAC
>    SET STATUS BAR OFF
>    CASE _DOS
>    SET STATUS OFF
>    OTHERWISE
>ENDCASE
>SET MARK OF BAR BAR( ) OF POPENV TO .F.
>ELSE
>DO CASE
>CASE _WINDOWS OR _MAC
>SET STATUS BAR ON
>CASE _DOS
>SET STATUS ON
>OTHERWISE
>ENDCASE
>SET MARK OF BAR BAR( ) OF POPENV TO .T.
>ENDIF
>CASE PROMPT( ) = 'Clock'
>IF MRKBAR('popEnv', BAR( ))
>SET CLOCK OFF
>SET MARK OF BAR BAR( ) OF POPENV TO .F.
>ELSE
>DO CASE
>CASE _WINDOWS OR _MAC
>SET STATUS BAR ON
>SET CLOCK STATUS
>CASE _DOS
>SET CLOCK ON
>OTHERWISE
>ENDCASE
>SET MARK OF BAR BAR( ) OF POPENV TO .T.
>ENDIF
>CASE PROMPT( ) = 'Extended Video'
>IF MRKBAR('popEnv', BAR( ))
>SET DISPLAY TO VGA25
>SET MARK OF BAR BAR( ) OF POPENV TO .F.
>ELSE
>SET DISPLAY TO VGA50
>SET MARK OF BAR BAR( ) OF POPENV TO .T.
>ENDIF
>CASE PROMPT( ) = 'Sticky'
>IF MRKBAR('popEnv', BAR( ))
>DO CASE
>CASE _WINDOWS OR _MAC
>WAIT WINDOW 'STICKY is always on in this Visual FoxPro version'
>CASE _DOS
>SET STICKY OFF
>OTHERWISE
>ENDCASE
>SET MARK OF BAR BAR( ) OF POPENV TO .F.
>
>ELSE
>DO CASE
>CASE _WINDOWS OR _MAC
>WAIT WINDOW 'STICKY is always ON in Visual FoxPro'
>CASE _DOS
>SET STICKY ON
>OTHERWISE
>ENDCASE
>SET MARK OF BAR BAR( ) OF POPENV TO .T.
>ENDIF
>
>CASE PROMPT( ) ='Restore vfp menu'
>SET SYSMENU TO DEFA
>
>ENDCASE
>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform