Beispiel #1
0
        private List <LayoutItemInfo> GetControlList(DataLayoutControl _dataLayout, UIObjectBase _objectBaseLine)
        {
            var    lst   = new List <LayoutItemInfo>();
            string cName = "";

            foreach (var item in _dataLayout.Items)
            {
                LayoutControlItem i = item as LayoutControlItem;
                if (i != null)
                {
                    var c = i.Control;
                    cName = $"{c.Name.Replace(c.GetType().Name, "")}";
                    UILabel label = _objectBaseLine.ObjectLabels.Where(x => x.ColumnName == cName).FirstOrDefault();
                    if (label == null)
                    {
                        continue;
                    }
                    lst.Add(new LayoutItemInfo()
                    {
                        FieldName = cName.Trim(), Item = i, FieldSettings = label
                    });
                }
            }
            return(lst);
        }
        private void LinkAccountRef1(ListColumnInfo _col, CriteriaOperator _whereCO = null)
        {
            var listSrc = new XPCollection <CoreModel.AccountRef1>(session: unitOfWork1, loadingEnabled: false);

            listSrc.Criteria               = _whereCO;
            listSrc.LoadingEnabled         = true;
            accountRef1TreeList.DataSource = listSrc;
            //Setup labels
            var listObjectBase = UIObjectBase.GetUIObjectByName(typeof(CoreModel.AccountRef1), unitOfWork1);

            listObjectBase.SetupGUILabels(accountRef1TreeList.TreeList);

            if (_col.GridColumn != null)
            {
                _col.GridColumn.ColumnEdit = SharedPR.Items[ACCOUNT_REF1];
            }
            if (_col.LookUpEditor != null)
            {
                var ed = (_col.LookUpEditor as TreeListLookUpEdit);
                ed.Properties.TreeList      = accountRef1TreeList.TreeList;
                ed.Properties.DataSource    = listSrc;
                ed.Properties.DisplayMember = listObjectBase.LookUpDisplayMember();
                ed.Properties.ValueMember   = listObjectBase.LookUpValueMember();
            }
            if (_col.TreeListColumn != null)
            {
                _col.TreeListColumn.ColumnEdit = SharedPR.Items[ACCOUNT_REF1];
            }
        }
Beispiel #3
0
 public TextInput(UIObjectBase parent, int width, Vector2 pos)
     : base(parent.parent, width, 25, pos, Parameters.Filled, parent.parent.BaseColorDark, null, 1)
 {
     textOffset = new Vector2(4, 5);
     Text       = "";
     GenerateBorder(1);
 }
Beispiel #4
0
 public SwitchButton(UIObjectBase parent, int height, Vector2 pos)
     : base(parent.parent, height * 2, height, pos, Parameters.Filled, null, null, 0)
 {
     Parent          = parent;
     SliderPos       = Pos + Vector2.One;
     SliderSize      = height - 2;
     SwitchParameter = false;
     Color           = Parent.parent.BaseColorDark;
 }
Beispiel #5
0
 public Slider(UIObjectBase parent, int railWidth, int railHeight, float maxValue, float minValue, Vector2 pos)
     : base(parent.parent, railWidth, railHeight, pos, Parameters.Filled, null, null, 0)
 {
     SliderMaxValue = maxValue;
     SliderMinValue = minValue;
     SliderValue    = minValue;
     SliderOffset   = new Vector2(3, -(Height * 2 - Height / 2));
     sliderPos      = Pos + SliderOffset;
     SliderColor    = parent.parent.BaseColorLight;
 }
Beispiel #6
0
        /// <summary>
        /// Render object
        /// </summary>
        /// <param name="obj">Object to render</param>
        /// <param name="gameTime">Game time</param>
        public void RenderObject(UIObjectBase obj, GameTime gameTime)
        {
            obj.RenderBefore(_batch, gameTime);

            if (obj.Texture != null)
            {
                var destRect = new Rectangle((int)obj.Position.X, (int)obj.Position.Y, (int)(obj.Size.X * obj.Scale), (int)(obj.Size.Y * obj.Scale));
                _batch.Draw(obj.Texture, destRect, obj.SourceRectangle, obj.TextureColor * obj.Opacity, obj.Rotation, obj.RenderOrigin, SpriteEffects.None, 0f);
            }

            if (!string.IsNullOrWhiteSpace(obj.Caption))
            {
                _batch.DrawString(obj.Font ?? _defaultFont, obj.Caption, obj.Position + obj.TextPosition, obj.FontColor * obj.Opacity);
            }

            obj.RenderAfter(_batch, gameTime);
        }
Beispiel #7
0
        public List(UIObjectBase parent, int width, int itemHeight, int itemsPerPage, Vector2 pos, Color?itemBaseColor = null, bool isScrollable = false)
            : base(parent.parent, width, (itemHeight + 1) * itemsPerPage + 1, pos, Parameters.Filled, new Color(70, 70, 70), null, 0)
        {
            ItemSize           = new Vector2(width - 2, itemHeight);
            ListItems          = new List <ListItem>();
            CurrentListItems   = new List <ListItem>();
            currentScrollItems = new LinkedList <ListItem>();
            parentObject       = parent;
            itemTextOffset     = new Vector2(3, ItemSize.Y / 2 - (int)this.parent.UIFontSmall.MeasureString("Item").Y / 2);

            CurrentPage        = 1;
            ItemsPerPage       = itemsPerPage;
            isMouseInside      = false;
            this.itemBaseColor = itemBaseColor ?? parent.parent.BaseColor;
            this.isScrollable  = isScrollable;

            ConnectInput();
            CreateItemTextures();
        }
Beispiel #8
0
 public Button(UIObjectBase parent, int width, int height, Vector2 pos)
     : base(parent.parent, width, height, pos, Parameters.Filled, parent.parent.BaseColorDark, null, 0)
 {
     State = ButtonState.None;
     ConnectInput();
 }
Beispiel #9
0
 public StatedButton(UIObjectBase parent, int width, int height, Vector2 pos)
     : base(parent, width, height, pos)
 {
 }
Beispiel #10
0
 public Scope(UIObjectBase parent, int width, int height, Vector2 pos)
     : base(parent.parent, width, height, pos, Parameters.Filled, parent.parent.BaseColorDark, null, 0)
 {
     LabelText = "text";
 }