黄学彪
2019-12-20 23fb45dd846ed8b62304c408c6bbe64265d4ac8b
ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
@@ -12,7 +12,7 @@
        /// <summary>
        /// line
        /// </summary>
        public Line Line;
        public Button Line;
        /// <summary>
        /// isSelected
        /// </summary>
@@ -46,14 +46,12 @@
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        public ButtonLineForm(int x, int y, int width, int height)
        public ButtonLineForm(int x, int y)
        {
            X = Application.GetRealWidth(x);
            Y = Application.GetRealHeight(y);
            Width = Application.GetRealWidth(width);
            Height = Application.GetRealHeight(height);
            Width = Application.GetRealWidth(100);
            Height = Application.GetRealHeight(85);
        }
        /// <summary>
@@ -64,14 +62,24 @@
            NameBtn = new Button()
            {
                Width = Width,
                Height = Height - 3,
                Height = Height - Application.GetRealHeight(6),
                TextColor = ZigbeeColor.Current.GXCTextGrayColor4,
                SelectedTextColor = ZigbeeColor.Current.GXCTextDeepBlackColor,
                TextSize = CommonFormResouce.TextSize
                TextSize = CommonFormResouce.TextSize,
                TextAlignment = TextAlignment.CenterLeft
            };
            AddChidren(NameBtn);
            Line = new Line(Height, Width / 2, 2);
            Line = new Button
            {
                X = 0,
                Y = Height - Application.GetRealHeight(6),
                Width = 10,
                Height = Application.GetRealHeight(6),
                Radius = (uint)Application.GetRealHeight(6 / 2),
                BackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
                Visible = false
            };
            AddChidren(Line);
        }
@@ -82,6 +90,18 @@
        public void SetTitle(string title)
        {
            NameBtn.Text = title;
            RefreshWidth();
        }
        /// <summary>
        /// RefreshWidth
        /// </summary>
        public void RefreshWidth()
        {
            NameBtn.Width = NameBtn.GetTextWidth() + Application.GetRealWidth(100);
            Width = NameBtn.Width;
            Line.X = NameBtn.GetTextWidth() / 4;
            Line.Width= NameBtn.GetTextWidth() / 2;
        }
        /// <summary>
@@ -99,9 +119,10 @@
        /// <param name="statu"></param>
        public void SetStatu(bool statu)
        {
            NameBtn.IsSelected = Line.IsSelected = statu;
            NameBtn.IsSelected = Line.Visible = statu;
            NameBtn.TextSize = statu ? CommonFormResouce.TextSize_Selected : CommonFormResouce.TextSize;
            NameBtn.IsBold = statu;
            RefreshWidth();
        }
    }
}