public InventoryMerchantPane(MerchantId id)
        {
            var slotSpans = new IUiElement[InventoryHeight];

            for (int j = 0; j < InventoryHeight; j++)
            {
                var slotsInRow = new IUiElement[InventoryWidth];
                for (int i = 0; i < InventoryWidth; i++)
                {
                    int index = j * InventoryWidth + i;
                    slotsInRow[i] = new LogicalInventorySlot(new InventorySlotId(
                                                                 InventoryType.Merchant,
                                                                 (ushort)id,
                                                                 (ItemSlotId)((int)ItemSlotId.Slot0 + index)));
                }
                slotSpans[j] = new HorizontalStack(slotsInRow);
            }

            var slotStack     = new VerticalStack(slotSpans);
            var slotHalfFrame = new ButtonFrame(slotStack)
            {
                Theme = ButtonTheme.InventoryOuterFrame, Padding = -1
            };
            var header = new Header(new StringId(AssetType.SystemText, 0, (int)SystemTextId.Shop_Merchant));
            var stack  = new VerticalStack(header, slotHalfFrame)
            {
                Greedy = false
            };

            AttachChild(stack);
        }
            private StructuralGlyph HandleNewline(StructuralGlyph parent, StyleContext context)
            {
                StructuralGlyph newcontext;

                if (parent is GlyphLine) // normal case
                {
                    if (parent.Parent is VerticalStack)
                    {
                        newcontext = new GlyphLine
                        {
                            Style = context
                        };
                        parent.Parent.Add(newcontext);
                    }
                    else // parent.Parent is not a VerticalStack
                    {
                        var vertStack = new VerticalStack();
                        parent.Parent.Exchange(parent, vertStack);
                        vertStack.Add(parent);
                        newcontext = new GlyphLine
                        {
                            Style = context
                        };
                        vertStack.Add(newcontext);
                    }
                }
                else
                {
                    throw new NotImplementedException();
                }
                return(newcontext);
            }
Exemple #3
0
        public InventoryCharacterPane(PartyCharacterId activeCharacter, Func <InventoryPage> getPage)
        {
            _getPage = getPage;
            var page = _getPage();

            _summaryButton = new Button(SummaryButtonId, "I")
            {
                DoubleFrame = true, IsPressed = page == InventoryPage.Summary
            };
            _statsButton = new Button(StatsButtonId, "II")
            {
                DoubleFrame = true, IsPressed = page == InventoryPage.Stats
            };
            _miscButton = new Button(MiscButtonId, "III")
            {
                DoubleFrame = true, IsPressed = page == InventoryPage.Misc
            };
            var buttonStack = new HorizontalStack(
                new Padding(84, 0),
                new FixedSize(16, 15, _summaryButton),
                new FixedSize(16, 15, _statsButton),
                new FixedSize(16, 15, _miscButton));

            var stack = new VerticalStack(
                new InventoryActivePageSelector(activeCharacter, getPage),
                new Padding(0, 4),
                buttonStack
                );

            Children.Add(stack);
        }
    public NumericPromptDialog(IText text, int min, int max, int depth = 0) : base(DialogPositioning.Center, depth)
    {
        On <CloseWindowEvent>(e => Close());

        var textSection = new UiText(text);
        var slider      = new Slider(() => Value, x => Value = x, min, max);
        var button      = new Button(Base.SystemText.MsgBox_OK).OnClick(Close);

        Value = min;

        // 30
        var stack = new VerticalStack(
            new ButtonFrame(
                new HorizontalStack(
                    textSection,
                    new Spacing(0, 31)))
        {
            State = ButtonState.Pressed
        },
            new Spacing(0, 5),
            slider,
            new Spacing(0, 5),
            button,
            new Spacing(186, 0));

        AttachChild(new DialogFrame(stack)
        {
            Background = DialogFrameBackgroundStyle.MainMenuPattern
        });
    }
        /*---------------------------------------------\
        |/--------\2/---------------------------------\|^5
        ||        | | Take how many items?            ||
        ||ITEM PIC| |                                 ||
        ||1:1 size| |       151x30(inner)             ||
        |\--------/ |                                 ||
        |^6         \---------------------------------/|
        |                         ^5                 7^|
        |    [<] [=======[  3  ]==============] [>]    |
        |                   [    OK    ]   ^4          |
        \---------------------------------------------*///^5
        public ItemQuantityDialog(int depth, StringId stringId, AssetId id, int max, bool useTenths, Action <int> continuation)
            : base(DialogPositioning.Center, depth)
        {
            _continuation = continuation;
            IUiElement itemPic = new UiSpriteElement <AssetId>(id)
            {
                SubId = id.Type == AssetType.ItemGraphics ? id.Id : 0
            };

            var topStack = new HorizontalStack(
                new NonGreedy(new GroupingFrame(itemPic)),
                new Spacing(2, 0),
                new GroupingFrame(new FixedSize(151, 30, new UiTextBuilder(stringId)))
                );

            Func <int, string> formatFunc = useTenths ? (Func <int, string>)FormatTenths : FormatUnits;

            var stack = new VerticalStack(
                topStack,
                new Spacing(0, 5),
                new FixedSize(106, 14, new Slider(() => _quantity, x => _quantity = x, 0, max, formatFunc)),
                new Spacing(0, 4),
                new FixedSize(52, 13,
                              new Button(SystemTextId.MsgBox_OK)
            {
                DoubleFrame = true
            }.OnClick(Close))
                );

            AttachChild(new DialogFrame(new Padding(stack, 6))
            {
                Background = DialogFrameBackgroundStyle.MainMenuPattern
            });
        }
