Exemplo n.º 1
0
        public LevelSetsPropertiesView(IEditor <CampaignFile> editor_)
        {
            editor = editor_;

            Style = "vertical";

            properties = new PropertiesListBase();

            properties.AddRow("Name", nameBox = new TextBox());
            properties.AddRow("Description", descriptionBox = new TextBox());
            properties.AddRow("Icon", iconBox = new ResourceSelector(editor, ResourceType.Texture));
            properties.AddRow(null, new StackLayout()
            {
                Style = "no-padding horizontal",

                Items =
                {
                    (iconPreview = new StretchedImageBox()
                    {
                        Height   = 96,
                        Width    = 96,
                    }),
                    null
                }
            });

            properties.AddRow("Campaign playlist", campaignDisplayBox = new BooleanSelector());
            properties.AddRow("Sprint playlist", sprintDisplayBox     = new BooleanSelector());

            properties.AddRow("Unique ID", guidBox = new GuidLabel());
            //properties.AddRow("Playlist locking", new EnumDropDown<PlaylistUnlock>());
            //properties.AddRow("Individual level locking", new EnumDropDown<LevelUnlock>());
            //properties.AddRow("Difficulty rating", new EnumDropDown<Difficulty>());

            properties.CompleteRows();

            Items.Add(new StackLayoutItem(properties)
            {
                Expand = false
            });

            nameBox.TextChanged             += NotifyModified;
            descriptionBox.TextChanged      += NotifyModified;
            iconBox.ResourceSelected        += NotifyModified;
            iconBox.ResourceSelected        += IconSelected;
            guidBox.TextChanged             += NotifyModified;
            sprintDisplayBox.ValueChanged   += NotifyModified;
            campaignDisplayBox.ValueChanged += NotifyModified;
        }
Exemplo n.º 2
0
        protected ResourceDialogBase(T data, IEditor <CampaignFile> editor)
        {
            this.editor = editor;
            Data        = data.CloneObject() ?? new T();
            Size        = MinimumSize = new Size(360, 180);
            Resizable   = false;

            Content = (stackLayout = new StackLayout()
            {
                Style = "vertical",
                Spacing = 16,

                Items =
                {
                    new StackLayoutItem(new Scrollable()
                    {
                        Content = properties = new PropertiesListBase()
                    }, true),
                    new StackLayoutItem(new StackLayout()
                    {
                        Style = "horizontal",
                        Spacing = 4,

                        Items =
                        {
                            null,
                            (DefaultButton = new Button(Confirm)
                            {
                                Text = "OK",
                                Image = Resources.GetIcon("CheckGreen.ico", 16)
                            }),
                            (AbortButton = new Button(Cancel)
                            {
                                Text = "Cancel",
                                Image = Resources.GetIcon("CloseRed.ico", 16)
                            })
                        }
                    }, false)
                }
            });

            Title = string.Format("{0} {1}", Equals(data, null) ? "Add new" : "Edit", typeof(T).Name.ToLower());

            InitializeComponent();

            properties.CompleteRows();
        }
Exemplo n.º 3
0
        public NewProjectWindow()
        {
            Title       = "New project";
            Padding     = new Padding(8);
            MinimumSize = new Size(512, 160);
            Resizable   = false;

            Content = new StackLayout()
            {
                Style   = "vertical",
                Spacing = 8,
                Items   =
                {
                    new StackLayoutItem(propertiesPanel = new PropertiesListBase())
                    {
                        Expand                          = true
                    },
                    new StackLayoutItem(new StackLayout()
                    {
                        Style   = "horizontal",
                        Spacing =                                  8,
                        Padding = new Padding(0, 8, 0, 0),

                        Items                           =
                        {
                            null,
                            (confirmButton              = new Button(OnConfirm)
                            {
                                Text                    = "OK",
                                Image                   = Resources.GetIcon("CheckGreen.ico",               16)
                            }),
                            (cancelButton               = new Button(OnCancel)
                            {
                                Text                    = "Cancel",
                                Image                   = Resources.GetIcon("CloseRed.ico",                          16)
                            })
                        }
                    })
                    {
                        Expand                          = false
                    }
                }
            };

            folderDialog = new SelectFolderDialog()
            {
                Title = "Project folder",
                //Directory = EtoEnvironment.GetFolderPath(EtoSpecialFolder.Documents)
            };

            propertiesPanel.AddRow("Project name", nameBox       = new TextBox());
            propertiesPanel.AddRow("Description", descriptionBox = new TextBox());
            propertiesPanel.AddRow("Folder", folderBox           = new TextBoxWithButton()
            {
                ControlEnabled = false
            });
            propertiesPanel.CompleteRows();

            AbortButton   = cancelButton;
            DefaultButton = confirmButton;

            folderBox.ButtonClick += SelectFolder;
        }