黄学彪
2021-01-28 1fcf2302f79f9cbea5ef17c3688311ed65cfabb4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using Shared;
using System;
using System.Collections.Generic;
using System.Text;
 
namespace HDL_ON.Stan
{
    /// <summary>
    /// 做成一个加大点击区域的图标控件
    /// </summary>
    public class IconBigViewControl : FrameLayoutStatuControl
    {
        /// <summary>
        /// 图标控件(迫不得己,这个东西开放出去)
        /// </summary>
        public ButtonCtrBase btnIcon = null;
        /// <summary>
        /// UnSelectedImagePath
        /// </summary>
        public string UnSelectedImagePath
        {
            get { return btnIcon.UnSelectedImagePath; }
            set { btnIcon.UnSelectedImagePath = value; }
        }
        /// <summary>
        /// SelectedImagePath
        /// </summary>
        public string SelectedImagePath
        {
            get { return btnIcon.SelectedImagePath; }
            set { btnIcon.SelectedImagePath = value; }
        }
        /// <summary>
        /// IsSelected
        /// </summary>
        public bool IsSelected
        {
            get { return btnIcon.IsSelected; }
            set { btnIcon.IsSelected = value; }
        }
 
        /// <summary>
        /// X轴的真实偏移量(请确保已经调用InitControl初始化函数,用法:蓝湖上的X轴,减掉这个值即可)
        /// </summary>
        public int XOffset
        {
            get { return (this.Width - btnIcon.Width) / 2; }
        }
 
        /// <summary>
        /// Y轴的真实偏移量(请确保已经调用InitControl初始化函数,用法:蓝湖上的Y轴,减掉这个值即可)
        /// </summary>
        public int YOffset
        {
            get { return (this.Height - btnIcon.Height) / 2; }
        }
 
        /// <summary>
        /// 做成一个加大点击区域的图标控件
        /// </summary>
        /// <param name="i_width">控件空度</param>
        /// <param name="i_height">控件高度</param>
        public IconBigViewControl(int i_width, int i_height)
        {
            this.Width = this.GetPictrueRealSize(38);
            this.Height = this.GetPictrueRealSize(38);
 
            this.btnIcon = new ButtonCtrBase();
            btnIcon.Width = this.GetPictrueRealSize(i_width);
            btnIcon.Height = this.GetPictrueRealSize(i_height);
            btnIcon.Gravity = Gravity.Center;
        }
 
        /// <summary>
        /// 初始化
        /// </summary>
        public void InitControl()
        {
            this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
        }
    }
}