Exemple #1
0
        public TextBox(
            IUserInterfaceGenerator userInterfaceGenerator,
            IGameSettings gameSettings,
            IMouse mouse)
            : base(mouse, gameSettings)
        {
            var width  = gameSettings.NativeWidth - (gameSettings.NativeWidth / 4);
            var height = gameSettings.NativeHeight - (gameSettings.NativeHeight / 4);

            maxSize            = new PointF(width, height);
            label              = userInterfaceGenerator.MakeLabel(this);
            label.TextWrapping = TextWrapping.Wrap;

            Child = label;
        }
Exemple #2
0
        public Rest(
            IUserInterfaces userInterfaces,
            IUserInterfaceGenerator userInterfaceGenerator,
            IMouse mouse,
            IGameSettings gameSettings)
            : base(mouse, gameSettings)
        {
            this.userInterfaces = userInterfaces;

            var stack = userInterfaceGenerator.MakeStackPanel(this);

            stack.Orientation = Orientation.Vertical;

            TenButton                = userInterfaceGenerator.MakeButton(stack);
            TenButton.Child          = userInterfaceGenerator.MakeLabel("10 minutes", TenButton);
            TenButton.MouseButtonUp += TenBtnOnMouseButtonUp;

            ThirtyButton                = userInterfaceGenerator.MakeButton(stack);
            ThirtyButton.Child          = userInterfaceGenerator.MakeLabel("30 minutes", ThirtyButton);
            ThirtyButton.MouseButtonUp += ThirtyBtnOnMouseButtonUp;

            SixtyButton                = userInterfaceGenerator.MakeButton(stack);
            SixtyButton.Child          = userInterfaceGenerator.MakeLabel("60 minutes", SixtyButton);
            SixtyButton.MouseButtonUp += SixtyBtnOnMouseButtonUp;

            SleepButton                = userInterfaceGenerator.MakeButton(stack);
            SleepButton.Child          = userInterfaceGenerator.MakeLabel("Sleep", SleepButton);
            SleepButton.MouseButtonUp += SleepBtnOnMouseButtonUp;

            CancelButton                = userInterfaceGenerator.MakeButton(stack);
            CancelButton.Child          = userInterfaceGenerator.MakeLabel("Cancel", CancelButton);
            CancelButton.MouseButtonUp += CancelBtnOnMouseButtonUp;

            stack.Children.Add(userInterfaceGenerator.MakeLabel("Rest for how long", stack));
            stack.Children.Add(TenButton);
            stack.Children.Add(ThirtyButton);
            stack.Children.Add(SixtyButton);
            stack.Children.Add(SleepButton);
            stack.Children.Add(CancelButton);

            Child = stack;
        }