| | |
| | | /// <summary> |
| | | /// line |
| | | /// </summary> |
| | | public Line Line; |
| | | public Button Line; |
| | | /// <summary> |
| | | /// isSelected |
| | | /// </summary> |
| | |
| | | /// </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> |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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> |
| | |
| | | /// <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(); |
| | | } |
| | | } |
| | | } |