Exemple #1
0
        private void CreatePages()
        {
            LinearLayout linear = new LinearLayout();

            linear.LinearOrientation = LinearLayout.Orientation.Horizontal;

            listViewContainer = new View()
            {
                Layout              = linear,
                Name                = "DropDownMenuList",
                WidthSpecification  = Window.Instance.WindowSize.Width * numberOfPages,
                HeightSpecification = LayoutParamPolicies.MatchParent,
                Padding             = new Extents(40, 40, 0, 0),
            };

            scrollable = new Scrollable()
            {
                Name = "Scrollable",
                FlickAnimationSpeed          = 0.8f,
                FlickDistanceMultiplierRange = new Vector2(0.2f, 0.5f),
                ScrollingDirection           = Tizen.NUI.Components.Scrollable.Direction.Horizontal,
                SnapToPage = true,
            };
            scrollable.Add(listViewContainer);

            scrollable.WidthSpecification  = LayoutParamPolicies.MatchParent;
            scrollable.HeightSpecification = LayoutParamPolicies.MatchParent;

            root.Add(scrollable);
        }
Exemple #2
0
        public SystemColorSection()
        {
            var layout = new StackLayout
            {
                Spacing = 10,
                HorizontalContentAlignment = HorizontalAlignment.Stretch
            };

            var type = typeof(SystemColors);

            var properties = type.GetRuntimeProperties();

            var skip            = new List <PropertyInfo>();
            var colorProperties = properties.Where(r => r.PropertyType == typeof(Color)).OrderBy(r => r.Name).ToList();

            foreach (var property in colorProperties)
            {
                if (skip.Contains(property))
                {
                    continue;
                }
                var color = (Color)property.GetValue(null);
                var label = new Label {
                    Text = property.Name
                };
                var panel = new Panel
                {
                    Content = label,
                    Padding = new Padding(10),
                };

                bool isTextColor = property.Name.EndsWith("Text");

                if (isTextColor)
                {
                    label.TextColor = color;
                }
                else
                {
                    panel.BackgroundColor = color;
                    var textProp = colorProperties.FirstOrDefault(r => r.Name == property.Name + "Text");
                    if (textProp != null)
                    {
                        label.TextColor = (Color)textProp.GetValue(null);
                        label.Text     += " && " + textProp.Name;
                        skip.Add(textProp);
                    }
                    else if (color.ToHSB().B < 0.5)
                    {
                        label.TextColor = Colors.White;
                    }
                }

                layout.Items.Add(panel);
            }

            Content = new Scrollable {
                Content = TableLayout.AutoSized(layout, centered: true)
            };
        }
Exemple #3
0
 public override void AIUpdate(GameObject ControlledObject, GameObject Target, Camera ViewCamera, float deltaTime)
 {
     ShotTimer += Time.deltaTime;
     if (ShotTimer >= ShotDelay)
     {
         GameObject  newShot  = GameObject.Instantiate(Shot, ControlledObject.transform.position, Quaternion.identity);
         Rigidbody2D shotBody = newShot.GetComponent <Rigidbody2D>();
         if (shotBody)
         {
             if (Target != null)
             {
                 Vector3 targetDirection = Target.transform.position - ControlledObject.transform.position;
                 targetDirection.Normalize();
                 shotBody.velocity = targetDirection * ShotSpeed;
             }
             else
             {
                 shotBody.velocity = new Vector3(ShotSpeed, 0, 0);
             }
         }
         Scrollable scrollable = newShot.GetComponent <Scrollable>();
         if (scrollable)
         {
             scrollable.viewCamera = ViewCamera;
         }
         ShotTimer = 0;
     }
 }
        public PluginManager()
        {
            Orientation       = Orientation.Horizontal;
            Panel1MinimumSize = 200;
            Panel1            = new Scrollable {
                Content = _pluginList
            };
            Panel2 = new Scrollable {
                Content = _settingControls
            };

            Plugins = new List <PluginReference>();
            _pluginList.SelectedIndexChanged += (sender, e) =>
            {
                if (_pluginList.SelectedIndex >= 0 && _pluginList.SelectedIndex <= Plugins.Count)
                {
                    SelectedPlugin = Plugins[_pluginList.SelectedIndex];
                }
            };

            foreach (var type in PluginManager.GetChildTypes <T>())
            {
                var pluginRef = new PluginReference(type);
                if (type != typeof(T) && !Plugins.Contains(pluginRef))
                {
                    Plugins.Add(pluginRef);
                }
            }

            _pluginList.Items.Clear();
            foreach (var plugin in Plugins)
            {
                _pluginList.Items.Add(string.IsNullOrWhiteSpace(plugin.Name) ? plugin.Path : plugin.Name);
            }
        }
