// 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 MenuHandBookTab extends GUITabPanel; var GeoPlayerController GeoPC; var float ButtonWidth, ButtonTabWidth, ButtonHeight, ButtonHGap, ButtonVGapSmall, ButtonVGapLarge, BarHeight, BarVPos, SButtonSize, SButtonVGap, SButtonHGap, TitleLeftGap, LineHeight; var GuiComponent GuiOwner; var MenuHandBook MenuOwner;// in this case the MenuHandBook, where this tab is created. enum HandBookImageModes { MODE_None, MODE_Square, MODE_NoneSquare }; struct HandBookInfo { var string NL_ButtonText; var string EN_ButtonText; var array NL_Text; var array EN_Text; var material Picture; var HandBookImageModes ImageMode; }; var array HandBookDataSet; 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 = MenuHandbook(MyOwner.MenuOwner); // Menu Background Controls[0].WinWidth = MenuOwner.TabWidth; Controls[0].WinHeight = 0.9; Controls[0].WinLeft = MenuOwner.TabLeft; Controls[0].WinTop = 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; //back button Controls[2].WinLeft = Controls[0].WinLeft;// + ButtonHGap; Controls[2].WinTop = Controls[0].WinTop; Controls[2].WinWidth = ButtonHeight; Controls[2].WinHeight = ButtonHeight; // FIlling the data set so the buttons can be made; MakeData(); //Buttons for(i = 3; i<17 ; i++) { Controls[i].bVisible = true; Controls[i].WinWidth = ButtonTabWidth; Controls[i].WinHeight = lineHeight; Controls[i].WinLeft = MenuOwner.TabLeft; if( i == 3) { Controls[i].WinTop = Controls[2].WinTop + Controls[2].WinHeight + ButtonVGapLarge; }else { Controls[i].WinTop = Controls[i-1].WinTop + LineHeight + SButtonVGap; } if((i -3) < HandBookDataSet.Length ) { if(GeoPC.Dutch) { GUIButton(Controls[i]).Caption = HandBookDataSet[i-3].NL_ButtonText; }else { GUIButton(Controls[i]).Caption = HandBookDataSet[i-3].EN_ButtonText; } }else { Controls[i].bVisible = false; } } LoadHandBookInfo(HandBookDataSet[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(HandBookDataSet[0]); } function ViewOnlyText() { Controls[17].WinLeft = MenuHandbook(GuiOwner.MenuOwner).TabLeft + ButtonTabWidth+ButtonVGapSmall ; Controls[17].WinTop = Controls[2].WinTop; Controls[17].WinWidth = 1 - 2*MenuHandbook(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; Log(GeoPC.ConsoleCommand("GetCurrentRes")); 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 } function LoadHandBookInfo(HandBookInfo 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 = "|"; text = ""; if(GeoPC.Dutch) { for(i = 0; i< HBInfo.NL_Text.Length; i++) { text = text $ HBInfo.NL_Text[i]; } GUILabel(Controls[1]).Caption = HBInfo.NL_ButtonText; MenuOwner.TitleBar.Caption = MenuOwner.NL_Title$" - "$NL_Title$" - "$HBInfo.NL_ButtonText; }else { for(i = 0; i< HBInfo.EN_Text.Length; i++) { text = text $ HBInfo.EN_Text[i]; } GUILabel(Controls[1]).Caption = HBInfo.EN_ButtonText; MenuOwner.TitleBar.Caption = MenuOwner.EN_Title $ " - " $EN_Title$" - " $HBInfo.EN_ButtonText; } GUIScrollTextBox(Controls[17]).SetContent(text); GUIScrollTextBox(Controls[17]).InternalOnAdjustTop(Controls[17]); } //============================================================================= // 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>2 && i<17) { LoadHandBookInfo(HandBookDataSet[i-3]); }else { /*switch(i) { case 1: // Quit Button Controller.ReplaceMenu("GeoSimulator.MenuMarker"); break; case 2: // Help Button Controller.OpenMenu("GeoSimulator.HelpMenuHandBook"); bVisible = false; break; } */ } }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="horizontal movement" StyleName="MidGameButton" bNeverFocus=true OnClick=InternalOnClick End Object 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' Begin Object Class=GUIGFxButton Name=PreviousPage Caption="" Graphic=Material'InGameMenuImagesT.NoBackgroundButtons.Previous' Position=ICP_Scaled StyleName="MidGameButton" bNeverFocus=true OnClick=InternalOnClick End Object Controls(2)=GUIButton'PreviousPage' //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 = "||" }