** ****************************************************************************************** * **EndUser4gl : Exemple d'un langage de 4 ème génération ** ******************************************************************************************* ** ** initialize dialog and Link Structure xxx with Windows in BLOC INITIALIZE ** #include "c:\EndUser4gl\4gl\hlp\IncludeSysEU\includesyseu.h" integer : exit_trans1 ,x ; char : toto:50 := "1234567890"; struct : ref { char Name: 25 , Surname:15 , Adresse:40 , Town:30 , Telephon:24, Fax:24, Country:20 ; long CodeTown ; } begin_transaction : Trans1 Execute Transaction with exit_trans1 != 1 begin_dialog Backgroundcolor : color(98,120,250) WinExtendstyle : :WS_EX_DLGMODALFRAME Winstyle : :WS_OVERLAPPED & :WS_CAPTION & :WS_SYSMENU & :WS_MINIMIZEBOX & :WS_MAXIMIZEBOX & CENTERDIALOG 100,250,680,500, " EndUser Dialog",UserDialog Rectangle 55, 15,560, 400, BkColor15 Attribut : FillColor : 230,242,218 FrameColor : 230,242,218 Rectangle 50, 10,555, 395, BkColor16 Attribut : FillColor : 144,208,213 FrameColor : 0,0,255 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 30, 49, 25, "Name " ,text1 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 60, 137, 25, "Surname (prénom)" ,text2 Text: WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 90, 61, 25, "Adresse" ,text3 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 120, 93, 25, "Code Town" ,text4 Text: WinExtendstyle : :0 Winstyle : :SS_LEFT 19,150, 80, 25, "Town Ville" ,text5 Text: WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 180, 72, 25, "Telephon" ,text6 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 210, 28, 25, "Fax" ,text7 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 240, 90, 25, "Pays/Country" ,text8 TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 30, 315, 25, ZoneTexte1 create : like ref.name Rectangle 187, 57,165, 30, BkColor41 Attribut : FillColor : 0,145,145 FrameColor : 0,145,145 TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 60, 160, 25, ZoneTexte2 create : like ref.surname TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 90, 412, 25, ZoneTexte3 create : like ref.adresse TextBox: WinExtendstyle : :WS_EX_CLIENTEDGE Winstyle : :ES_LEFT & :ES_NUMBER 190, 120, 110, 25, ZoneTexte4 create : like ref.CodeTown TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190,150, 268, 25, ZoneTexte5 create : like ref.Town TextBox : WinExtendstyle : :WS_EX_CLIENTEDGE Winstyle : :ES_LEFT & :ES_NUMBER 190, 180, 160, 25, ZoneTexte6 create : like ref.Telephon TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 210, 160, 25, ZoneTexte7 create : like ref.Fax TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 240, 160, 50, ZoneTexte8 create : like ref.Country PictureGIF 30 ,415, "c:\EndUser4gl\4gl\hlp\PgmGif\gifanimate\theend.gif",GifEndUser1 ButtonRegionChild 25,420,48,48, BoutonCancel create : use Cursor "c:\EndUser4gl\4gl\hlp\PgmCursor\hand-l.cur" , info " Informations Quit @ CopyRight EndUser4gl Mai 2001 Ph Bergougnoux " end_dialog Begin_Initialize ref.surname := "Philippe" ; ref. Adresse := "14 rue Jean Moulin" ; ref.Town := "St Avertin" ; ref.CodeTown := 37550; ref.Telephon := "00.33.2.47.28.58.19" ; ref.Fax := "00.33.2.47.28.58.19" ; ref.Country := "France" ; SetBkColorGif( GifEndUser1:YELLOW); require enableWindow(ZoneTexte1) ; ref.name := " EndUser4gl........" ; IconDialog(UserDialog:"c:\EndUser4gl\4gl\hlp\pgmicon\19.ico"); ** -1 : no background color SetColorText (Text1:RED,-1); SetColorText (Text2:black,-1); SetColorText (Text3:black,-1); SetColorText (Text4:green,-1); SetColorText (Text5:cyan,-1); SetColorText (Text6:yellow,-1);SetColorText (Text7:green,-1); SetColorText (Text8:orange,-1); SetColorText (ZoneTexte1:RED,-1); SetColorText (ZoneTexte2:blue,-1); SetColorText (ZoneTexte4:green,-1); SetColorText (ZoneTexte5:cyan,-1); SetColorText (ZoneTexte6:red,-1); SetColorText (ZoneTexte8:yellow,-1); End_Initialize **REfreshWin(BkColor41); OpenDialog (UserDialog) ; InputData(); ** ************************************************************************************ ** If Click on Dialog : Message Windows ** ************************************************************************************ Begin_Message_Dialog(UserDialog)::OnClickDialog(void) require GetPush(BoutonCancel) returning (x); if( x Not_Void ) then MsgBox : TITLE "My First TextBox" Message : " Push is ok : Cancel Transaction............" button : MB_OK icon : MB_ICONEXCLAMATION returning (x) ; exit_trans1 := 1 ; end_if; End_Message_Dialog /* WM_xxxxx */ end_transaction