Exemple #5
0
        void pSetupPatternElementUI_3()
        {
            Application.Instance.Invoke(() =>
            {
                TableRow right_tr2 = new TableRow();
                right_tl.Rows.Add(right_tr2);

                TableCell right_tr2_0 = new TableCell();
                right_tr2.Cells.Add(right_tr2_0);

                groupBox_position = new GroupBox();

                Scrollable s = new Scrollable();
                TableLayout groupBox_position_table = new TableLayout();
                s.Content = groupBox_position_table;
                groupBox_position.Content = s;
                groupBox_position.Text    = "Position";

                right_tr2_0.Control = groupBox_position;

                pSubShapeRef_UI(groupBox_position_table);
                pSubShapePos_UI(groupBox_position_table);
                pSubShapeXPos_UI(groupBox_position_table);
                pSubShapeXRelPos_UI(groupBox_position_table);
                pSubShapeXRelPosSS_UI(groupBox_position_table);
                pSubShapeYPos_UI(groupBox_position_table);
                pSubShapeYRelPos_UI(groupBox_position_table);
                pSubShapeYRelPosSS_UI(groupBox_position_table);
                pRot_UI(groupBox_position_table);
                pRelRot_UI(groupBox_position_table);
                pFlip_UI(groupBox_position_table);
                pArray_UI(groupBox_position_table);
                pMerge_UI(groupBox_position_table);
            });
        }
Exemple #6
0
        private void CreateList()
        {
            LinearLayout linear = new LinearLayout();

            linear.LinearOrientation = LinearLayout.Orientation.Vertical;

            listViewContainer = new View()
            {
                Layout              = linear,
                Name                = "DropDownMenuList",
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.MatchParent,
                Focusable           = true,
                Padding             = new Extents(40, 40, 0, 0),
            };

            scrollable = new Scrollable()
            {
                Name = "Scrollable",
                // FlickAnimationSpeed = 0.8f,
                // FlickDistanceMultiplierRange = new Vector2(0.3f,0.6f),
            };
            scrollable.Add(listViewContainer);

            scrollable.WidthSpecification  = LayoutParamPolicies.MatchParent;
            scrollable.HeightSpecification = LayoutParamPolicies.MatchParent;

            root.Add(scrollable);
        }
Exemple #7
0
 void LogEvents(Scrollable control)
 {
     control.Scroll += delegate(object sender, ScrollEventArgs e)
     {
         Log.Write(control, "Scroll, ScrollPosition: {0}", e.ScrollPosition);
     };
 }
Exemple #8
0
        Scrollable CreateScrollable()
        {
            var scrollable = new Scrollable {
                Size = new Size(100, 200)
            };

            LogEvents(scrollable);

            var desc = new Label
            {
                Text              = "Content",
                BackgroundColor   = Colors.Green,
                Size              = new Size(400, 400),
                TextAlignment     = TextAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center
            };

            var content = new Panel
            {
                BackgroundColor = Colors.Red,                 // should not see red
                Content         = desc
            };

            scrollable.Content = content;
            return(scrollable);
        }
