Ejemplo n.º 1
0
        Control CreateButtons()
        {
            var      table = new TableLayout(3, 3);
            CheckBox top, right, bottom, left;

            table.Add(top = new CheckBox {
                Text = "Top", BackgroundColor = Colors.Blue
            }, 1, 0, true, true);
            table.Add(right = new CheckBox {
                Text = "Right", BackgroundColor = Colors.Red
            }, 2, 1, true, true);
            table.Add(bottom = new CheckBox {
                Text = "Bottom", BackgroundColor = Colors.Blue
            }, 1, 2, true, true);
            table.Add(left = new CheckBox {
                Text = "Left", BackgroundColor = Colors.Red
            }, 0, 1, true, true);

            top.CheckedChanged    += (s, e) => Anchor = Flip(Anchor, Anchor.Top);
            right.CheckedChanged  += (s, e) => Anchor = Flip(Anchor, Anchor.Right);
            bottom.CheckedChanged += (s, e) => Anchor = Flip(Anchor, Anchor.Bottom);
            left.CheckedChanged   += (s, e) => Anchor = Flip(Anchor, Anchor.Left);

            return(table);
        }
Ejemplo n.º 2
0
        private Control CreateXamarinStudioDirectory()
        {
            var layout = new TableLayout(2, 2);

            var home = new Label {
                Text = "Xamarin Studio Bin Directory"
            };
            var txt = new TextBox();
            var btn = new Button {
                Text = "Select"
            };

            txt.Bind(b => b.Text, _vm, b => b.XamarinStudioDirectory);

            btn.Click += (s, e) =>
            {
                var dialog = new SelectFolderDialog();
                var result = dialog.ShowDialog(Application.Instance.MainForm);

                if (result == DialogResult.Ok)
                {
                    _vm.XamarinStudioDirectory = dialog.Directory;
                }
            };

            layout.Spacing = new Size(5, 5);
            layout.Add(home, 0, 0, true, false);
            layout.Add(txt, 0, 1, true, false);
            layout.Add(btn, 1, 1, false, false);

            return(layout);
        }
Ejemplo n.º 3
0
        protected override Control OnDefineLayout()
        {
            _grid = new PropertyEditorGridView();

            // actionbar layout
            var actionbar = new TableLayout(1, 1)
            {
                Spacing = new Size(5, 0)
            };

            _pouchHeader = new Label();
            actionbar.Add(_pouchHeader, 0, 0, true, false);

            var layout = new TableLayout(1, 2)
            {
                Spacing = new Size(5, 5)
            };

            // positioning
            layout.Add(actionbar, 0, 0, true, false);
            layout.Add(_grid, 0, 1, true, true);

            layout.Shown += (sender, args) =>
            {
                ToolboxApp.AppEvents.RefreshWidget(PouchTypes.AttachedProperties);
            };

            return(layout);
        }
Ejemplo n.º 4
0
        Control ToggleButton()
        {
            var control = new Button {
                Text = "Add Columns To Table"
            };

            control.Click += delegate {
                toggle = !toggle;
                this.SuspendLayout();
                if (toggle)
                {
                    mainTable.Add(VerticalSection(), 0, 0);
                    rightSection.AddDockedControl(VerticalSection());
                    middleTable.Add(HorizontalSection(), 0, 2);
                    topSection.AddDockedControl(HorizontalSection());
                    control.Text = "Remove Columns";
                }
                else
                {
                    mainTable.Add(null, 0, 0);
                    rightSection.AddDockedControl(null);
                    middleTable.Add(null, 0, 2);
                    topSection.AddDockedControl(null);
                    control.Text = "Add Columns To Table";
                }
                this.ResumeLayout();
            };

            return(control);
        }
Ejemplo n.º 5
0
        public override Control CreateLayout(PropertyEditorModel <string> model)
        {
            var layout = new TableLayout(2, 1)
            {
                Spacing = AppStyles.PropertyCellSpacing
            };

            var txt = new TextBox
            {
                Height   = AppStyles.PropertyCellHeight,
                ReadOnly = true
            };

            if (!model.Property.CanWrite)
            {
                txt.ReadOnly = true;
            }

            txt.TextBinding.BindDataContext((PropertyEditorModel <string> t) => (string)t.DisplayValue);

            var btn = new Button
            {
                Width = AppStyles.IconWidth,
                Text  = "..."
            };

            btn.Click += (s, e) => OpenDialog(model);

            layout.Add(txt, 0, 0, true, false);
            layout.Add(btn, 1, 0, false, false);

            return(layout);
        }
