using System;
using Shared.Common;
namespace Shared.Phone.Device.CommonForm
{
public class SelectSceneRow:FrameLayout
{
///
/// ClickButton
///
public Button ClickButton;
///
/// name
///
public Button NameBtn;
///
/// Image
///
public Button ImageBtn;
///
/// SelectBtn
///
public Button SelectBtn;
///
/// v_Selected
///
private bool v_Selected;
///
/// line
///
private Button line;
///
/// IsSelected
///
public bool IsSelected
{
set
{
v_Selected = value;
try
{
SetStatu(v_Selected);
}
catch
{
}
}
get
{
return v_Selected;
}
}
///
/// SelectSceneRow
///
///
///
public SelectSceneRow(int x = 0, int y = 0)
{
X = Application.GetRealWidth(x);
Y = Application.GetRealHeight(y);
Width = Application.GetRealWidth(1022);
Height = Application.GetRealHeight(127);
}
///
/// Init
///
public void Init()
{
ImageBtn = new Button()
{
X = Application.GetRealWidth(58),
Width = Application.GetMinRealAverage(81),
Height = Application.GetMinRealAverage(81),
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = "Scene/SceneIcon.png"
};
AddChidren(ImageBtn);
NameBtn = new Button()
{
X = Application.GetRealWidth(173),
Width = Application.GetRealWidth(600),
Height = Application.GetRealHeight(80),
Gravity = Gravity.CenterVertical,
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextAlignment = TextAlignment.CenterLeft,
TextSize=15
};
AddChidren(NameBtn);
SelectBtn = new Button()
{
X = Application.GetRealWidth(919),
Width = Application.GetMinRealAverage(104),
Height = Application.GetMinRealAverage(104),
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = "Scene/Selected.png",
Visible=false
};
AddChidren(SelectBtn);
line = new Button()
{
X = Application.GetRealWidth(180),
Y = this.Height - 1,
Width = Application.GetRealWidth(841),
Height = 1,
BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
};
AddChidren(line);
ClickButton = new Button
{
};
AddChidren(ClickButton);
}
///
/// SetTitle
///
///
public void SetTitle(string title)
{
NameBtn.Text = title;
}
///
/// SetTitle
///
///
public void SetTitle(int title)
{
SetTitle(Language.StringByID(title));
}
///
/// SetStatu
///
///
public void SetStatu(bool statu)
{
SelectBtn.Visible = statu;
}
///
/// HideIcon
///
///
public void HideIcon(bool statu)
{
ImageBtn.Visible = !statu;
}
///
/// hideLine
///
///
public void hideLine(bool statu)
{
line.Visible = !statu;
}
}
}