Exemple #6
0
        public BlocoCanhoto(DanfeViewModel viewModel, Estilo estilo) : base(viewModel, estilo)
        {
            var textoRecebimento = new TextoSimples(estilo, viewModel.TextoRecebimento)
            {
                Height = TextoRecebimentoAltura, TamanhoFonte = 8
            };
            var nfe = new NumeroNfSerie(estilo, viewModel.NfNumero.ToString(Formatador.FormatoNumeroNF), viewModel.NfSerie.ToString())
            {
                Height = AlturaLinha2 + TextoRecebimentoAltura, Width = 30
            };

            var campos = new LinhaCampos(Estilo)
            {
                Height = AlturaLinha2
            }
            .ComCampo("Data de Recebimento", null)
            .ComCampo("Identificação e assinatura do recebedor", null)
            .ComLarguras(50, 0);

            var coluna1 = new VerticalStack();

            coluna1.Add(textoRecebimento, campos);

            var linha = new FlexibleLine()
            {
                Height = coluna1.Height
            }
            .ComElemento(coluna1)
            .ComElemento(nfe)
            .ComLarguras(0, 16);

            MainVerticalStack.Add(linha, new LinhaTracejada(2));
        }
Exemple #7
0
        public YesNoMessageBox(StringId stringId, int depth) : base(DialogPositioning.Center, depth)
        {
            // TODO: Block0 = yes text, Block1 = no text.
            var elements = new VerticalStack(
                new Spacing(0, 5),
                new FixedSizePanel(231, 30, new UiTextBuilder(stringId)),
                new Spacing(0, 5),
                new HorizontalStack(
                    new Spacing(11, 0),
                    new Button(Base.SystemText.MsgBox_Yes)
            {
                DoubleFrame = true
            }
                    .OnClick(() => OnButton(true)),
                    new Spacing(8, 0),
                    new Button(Base.SystemText.MsgBox_No)
            {
                DoubleFrame = true
            }
                    .OnClick(() => OnButton(false)),
                    new Spacing(10, 0)
                    ),
                new Spacing(0, 5)
                );

            var horizontalPad = new HorizontalStack(
                new Spacing(6, 0),
                elements,
                new Spacing(6, 0)
                );

            AttachChild(new DialogFrame(horizontalPad));
        }