Ejemplo n.º 6
0
        public ChatPanel(Main main)
        {
            this.main = main;
            Size      = new Size(200, 140);

            var layout = new TableLayout(2, 1);

            layout.Add(ChatPane(), 0, 0, true, true);
            layout.Add(UserPane(), 1, 0);

            Content = layout;

            main.Client.Message += (sender, ce) => AddMessage(ce.Message, ce.User);

            main.Client.UsersChanged += delegate
            {
                var usersList = main.Client.Users.ToList();
                usersList.Sort(delegate(User x, User y)
                {
                    var l = -x.Level.CompareTo(y.Level);
                    return(l != 0 ? l : string.Compare(x.Alias, y.Alias, StringComparison.CurrentCultureIgnoreCase));
                });
                users.Items.Clear();
                users.Items.AddRange(usersList);
            };
        }
Ejemplo n.º 7
0
        public override Control OnCreate(CellEventArgs args)
        {
            Initialize(args);

            var container = new TableLayout(2, 1)
            {
                Spacing = AppStyles.PropertyCellSpacing
            };

            var lbl = new Label
            {
                TextAlignment     = TextAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Height            = AppStyles.PropertyCellHeight,
                Text = "Complex Object"
            };

            var btn = new Button
            {
                Width = AppStyles.IconWidth,
                Text  = "..."
            };

            // this captures the model. why??
            var model = Model;

            btn.Click += (s, e) => ShowEditDialog(model);

            container.Add(lbl, 0, 0, true, false);
            container.Add(btn, 1, 0, false, false);

            return(container);
        }
Ejemplo n.º 8
0
        public AttributeDialog(CharacterHandler handler, Palette palette, Attribute attribute, bool iceColours)
        {
            this.handler = handler;
            Title        = "Select attribute";
            var pos = handler.CharacterDocument.Info.AttributeDialogBounds;

            if (pos != null)
            {
                Bounds = pos.Value;
            }
            else
            {
                ClientSize = handler.CharacterDocument.Info.AttributeDialogSize ?? new Size(260, 260);
            }
#if DESKTOP
            this.Resizable = true;
#endif

            TableLayout layout = new TableLayout(1, 2);

            colours            = new ColourSelection(palette, attribute);
            colours.Size       = new Size(250, 200);
            colours.Selected  += colours_Selected;
            colours.iCEColours = iceColours;
            layout.Add(colours, 0, 0, true, true);

            layout.Add(GenerateButtons(), 0, 1, true, false);

            Content = layout;
        }
Ejemplo n.º 9
0
        private Control CreateFooter()
        {
            var ok = new Button {
                Text = CommonResource.Ok
            };

            _cancelButton = new Button {
                Text = CommonResource.Cancel
            };


            ok.Click += async(s, e) =>
            {
                await NotifyFormsAboutClosingTime();

                CloseDialog();
            };

            _cancelButton.Click += (s, e) => { CloseDialog(); };


            var layout = new TableLayout(3, 1)
            {
                Padding = new Padding(10),
                Spacing = new Size(5, 0)
            };

            layout.Add(null, 0, 0, true, true);
            layout.Add(ok, 1, 0, false, false);
            layout.Add(_cancelButton, 2, 0, false, false);

            return(layout);
        }
Ejemplo n.º 10
0
        public SpacingSection()
        {
            var layout = new TableLayout(this, 3, 1);

            layout.Add(NoSpacing(), 0, 0, true, true);
            layout.Add(NoPadding(), 1, 0, true, true);
            layout.Add(DifferentSizes(), 2, 0, true, true);
        }
Ejemplo n.º 11
0
        Control Buttons()
        {
            var layout = new TableLayout(3, 1);

            layout.SetColumnScale(0);
            layout.Add(CancelButton(), 1, 0);
            layout.Add(OkButton(), 2, 0);
            return(layout);
        }
Ejemplo n.º 12
0
		Control MiddleSection()
		{
			middleTable = new TableLayout(1, 3);

			middleTable.Add(new Label { Text = "Content", BackgroundColor = Colors.LightGrey, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Center }, 0, 1, true, true);
			middleTable.Add(topSection = new Panel(), 0, 0);

			return middleTable;
		}
Ejemplo n.º 13
0
        Control ChatPane()
        {
            var layout = new TableLayout(1, 2);

            layout.Padding = Padding.Empty;
            layout.Add(TextControl(), 0, 0, true, true);
            layout.Add(InputControl(), 0, 1);
            return(layout);
        }
Ejemplo n.º 14
0
 static T LabelControl <T>(TableLayout layout, T control, string label, int y)
     where T : Control
 {
     layout.Add(new Label {
         Text = label, VerticalAlignment = VerticalAlignment.Center
     }, 0, y);
     layout.Add(control, 1, y);
     return(control);
 }
