// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. //============================================================================= // // ------------------------------------------------------------ // © 2006, Geodelft // // Date Id Modification // 2006-10-07 The Created this header // 2006-10-08 The Implemented Dutch translations // 2006-10-25 The Hide control InputMouseSmoothStr //============================================================================= class MenuAboutTab extends GUITabPanel; var GeoPlayerController GeoPC; var float ButtonWidth, ButtonTabWidth, ButtonHeight, ButtonHGap, ButtonVGapSmall, ButtonVGapLarge, BarHeight, BarVPos, SButtonSize, SButtonVGap, SButtonHGap, TitleLeftGap, LineHeight; var GuiComponent GuiOwner; var MenuAbout MenuOwner;// in this case the MenuAbout, where this tab is created. enum HandBookImageModes { MODE_None, MODE_Square, MODE_NoneSquare }; struct MenuAboutInfo { var string NL_ButtonText; var string EN_ButtonText; var string NL_ButtonHint; var string EN_ButtonHint; var array NL_Text; var array EN_Text; var material Picture; var HandBookImageModes ImageMode; }; var array MenuAboutDataSet; var string EN_Title, NL_Title, FirstBullit,XthBullit,AfterLastBullit; //============================================================================= // Date Id Modification // 2006-10-07 The Created this header //============================================================================= function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.Initcomponent(MyController, MyOwner); GuiOwner = MyOwner; GeoPC = GeoPlayerController(PlayerOwner()); MenuOwner = MenuAbout(MyOwner.MenuOwner); // Menu Background Controls[0].WinWidth = MenuOwner.TabWidth; Controls[0].WinHeight = MenuOwner.TabHeight; Controls[0].WinLeft = MenuOwner.TabLeft; Controls[0].WinTop = MenuOwner.TabTop;//0 + SButtonHGap; Controls[0].bVisible = false; //Title Controls[1].WinLeft = Controls[0].WinLeft;// + ButtonHGap; Controls[1].WinTop = Controls[0].WinTop; Controls[1].WinWidth = Controls[0].WinWidth; Controls[1].WinHeight =0;//ButtonHeight; // FIlling the data set so the buttons can be made; MakeData(); //Buttons if(MenuAboutDataSet.Length == 1) { for(i = 2; i<17 ; i++) { Controls[i].bVisible = false; } LoadHandBookInfo(MenuAboutDataSet[0]); Controls[17].WinLeft = MenuOwner.TabLeft; Controls[17].WinWidth = Controls[0].WinWidth - 2*MenuOwner.TabLeft; Controls[18].WinLeft = Controls[17].WinLeft + Controls[17].WinWidth/2 - Controls[18].WinWidth/2; }else { for(i = 2; i<17 ; i++) { Controls[i].bVisible = true; Controls[i].WinWidth = ButtonTabWidth; Controls[i].WinHeight = ButtonHeight; Controls[i].WinLeft = MenuOwner.TabLeft; if( i == 2) { Controls[i].WinTop = Controls[0].WinTop;// + Controls[2].WinHeight + ButtonVGapLarge; }else { Controls[i].WinTop = Controls[i-1].WinTop + LineHeight + SButtonVGap; } if((i -2) < MenuAboutDataSet.Length ) { if(GeoPC.Dutch) { GUIButton(Controls[i]).Caption = MenuAboutDataSet[i-2].NL_ButtonText; GUIButton(Controls[i]).Hint = MenuAboutDataSet[i-2].NL_ButtonHint; }else { GUIButton(Controls[i]).Caption = MenuAboutDataSet[i-2].EN_ButtonText; GUIButton(Controls[i]).Hint = MenuAboutDataSet[i-2].EN_ButtonHint; } }else { Controls[i].bVisible = false; } } LoadHandBookInfo(MenuAboutDataSet[0]); } for(i = 0; i< Controls.Length; i++) { Controls[i].wintop = Controls[i].wintop -2; } } //============================================================================= // Date Id Modification // 2006-10-07 The Created this function //============================================================================= function ShowPanel(bool bShow) { local int i; Super.ShowPanel(bShow); //log("ShowPanel MenuHandBookTab"); if(bShow) { for(i = 0; i< Controls.Length; i++) { Controls[i].wintop = Controls[i].wintop +2; } }else { for(i = 0; i< Controls.Length; i++) { Controls[i].wintop = Controls[i].wintop -2; } } LoadHandBookInfo(MenuAboutDataSet[0]); } function ViewOnlyText() { Controls[17].WinLeft = MenuAbout(GuiOwner.MenuOwner).TabLeft + ButtonTabWidth+ButtonVGapSmall ; Controls[17].WinTop = Controls[0].WinTop; Controls[17].WinWidth = 1 - 2*MenuAbout(GuiOwner.MenuOwner).TabLeft -ButtonTabWidth - 2*ButtonVGapSmall; Controls[17].WinHeight = Controls[0].WinHeight;// - Controls[17].WinTop; Controls[18].bVisible = false; } function ViewSquareImage() { ViewOnlyText(); Controls[18].bVisible = true; Controls[17].WinHeight = (Controls[17].WinHeight / 2) - ButtonVGapLarge/2; Controls[18].WinHeight = Controls[17].WinHeight; Controls[18].WinTop = Controls[17].WinTop + Controls[17].WinHeight + ButtonVGapLarge; Controls[18].WinWidth = Controls[18].WinHeight; Controls[18].WinLeft = Controls[17].WinLeft + Controls[17].WinWidth/2 - Controls[18].WinWidth/2; } function ViewNonSquareImage() { ViewOnlyText(); Controls[18].bVisible = true; Controls[18].WinWidth = Controls[17].WinWidth; Controls[18].WinHeight = Controls[18].WinWidth / 2; Controls[18].WinLeft = Controls[17].WinLeft + Controls[17].WinWidth/2 - Controls[18].WinWidth/2; Controls[17].WinHeight = Controls[17].WinHeight - Controls[18].WinHeight - ButtonVGapLarge; Controls[18].WinTop = Controls[17].WinTop + Controls[17].WinHeight + ButtonVGapLarge; } function MakeData() { //to be filled in when extended } /// 2008-01-17 Jln New method for adding text to the textbox, so that it does not disappear anymore. function LoadHandBookInfo(MenuAboutInfo HBInfo) { local int i; local string text; if(HBInfo.ImageMode == HandBookImageModes.MODE_None) { ViewOnlyText(); }else if(HBInfo.ImageMode == HandBookImageModes.MODE_Square) { ViewSquareImage(); GUIImage(Controls[18]).Image = HBInfo.Picture; }if(HBInfo.ImageMode == HandBookImageModes.MODE_NoneSquare) { ViewNonSquareImage(); GUIImage(Controls[18]).Image = HBInfo.Picture; } GUIScrollTextBox(Controls[17]).MyScrollText.Separator = "|"; if(GeoPC.Dutch) { text = ""; for(i = 0; i< HBInfo.NL_Text.Length; i++) { text = text $ HBInfo.NL_Text[i]; } GUIScrollTextBox(Controls[17]).SetContent(text); GUILabel(Controls[1]).Caption = HBInfo.NL_ButtonText; MenuOwner.TitleBar.Caption = MenuOwner.NL_Title$" - "$NL_Title$" - "$HBInfo.NL_ButtonText; } else { /// 2008-01-17 Jln New method for displaying text. text = ""; for(i = 0; i< HBInfo.NL_Text.Length; i++) { text = text $ HBInfo.EN_Text[i]; } GUIScrollTextBox(Controls[17]).SetContent(text); /* Old method, which causes a problem: Sometimesw the text is not readable: GUIScrollTextBox(Controls[17]).SetContent(HBInfo.EN_Text[0]); for(i = 1; i< HBInfo.EN_Text.Length; i++) { GUIScrollTextBox(Controls[17]).AddText(HBInfo.EN_Text[i]); } */ GUILabel(Controls[1]).Caption = HBInfo.EN_ButtonText; } if(MenuAboutDataSet.Length == 1) { Controls[17].WinLeft = MenuOwner.TabLeft; Controls[17].WinWidth = Controls[0].WinWidth - 2*MenuOwner.TabLeft; Controls[18].WinLeft = Controls[17].WinLeft + Controls[17].WinWidth/2 - Controls[18].WinWidth/2; if(GeoPC.Dutch) { MenuOwner.TitleBar.Caption = MenuOwner.NL_Title $ " - " $NL_Title; }else { MenuOwner.TitleBar.Caption = MenuOwner.EN_Title $ " - " $EN_Title; } } } //============================================================================= // Date Id Modification // 2006-10-07 The Created this header //============================================================================= function UpdateLanguage() { if (GeoPC.Dutch) { } else { } } function bool InternalOnClick(GUIComponent Sender) { local int i; for(i = 0; i < Controls.length; i++) { if(Sender == Controls[i]) { if(i>1 && i<17) { LoadHandBookInfo(MenuAboutDataSet[i-2]); } }else if(Sender == Controls[2]) { MenuOwner.TabC.ActivateTabByName("Link",true); } } return true; } //============================================================================= // Date Id Modification // 2006-10-07 The Created this header //============================================================================= defaultproperties { // Begin Object class=GUITitleBar Name=MenuTitle // Caption="Levee Patroller Options" // StyleName="Header" // End Object // Controls(0)=GUITitleBar'MenuTitle Begin Object Class=GUIButton name=Background bAcceptsInput=false bNeverFocus=true StyleName="GeoCallBar" End Object Controls(0)=GUIButton'Background' Begin Object class=GUILabel Name=TopicDesc Caption="" TextALign=TXTA_Center TextColor=(R=255,G=120,B=0,A=255) TextFont="HeaderFont" bVisible=false; End Object Controls(1)=GUILabel'TopicDesc' Begin Object Class=GUIButton Name=Ok Caption="***" StyleName="MidGameButton" bNeverFocus=true OnClick=InternalOnClick End Object Controls(2)=GUIButton'Ok' Controls(3)=GUIButton'Ok' Controls(4)=GUIButton'Ok' Controls(5)=GUIButton'Ok' Controls(6)=GUIButton'Ok' Controls(7)=GUIButton'Ok' Controls(8)=GUIButton'Ok' Controls(9)=GUIButton'Ok' Controls(10)=GUIButton'Ok' Controls(11)=GUIButton'Ok' Controls(12)=GUIButton'Ok' Controls(13)=GUIButton'Ok' Controls(14)=GUIButton'Ok' Controls(15)=GUIButton'Ok' Controls(16)=GUIButton'Ok' Begin Object Class=GUIScrollTextBox Name=cScroll_LevelDescription CharDelay=0.0021 EOLDelay=0.001 bNeverFocus=true bVisibleWhenEmpty=true bNoTeletype=true bStripColors=false End Object Controls(17)=GUIScrollTextBox'cScroll_LevelDescription' Begin Object class=GUIImage Name=Pict //Image=Material'InGameMenuImagesT.Handbook.ErosionInner' ImageColor=(R=255,G=255,B=255,A=255); ImageStyle=ISTY_Justified ImageAlign=IMGA_Center End Object Controls(18)=GUIImage'Pict' //standard variables ButtonWidth=0.2 ButtonTabWidth=0.21 ButtonHeight=0.04 ButtonHGap=0.025 ButtonVGapLarge=0.03 ButtonVGapSmall=0.02 BarHeight=0.21 BarVPos=0.5 SButtonSize=0.06 SButtonHGap=0.02 SButtonVGap=0.02 TitleLeftGap=0.05 LineHeight=0.035 bFillHeight = true; EN_Title="TabTitle" NL_Title="TabTitle" FirstBullit = "|| * " XthBullit = "| * " AfterLastBullit = "||" }