Exemple #8
0
        public SticksSettingsContainer()
        {
            SetSpacing(30, 0);
            SetPadding(10, 10, 10, 10);
            SetMargin(10, 10, 10, 10);

            _leftStickLayout  = new VerticalStack();
            _rightStickLayout = new VerticalStack();
            _lLabel           = Items.GetHeaderLabel(Controller.GetLanguage()["LeftStickSettings"]);
            _lLabel.SetMargin(0, 0, 0, 20);
            _rLabel = Items.GetHeaderLabel(Controller.GetLanguage()["RightStickSettings"]);
            _rLabel.SetMargin(0, 0, 0, 20);
            _lSpeedSlider        = new SpeedSlider(Controller.GetLanguage()["LeftStickSpeed"]);
            _rSpeedSlider        = new SpeedSlider(Controller.GetLanguage()["RightStickSpeed"]);
            _lStickAssignment    = new NamedComboBox(Controller.GetLanguage()["AssignStick"]);
            _rStickAssignment    = new NamedComboBox(Controller.GetLanguage()["AssignStick"]);
            _lDynamicSensitivity = Items.GetSwitcher(Controller.GetLanguage()["StickDynamicSens"],
                                                     Controller.GetProfile().LeftThumbStickAcceleration);
            _rDynamicSensitivity = Items.GetSwitcher(Controller.GetLanguage()["StickDynamicSens"],
                                                     Controller.GetProfile().RightThumbStickAcceleration);
            _lArrows    = Items.GetListItem(Controller.GetLanguage()["StickActionArrows"]);
            _rArrows    = Items.GetListItem(Controller.GetLanguage()["StickActionArrows"]);
            _lMouseMove = Items.GetListItem(Controller.GetLanguage()["StickActionMouseMove"]);
            _rMouseMove = Items.GetListItem(Controller.GetLanguage()["StickActionMouseMove"]);
        }
Exemple #9
0
        public static VerticalStack GetLeftLayoutItem()
        {
            var verticalStack = new VerticalStack();

            //verticalStack.SetStyle(Styles.GetLeftLayoutItemStyle());
            return(verticalStack);
        }
Exemple #10
0
        public static VerticalStack GetButtonsList()
        {
            var buttonsList = new VerticalStack();

            buttonsList.SetStyle(Styles.GetButtonsListStyle());
            return(buttonsList);
        }
Exemple #11
0
        public static VerticalStack GetDialogWindowLayout(int titleHeight)
        {
            var layout = new VerticalStack();

            layout.SetStyle(Styles.GetDialogLayoutStyle(titleHeight));
            layout.SetContentAlignment(ItemAlignment.HCenter);
            return(layout);
        }
Exemple #12
0
        internal static VerticalStack GetStandardLayout(int topMargin)
        {
            VerticalStack layout = new VerticalStack();

            layout.SetMargin(0, topMargin, 0, 0);
            layout.SetBackground(60, 60, 60);

            return(layout);
        }
Exemple #13
0
    protected override void Subscribed()
    {
        var disk = Resolve <IFileSystem>();

        IText BuildEmptySlotText(int x) =>
        new DynamicText(() =>
        {
            var textFormatter = Resolve <ITextFormatter>();
            var block         = textFormatter
                                .Ink(FontColor.Gray)
                                .Format(Base.SystemText.MainMenu_EmptyPosition)
                                .GetBlocks().Single();
            block.Text = $"{x,2}    {block.Text}";
            return(new[] { block });
        });

        var buttons = new List <IUiElement>();

        for (ushort i = 1; i <= MaxSaveNumber; i++)
        {
            var filename = BuildSaveFilename(i);
            if (disk.FileExists(filename))
            {
                using var stream = disk.OpenRead(filename);
                using var br     = new BinaryReader(stream);
                var    name       = SavedGame.GetName(br) ?? "Invalid";
                var    text       = $"{i,2}    {name}";
                ushort slotNumber = i;
                buttons.Add(new ConversationOption(new LiteralText(text), null, () => PickSlot(slotNumber)));
            }
            else if (_showEmptySlots)
            {
                var    text       = BuildEmptySlotText(i);
                ushort slotNumber = i;
                buttons.Add(new ConversationOption(text, null, () => PickSlot(slotNumber)));
            }
        }

        var elements = new List <IUiElement> {
            new Spacing(280, 0)
        };

        elements.AddRange(buttons);
        elements.Add(new Spacing(0, 4));

        var header = new UiTextBuilder(_stringId).Center().NoWrap();

        elements.Add(new ButtonFrame(new Padding(header, 2))
        {
            State = ButtonState.Pressed
        });

        var stack = new VerticalStack(elements);

        AttachChild(new DialogFrame(new Padding(stack, 4, 5, 6, 5)));
    }
Exemple #14
0
        public static VerticalStack GetLayout()
        {
            VerticalStack layout = new VerticalStack();

            layout.SetBackground(Palette.LayoutBackground);
            layout.SetPadding(6, 25, 6, 25);
            layout.SetSpacing(0, 15);

            return(layout);
        }
