// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // Date Id Modification // // /// jln - 11-09-2008 Simple alert/messagebox function //============================================================================= class dialogAlert extends GeoGUIPage; var automated GeoFrame DialogBackground; var automated GeoMultiLineLabel TextLabelMultiLine; var automated GeoLabel TextLabel; var automated GeoButton CloseButton; var automated GeoImage Picture; var bool bMultiLineText; 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) { if(Len(text) > 70) { bMultiLineText = true; TextLabelMultiLine.SetVisibility(true); TextLabel.SetVisibility(false); TextLabelMultiLine.SetContent(text); } else { bMultiLineText = false; TextLabelMultiLine.SetVisibility(false); TextLabel.SetVisibility(true); TextLabel.Caption = text; } } /// jln - 30-09-2008 Parameter 1 is the text. event HandleParameters(string Param1, string Param2) { setText(Param1); ///Set image if name is given: if (Len(Param2) > 0) { Picture.Image = Material(DynamicLoadObject(Param2, class'Material')); } } //============================================================================= // Date Id Modification //============================================================================= defaultproperties { Begin Object Class=GeoFrame name=TDialogBackground WinWidth=1.0 WinLeft=0.0 WinTop=0.375 WinHeight=0.3 End Object Begin Object class=GeoMultiLineLabel name=TTextMulti IniOption="TTextOne" WinHeight=0.2 WinWidth=0.7 WinTop=0.45 WinLeft=0.1 bVisible=false End Object Begin Object class=GeoLabel name=TText IniOption="TTextOne" TextAlign=TXTA_Center WinHeight=0.1 WinWidth=1.0 WinTop=0.435 WinLeft=0.0 TextFont="GeoNormalFont" End Object Begin Object class=GeoButton Name=TCloseButton IniOption="TCloseButton" WinWidth=0.12 WinLeft=0.44 WinTop=0.56 OnClick=ButtonClick End Object Begin Object class=GeoImage name=TPicture WinHeight=0.2 WinWidth=0.2 WinTop=0.43 WinLeft=0.8 End Object DialogBackground = TDialogBackground TextLabelMultiLine=TTextMulti TextLabel = TText CloseButton = TCloseButton Picture = TPicture AllowSelect = true bAllowedAsLast=true bDisconnectOnOpen=false bPersistent=false }