/// <summary> /// 复选框状态切换事件 /// </summary> /// <param name="sender">调用者</param> private void checkBoxCheckedChanged(object sender) { if (m_xml != null) { if (!m_settingProperty) { m_settingProperty = true; FCCheckBox checkBox = sender as FCCheckBox; if (checkBox != null) { m_designerDiv.saveUndo(); String name = checkBox.Tag.ToString(); String value = checkBox.Checked ? "True" : "False"; int targetsSize = m_targets.Count; for (int i = 0; i < targetsSize; i++) { FCView target = m_targets[i]; m_xml.setProperty(target, name, value); target.update(); } Native.update(); Native.invalidate(); } m_settingProperty = false; } } }
/// <summary> /// 创建复选框控件单元格 /// </summary> public FCGridCheckBoxCell() { FCCheckBox checkBox = new FCCheckBox(); checkBox.DisplayOffset = false; checkBox.ButtonAlign = FCHorizontalAlign.Center; Control = checkBox; }
/// <summary> /// 设置字符型数值 /// </summary> /// <param name="value"></param> public override void setString(String value) { FCCheckBox checkBox = CheckBox; if (checkBox != null) { checkBox.Checked = value == "true"; } }
/// <summary> /// 设置长整型数值 /// </summary> /// <param name="value">数值</param> public override void setLong(long value) { FCCheckBox checkBox = CheckBox; if (checkBox != null) { checkBox.Checked = value > 0 ? true : false; } }
/// <summary> /// 设置单精度浮点值 /// </summary> /// <param name="value">数值</param> public override void setFloat(float value) { FCCheckBox checkBox = CheckBox; if (checkBox != null) { checkBox.Checked = value > 0 ? true : false; } }
/// <summary> /// 设置双精度浮点值 /// </summary> /// <param name="value">数值</param> public override void setDouble(double value) { FCCheckBox checkBox = CheckBox; if (checkBox != null) { checkBox.Checked = value > 0 ? true : false; } }
/// <summary> /// 设置布尔型数值 /// </summary> /// <param name="value">数值</param> public override void setBool(bool value) { FCCheckBox checkBox = CheckBox; if (checkBox != null) { checkBox.Checked = value; } }
/// <summary> /// 获取布尔型数值 /// </summary> /// <returns></returns> public override String getString() { FCCheckBox checkBox = CheckBox; if (checkBox != null) { return(checkBox.Checked ? "true" : "false"); } else { return("false"); } }
/// <summary> /// 获取长整型数值 /// </summary> /// <returns>长整型数值</returns> public override long getLong() { FCCheckBox checkBox = CheckBox; if (checkBox != null) { return(checkBox.Checked ? 1 : 0); } else { return(0); } }
/// <summary> /// 获取整型数值 /// </summary> /// <returns>整型数值</returns> public override int getInt() { FCCheckBox checkBox = CheckBox; if (checkBox != null) { return(checkBox.Checked ? 1 : 0); } else { return(0); } }
/// <summary> /// 获取双精度浮点值 /// </summary> /// <returns>双精度浮点值</returns> public override double getDouble() { FCCheckBox checkBox = CheckBox; if (checkBox != null) { return(checkBox.Checked ? 1 : 0); } else { return(0); } }
/// <summary> /// 获取布尔型数值 /// </summary> /// <returns>布尔型数值</returns> public override bool getBool() { FCCheckBox checkBox = CheckBox; if (checkBox != null) { return(checkBox.Checked); } else { return(false); } }