Exemple #15
0
        public BlocoBase(DanfeViewModel viewModel, Estilo estilo) : base(estilo)
        {
            MainVerticalStack = new VerticalStack();
            ViewModel         = viewModel ?? throw new ArgumentNullException(nameof(viewModel));

            if (!String.IsNullOrWhiteSpace(Cabecalho))
            {
                MainVerticalStack.Add(new CabecalhoBloco(estilo, Cabecalho));
            }
        }
Exemple #16
0
        public Contact(String name)
        {
            _layout             = new VerticalStack();
            _iconImage          = new ImageItem(DefaultsService.GetDefaultImage(EmbeddedImage.User, EmbeddedImageSize.Size64x64));
            _faceItem           = new BlankItem();
            _nameLabel          = new Label(name);
            _notificationNumber = new Label();

            SetStyle(DefaultsService.GetDefaultStyle(typeof(RadialMenu.Contact)));
        }
Exemple #17
0
        public static VerticalStack GetSideBarLayout()
        {
            VerticalStack layout = new VerticalStack();

            layout.SetWidthPolicy(SizePolicy.Fixed);
            layout.SetWidth(40);
            layout.SetBackground(35, 35, 35);
            layout.SetMargin(0, 55, 0, 55);
            layout.SetContentAlignment(ItemAlignment.VCenter);
            return(layout);
        }
Exemple #18
0
        public InventoryMidPane(PartyCharacterId activeCharacter, InventoryConfig.PlayerInventory config)
        {
            var background = new FixedPositionStack();

            background.Add(new UiSprite <FullBodyPictureId>((FullBodyPictureId)activeCharacter), 1, -3);
            Children.Add(background);

            var bodyStack = new FixedPositionStack();

            foreach (var bodyPart in config)
            {
                var itemSlotId = bodyPart.Key;
                var position   = bodyPart.Value;
                bodyStack.Add(new InventoryBodyPart(activeCharacter, itemSlotId), (int)position.X, (int)position.Y);
            }

            var frame = new ButtonFrame(bodyStack)
            {
                Theme = new FrameTheme()
            };
            var labelStack = new HorizontalStack(
                new InventoryOffensiveLabel(activeCharacter),
                new InventoryWeightLabel(activeCharacter),
                new InventoryDefensiveLabel(activeCharacter)
                );

            var mainStack = new VerticalStack(
                new Header(new DynamicText(() =>
            {
                var member   = Resolve <IParty>()[activeCharacter];
                var settings = Resolve <ISettings>();
                if (member == null)
                {
                    return(new TextBlock[0]);
                }

                var name = member.Apparent.GetName(settings.Gameplay.Language);
                return(new[] { new TextBlock(name)
                               {
                                   Alignment = TextAlignment.Center
                               } });
            })),
                new HorizontalStack(
                    new Padding(3, 0),
                    frame,
                    new Padding(3, 0)),
                labelStack
                );

            Children.Add(mainStack);
        }
Exemple #19
0
        public override void InitElements()
        {
            base.InitElements();

            //window's attr
            Window.SetBackground(45, 45, 45);

            //title
            TitleBar title = new TitleBar("Adding a new member");

            title.SetFont(DefaultsService.GetDefaultFont(14));
            title.GetMinimizeButton().SetVisible(false);
            title.GetMaximizeButton().SetVisible(false);

            VerticalStack layout = new VerticalStack();

            layout.SetMargin(0, title.GetHeight(), 0, 0);
            layout.SetPadding(6, 15, 6, 6);
            layout.SetSpacing(vertical: 30);
            layout.SetBackground(255, 255, 255, 20);

            //message
            _input.EventKeyRelease += OnKeyRelease;

            //ok
            _add.SetBackground(255, 181, 111);
            _add.SetStyle(Styles.GetButtonStyle());
            _add.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0));
            _add.EventMouseClick += (sender, args) =>
            {
                InputResult = _input.GetText();
                Close();
            };

            //adding items
            Window.AddItems(
                title,
                layout
                );
            layout.AddItems(
                _input,
                _add
                );

            title.GetCloseButton().EventMouseClick  = null;
            title.GetCloseButton().EventMouseClick += (sender, args) =>
            {
                Close();
            };
        }
