/// <summary> /// 更新布局方法 /// </summary> public override void update() { if (Checked) { ArrayList <FCView> controls = null; if (Parent != null) { controls = Parent.getControls(); } else { controls = Native.getControls(); } //反选组别相同的项 int controlSize = controls.size(); for (int i = 0; i < controlSize; i++) { FCRadioButton radioButton = controls.get(i) as FCRadioButton; if (radioButton != null && radioButton != this) { if (radioButton.GroupName == GroupName && radioButton.Checked == true) { radioButton.Checked = false; radioButton.invalidate(); } } } } }
/// <summary> /// 创建单选按钮单元格 /// </summary> public GridRadioButtonCell() { FCRadioButton radioButton = new FCRadioButton(); radioButton.BorderColor = FCColor.None; radioButton.DisplayOffset = false; Control = radioButton; }
/// <summary> /// 设置字符型数值 /// </summary> /// <param name="value"></param> public override void setString(String value) { FCRadioButton radioButton = RadioButton; if (radioButton != null) { radioButton.Checked = value == "true"; } }
/// <summary> /// 设置长整型数值 /// </summary> /// <param name="value">数值</param> public override void setLong(long value) { FCRadioButton radioButton = RadioButton; if (radioButton != null) { radioButton.Checked = value > 0 ? true : false; } }
/// <summary> /// 设置布尔型数值 /// </summary> /// <param name="value">数值</param> public override void setBool(bool value) { FCRadioButton radioButton = RadioButton; if (radioButton != null) { radioButton.Checked = value; } }
/// <summary> /// 获取布尔型数值 /// </summary> /// <returns></returns> public override String getString() { FCRadioButton radioButton = RadioButton; if (radioButton != null) { return(radioButton.Checked ? "true" : "false"); } else { return("false"); } }
/// <summary> /// 获取长整型数值 /// </summary> /// <returns>长整型数值</returns> public override long getLong() { FCRadioButton radioButton = RadioButton; if (radioButton != null) { return(radioButton.Checked ? 1 : 0); } else { return(0); } }
/// <summary> /// 获取整型数值 /// </summary> /// <returns>整型数值</returns> public override int getInt() { FCRadioButton radioButton = RadioButton; if (radioButton != null) { return(radioButton.Checked ? 1 : 0); } else { return(0); } }
/// <summary> /// 获取双精度浮点值 /// </summary> /// <returns>双精度浮点值</returns> public override double getDouble() { FCRadioButton radioButton = RadioButton; if (radioButton != null) { return(radioButton.Checked ? 1 : 0); } else { return(0); } }
/// <summary> /// 获取布尔型数值 /// </summary> /// <returns>布尔型数值</returns> public override bool getBool() { FCRadioButton radioButton = RadioButton; if (radioButton != null) { return(radioButton.Checked); } else { return(false); } }