public RowBool(DataAttr attrDef, string name = "", string value = "", AttrList parent = null) { InitializeComponent(); m_parent = parent; m_isCommon = attrDef.m_isCommon; m_subType = attrDef.m_subType; m_eventLock = false; m_name = name; m_preValue = value; m_type = attrDef.m_type; m_defValue = attrDef.m_defValue; if (m_subType != null && m_subType != "") { switch (m_subType) { case "allBool": { mx_root.MinWidth = 300; } break; default: { } break; } } }
public bool initData(XmlElement xeAttrClass) { if(parseClassData(xeAttrClass) == true) { m_uiAttrList = new AttrList(m_className, this); m_uiAttrList.Visibility = System.Windows.Visibility.Collapsed; MainWindow.s_pW.mx_toolArea.Items.Add(m_uiAttrList); } return true; }
public AttrRow(AttrDef_T attrDef, string name = "", string value = "", AttrList parent = null) { m_mapCbiApprPre = new Dictionary<string, ComboBoxItem>(); m_mapCbiApprSuf = new Dictionary<string, ComboBoxItem>(); InitializeComponent(); m_parent = parent; m_isEnum = attrDef.m_isEnum; m_mapEnum = attrDef.m_mapEnum; m_isCommon = attrDef.m_isCommon; m_subType = attrDef.m_subType; m_eventLock = false; m_name = name; m_preValue = value; m_type = attrDef.m_type; }
public RowNormal(DataAttr attrDef = null, string name = "", string value = "", AttrList parent = null) { InitializeComponent(); m_parent = parent; if (attrDef != null) { m_isCommon = attrDef.m_isCommon; m_subType = attrDef.m_subType; mt_type = attrDef.m_type; } else { m_isCommon = false; m_subType = ""; mt_type = "string"; } m_eventLock = false; m_name = name; m_preValue = value; m_type = mt_type; if (m_subType != null && m_subType != "") { switch (m_subType) { case "halfNormal": { mx_c2.Width = new GridLength(75); this.MinWidth = 150; mx_root.MinWidth = 150; } break; default: { } break; } } if(m_type == "Color") { mx_viewColor = new CustomWPFColorPicker.ColorPickerControlView(); mx_exFrame.Children.Add(mx_viewColor); } }
public AttrRow(string type = "string", string name = "", string value = "", AttrList parent = null) { InitializeComponent(); mt_name = name; mt_value = value; mt_type = type; m_parent = parent; m_isEnum = false; m_mapEnum = null; m_isCommon = false; m_subType = ""; m_eventLock = false; m_name = mt_name; m_preValue = mt_value; m_type = mt_type; }
public RowEnum(DataAttr attrDef, string name = "", string value = "", AttrList parent = null) { m_isUseEvent = false; InitializeComponent(); m_parent = parent; m_mapEnum = attrDef.m_mapEnum; m_isCommon = attrDef.m_isCommon; m_subType = attrDef.m_subType; m_eventLock = false; m_name = name; m_preValue = value; m_type = attrDef.m_type; if (m_mapEnum != null && m_mapEnum.Count() > 0) { foreach (KeyValuePair<string, ComboBoxItem> pairEnum in m_mapEnum.ToList()) { ComboBoxItem cbEnum = new ComboBoxItem(); string strEnum = ""; if (m_subType != null && m_subType != "") { strEnum = MainWindow.s_pW.m_strDic.getWordByKey(pairEnum.Key, StringDic.conf_ctrlAttrTipDic + "_" + m_subType); } if (strEnum == "") { strEnum = pairEnum.Key; } cbEnum.Content = strEnum; cbEnum.ToolTip = pairEnum.Key; m_mapEnum[pairEnum.Key] = cbEnum; mx_valueEnum.Items.Add(cbEnum); } } }
public RowWeight(DataAttr attrDef, string name = "", string value = "", AttrList parent = null) { m_mapRow = new Dictionary<string, CheckBox>(); m_mapRowGroup = new Dictionary<string, Dictionary<string, RadioButton>>(); m_mapRbGroupName = new Dictionary<RadioButton, string>(); m_mapGroupTakeBack = new Dictionary<string, int>(); InitializeComponent(); m_parent = parent; m_lstWeight = attrDef.m_lstWeight; m_isCommon = attrDef.m_isCommon; m_subType = attrDef.m_subType; m_eventLock = false; if (m_lstWeight != null && m_lstWeight.Count > 0) { foreach (object rowWt in m_lstWeight) { if (rowWt != null) { if (rowWt is string) { string rowName = (string)rowWt; CheckBox cbRow = new CheckBox(); string strRow = ""; if (m_subType != null && m_subType != "") { strRow = MainWindow.s_pW.m_strDic.getWordByKey(rowName, StringDic.conf_ctrlAttrTipDic + "_" + m_subType); } if (strRow == "") { strRow = rowName; } cbRow.Content = strRow; cbRow.ToolTip = rowName; cbRow.Margin = new Thickness(5); cbRow.IsChecked = false; cbRow.Checked += mx_cbRow_Checked; cbRow.Unchecked += mx_cbRow_Unchecked; mx_valueFrame.Children.Add(cbRow); m_mapRow.Add(rowName, cbRow); } else if (rowWt is WeightRowGroup_T) { WeightRowGroup_T wrgDef = (WeightRowGroup_T)rowWt; WrapPanel wpGroup = new WrapPanel(); Label lbTitle = new Label(); string strGroup = ""; Dictionary<string, RadioButton> mapRow = new Dictionary<string, RadioButton>(); if (m_subType != null && m_subType != "") { strGroup = MainWindow.s_pW.m_strDic.getWordByKey(wrgDef.m_groupName, StringDic.conf_ctrlAttrTipDic + "_" + m_subType); } if (strGroup == "") { strGroup = wrgDef.m_groupName; } lbTitle.Content = strGroup; lbTitle.ToolTip = wrgDef.m_groupName; wpGroup.Children.Add(lbTitle); wpGroup.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0x88, 0x00, 0x00, 0x00)); mx_valueFrame.Children.Add(wpGroup); int numTakeBack = 0; foreach (string rowName in wrgDef.m_lstRow) { RadioButton rbRow = new RadioButton(); string strRow = ""; if (m_subType != null && m_subType != "") { strRow = MainWindow.s_pW.m_strDic.getWordByKey(rowName, StringDic.conf_ctrlAttrTipDic + "_" + m_subType); } if (strRow == "") { strRow = rowName; } rbRow.Content = strRow; rbRow.ToolTip = rowName; rbRow.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; rbRow.Checked += mx_rbRow_Checked; rbRow.Margin = new Thickness(1); rbRow.Padding = new Thickness(5); wpGroup.Children.Add(rbRow); mapRow.Add(rowName, rbRow); m_mapRbGroupName.Add(rbRow, wrgDef.m_groupName); int subNum; if(int.TryParse(rowName, out subNum)) { numTakeBack |= subNum; } } m_mapRowGroup.Add(wrgDef.m_groupName, mapRow); m_mapGroupTakeBack.Add(wrgDef.m_groupName, numTakeBack); } } } } m_name = name; m_preValue = value; m_type = attrDef.m_type; }