Exemple #20
0
        public override void InitWindow()
        {
            SetParameters(nameof(MainWindow), "EnigmaGame", 798, 640, false);
            SetAntiAliasingQuality(MSAA.MSAA8x);
            SetBackground(Common.Background);
            SetPadding(1, 1, 1, 1);
            SetMinSize(GetWidth(), GetHeight());

            //icons
            var big   = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.icon.png"));
            var small = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.icon.png"));

            SetIcon(big, small);

            TitleBar title = new TitleBar("EnigmaGame");

            title.SetIcon(small, 20, 20);
            title.SetShadow(5, 0, 2, Color.Black);

            VerticalStack layout = new VerticalStack();

            layout.SetBackground(GetBackground());
            layout.SetPadding(30, 30, 30, 30);
            layout.SetMargin(10, title.GetHeight() + 10, 10, 10);
            layout.SetSpacing(0, 10);
            layout.SetBorder(new Border(Common.Selected, new CornerRadius(10), 4));
            layout.SetShadow(10, 0, 0, Color.Black);


            //adding
            AddItems(
                layout,
                title,
                menu
                );

            layout.AddItems(
                header,
                time_limit,
                cards_board,
                hand
                );

            //events
            EventKeyPress += OnKeyPress;

            wrong = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.wrong.wav"));
            key   = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.switch.wav"));
            next  = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.next.wav"));
        }
Exemple #21
0
        public InventoryMiscPage()
        {
            var stack = new VerticalStack(
                new Header(SystemTextId.Inv3_Conditions),
                new Spacing(0, 64),
                new Header(SystemTextId.Inv3_Languages),
                new Spacing(0, 23),
                new Header(SystemTextId.Inv3_TemporarySpells),
                new Spacing(0, 45),
                new Button(SystemTextId.Inv3_CombatPositions) // TODO: Make functional
                );

            AttachChild(stack);
        }
Exemple #22
0
        protected override void Subscribed()
        {
            var languageButtons = new List <IUiElement>();

            void SetLanguage(string language) => Raise(new SetLanguageEvent(language));

            var languages  = new List <(string, string)>();
            var modApplier = Resolve <IModApplier>();

            foreach (var kvp in modApplier.Languages.OrderBy(x => x.Value.ShortName))
            {
                if (HasLanguageFiles(kvp.Key))
                {
                    languages.Add((kvp.Key, kvp.Value.ShortName));
                }
            }

            foreach (var(language, shortName) in languages)
            {
                languageButtons.Add(new Button(shortName).OnClick(() => SetLanguage(language)));
            }

            var elements = new List <IUiElement>
            {
                new Spacing(156, 2),
                new Label(TextId.From(Base.UAlbionString.LanguageLabel)),
                new HorizontalStack(languageButtons),
                new Spacing(0, 2),
                new Label((TextId)Base.SystemText.Options_MusicVolume),
                new Slider(() => _musicVolume, x => _musicVolume = x, 0, 127),
                new Spacing(0, 2),
                new Label((TextId)Base.SystemText.Options_FXVolume),
                new Slider(() => _fxVolume, x => _fxVolume = x, 0, 127),
                new Spacing(0, 2),
                new Label((TextId)Base.SystemText.Options_CombatTextDelay),
                new Slider(() => _combatDelay, x => _combatDelay = x, 1, 50),
                new Spacing(0, 2),
                new Button(Base.SystemText.MsgBox_OK).OnClick(SaveAndClose),
                new Spacing(0, 2),
            };
            var stack = new VerticalStack(elements);

            AttachChild(new DialogFrame(stack));

            var settings = Resolve <ISettings>();

            _musicVolume = settings.Audio.MusicVolume;
            _fxVolume    = settings.Audio.FxVolume;
            _combatDelay = settings.Gameplay.CombatDelay;
        }
        public BindsSettingsContainer()
        {
            SetSpacing(60, 0);
            SetPadding(10, 40, 10, 0);
            SetMargin(10, 10, 10, 10);

            _leftBinds  = new VerticalStack();
            _rightBinds = new VerticalStack();

            // context menu
            _copy       = new MenuItem(Controller.GetLanguage()["CopyMenuItem"]);
            _paste      = new MenuItem(Controller.GetLanguage()["PasteMenuItem"]);
            _clear      = new MenuItem(Controller.GetLanguage()["ClearMenuItem"]);
            _manualMode = new MenuItem(Controller.GetLanguage()["ManualMenuItem"]);
        }
