// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // Date Id Modification // // /// jln - 11-09-2008 Simple alert/messagebox function //============================================================================= class dialogPhaseIntro extends GeoGUIPage; var automated GeoFrame DialogBackground; var automated GeoMultiLineLabel TextLabel; var automated GeoButton CloseButton; var automated GeoLabel Title; function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.InitComponent(MyController, MyOwner); } function bool ButtonClick(GUIComponent Sender) { /// jln - 05-09-2008 Close window: if (Sender == CloseButton) { Controller.CloseMenu(); } return true; } function setText(string text) { TextLabel.SetContent(text); } /// jln - 30-09-2008 Parameter 1 is the text. event HandleParameters(string Param1, string Param2) { setText(GeoPC.IL8N(Param1, "GeoInterface.dialogPhaseIntro")); Title.Caption = GeoPC.IL8N(Param1 $ "title", "GeoInterface.dialogPhaseIntro"); /// With a lot of text, make the dialog larger: if (Len(GeoPC.IL8N(Param1, "GeoInterface.dialogPhaseIntro")) > 300) { DialogBackground.WinHeight += 0.1; TextLabel.WinHeight += 0.1; CloseButton.WinTop += 0.1; /// jln - 28-11-2008 Kinda silly, but makes it clear what we are doing - raising the dialog to keep it centered better: DialogBackground.WinTop -= 0.05; TextLabel.WinTop -= 0.05; CloseButton.WinTop -= 0.05; Title.WinTop -= 0.05; } } //============================================================================= // Date Id Modification //============================================================================= defaultproperties { Begin Object Class=GeoFrame name=TDialogBackground WinWidth=0.5 WinLeft=0.25 WinTop=0.3 WinHeight=0.4 End Object Begin Object class=GeoMultiLineLabel name=TTextOne IniOption="TTextOne" WinHeight=0.20 WinWidth=0.4 WinTop=0.4 WinLeft=0.3 End Object Begin Object class=GeoButton Name=TCloseButton IniOption="TCloseButton" WinWidth=0.12 WinLeft=0.44 WinTop=0.6 OnClick=ButtonClick End Object Begin Object class=GeoLabel Name=TTitle WinWidth=0.4 WinLeft=0.3 WinTop=0.36 End Object DialogBackground = TDialogBackground TextLabel = TTextOne CloseButton = TCloseButton Title = TTitle AllowSelect = true bAllowedAsLast=true bDisconnectOnOpen=false bPersistent=false }