Exemple #9
0
        private void InitializeComponent()
        {
            Title = "Build Output";

            panel = new Panel();

            textArea = new TextArea
            {
                Wrap     = false,
                ReadOnly = true
            };

            scrollable = new Scrollable
            {
                BackgroundColor     = DrawInfo.BackColor,
                ExpandContentWidth  = true,
                ExpandContentHeight = true
            };
            drawable           = new Drawable();
            scrollable.Content = drawable;

            panel.Content = textArea;
            CreateContent(panel);

            drawable.MouseDown     += Drawable_MouseDown;
            drawable.MouseMove     += Drawable_MouseMove;
            drawable.MouseLeave    += Drawable_MouseLeave;
            drawable.SizeChanged   += Drawable_SizeChanged;
            drawable.Paint         += Drawable_Paint;
            scrollable.SizeChanged += Scrollable1_SizeChanged;
            scrollable.Scroll      += Scrollable1_Scroll;
        }
        private Scrollable CreateFileScrollable()
        {
            Scrollable scrollable = new Scrollable {
                Size = new Size(-1, 350)
            };
            TableLayout fileLayout = new TableLayout {
                Padding = new Padding(10, 10, 20, 10), Spacing = new Size(0, 10)
            };

            if (string.IsNullOrEmpty(AppData.ExcelFolderPath) || !Directory.Exists(AppData.ExcelFolderPath))
            {
                fileLayout.Rows.Add(new Panel {
                    Size = new Size(200, 100)
                });
                fileLayout.Rows.Add(new Label {
                    Text = "无法读取到Excel文件,请检查Excel路径是否正确"
                });
                fileLayout.Rows.Add(new TableRow {
                    ScaleHeight = true
                });
            }
            else
            {
                ConstructExcelFileLayout(ref fileLayout);
            }

            fileLayout.Rows.Add(new TableRow {
                ScaleHeight = true
            });

            scrollable.Content = fileLayout;
            return(scrollable);
        }
Exemple #11
0
        public LoggerPanel(uint documentSerialNumber)
        {
            Logs = new ObservableCollection <Log>();

            StackGrid = new GridView()
            {
                ShowHeader = false,
                DataStore  = Logs,
                GridLines  = GridLines.Vertical
            };

            StackGrid.Columns.Add(new GridColumn()
            {
                HeaderText = "Level",
                Width      = 12,
                Editable   = false,
                DataCell   = new ImageViewCell
                {
                    Binding = Binding.Delegate((Log m) => m.LogLevel)
                }
            });

            StackGrid.Columns.Add(new GridColumn()
            {
                HeaderText = "TS",
                Editable   = false,
                AutoSize   = true,
                DataCell   = new TextBoxCell
                {
                    Binding = Binding.Property <Log, string>(r => r.Ts)
                }
            });

            StackGrid.Columns.Add(new GridColumn()
            {
                HeaderText = "Message",
                Editable   = false,
                AutoSize   = true,
                DataCell   = new TextBoxCell
                {
                    Binding = Binding.Property <Log, string>(r => r.Text)
                }
            });

            Content = new Scrollable()
            {
                Content = StackGrid
            };

            var clearBtn = new ButtonMenuItem
            {
                Text = "CLear"
            };

            clearBtn.Click += ClearBtn_Click;

            ContextMenu = new ContextMenu(new MenuItem[] { clearBtn });

            Info("Noah Logger initialize complete");
        }
Exemple #12
0
        protected override Control OnDefineLayout()
        {
            _groups = new StackLayout
            {
                HorizontalContentAlignment = HorizontalAlignment.Center,
                Orientation = Orientation.Vertical,
                Spacing     = 50
            };

            var centered = new DynamicLayout();

            centered.AddCentered(_groups);

            CreateGroups();

            var scrollable = new Scrollable
            {
                ExpandContentWidth  = true,
                ExpandContentHeight = true,
                Border  = BorderType.None,
                Padding = new Padding(10),
                Content = centered
            };

            return(scrollable);
        }
Exemple #13
0
        public void Init()
        {
            int gIndex = 0;

            foreach (var str in MdSessionData.CurrentInputMethod.Groups)
            {
                var tp = new TabPage();
                tp.Text = str;
                tp.Tag  = gIndex;
                gIndex++;

                var sc = new Scrollable();
                sc.Border  = BorderType.None;
                tp.Content = sc;

                this.slcList.Add(999);
                var msl = new StackLayout();
                msl.Orientation = Orientation.Vertical;
                this.slMainList.Add(msl);
                sc.Content = msl;

                this.slList.Add(null);

                int ind = TCMain.Pages.Count;
                this.TCMain.Pages.Add(tp);
                tp.Click += (sender, e) => PressedTab(sender, ind);
            }

            PressedTab(TCMain.Pages[0], 0);
        }
