private void btnSetPageText_Click(object sender, EventArgs e) { if (InputDataCheck()) { FormProvoider.SetTabPageText(ItemID, FormProvoider.GetCurTabPage(ItemID), this.txtCurTabPage.Text); } }
private void btnDeleteColumn_Click(object sender, EventArgs e) { try { if (DialogResult.Yes == MessageBox.Show("确定删除?", "删除确认", MessageBoxButtons.YesNo)) { FormProvoider.DeleteGridColumn(controlID, indexColumn); _gridColumns.Remove(txtCurColumn.Text.Trim()); if (indexColumn > 0) { BindColumnInfo(indexColumn - 1); indexColumn = indexColumn - 1; } else if (FormProvoider.GetGridColumns(controlID) > 0) { BindColumnInfo(0); indexColumn = 0; } else { txtCurColumn.Text = string.Empty; txtColumnWidth.Text = string.Empty; combStyle.SelectedItem = null; txtDefaultValue.Text = string.Empty; _currentColumn = string.Empty; chkSum.Checked = false; } //((FormDesignerWorkbenchWindow)WorkbenchSingleton.Workbench.ActiveWorkbenchWindow).formDataCollection.Remove(controlID.ToString()); MessageBox.Show("删除成功!请绑定数据。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { } }
private void SetColor(Color color, int formItemID) { windowTextColor = color; int col = color.B << 16 | color.G << 8 | color.R; FormProvoider.SetFormItemColor(formItemID, col); }
private void btnInsertTabPage_Click(object sender, EventArgs e) { if (InputDataCheck()) { FormProvoider.InsertTabPage(Convert.ToInt32(ItemID), this.txtCurTabPage.Text, -1); } }
private void btnNextPage_Click(object sender, EventArgs e) { FormProvoider.SetCurTabPage(ItemID, FormProvoider.GetCurTabPage(ItemID) + 1); StringBuilder pageText = new StringBuilder(256); FormProvoider.GetTabPageText(ItemID, FormProvoider.GetCurTabPage(ItemID), pageText, pageText.Capacity); this.txtCurTabPage.Text = pageText.ToString(); }
private void BindData(string ItemName) { this.txtContorlName.Text = ItemName; StringBuilder pageText = new StringBuilder(256); FormProvoider.GetTabPageText(ItemID, FormProvoider.GetCurTabPage(ItemID), pageText, pageText.Capacity); this.txtCurTabPage.Text = pageText.ToString(); }
/// <summary> /// 页面生成DataGrid /// </summary> /// <param name="formDesignerWorkbenchWindow"></param> /// <param name="ID"></param> /// <param name="Attribute"></param> //private void SetDataGrid(FormDesignerWorkbenchWindow formDesignerWorkbenchWindow, string ID, object Attribute) //{ // DataGridControlAttribute DataGridControlAttribute = (DataGridControlAttribute)Attribute; // int columnIndex = 0; // for (int j = 0; j < DataGridControlAttribute.Columns.Count; j++) // { // Dap2xProvoider.GridColumn gridColumnInfo = new Dap2xProvoider.GridColumn(); // gridColumnInfo.columnalign = 1; // gridColumnInfo.columnWidth = Convert.ToInt32(DataGridControlAttribute.Columns[j].Width); // gridColumnInfo.columncaption = DataGridControlAttribute.Columns[j].Text; // gridColumnInfo.columnStyle = formDesignerWorkbenchWindow.ColumnStyle.GetKeyByValue(DataGridControlAttribute.Columns[j].Input); // gridColumnInfo.columndefaultValue = DataGridControlAttribute.Columns[j].DefaultValue; // if (DataGridControlAttribute.Columns[j].ReadOnly == "true") // gridColumnInfo.columnalign = 1; // else if (DataGridControlAttribute.Columns[j].ReadOnly == "false") // gridColumnInfo.columnalign = 0; // if (null != DataGridControlAttribute.Columns[j].Sum) // { // if (DataGridControlAttribute.Columns[j].Sum == "true") // gridColumnInfo.sum = 1; // else if (DataGridControlAttribute.Columns[j].Sum == "false") // gridColumnInfo.sum = 0; // } // Dap2xProvoider.InsertGridColumn(DataGridControlAttribute.FormItemId, columnIndex, gridColumnInfo); // columnIndex++; // } //} private void SetRadioButtonList(object Attribute) { RadioButtonListAttribute radioButtonListAttribute = (RadioButtonListAttribute)Attribute; FormProvoider.SetRaidoButtonCols(radioButtonListAttribute.FormItemId, radioButtonListAttribute.Columns); FormProvoider.SetRaidoButtonRows(radioButtonListAttribute.FormItemId, radioButtonListAttribute.Rows); FormProvoider.SetRadioButtonCaption(radioButtonListAttribute.FormItemId, radioButtonListAttribute.RadioButtonListText); }
private void btnNextColumn_Click(object sender, EventArgs e) { if (FormProvoider.GetGridColumns(controlID) > indexColumn + 1) { BindColumnInfo(indexColumn + 1); indexColumn = indexColumn + 1; } }
private void InitForm() { //画表单 FormProvoider.CreateFormEditor(this.Handle); FormProvoider.MoveFormEditor(this.Width, this.Height); //属性 delegateFormItemChange = new FormItemChange(Control_Change); FormProvoider.FormItemChangeFun(Marshal.GetFunctionPointerForDelegate(delegateFormItemChange)); }
private void SetFont(Font font, int formItemID) { windowTextFont = font; FormProvoider.FontWnd fonts = new FormProvoider.FontWnd(); fonts.ftSize = Convert.ToInt32(font.Size); fonts.ftStyle = GetFontStyle(font); fonts.itemName = font.Name; FormProvoider.SetFormItemFont(formItemID, fonts); }
private void btnDeletePage_Click(object sender, EventArgs e) { if (DialogResult.Yes == MessageBox.Show("确定删除?", "删除确认", MessageBoxButtons.YesNo)) { FormProvoider.DeleteTabPage(ItemID, FormProvoider.GetCurTabPage(ItemID)); StringBuilder pageText = new StringBuilder(256); FormProvoider.GetTabPageText(ItemID, FormProvoider.GetCurTabPage(ItemID), pageText, pageText.Capacity); this.txtCurTabPage.Text = pageText.ToString(); } }
private void SetRbt() { if (FormProvoider.GetFormItemStyle(_formItemInfo.formItemID) != 0) { this.rbtMultiRow.Checked = true; } else { this.rbtMultiRow.Checked = false; } }
private void btnOK_Click(object sender, EventArgs e) { if (this.txtContent.Text.Trim().Length == 0) { MessageBox.Show("内容不能为空!"); return; } FormProvoider.SetRaidoButtonRows(ContorlID, Convert.ToInt32(this.nudRows.Value)); FormProvoider.SetRaidoButtonCols(ContorlID, Convert.ToInt32(this.nudColumns.Value)); FormProvoider.SetRadioButtonCaption(ContorlID, this.txtContent.Text.Trim()); this.Close(); }
private void InitSheet() { if (null != CurrForm.SHEET) { int nLen = (int)CurrForm.SHEET.Length; // 通过内存加载 IntPtr xxBuffer = Marshal.AllocHGlobal(nLen); Marshal.Copy(CurrForm.SHEET, 0, xxBuffer, nLen); FormProvoider.LoadSheetFromBuffer(xxBuffer); Marshal.FreeHGlobal(xxBuffer); } }
private void InitData() { this.nudRows.Value = Convert.ToInt16(FormProvoider.GetRaidoButtonRows(ContorlID)); this.nudColumns.Value = Convert.ToInt16(FormProvoider.GetRaidoButtonCols(ContorlID)); //加size,解决报buffer溢出异常的错误 zhangxl 2012-05-30 int sizeBuffer = FormProvoider.GetRadioButtonCaption(ContorlID, null); StringBuilder caption = new StringBuilder(sizeBuffer); int bufsize = FormProvoider.GetRadioButtonCaption(ContorlID, caption); this.txtContent.Text = caption.ToString(); }
private void treeListDetail_Click(object sender, EventArgs e) { if (treeListDetail.FocusedNode != null) { if (treeListDetail.FocusedNode.Level >= 2) { if (treeListDetail.FocusedNode.Tag is SYS_METADATADETAIL) { selectedProperty = treeListDetail.FocusedNode.Tag as SYS_METADATADETAIL; selectedMetadata = treeListDetail.FocusedNode.ParentNode.Tag as SYS_METADATA; FormProvoider.DoToolBarCmd(60303); } } } }
private void btnInsert_Click(object sender, EventArgs e) { try { if (CheckInputDate()) { if (_gridColumns.Contains(txtCurColumn.Text.Trim())) { MessageBox.Show("已存在此列", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } _gridColumns.Add(txtCurColumn.Text.Trim()); FormProvoider.GridColumn gridColumnInfo = new FormProvoider.GridColumn(); gridColumnInfo.columnalign = 1; gridColumnInfo.columnWidth = Convert.ToInt32(this.txtColumnWidth.Text.Trim()); gridColumnInfo.columncaption = this.txtCurColumn.Text.Trim(); //gridColumnInfo.columnStyle = Convert.ToInt32(((KeyValueObject)combStyle.SelectedItem).key); gridColumnInfo.columndefaultValue = this.txtDefaultValue.Text.Trim(); if (rbtReadOnly.Checked == true) { gridColumnInfo.columnalign = 1; } else { gridColumnInfo.columnalign = 2; } if (chkSum.Checked) { gridColumnInfo.sum = 1; } else { gridColumnInfo.sum = 0; } FormProvoider.InsertGridColumn(controlID, indexColumn + 1, gridColumnInfo); indexColumn += 1; _currentColumn = txtCurColumn.Text.Trim(); //((FormDesignerWorkbenchWindow)WorkbenchSingleton.Workbench.ActiveWorkbenchWindow).formDataCollection.Remove(controlID.ToString()); MessageBox.Show("添加成功!请绑定数据。"); } } catch { } }
private void BindValues() { foreach (KeyValuePair <int, string> kvp in columnStyle.ColumnStyles) { //this.combStyle.Items.Add(new KeyValueObject(kvp.Key.ToString(),kvp.Value)); } if (FormProvoider.GetGridColumns(controlID) > 0) { BindColumnInfo(0); indexColumn = 0; } for (int i = 0; i < FormProvoider.GetGridColumns(controlID); i++) { FormProvoider.GridColumn gridColumnInfo = new FormProvoider.GridColumn(); FormProvoider.GetGridColumnInfo(controlID, i, out gridColumnInfo); _gridColumns.Add(gridColumnInfo.columncaption); } }
private void btnOK_Click(object sender, EventArgs e) { try { if (rbtMultiRow.Checked == true) { FormProvoider.SetFormItemStyle(Convert.ToInt32(_formItemInfo.formItemID), 0x00010000, true); } else { FormProvoider.SetFormItemStyle(Convert.ToInt32(_formItemInfo.formItemID), 0x00010000, false); } MessageBox.Show("ÉèÖóɹ¦£¡"); this.Close(); } catch (Exception E) { MessageBox.Show(E.ToString(), "ÉèÖôíÎó"); } }
private void btnSetColumn_Click(object sender, EventArgs e) { try { if (CheckInputDate()) { _gridColumns.Remove(_currentColumn); _gridColumns.Add(txtCurColumn.Text.Trim()); FormProvoider.GridColumn gridColumnInfo = new FormProvoider.GridColumn(); gridColumnInfo.columnalign = 1; gridColumnInfo.columnWidth = Convert.ToInt32(this.txtColumnWidth.Text.Trim()); gridColumnInfo.columncaption = this.txtCurColumn.Text.Trim(); //gridColumnInfo.columnStyle = Convert.ToInt32(((KeyValueObject)combStyle.SelectedItem).key); gridColumnInfo.columndefaultValue = this.txtDefaultValue.Text.Trim(); if (rbtReadOnly.Checked == true) { gridColumnInfo.columnalign = 1; } else { gridColumnInfo.columnalign = 2; } if (chkSum.Checked) { gridColumnInfo.sum = 1; } else { gridColumnInfo.sum = 0; } FormProvoider.ModifyGridColumn(controlID, indexColumn, gridColumnInfo); MessageBox.Show("更新成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { } }
/// <summary> /// 生成表单文件 /// </summary> /// <param name="formDesignerWorkbenchWindow"></param> /// <param name="FilePath"></param> /// <returns></returns> //public bool Execute(FormDesignerWorkbenchWindow formDesignerWorkbenchWindow, out string xmlString) //{ // bool isCheckerok = true; // xmlString = string.Empty; // try // { // List<object> list = new List<object>(); // list.Add(formDesignerWorkbenchWindow.formValidatesCollection); // //list.Add(formDesignerWorkbenchWindow.dataDefineResource); // list.Add(formDesignerWorkbenchWindow.formDataCollection); // list.Add(formDesignerWorkbenchWindow.formRightsCollection); // BuildRuleChecker.CheckReference(formDesignerWorkbenchWindow); // string message = string.Empty; // if (isCheckerok) // { // xmlString = DistFormXmlBuilder.BuildXml(list,formDesignerWorkbenchWindow, // formDesignerWorkbenchWindow.SheetLayoutXML); // } // } // catch(Exception E) // { // isCheckerok = false; // MessageBox.Show(E.Message); // } // return isCheckerok; //} /// <summary> /// 读取单个表单文件 /// </summary> /// <param name="dockFormDesigner"></param> /// <param name="filePath"></param> public void ResetXml(DockFormDesigner dockFormDesigner, string fileContent) { #region //控件 FormXmlParser formXmlParser = new FormXmlParser(fileContent, true); PageProperty.IsPrint = formXmlParser.GetPrintProperty("/Form", "isprint"); Dictionary <string, string> dic = new Dictionary <string, string>(); ControlCollection controlCollection = formXmlParser.GetControls(dockFormDesigner, "/Form/Control", out dic); string width, height; dic.TryGetValue("width", out width); dic.TryGetValue("height", out height); FormProvoider.SetFormViewSize(Convert.ToInt32(width), Convert.ToInt32(height)); foreach (KeyValuePair <string, object> kvp in controlCollection) { #region FormItemType == 5 if (((GeneralAttribute)kvp.Value).FormItemType == 5) { FormProvoider.Rect rcRect = new FormProvoider.Rect(); SetRect(out rcRect, (GeneralAttribute)kvp.Value); FormProvoider.CreateFormItem(Convert.ToInt32(((GeneralAttribute)kvp.Value).FormItemType), rcRect, Convert.ToInt32(kvp.Key), ((GeneralAttribute)kvp.Value).ExtensionType); TableContorlAttribute tableContorlAttribute = (TableContorlAttribute)kvp.Value; int page = 0; foreach (KeyValuePair <string, Group> kvpGroup in tableContorlAttribute.Groups) { FormProvoider.InsertTabPage(((GeneralAttribute)kvp.Value).FormItemId, kvpGroup.Value.Name, page); foreach (KeyValuePair <string, GeneralAttribute> kvpChildAttribute in kvpGroup.Value.GroupControls) { FormProvoider.Rect rcRectChild = new FormProvoider.Rect(); SetRect(out rcRectChild, (GeneralAttribute)kvpChildAttribute.Value); FormProvoider.CreateChlidFormItem(kvpChildAttribute.Value.FormItemType, rcRectChild, Convert.ToInt32(kvpChildAttribute.Key), Convert.ToInt32(kvp.Key), page, ((GeneralAttribute)kvpChildAttribute.Value).ExtensionType); if (((GeneralAttribute)kvpChildAttribute.Value).Multiline == true && ((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 1) { FormProvoider.SetFormItemStyle(Convert.ToInt32(kvpChildAttribute.Key), 0x00010000, true);//0x00010000 } if (((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 7) { //SetDataGrid(formDesignerWorkbenchWindow, kvpChildAttribute.Key, kvpChildAttribute.Value); } if (((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 20) { SetRadioButtonList(kvpChildAttribute.Value); } if (((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 4 || ((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 15 || ((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 3 || ((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 6) { FormProvoider.SetStaticText(Convert.ToInt32(kvpChildAttribute.Key), kvpChildAttribute.Value.Text); } if (((GeneralAttribute)kvpChildAttribute.Value).FormItemType == 4) { FormProvoider.FontWnd font = new FormProvoider.FontWnd(); font.itemName = ((GeneralAttribute)kvpChildAttribute.Value).WindowTextFont.FontFamily.Name; font.ftSize = Convert.ToInt32(((GeneralAttribute)kvpChildAttribute.Value).WindowTextFont.Size); font.ftStyle = GeneralAttribute.GetFontStyle(((GeneralAttribute)kvpChildAttribute.Value).WindowTextFont); FormProvoider.SetFormItemFont(((GeneralAttribute)kvpChildAttribute.Value).FormItemId, font); FormProvoider.SetFormItemStyle(((GeneralAttribute)kvpChildAttribute.Value).FormItemId, 0x00800000, ((GeneralAttribute)kvpChildAttribute.Value).Border); } } page++; } } #endregion else if (((GeneralAttribute)kvp.Value).FormItemType == 7) { FormProvoider.Rect rcRect = new FormProvoider.Rect(); SetRect(out rcRect, (GeneralAttribute)kvp.Value); FormProvoider.CreateFormItem(Convert.ToInt32(((GeneralAttribute)kvp.Value).FormItemType), rcRect, Convert.ToInt32(kvp.Key), ((GeneralAttribute)kvp.Value).ExtensionType); //SetDataGrid(formDesignerWorkbenchWindow, kvp.Key, kvp.Value); } else if (((GeneralAttribute)kvp.Value).FormItemType == 20) { FormProvoider.Rect rcRect = new FormProvoider.Rect(); SetRect(out rcRect, (GeneralAttribute)kvp.Value); FormProvoider.CreateFormItem(Convert.ToInt32(((GeneralAttribute)kvp.Value).FormItemType), rcRect, Convert.ToInt32(kvp.Key), ((GeneralAttribute)kvp.Value).ExtensionType); SetRadioButtonList(kvp.Value); } else if (((GeneralAttribute)kvp.Value).FormItemType == 255)//直线 { FormProvoider.Rect rcRect = new FormProvoider.Rect(); SetRect(out rcRect, (GeneralAttribute)kvp.Value); FormProvoider.CreateFormItem(Convert.ToInt32(((GeneralAttribute)kvp.Value).FormItemType), rcRect, Convert.ToInt32(kvp.Key), ((GeneralAttribute)kvp.Value).ExtensionType); } else { FormProvoider.Rect rcRect = new FormProvoider.Rect(); SetRect(out rcRect, (GeneralAttribute)kvp.Value); FormProvoider.CreateFormItem(Convert.ToInt32(((GeneralAttribute)kvp.Value).FormItemType), rcRect, Convert.ToInt32(kvp.Key), ((GeneralAttribute)kvp.Value).ExtensionType); if (((GeneralAttribute)kvp.Value).FormItemType == 1) { DockFormDesigner.controlIdItems.Add(kvp.Key); } else { FormProvoider.SetStaticText(Convert.ToInt32(kvp.Key), ((GeneralAttribute)kvp.Value).Text); } //Dap2xProvoider.SetFormItemStyle(((GeneralAttribute)kvp.Value).FormItemId, 0x00800000, false); if (((GeneralAttribute)kvp.Value).FormItemType == 1 && ((GeneralAttribute)kvp.Value).Multiline == true) { FormProvoider.SetFormItemStyle(((GeneralAttribute)kvp.Value).FormItemId, 0x00010000, true); } else { FormProvoider.SetFormItemStyle(((GeneralAttribute)kvp.Value).FormItemId, 0x00010000, false); } if (((GeneralAttribute)kvp.Value).FormItemType == 4) { FormProvoider.FontWnd font = new FormProvoider.FontWnd(); font.itemName = ((GeneralAttribute)kvp.Value).WindowTextFont.FontFamily.Name; font.ftSize = Convert.ToInt32(((GeneralAttribute)kvp.Value).WindowTextFont.Size); font.ftStyle = GeneralAttribute.GetFontStyle(((GeneralAttribute)kvp.Value).WindowTextFont); FormProvoider.SetFormItemFont(((GeneralAttribute)kvp.Value).FormItemId, font); Color color = ((GeneralAttribute)kvp.Value).WindowTextColor; FormProvoider.SetFormItemColor(((GeneralAttribute)kvp.Value).FormItemId, color.B << 16 | color.G << 8 | color.R); //边框 FormProvoider.SetFormItemStyle(((GeneralAttribute)kvp.Value).FormItemId, 0x00800000, ((GeneralAttribute)kvp.Value).Border); } } } #endregion //formDesignerWorkbenchWindow.formDataCollection = formDesignerWorkbenchWindow.FormParameter.FormDataCollection; //formDesignerWorkbenchWindow.formValidatesCollection = getObjectFromXml.GetFormValidatesCollection("/Form/Validation");//formValidatesCollection //formDesignerWorkbenchWindow.formRightsCollection = getObjectFromXml.GetFormRightsCollection("/Form/Right");//formRightsCollection ////zhanben20100919 新增表单脚本功能 //formDesignerWorkbenchWindow.FormScriptString = getObjectFromXml.GetFormScriptString("/Form/Script"); }
private void nbiSelector_LinkClicked(object sender, NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(0); }
private void nbiCheckBox_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60318); }
private void nbiRadioButton_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60317); }
public void ExecuteToolBarCommand(uint nId) { FormProvoider.DoToolBarCmd(nId); }
private void nbiDelPage_LinkClicked(object sender, NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60024); }
private void nbiBgImg_LinkClicked(object sender, NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60027); }
private void nbiProperty_LinkClicked(object sender, NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60029); }
private void nbiPrintPreview_LinkClicked(object sender, NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60033); }
private void nbiPrintSetting_LinkClicked(object sender, NavBarLinkEventArgs e) { FormProvoider.DoToolBarCmd(60015); }