public TileSelector(Int32 width = DEFAULT_SIZE, Int32 height = DEFAULT_SIZE) : base() { Width = width; Height = height; VMainBox = new VAutoSizeBox(false); HMidleBox = new HAutoSizeBox(); MultiBox = new MultiBox(Alignment.Vertical, Height, Width); MultiBox.SetSize(Width); MultiBox.OnVPointerChange += new PointerChangeEventHandler(MultiBox_OnVPointerChange); MultiBox.OnHPointerChange += new PointerChangeEventHandler(MultiBox_OnHPointerChange); VScrollBar = new VScrollBar(); VScrollBar.Scrolled += new ScrollEventHandler(VScrollBar_Scrolled); HScrollBar = new HScrollBar(); HScrollBar.Scrolled += new ScrollEventHandler(HScrollBar_Scrolled); AddWidget(VMainBox); VMainBox.AddItem(HMidleBox, 0, HAlignment.Right); HMidleBox.AddItem(MultiBox); HMidleBox.AddItem(VScrollBar); VMainBox.AddItem(HScrollBar); }
private ConfirmationDialogBox() : base("Confirmation") { ButtonBox = new HAutoSizeBox(); AddItem(ButtonBox, 0, HAlignment.Center); YesButton = new Button("Yes", Button.EMode.BackgroundLabel, true); YesButton.Clicked += new ClickEventHandler(YesButton_Clicked); ButtonBox.AddItem(YesButton); NoButton = new Button("No", Button.EMode.BackgroundLabel, true); NoButton.Clicked += new ClickEventHandler(NoButton_Clicked); ButtonBox.AddItem(NoButton); }
public UpDownBox( Int32 minValue = DEFAULT_MIN_VALUE, Int32 maxValue = DEFAULT_MAX_VALUE, Int32 scaleValue = DEFAULT_SCALE_VALUE, Int32 defaultValue = DEFAULT_DEFAULT_VALUE, String label = null, LabeledWidget.EMode mode = DEFAULT_MODE, Boolean shortCutMode = DEFAULT_SHORTCUT_MODE) : base(label, mode, shortCutMode) { MinValue = minValue; MaxValue = maxValue; ScaleValue = scaleValue; DefaultValue = defaultValue; MainBox = new HAutoSizeBox(true, null, 0); ButtonBox = new VAutoSizeBox(true, null, 0); DownBtn = new Button(Create.Texture("Gui_DownButtonN"), Create.Texture("Gui_DownButtonO")); DownBtn.Dimension *= BUTTON_RESIZE_FACTOR; DownBtn.Clicked += new ClickEventHandler(DownBtn_Clicked); AddWidget(DownBtn); UpBtn = new Button(Create.Texture("Gui_UpButtonN"), Create.Texture("Gui_UpButtonO")); UpBtn.Dimension *= BUTTON_RESIZE_FACTOR; UpBtn.Clicked += new ClickEventHandler(UpBtn_Clicked); ButtonBox.AddItem(UpBtn); ButtonBox.AddItem(DownBtn); TextBox = new TextBox(BlazeraLib.TextBox.EInputType.Numeric); SetCurrentValue(GetDefaultValue()); TextBox.Dimension = new SFML.Window.Vector2f(40F, UpBtn.Dimension.Y + DownBtn.Dimension.Y); TextBox.TextAdded += new TextAddedEventHandler(TextBox_TextAdded); AddWidget(TextBox); ValueIsModified = false; MainBox.AddItem(TextBox); MainBox.AddItem(ButtonBox); AddLabeledWidget(MainBox); GetLabelWidget().Clicked += new ClickEventHandler(UpDownBox_Clicked); }
public MessageBox() : base() { Padding = DEFAULT_PADDING; MainBox = new HAutoSizeBox(); MainBox.Position = GetGlobalFromLocal(new Vector2f()); AddWidget(MainBox); Messages = new List<string>(); MessageBuilder = new MessageBuilder(new MessageBuilder.CInfo( new Vector2f(MAX_WIDTH, MAX_HEIGHT), GameData.DEFAULT_FONT, Label.GetSizeFromESize(DEFAULT_TEXT_SIZE), DEFAULT_TEXT_STYLES)); InteractiveMode = true; CurrentMessageLabel = new Label(null, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_SIZE); CurrentMessageLabel.Style = DEFAULT_TEXT_STYLES; MainBox.AddItem(CurrentMessageLabel, 0, VAlignment.Top); LetterTimer = new Timer(); IsPlaying = false; IsLooping = false; MessageIsCompleted = false; CurrentMessage = 0; CurrentLetter = 0; }
private void RefreshBox() { if (Alignment == BlazeraLib.Alignment.Vertical) GetVMainBox().Clear(); else GetHMainBox().Clear(); for (Int32 vCount = CurrentVPointer; vCount < CurrentVPointer + GetCurrentVSize(); vCount++) { List<Widget> newList = GetItems(vCount, CurrentHPointer, GetCurrentHSize(vCount)); if (Alignment == BlazeraLib.Alignment.Vertical) { HAutoSizeBox HB = new HAutoSizeBox(true, null, 0F); HB.AddItem(newList, 0, VAlignment.Top); GetVMainBox().AddItem(HB, 0, HAlignment.Left); } else { VAutoSizeBox VB = new VAutoSizeBox(true, null, 0F); VB.AddItem(newList, 0, HAlignment.Center); GetHMainBox().AddItem(VB, 0, VAlignment.Center); } } }