Ejemplo n.º 15
0
        Control MainTable()
        {
            mainTable = new TableLayout(new Panel(), 3, 1);

            mainTable.Add(MiddleSection(), 1, 0, true, true);
            mainTable.Add(rightSection = new Panel(), 2, 0);

            return(mainTable.Container);
        }
Ejemplo n.º 16
0
        public WebViewSection()
        {
            var layout = new TableLayout(this, 1, 3);

            int row = 0;

            layout.Add(Buttons(), 0, row++);
            layout.Add(TitleLabel(), 0, row++);
            layout.Add(WebView(), 0, row++, true, true);
        }
Ejemplo n.º 17
0
        Control MiddleSection()
        {
            middleTable = new TableLayout(new Panel(), 1, 3);

            middleTable.Add(new Label {
                Text = "Content", BackgroundColor = Colors.LightGrey, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle
            }, 0, 1, true, true);
            middleTable.Add(topSection = new Panel(), 0, 0);

            return(middleTable.Container);
        }
Ejemplo n.º 18
0
        Control MainTable()
        {
            mainTable         = new TableLayout(3, 1);
            mainTable.Padding = new Padding(10);
            mainTable.Spacing = new Size(5, 5);

            mainTable.Add(MiddleSection(), 1, 0, true, true);
            mainTable.Add(rightSection = new Panel(), 2, 0);

            return(mainTable);
        }
Ejemplo n.º 19
0
        Control Middle()
        {
            var layout = new TableLayout(3, 1);

            layout.Padding = Padding.Empty;
            layout.Spacing = Size.Empty;
            layout.Add(leftPads, 0, 0);
            layout.Add(content, 1, 0, true, true);
            layout.Add(rightPads, 2, 0);
            return(layout);
        }
Ejemplo n.º 20
0
        private void InitializeComponent()
        {
            Width     = 370;
            Height    = 285;
            Title     = "New File";
            Resizable = true;

            layout1         = new DynamicLayout();
            layout1.Padding = new Padding(6);

            table1         = new TableLayout(2, 3);
            table1.Spacing = new Size(4, 4);

            labelName      = new Label();
            labelName.Text = "Name: ";
            labelName.VerticalAlignment = VerticalAlignment.Center;
            table1.Add(labelName, 0, 0, false, false);

            layout2 = new DynamicLayout();
            layout2.DefaultSpacing = new Size(4, 4);
            layout2.BeginHorizontal();

            textBox1 = new TextBox();
            layout2.Add(textBox1, true, true);

            labelExt      = new Label();
            labelExt.Text = " .spriteFont";
            labelExt.VerticalAlignment = VerticalAlignment.Center;
            labelExt.Width             = 80;
            layout2.Add(labelExt, false, true);

            table1.Add(layout2, 1, 0, true, false);

            labelType      = new Label();
            labelType.Text = "Type: ";
            labelType.VerticalAlignment = VerticalAlignment.Top;
            table1.Add(labelType, 0, 1, false, true);

            list1 = new ListBox();
            table1.Add(list1, 1, 1, true, true);

            layout1.Add(table1, true, true);

            labelError = new Label();
            labelError.TextAlignment = TextAlignment.Center;
            table1.Add(labelError, 1, 2, true, false);

            layout1.Add(labelError, true, false);

            CreateContent(layout1);

            textBox1.TextChanged       += TextBox1_TextChanged;
            list1.SelectedIndexChanged += List1_SelectedIndexChanged;
        }
Ejemplo n.º 21
0
        Control WidthRow()
        {
            var layout = new TableLayout(2, 2);

            layout.Padding = new Padding(20, 10, 20, 0);

            layout.Add(new Label {
                Text = "Canvas Width", VerticalAlign = VerticalAlign.Middle
            }, 0, 0);
            layout.Add(WidthControl(), 1, 0, true, false);
            return(layout);
        }
Ejemplo n.º 22
0
        Control EntryControls()
        {
            var layout = new TableLayout(2, 1);
            int row    = 0;

            layout.Add(new Label {
                Text = "Alias"
            }, 0, row);
            layout.Add(AliasControl(), 1, row++);

            return(layout);
        }
Ejemplo n.º 23
0
        Control Buttons()
        {
            var layout = new TableLayout(4, 1);

            layout.Padding = Padding.Empty;
            layout.SetColumnScale(1);

            layout.Add(RemoveSauceButton(), 0, 0);
            layout.Add(CancelButton(), 2, 0);
            layout.Add(SaveButton(), 3, 0);

            return(layout);
        }
