| | |
| | | private NormalViewControl InitDeviceButtonControl(FrameLayout frame, CommonDevice device)
|
| | | {
|
| | | var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false);
|
| | | btnIcon.Text = "Button" + device.DeviceEpoint;
|
| | | btnIcon.Text = "BUTTON" + device.DeviceEpoint;
|
| | | btnIcon.TextAlignment = TextAlignment.Center;
|
| | | btnIcon.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnIcon.IsBold = true;
|
| | | if (frame is FrameLayoutStatuControl)
|
| | | {
|
| | | ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | |
| | | {
|
| | | //按键1
|
| | | var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]);
|
| | | btnButton1.TextSize = 12;
|
| | | btnButton1.TextSize = 10;
|
| | | btnButton1.Height = this.GetPictrueRealSize(175);
|
| | | btnButton1.Width = this.GetPictrueRealSize(183);
|
| | | btnButton1.X = this.GetPictrueRealSize(34);
|
| | |
| | |
|
| | | //按键2
|
| | | var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]);
|
| | | btnButton2.TextSize = 12;
|
| | | btnButton2.TextSize = 10;
|
| | | btnButton2.Height = this.GetPictrueRealSize(175);
|
| | | btnButton2.Width = this.GetPictrueRealSize(183);
|
| | | btnButton2.X = btnButton1.Right;
|
| | |
| | |
|
| | | //按键3
|
| | | var btnButton3 = this.InitDeviceButtonControl(frameBack, listDevice[2]);
|
| | | btnButton3.TextSize = 12;
|
| | | btnButton3.TextSize = 10;
|
| | | btnButton3.Height = this.GetPictrueRealSize(175);
|
| | | btnButton3.Width = this.GetPictrueRealSize(183);
|
| | | btnButton3.X = btnButton1.X;
|
| | |
| | |
|
| | | //按键4
|
| | | var btnButton4 = this.InitDeviceButtonControl(frameBack, listDevice[3]);
|
| | | btnButton4.TextSize = 12;
|
| | | btnButton4.TextSize = 10;
|
| | | btnButton4.Height = this.GetPictrueRealSize(175);
|
| | | btnButton4.Width = this.GetPictrueRealSize(183);
|
| | | btnButton4.X = btnButton2.X;
|
| | |
| | | frameButton1.Width = this.GetPictrueRealSize(183);
|
| | | frameBack.AddChidren(frameButton1);
|
| | | var btnButton1 = this.InitDeviceButtonControl(frameButton1, device1);
|
| | | btnButton1.TextSize = 10;
|
| | | btnButton1.TextSize = 8;
|
| | | btnButton1.Height = this.GetPictrueRealSize(35);
|
| | | btnButton1.Width = this.GetPictrueRealSize(183);
|
| | | btnButton1.Y = this.GetPictrueRealSize(37);
|
| | |
| | | frameButton2.Y = frameButton1.Bottom;
|
| | | frameBack.AddChidren(frameButton2);
|
| | | var btnButton2 = this.InitDeviceButtonControl(frameButton2, device2);
|
| | | btnButton2.TextSize = 10;
|
| | | btnButton2.TextSize = 8;
|
| | | btnButton2.Height = btnButton1.Height;
|
| | | btnButton2.Width = btnButton1.Width;
|
| | | btnButton2.Y = this.GetPictrueRealSize(20);
|
| | |
| | | nowContr.TextColor = 0xfffb744a;
|
| | |
|
| | | nowSelectControl = nowContr;
|
| | | nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("Button", string.Empty)));
|
| | | nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("BUTTON", string.Empty)));
|
| | |
|
| | | //重新初始化菜单行
|
| | | this.InitMenuRow();
|