Exemple #14
0
        /// <summary>
        /// This make possible the build above.
        /// DO NOT TRY TO MODIFY THIS.
        /// </summary>
        private void BuildScrollable(Scrollable scrollable, int value)
        {
            switch (scrollable)
            {
            case Scrollable.FlingToBeginning:
                FlingToBeginning(value);
                break;

            case Scrollable.FlingToEnd:
                FlingToEnd(value);
                break;

            case Scrollable.ScrollBackward:
                ScrollBackward(value);
                break;

            case Scrollable.ScrollForward:
                ScrollForward(value);
                break;

            case Scrollable.ScrollToBeginning:
                ScrollToBeginning(value);
                break;

            case Scrollable.ScrollToEnd:
                ScrollToEnd(value);
                break;

            case Scrollable.SetMaxSearchSwipes:
                SetMaxSearchSwipes(value);
                break;
            }
        }
Exemple #15
0
        /// <summary>
        /// This make possible the build above.
        /// DO NOT TRY TO MODIFY THIS.
        /// </summary>
        private void BuildScrollable(Scrollable scrollable)
        {
            switch (scrollable)
            {
            case Scrollable.FlingBackward:
                FlingBackward();
                break;

            case Scrollable.FlingForward:
                FlingForward();
                break;

            case Scrollable.GetMaxSearchSwipes:
                GetMaxSearchSwipes();
                break;

            case Scrollable.GetSwipeDeadZonePercentage:
                GetSwipeDeadZonePercentage();
                break;

            case Scrollable.ScrollBackward:
                ScrollBackward();
                break;

            case Scrollable.ScrollForward:
                ScrollForward();
                break;
            }
        }
        private void ClientsReceived(String[] names, Boolean locked)
        {
            Scrollable  scroll = controls["scroll"] as Scrollable;
            StackLayout stack  = scroll.Content as StackLayout;

            if (!locked)
            {
                stack.Items.Clear();
                for (Int32 i = 0; i < names.Length; i++)
                {
                    stack.Items.Add(new StackLayoutItem {
                        Control = new CheckBox {
                            Font = new Font("Segoe UI", 10), Text = names[i], ThreeState = false
                        }
                    });
                }

                // Get locked clients
                Client.Instance.RequestClients((controls["room"] as Label).Text, true);
            }
            else
            {
                for (Int32 i = 0; i < stack.Items.Count; i++)
                {
                    if (names.Contains((stack.Items[i].Control as CheckBox).Text))
                    {
                        (stack.Items[i].Control as CheckBox).Text += " (locked)";
                    }
                }
            }
        }
        public override void LayoutCore()
        {
            int ScrollbarSize = Scrollbar.InitialSize;

            Scrollable.Bounds.Location = this.Bounds.Location;
            int ScrollbarsMargin = (this.ScrollbarsVisible ? ScrollbarSize : 0);

            Scrollable.Bounds.Size.X = this.Bounds.Size.X - ScrollbarsMargin;
            Scrollable.Bounds.Size.Y = this.Bounds.Size.Y - ScrollbarsMargin;
            Scrollable.LayoutCore();

            VScroll.Bounds.Location.Set(Scrollable.Bounds.Right, Scrollable.Bounds.Location.Y);
            VScroll.Bounds.Size.Set(ScrollbarSize, Scrollable.Bounds.Size.Y);
            VScroll.LayoutCore();

            HScroll.Bounds.Location.Set(Scrollable.Bounds.Location.X, Scrollable.Bounds.Bottom);
            HScroll.Bounds.Size.Set(Scrollable.Bounds.Size.X, ScrollbarSize);
            HScroll.LayoutCore();

            BottomRightCorner.Bounds.Location.Set(VScroll.Bounds.Location.X, HScroll.Bounds.Location.Y);
            BottomRightCorner.Bounds.Size.Set(VScroll.Bounds.Size.X, HScroll.Bounds.Size.Y);

            VScroll.SyncToView();
            HScroll.SyncToView();
        }
        void InitializeComponent()
        {
            var tlMain = new TableLayout();

            tlMain.Padding = 5;

            var trTop = new TableRow();

            tlMain.Rows.Add(trTop);

            var slTop = new StackLayout();

            slTop.Spacing     = 5;
            slTop.Orientation = Orientation.Horizontal;
            slTop.VerticalContentAlignment = VerticalAlignment.Center;
            trTop.Cells.Add(slTop);


            BtnLoad         = new Button();
            BtnLoad.Text    = "Load Layout";
            BtnLoad.ToolTip = "Load Layout";
            slTop.Items.Add(BtnLoad);

            BtnSave         = new Button();
            BtnSave.Text    = "Save Layout*";
            BtnSave.ToolTip = "Save Layout";
            slTop.Items.Add(BtnSave);

            BtnSaveAs         = new Button();
            BtnSaveAs.Text    = "Save Layout As";
            BtnSaveAs.ToolTip = "Save Layout As";
            slTop.Items.Add(BtnSaveAs);

            BtnAddLayer         = new Button();
            BtnAddLayer.Text    = "Add Layer";
            BtnAddLayer.ToolTip = "Add Layer";
            slTop.Items.Add(BtnAddLayer);

            LLayoutName = new Label();
            slTop.Items.Add(LLayoutName);

            var trMain = new TableRow();

            tlMain.Rows.Add(trMain);

            var scMain = new Scrollable();

            scMain.Border = BorderType.None;
            trMain.Cells.Add(scMain);

            SLMain             = new StackLayout();
            SLMain.Spacing     = 5;
            SLMain.Orientation = Orientation.Vertical;
            scMain.Content     = SLMain;



            Content = tlMain;
        }
 public void ScrollContentX(int NewPosition)
 {
     if (!HScroll.Thumb.Visible)
     {
         return;
     }
     Scrollable.ScrollToX(NewPosition);
     HScroll.SyncToView();
 }
