** ****************************************************************************************** * **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 ; long : color1; char : wParamChar:1; 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, 20, "Name " ,text1 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 60, 137, 20, "Surname (prénom)" ,text2 Text: WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 90, 61, 20, "Adresse" ,text3 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 120, 93, 20, "Code Town" ,text4 Text: WinExtendstyle : :0 Winstyle : :SS_LEFT 19,150, 80, 20, "Town Ville" ,text5 Text: WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 180, 72, 20, "Telephon" ,text6 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 210, 28, 20, "Fax" ,text7 Text : WinExtendstyle : :0 Winstyle : :SS_LEFT 19, 240, 90, 20, "Pays/Country" ,text8 Rectangle 185, 25, 315, 25, Announce1 Attribut : FillColor : 192,193,218 FrameColor : 255,255,255 TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 30, 315, 20, ZoneTexte1 create : like ref.name TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 60, 160, 20, ZoneTexte2 create : like ref.surname TextBox : WinExtendstyle : :0 Winstyle : :ES_LEFT 190, 90, 412, 20, 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 : :0 Winstyle : :ES_LEFT & :ES_NUMBER 190, 180, 160, 25, ZoneTexte6 create : like ref.Telephon TextBox : WinExtendstyle : :WS_EX_CLIENTEDGE Winstyle : :ES_LEFT 190, 210, 160, 25, ZoneTexte7 create : like ref.Fax TextBox : WinExtendstyle : :WS_EX_CLIENTEDGE Winstyle : :ES_LEFT 190, 240, 160, 50, ZoneTexte8 create : like ref.Country Announce 190, 55, 160, 25, Announce2 Attribut : FillColor : 192,193,218 FrameColor : 255,255,255 ShadowText : 1,1 color(255,255,255) SetColorText : 0,0,0 DrawText : DT_LEFT SetFonts : 16,10,0,0,FW_EXTRABOLD,0,0,0,"Arial" Announce 190, 85, 412, 25, Announce3 Attribut : FillColor : 192,193,218 FrameColor : 255,255,255 ShadowText : 1,1 color(255,255,255) SetColorText : 0,0,0 DrawText : DT_LEFT SetFonts : 16,10,0,0,FW_EXTRABOLD,0,0,0,"Arial" Elliptical 12,370,50,50,Cercle1 Attribut : FillColor : 171,220,102 FrameColor : 185,50,90 ShadowText : -1, -3 color(0,0,255) SetColorText : 166, 69,111 DrawText : DT_CENTER SetFonts : 20,9,0,0,FW_EXTRABOLD,1,1,0,"Arial" ButtonRegionChild 12,370,48,48, BoutonCancel create : use Cursor "c:\EndUser4gl\4gl\hlp\PgmCursor\hand-l.cur" , info " Option @ Quit " Announce 12, 425, 600, 45, Announce4 Attribut : FillColor : 255,255,255 FrameColor : 0,0,0 ShadowText : 1,1 color(0,0,0) SetColorText : 0,0,255 DrawText : DT_CENTER SetFonts : 16,10,1,1,FW_EXTRABOLD,0,0,0,"Arial" **PushIcon 12, 370, 120,50, ICON_HAND , BoutonCancel Create : Info " Bye Bye........." 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" ; color(192,193,218) returning(color1);SetWinTxt(Announce4:"Text \ TextBox \ Dialog \ Transaction \ Announce \ Rectangle...."); SetWinTxt(Cercle1:"Quit"); 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);SetWinTxt(Announce2:ref.surname ); SetColorText (ZoneTexte2:blue,-1); SetWinTxt(Announce3:ref.adresse); SetColorText (ZoneTexte4:green,-1); SetColorText (ZoneTexte5:cyan,-1); SetColorText (ZoneTexte6:red,-1); SetColorText (ZoneTexte8:yellow,-1); End_Initialize 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 */ Begin_Message_Dialog(UserDialog)::INPUTDATA (wParamChar) isOnInputDATA(ZoneTexte2) returning (x); if( x Not_Void ) then SetWinTxt(Announce2:ref.surname ); RefreshWin(Announce2); end_if; isOnInputDATA(ZoneTexte3) returning (x); if( x Not_Void ) then SetWinTxt(Announce3:ref.adresse ); RefreshWin(Announce3); end_if; **display "ok : ",wParamChar; End_Message_Dialog /* WM_xxxxx */ end_transaction