Exemple #24
0
    protected override void Subscribed()
    {
        RemoveAllChildren();

        var state    = Resolve <IGameState>();
        var elements = new List <IUiElement>
        {
            new Spacing(0, 2),
            new HorizontalStack(new Spacing(5, 0), new BoldHeader((TextId)Base.SystemText.MainMenu_MainMenu), new Spacing(5, 0)),
            new Divider(CommonColor.Yellow3),
            new Spacing(0, 2),
        };

        if (state.Loaded)
        {
            elements.AddRange(new IUiElement[]
            {
                new Button(Base.SystemText.MainMenu_ContinueGame).OnClick(Continue),
                new Spacing(0, 4),
            });
        }

        elements.AddRange(new IUiElement[]
        {
            new Button(Base.SystemText.MainMenu_NewGame).OnClick(NewGame),
            new Button(Base.SystemText.MainMenu_LoadGame).OnClick(LoadGame),
        });

        if (state.Loaded)
        {
            elements.Add(new Button(Base.SystemText.MainMenu_SaveGame).OnClick(SaveGame));
        }

        elements.AddRange(new IUiElement[]
        {
            new Spacing(0, 4),
            new Button(Base.SystemText.MainMenu_Options).OnClick(Options),
            new Button(Base.SystemText.MainMenu_ViewIntro),
            new Button(Base.SystemText.MainMenu_Credits),
            new Spacing(0, 3),
            new Button(Base.SystemText.MainMenu_QuitGame).OnClick(QuitGame),
            new Spacing(0, 2),
        });

        var stack = new VerticalStack(elements);

        AttachChild(new DialogFrame(stack));
    }
        public BlocoIdentificacaoEmitente(DanfeViewModel viewModel, Estilo estilo) : base(viewModel, estilo)
        {
            var textoConsulta = new TextoSimples(Estilo, Strings.TextoConsulta)
            {
                Height = 8,
                AlinhamentoHorizontal = AlinhamentoHorizontal.Centro,
                AlinhamentoVertical   = AlinhamentoVertical.Centro,
                TamanhoFonte          = 9
            };

            var campoChaveAcesso = new Campo("Chave de Acesso", Formatador.FormatarChaveAcesso(ViewModel.ChaveAcesso), estilo, AlinhamentoHorizontal.Centro)
            {
                Height = Constantes.CampoAltura
            };
            var codigoBarras = new Barcode128C(viewModel.ChaveAcesso, Estilo)
            {
                Height = AlturaLinha1 - textoConsulta.Height - campoChaveAcesso.Height
            };

            var coluna3 = new VerticalStack();

            coluna3.Add(codigoBarras, campoChaveAcesso, textoConsulta);

            ifdNfe     = new NumeroNfSerie2(estilo, ViewModel);
            idEmitente = new IdentificacaoEmitente(Estilo, ViewModel);

            FlexibleLine fl = new FlexibleLine()
            {
                Height = coluna3.Height
            }
            .ComElemento(idEmitente)
            .ComElemento(ifdNfe)
            .ComElemento(coluna3)
            .ComLarguras(0, 15, 46.5F);

            MainVerticalStack.Add(fl);

            AdicionarLinhaCampos()
            .ComCampo("Natureza da operação", ViewModel.NaturezaOperacao)
            .ComCampo("Protocolo de autorização", ViewModel.ProtocoloAutorizacao, AlinhamentoHorizontal.Centro)
            .ComLarguras(0, 46.5F);

            AdicionarLinhaCampos()
            .ComCampo("Inscrição Estadual", ViewModel.Emitente.Ie, AlinhamentoHorizontal.Centro)
            .ComCampo("Inscrição Estadual do Subst. Tributário", ViewModel.Emitente.IeSt, AlinhamentoHorizontal.Centro)
            .ComCampo("Cnpj", Formatador.FormatarCnpj(ViewModel.Emitente.CnpjCpf), AlinhamentoHorizontal.Centro)
            .ComLargurasIguais();
        }