Exemple #20
0
 Control ColoursHolder()
 {
     coloursHolder = new Scrollable
     {
         Size = new Size(16 * 18 + 14 + 16, 4 * 18 + 14),
         ExpandContentWidth  = false,
         ExpandContentHeight = false
     };
     return(coloursHolder);
 }
Exemple #21
0
        private TableLayout ConstructFbsFilePickerLayout()
        {
            TableLayout layout = new TableLayout();

            fbsFileNames = GetFbsFileNamesInDirectory(AppData.FbsDirectory);

            if (fbsFileNames != null && fbsFileNames.Length > 0)
            {
                Scrollable scrollable = new Scrollable();
                scrollable.Height = 300;

                TableLayout scrollContentLayout = new TableLayout();
                scrollContentLayout.Spacing = new Size(30, 10);
                for (int i = 0; i < fbsFileNames.Length; i++)
                {
                    string fileName      = fbsFileNames[i];
                    Label  fileNameLabel = new Label {
                        Text = fileName, Width = 200
                    };
                    scrollContentLayout.Rows.Add(fileNameLabel);
                }

                scrollContentLayout.Rows.Add(new TableRow {
                    ScaleHeight = true
                });

                scrollable.Content = scrollContentLayout;
                layout.Rows.Add(scrollable);

                //添加按钮
                Button refreshButton = new Button {
                    Text = "刷新"
                };
                refreshButton.Click += (sender, args) => { ReConstructWindowLayout(); };

                TableLayout fileButtonLayout = new TableLayout {
                    Spacing = new Size(10, 10)
                };
                fileButtonLayout.Rows.Add(new TableRow {
                    Cells = { refreshButton }
                });
                layout.Rows.Add(fileButtonLayout);
            }
            else
            {
                layout.Rows.Add(new Label {
                    Text = "路径内没有.fbs文件"
                });
            }

            layout.Rows.Add(new TableRow {
                ScaleHeight = true
            });
            return(layout);
        }
Exemple #22
0
        private Control CreateTextArea(string value)
        {
            var scroll = new Scrollable();
            var txt    = new TextArea();

            txt.ReadOnly   = true;
            txt.Font       = Fonts.Monospace(10);
            txt.Text       = value;
            scroll.Content = txt;
            return(scroll);
        }