Ejemplo n.º 24
0
        public SpacingSection()
        {
            var layout = new TableLayout(3, 1);

            layout.Spacing = new Size(5, 5);
            layout.Padding = new Padding(10);

            layout.Add(NoSpacing(), 0, 0, true, true);
            layout.Add(NoPadding(), 1, 0, true, true);
            layout.Add(DifferentSizes(), 2, 0, true, true);

            Content = layout;
        }
Ejemplo n.º 25
0
        void CreateControls()
        {
            fileTypeHolder = new Panel();

            var layout = new TableLayout(1, 3);

            layout.Padding = new Padding(10);

            layout.Add(EditorControls(), 0, 0, true, true);
            layout.Add(fileTypeHolder, 0, 1);
            layout.Add(Buttons(), 0, 2);

            Content = layout;
        }
Ejemplo n.º 26
0
        public ScrollableSection()
        {
            var layout = new TableLayout(this, 4, 2);

            layout.SetColumnScale(1);
            layout.SetColumnScale(3);
            layout.SetRowScale(0);
            layout.SetRowScale(1);

            layout.Add(new Label {
                Text = "Default"
            }, 0, 0);
            layout.Add(DefaultScrollable(), 1, 0);

            layout.Add(new Label {
                Text = "No Border"
            }, 2, 0);
            layout.Add(NoBorderScrollable(), 3, 0);

            layout.Add(new Label {
                Text = "Bezeled"
            }, 0, 1);
            layout.Add(BezelScrollable(), 1, 1);

            layout.Add(new Label {
                Text = "Line"
            }, 2, 1);
            layout.Add(LineScrollable(), 3, 1);
        }
Ejemplo n.º 27
0
        public PadPanel()
        {
            var layout = new TableLayout(1, 3);

            layout.Padding = Padding.Empty;
            layout.Spacing = Size.Empty;
            content        = new Panel();

            layout.Add(topPads, 0, 0);
            layout.Add(Middle(), 0, 1, true, true);
            layout.Add(bottomPads, 0, 2);

            base.Content = layout;
        }
Ejemplo n.º 28
0
        protected override Control OnDefineLayout()
        {
            var layout = new TableLayout(1, 4)
            {
                DataContext = _vm
            };

            layout.Add(CreateAppearanceGroup(), 0, 0, true, false);
            layout.Add(CreatePathsGroup(), 0, 1, true, false);
            layout.Add(CreateLoggingGroup(), 0, 2, true, false);
            layout.Add(null, 0, 3, true, true);

            return(layout);
        }
Ejemplo n.º 29
0
        public ScrollableSection()
        {
            var layout = new TableLayout(4, 2);

            layout.Spacing = new Size(5, 5);
            layout.Padding = new Padding(10);

            layout.SetColumnScale(1);
            layout.SetColumnScale(3);
            layout.SetRowScale(0);
            layout.SetRowScale(1);

            layout.Add(new Label {
                Text = "Default"
            }, 0, 0);
            layout.Add(DefaultScrollable(), 1, 0);

            layout.Add(new Label {
                Text = "No Border"
            }, 2, 0);
            layout.Add(NoBorderScrollable(), 3, 0);

            layout.Add(new Label {
                Text = "Bezeled"
            }, 0, 1);
            layout.Add(BezelScrollable(), 1, 1);

            layout.Add(new Label {
                Text = "Line"
            }, 2, 1);
            layout.Add(LineScrollable(), 3, 1);

            Content = layout;
        }
Ejemplo n.º 30
0
        public static Dialog Create(string message)
        {
            var dialog = new Dialog
            {
                Icon    = AppImages.Xf,
                Title   = AppResource.Error_dialog_title,
                Padding = AppStyles.WindowPadding,
                Width   = 500,
                Height  = 400,
            };

            var container = new TableLayout(1, 3)
            {
                Spacing = new Size(0, 10)
            };

            var about = new Label {
                Text = AboutResource.Save_log_before_termination
            };
            var txtCtrl = new TextArea {
                ReadOnly = true, Text = message, Wrap = true
            };
            var ok = new Button {
                Text = CommonResource.Ok
            };
            var export = new LinkButton {
                Text = AboutResource.Export_log_and_trace
            };

            export.Click += (s, e) => { SaveLogDialog.Show(message); };

            container.Add(about, 0, 0, true, false);
            container.Add(txtCtrl, 0, 1, true, true);

            var btnRow = new TableLayout(3, 1)
            {
                Spacing = new Size(6, 0)
            };

            btnRow.Add(export, 0, 0, false, false);
            btnRow.Add(null, 1, 0, true, false);
            btnRow.Add(ok, 2, 0, false, false);

            container.Add(btnRow, 0, 2, true, false);

            dialog.Content = container;
            ok.Click      += (s, e) => dialog.Close();

            return(dialog);
        }