Exemple #26
0
        public override void InitWindow()
        {
            // Window's attr
            SetParameters(Controller.GetLanguage()["MainTitle"], Controller.GetLanguage()["MainTitle"], 300, 360, false);
            SetMinSize(300, 360);
            SetBackground(Palette.CommonDark);
            IsCentered = true;
            SetIcon(Resources.Icon, Resources.Icon);

            // Content
            Title = Items.GetTitleBar(Controller.GetLanguage()["MainTitle"]);

            VerticalStack layout = Items.GetLayout();

            layout.SetMargin(0, Title.GetHeight(), 0, 0);

            BtnStatus   = Items.GetButton(Controller.GetLanguage()["BatteryButton"]);
            BtnSettings = Items.GetButton(Controller.GetLanguage()["SettingsButton"]);
            BtnStart    = Items.GetButton(Controller.GetLanguage()["StartButton"]);

            ImgStatus = Items.GetBatteryItem();

            ProfileList = Items.GetProfileList();
            foreach (var profile in Controller.GetAllProfiles())
            {
                ProfileList.AddItem(Items.GetListItem(profile.Name));
            }

            // Adding content
            AddItems(Title, layout);
            layout.AddItems(
                ProfileList,
                ImgStatus,
                BtnStatus,
                BtnSettings,
                new Frame(),
                BtnStart
                );

            // Post settings
            ProfileList.SetCurrentIndex(
                Controller.GetAllProfiles().Select(p => p.Name).ToList().IndexOf(Controller.GetProfile().Name));

            ProfileList.SelectionChanged += () =>
            {
                Controller.InvokeEventProfileChanged(ProfileList.GetText());
            };
        }
Exemple #27
0
        public InventoryMiscPage(PartyCharacterId activeCharacter)
        {
            StringId S(SystemTextId id) => new StringId(AssetType.SystemText, 0, (int)id);

            var stack = new VerticalStack(
                new Header(S(SystemTextId.Inv3_Conditions)),
                new Padding(0, 64),
                new Header(S(SystemTextId.Inv3_Languages)),
                new Padding(0, 23),
                new Header(S(SystemTextId.Inv3_TemporarySpells)),
                new Padding(0, 45),
                new Button(CombatPositionButtonId, S(SystemTextId.Inv3_CombatPositions))
                );

            Children.Add(stack);
        }
Exemple #28
0
        public override void InitWindow()
        {
            // Window's attr
            SetParameters(Controller.GetLanguage()["SetsTitle"], Controller.GetLanguage()["SetsTitle"], 900, 600, false);
            SetMinSize(900, 600);
            SetBackground(Factory.Palette.CommonDark);
            IsCentered = true;
            SetIcon(Factory.Resources.Icon, Factory.Resources.Icon);

            // Content
            _titleBar = Factory.Items.GetTitleBar(Controller.GetLanguage()["SetsTitle"]);
            CloseBtn  = _titleBar.GetCloseButton();

            VerticalStack layout = Factory.Items.GetLayout();

            layout.SetMargin(0, _titleBar.GetHeight(), 0, 0);
            layout.SetPadding(0, 0, 0, 15);

            _tabArea = new TabView();
            _tabArea.SetTabPolicy(SizePolicy.Expand);

            _common        = new SettingsTab(Controller.GetLanguage()["SetsTabCommon"]);
            _commonContent = new CommonSettingsContainer();

            _binds        = new SettingsTab(Controller.GetLanguage()["SetsTabBinds"]);
            _bindsContent = new BindsSettingsContainer();

            _sticks        = new SettingsTab(Controller.GetLanguage()["SetsTabSticks"]);
            _sticksContent = new SticksSettingsContainer();

            SaveBtn = Items.GetControlButton(Controller.GetLanguage()["SaveButton"]);

            // Adding content
            AddItems(_titleBar, layout);
            layout.AddItems(
                _tabArea,
                SaveBtn
                );

            _tabArea.AddTab(_common);
            _tabArea.AddTab(_sticks);
            _tabArea.AddTab(_binds);

            _tabArea.AddItemToTab(_common, _commonContent as IBaseItem);
            _tabArea.AddItemToTab(_sticks, _sticksContent as IBaseItem);
            _tabArea.AddItemToTab(_binds, _bindsContent as IBaseItem);
        }