Exemple #23
0
        public HistoryDetialWindow(string name, string tableJson, Bitmap bitmap)
        {
            ClientSize = new Size(600, 400);
            table      = JsonConvert.DeserializeObject <string[][]>(tableJson);
            Title      = name;

            string[] headerRow = table[0];

            var collection = new ObservableCollection <string[]>();

            for (int i = 1; i < table.GetLength(0); i++)
            {
                if (table[i].Length != headerRow.Length)
                {
                    continue;
                }

                collection.Add(table[i]);
            }

            var grid = new GridView
            {
                ShowHeader = true,
                GridLines  = GridLines.Both,
                DataStore  = collection
            };

            for (int i = 0; i < headerRow.Length; i++)
            {
                grid.Columns.Add(new GridColumn
                {
                    HeaderText = table[0][i],
                    DataCell   = new TextBoxCell(i),
                    AutoSize   = true
                });
            }

            var layout = new DynamicLayout
            {
                Padding = new Padding(5)
            };

            layout.AddSeparateRow(new ImageView
            {
                Image = bitmap
            });

            layout.AddSeparateRow(grid);

            Content = new Scrollable
            {
                Content = layout
            };
        }
Exemple #24
0
        public DockLayoutExpansion()
        {
            var layout = new DynamicLayout();

            defaultScrollable = new Scrollable();
            layout.AddSeparateRow(null, ExpandContentWidth(), ExpandContentHeight(), null);
            layout.Add(Default(), yscale: true);
            layout.Add(ExpandedWidth(), yscale: true);
            layout.Add(ExpandedHeight(), yscale: true);
            Content = layout;
        }
 void _addScrollingNotifierListener()
 {
     if (this.widget.closeOnScroll)
     {
         this._scrollPosition = Scrollable.of(this.context)?.position;
         if (this._scrollPosition != null)
         {
             this._scrollPosition.isScrollingNotifier.addListener(this._isScrollingListener);
         }
     }
 }
Exemple #26
0
        public void ScrollableShouldSetScrollSize()
        {
            Invoke(() =>
            {
                var form = new Form();

                var scrollable = new Scrollable();
                form.Content   = scrollable;

                scrollable.ScrollSize = new Size(1000, 1000);
            });
        }
 private void MoveTo(RowPresenter rowPresenter, bool ensureSelectVisible = true)
 {
     if (ShouldSelectByKey)
     {
         Select(rowPresenter, SelectionMode.Single, ensureSelectVisible);
     }
     else
     {
         CurrentRow = rowPresenter;
         Scrollable.EnsureCurrentRowVisible();
     }
 }
Exemple #28
0
    private void Awake()
    {
        photonView = GetComponent <PhotonView>();
        scroller   = GetComponent <Scrollable>();

        if (NetworkManager.Instance.IsViewMine(photonView) == false)
        {
            Destroy(transform.GetChild(0).GetComponent <Animator>());
            Destroy(scroller);
            Destroy(this);
        }
    }
Exemple #29
0
        /// <summary>
        /// This make possible the build above.
        /// DO NOT TRY TO MODIFY THIS.
        /// </summary>
        private void BuildScrollable(Scrollable scrollable, Selector selector, string text, bool allowScrollSearch)
        {
            switch (scrollable)
            {
            case Scrollable.GetChildByDescription:
                GetChildByDescription(selector, text, allowScrollSearch);
                break;

            case Scrollable.GetChildByText:
                GetChildByText(selector, text, allowScrollSearch);
                break;
            }
        }
Exemple #30
0
        /// <summary>
        /// This make possible the build above.
        /// DO NOT TRY TO MODIFY THIS.
        /// </summary>
        private void BuildScrollable(Scrollable scrollable, int steps, int swipes)
        {
            switch (scrollable)
            {
            case Scrollable.ScrollToBeginning:
                ScrollToBeginning(swipes, steps);
                break;

            case Scrollable.ScrollToEnd:
                ScrollToEnd(swipes, steps);
                break;
            }
        }