using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.Phone.UserCenter
{
///
/// 做成一个模拟RowLayout,进行输入的FrameLayout控件(左边有标题)
///
public class FrameCaptionInputControl : FrameRowControl
{
#region ■ 变量声明___________________________
///
/// 输入框的值
///
public string Text
{
get { return txtInput.Text.Trim(); }
set { txtInput.Text = value; }
}
///
/// 输入框控件(取值或者获取值可以使用【Text】属性,虽然这个也可以取)
///
public TextInputExControl txtInput = null;
///
/// 标题控件
///
public NormalViewControl btnCaption = null;
#endregion
#region ■ 初始化_____________________________
///
/// 做成一个模拟RowLayout,进行输入的FrameLayout控件(左边有标题)
///
/// 标题文本
/// 输入框的值
/// 子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)
public FrameCaptionInputControl(string i_caption, string i_text, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
{
this.UseClickStatu = false;
btnCaption = new NormalViewControl(270, 58, true);
btnCaption.X = ControlCommonResourse.XXLeft;
btnCaption.Gravity = Gravity.CenterVertical;
btnCaption.Text = i_caption + ":";
txtInput = new TextInputExControl(700, true);
txtInput.X = Application.GetRealWidth(294);
txtInput.Gravity = Gravity.CenterVertical;
txtInput.Text = i_text;
}
///
/// 初始化控件
///
/// 标题
/// 文本框的值
public void InitControl()
{
this.AddChidren(btnCaption, ChidrenBindMode.NotBind);
this.AddChidren(txtInput, ChidrenBindMode.NotBind);
if (chidrenYaxis != 0)
{
btnCaption.Y += chidrenYaxis;
txtInput.Y += chidrenYaxis;
}
}
#endregion
}
}