Exemple #29
0
        public override void InitWindow()
        {
            SetParameters(
                nameof(GraphView),
                nameof(GraphView),
                800,
                800,
                false);
            SetMinSize(1000, 1000);
            SetBackground(45, 45, 45);

            var title       = UiElements.GetTitleBar();
            var mainLayout  = UiElements.GetMainLayout();
            var buttonsList = UiElements.GetButtonsList();

            _toolbar = UiElements.GetToolbar();
            var leftLayoutItem = UiElements.GetLeftLayoutItem();
            var tabView        = UiElements.GetTabView();
            var logTextArea    = UiElements.GetLogTextArea();

            _imageArea = new ImageItem(
                new Bitmap(
                    "/home/nick/RiderProjects/DiscreteMaths/Graphs/Graphs/notGenerated.png"));
            _imageArea.SetMaxWidth(1024);
            _imageArea.SetMaxHeight(1024);
            _imageArea.KeepAspectRatio(true);

            _tabView     = tabView;
            _buttonsList = buttonsList;
            _logTextArea = logTextArea;
            _logTextArea.SetText("Log Journal" + Environment.NewLine);
            _logTextArea.SetFont(new Font(FontFamily.GenericMonospace, 14, FontStyle.Bold));

            AddItems(title, mainLayout);
            mainLayout.AssignLeftItem(leftLayoutItem);
            mainLayout.AssignRightItem(buttonsList);
            leftLayoutItem.AddItems(tabView, _toolbar);

            tabView.AddTabs(new Tab("Graph"), new Tab("Log"));

            tabView.AddItemToTabByName("Log", _logTextArea);
            tabView.AddItemToTabByName("Graph", _imageArea);

            PopulateButtonsList();
            PopulateToolbar();
        }
Exemple #30
0
        protected override void Subscribed()
        {
            var languageButtons = new List <IUiElement>();

            void SetLanguage(GameLanguage language) => Raise(new SetLanguageEvent(language));

            void AddLang(string label, GameLanguage language)
            {
                if (HasLanguageFiles(language))
                {
                    languageButtons.Add(new Button(label).OnClick(() => SetLanguage(language)));
                }
            }

            AddLang("EN", GameLanguage.English);
            AddLang("DE", GameLanguage.German);
            AddLang("FR", GameLanguage.French);

            var elements = new List <IUiElement>
            {
                new Spacing(156, 2),
                new Label(UAlbionStringId.LanguageLabel),
                new HorizontalStack(languageButtons),
                new Spacing(0, 2),
                new Label(SystemTextId.Options_MusicVolume),
                new Slider(() => _musicVolume, x => _musicVolume = x, 0, 127),
                new Spacing(0, 2),
                new Label(SystemTextId.Options_FXVolume),
                new Slider(() => _fxVolume, x => _fxVolume = x, 0, 127),
                new Spacing(0, 2),
                new Label(SystemTextId.Options_CombatTextDelay),
                new Slider(() => _combatDelay, x => _combatDelay = x, 1, 50),
                new Spacing(0, 2),
                new Button(SystemTextId.MsgBox_OK).OnClick(SaveAndClose),
                new Spacing(0, 2),
            };
            var stack = new VerticalStack(elements);

            AttachChild(new DialogFrame(stack));

            var settings = Resolve <ISettings>();

            _musicVolume = settings.Audio.MusicVolume;
            _fxVolume    = settings.Audio.FxVolume;
            _combatDelay = settings.Gameplay.CombatDelay;
        }
			private StructuralGlyph HandleNewline(StructuralGlyph parent, StyleContext context)
			{
				StructuralGlyph newcontext;

				if (parent is GlyphLine) // normal case
				{
					if (parent.Parent is VerticalStack)
					{
						newcontext = new GlyphLine();
						newcontext.Style = context;
						parent.Parent.Add(newcontext);
					}
					else // parent.Parent is not a VerticalStack
					{
						var vertStack = new VerticalStack();
						parent.Parent.Exchange(parent, vertStack);
						vertStack.Add(parent);
						newcontext = new GlyphLine();
						newcontext.Style = context;
						vertStack.Add(newcontext);
					}
				}
				else
				{
					throw new NotImplementedException();
				}
				return newcontext;
			}
			public StructuralGlyph VisitTree(PegNode root, StyleContext context, double lineSpacingFactor, bool isFixedLineSpacing)
			{
				var rootGlyph = new VerticalStack();
				rootGlyph.Style = context;
				rootGlyph.LineSpacingFactor = lineSpacingFactor;
				rootGlyph.FixedLineSpacing = isFixedLineSpacing;

				var line = new GlyphLine();
				line.Style = context;

				rootGlyph.Add(line);

				if (null != root && null != root.child_)
					VisitNode(root.child_, context, line);

				return rootGlyph;
			}