** ****************************************************************************************** * **EndUser4gl : Exemple d'un langage de 4 ème génération ** ******************************************************************************************* ** Exemple : SETBKCOLORBUTTON(l_name_button, L_couleur or Keyword) ** REQUIRE is optionnal ** ** Exemple : SETCOLORBUTTON( Param 1 : L_name_button, ** Param 2 : L_color BACKGROUND BUTTON ** Param 3 : L_color TEXT BUTTON ** Param 4 : L_color BACKGROUND TEXTBUTTON ** Param 5 : Status : push := 0 ou not push BUTTON := 1 #include "c:\EndUser4gl\4gl\hlp\IncludeSysEU\includesyseu.h" integer : exit_trans1 ,x ,i,status; long : G_color; begin_transaction : Trans1 Execute Transaction with exit_trans1 != 1 begin_dialog WinExtendstyle : :WS_EX_DLGMODALFRAME Winstyle : :WS_OVERLAPPED & :WS_CAPTION & :WS_SYSMENU & :WS_THICKFRAME & :WS_MINIMIZEBOX & :WS_MAXIMIZEBOX & CENTERDIALOG 100,20,450,550, " EndUser 4 GL : SetBkColorButton " ,UserDialog PushButton 100, 100, 200, 140, "Test SetBkColorButton ", Bouton1 PushIcon 1, 280, 88, 40, ICON_HAND , BoutonCancel Create : Info " Bye Bye........." PushButton 100, 350, 88, 40, "BLUE", BoutonBlue PushButton 100, 400, 88, 40, "YELLOW", BoutonYellow PushButton 200, 350, 88, 40, "ORANGE", BoutonOrange PushButton 200, 400, 88, 40, "GREEN", BoutonGreen end_dialog Begin_Initialize Color(255,128,154) returning(G_color); End_Initialize Begin /* Color Button */ status := 1; SetColorButton(Bouton1:G_color,BLACK,PINK,status); SetColorButton(BoutonBlue:NO_BACKGROUND,WHITE,BLUE,0); SetColorButton(BoutonYellow:YELLOW,BLACK,RED,status); SetColorButton(BoutonOrange:ORANGE,WHITE,BLACK,0); SetColorButton(BoutonGreen:GREEN,RED,NO_BACKGROUND,status); end_begin ; OpenDialog (UserDialog) ; require GetPush(BoutonCancel) returning (x); if( x Not_Void ) then MsgBox : TITLE "My First DialogBkColor " Message : " Push is ok : Cancel Transaction" button : MB_OK icon : MB_ICONEXCLAMATION returning (x) ; exit_trans1 := 1 ; end_if; Begin /* select New Color */ require GetPush(BoutonBLUE) returning (x); if( x Not_Void ) then Color(0,0,255) returning(G_color); end_if; require GetPush(BoutonORANGE) returning (x); if( x Not_Void ) then Color(255,128,74) returning(G_color); end_if; require GetPush(BoutonYELLOW) returning (x); if( x Not_Void ) then Color(255, 255, 0) returning(G_color); end_if; require GetPush(BoutonGREEN) returning (x); if( x Not_Void ) then Color(0,255,0) returning(G_color); end_if; end_begin ; end_transaction ;