public ComboBoxItem()
     : base(new GISShare.Controls.WinForm.WFNew.BaseItemHost())
 {
     this.m_ViewItemListBox                       = new View.ViewItemListBoxItem();
     this.m_ViewItemListBox.BackColor             = System.Drawing.SystemColors.Window;
     this.m_ViewItemListBox.ShowOutLine           = false;
     this.m_ViewItemListBox.MultipleSelect        = false;
     this.m_ViewItemListBox.SelectedIndexChanged += new IntValueChangedHandler(ViewItemListBox_SelectedIndexChanged);
     this.m_ViewItemListBox.MouseUp              += new System.Windows.Forms.MouseEventHandler(ListBoxX_MouseUp);
     //
     GISShare.Controls.WinForm.WFNew.BaseItemHost baseItemHost = (GISShare.Controls.WinForm.WFNew.BaseItemHost)((ICustomizeComboBoxItem)this).ControlObject;
     baseItemHost.BackColor      = System.Drawing.SystemColors.Window;
     baseItemHost.Dock           = System.Windows.Forms.DockStyle.Fill;
     baseItemHost.BaseItemObject = this.m_ViewItemListBox;
     //
     //
     //
     this.DropDownWidth  = 120;
     this.DropDownHeight = 120;
     //
     this.Size = new Size(120, 21);
 }
Esempio n. 2
0
        private void btnOk_MouseClick(object sender, MouseEventArgs e)
        {
            string strFileName = this.txtFileName.Text;

            //
            if (strFileName.Length <= 0)
            {
                GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("请选择要加载的插件!");
                return;
            }
            //
            if (!System.IO.File.Exists(this.txtFileName.Text))
            {
                GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("文件“" + strFileName + "”已不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //
            if (this.rbCopy.Checked || this.rbCut.Checked)
            {
                if (!System.IO.Directory.Exists(this.m_pBaseHost3.PluginDLLFolder))
                {
                    System.IO.Directory.CreateDirectory(this.m_pBaseHost3.PluginDLLFolder);
                }
                string strFileNameNew = this.m_pBaseHost3.PluginDLLFolder + "\\" + System.IO.Path.GetFileName(strFileName);
                if (System.IO.File.Exists(strFileNameNew))
                {
                    GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("文件“" + strFileNameNew + "”已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                System.IO.File.Copy(strFileName, strFileNameNew);
                //
                if (this.rbCut.Checked)
                {
                    try
                    {
                        System.IO.File.Delete(strFileName);
                    }
                    catch
                    {
                        GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("删除文件“" + strFileName + "”失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                //
                strFileName = strFileNameNew;
            }
            //
            this.m_ViewItemListBox = new Controls.WinForm.WFNew.View.ViewItemListBoxItem();
            this.m_ViewItemListBox.ShowHScrollBar = true;
            //
            this.m_pBaseHost3.AppendPluginObject(strFileName);
            //
            if (MessageBox.Show("加载插件完成,是否查看加载信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                GISShare.Controls.WinForm.WFNew.Forms.TBForm form = new GISShare.Controls.WinForm.WFNew.Forms.TBForm();
                form.Text = "插件加载信息";
                form.Controls.Add(new GISShare.Controls.WinForm.WFNew.BaseItemHost(this.m_ViewItemListBox)
                {
                    Dock = DockStyle.Fill
                });
                form.Owner       = this;
                form.ShowIcon    = false;
                form.Size        = new Size(this.Width + 100, this.Height + 100);
                form.MinimizeBox = false;
                //form.MaximizeBox = false;
                form.ShowInTaskbar   = false;
                form.StartPosition   = FormStartPosition.Manual;
                form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
                form.Location        = new Point(this.Location.X + (this.Width - form.Width) / 2, this.Location.Y + (this.Height - form.Height) / 2);
                form.Show();
            }
        }
Esempio n. 3
0
 public DemoOfViewItemListBoxForm()
 {
     InitializeComponent();
     //
     //
     //
     #region 添加超级视图项
     GISShare.Controls.WinForm.WFNew.LabelSeparatorItem labelSeparatorItem = new GISShare.Controls.WinForm.WFNew.LabelSeparatorItem();
     labelSeparatorItem.Text             = "超级视图项(SuperViewItem):可以承载一个BaseItem的基类对象,如:LabelSeparatorItem";
     labelSeparatorItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     labelSeparatorItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     labelSeparatorItem.TextAlign        = ContentAlignment.MiddleLeft;
     GISShare.Controls.WinForm.WFNew.View.SuperViewItem superViewItem1 = new GISShare.Controls.WinForm.WFNew.View.SuperViewItem();
     superViewItem1.Height         = 26;
     superViewItem1.BaseItemObject = labelSeparatorItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem1);
     //
     GISShare.Controls.WinForm.WFNew.CheckBoxItem checkBoxItem = new GISShare.Controls.WinForm.WFNew.CheckBoxItem();
     checkBoxItem.Text             = "超级视图项(SuperViewItem):可以承载一个BaseItem的基类对象,如:CheckBoxItem";
     checkBoxItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     checkBoxItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     GISShare.Controls.WinForm.WFNew.View.SuperViewItem superViewItem2 = new GISShare.Controls.WinForm.WFNew.View.SuperViewItem();
     superViewItem2.BaseItemObject = checkBoxItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem2);
     //
     GISShare.Controls.WinForm.WFNew.RadioButtonItem radioButtonItem = new GISShare.Controls.WinForm.WFNew.RadioButtonItem();
     radioButtonItem.Text             = "超级视图项(SuperViewItem):可以承载一个BaseItem的基类对象,如:RadioButtonItem";
     radioButtonItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     radioButtonItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     GISShare.Controls.WinForm.WFNew.View.SuperViewItem superViewItem3 = new GISShare.Controls.WinForm.WFNew.View.SuperViewItem();
     superViewItem3.BaseItemObject = radioButtonItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem3);
     //
     GISShare.Controls.WinForm.WFNew.ImageRadioButtonItem imageRadioButtonItem = new GISShare.Controls.WinForm.WFNew.ImageRadioButtonItem();
     imageRadioButtonItem.Text             = "超级视图项(SuperViewItem):可以承载一个BaseItem的基类对象,如:ImageRadioButtonItem";
     imageRadioButtonItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     imageRadioButtonItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     imageRadioButtonItem.TextAlign        = ContentAlignment.MiddleLeft;
     imageRadioButtonItem.Image            = new System.Drawing.Bitmap(this.GetType().Assembly.GetManifestResourceStream("GISShare.Controls.WinForm.Demo.Image.Image.ico"));
     imageRadioButtonItem.ImageAlign       = ContentAlignment.MiddleLeft;
     imageRadioButtonItem.CDSpace          = 4;
     GISShare.Controls.WinForm.WFNew.View.SuperViewItem superViewItem4 = new GISShare.Controls.WinForm.WFNew.View.SuperViewItem();
     superViewItem4.BaseItemObject = imageRadioButtonItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem4);
     //
     GISShare.Controls.WinForm.WFNew.ButtonTextBoxItem buttonTextBoxItem = new GISShare.Controls.WinForm.WFNew.ButtonTextBoxItem();
     buttonTextBoxItem.eBorderStyle     = GISShare.Controls.WinForm.WFNew.BorderStyle.eSingle;
     buttonTextBoxItem.Text             = "超级视图项(SuperViewItem):可以承载一个BaseItem的基类对象,如:ButtonTextBoxItem";
     buttonTextBoxItem.Margin           = new System.Windows.Forms.Padding(0);
     buttonTextBoxItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     buttonTextBoxItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     GISShare.Controls.WinForm.WFNew.View.SuperViewItem superViewItem5 = new GISShare.Controls.WinForm.WFNew.View.SuperViewItem();
     superViewItem5.BaseItemObject = buttonTextBoxItem;
     superViewItem5.Height         = buttonTextBoxItem.Height;
     this.viewItemListBox1.ViewItems.Add(superViewItem5);
     #endregion
     //
     //
     //
     #region 添加行项
     GISShare.Controls.WinForm.WFNew.View.RowViewItem rowViewItem = new Controls.WinForm.WFNew.View.RowViewItem()
     {
         Height = 23
     };
     this.viewItemListBox1.ViewItems.Add(rowViewItem);
     for (int i = 0; i < 6; i++)
     {
         GISShare.Controls.WinForm.WFNew.RadioButtonItem radioButtonItem3 = new Controls.WinForm.WFNew.RadioButtonItem();
         radioButtonItem3.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
         radioButtonItem3.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
         radioButtonItem3.Text             = "第 " + (i + 1) + " 个";
         rowViewItem.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.SuperViewItem(radioButtonItem3)
         {
             Width = 120
         });                                                                                                                 //宽度必须设置
     }
     //
     GISShare.Controls.WinForm.WFNew.View.RowViewItem rowViewItem2 = new Controls.WinForm.WFNew.View.RowViewItem()
     {
         Height = 23
     };
     this.viewItemListBox1.ViewItems.Add(rowViewItem2);
     for (int i = 0; i < 6; i++)
     {
         GISShare.Controls.WinForm.WFNew.TextBoxItem textBoxItem = new Controls.WinForm.WFNew.TextBoxItem();
         textBoxItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
         textBoxItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eCenter;
         textBoxItem.Text             = "第 " + (i + 1) + " 个";
         rowViewItem2.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.SuperViewItem(textBoxItem)
         {
             Width = 120
         });                                                                                                             //宽度必须设置
     }
     //
     GISShare.Controls.WinForm.WFNew.View.RowViewItem rowViewItem3 = new Controls.WinForm.WFNew.View.RowViewItem()
     {
         Height = 23
     };
     this.viewItemListBox1.ViewItems.Add(rowViewItem3);
     for (int i = 0; i < 6; i++)
     {
         GISShare.Controls.WinForm.WFNew.CheckBoxItem checkBoxItem2 = new Controls.WinForm.WFNew.CheckBoxItem();
         checkBoxItem2.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
         checkBoxItem2.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
         checkBoxItem2.Text             = "第 " + (i + 1) + " 个";
         rowViewItem3.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.SuperViewItem(checkBoxItem2)
         {
             Width = 120
         });                                                                                                               //宽度必须设置
     }
     //
     GISShare.Controls.WinForm.WFNew.View.RowViewItem rowViewItem4 = new Controls.WinForm.WFNew.View.RowViewItem()
     {
         Height = 22
     };
     this.viewItemListBox1.ViewItems.Add(rowViewItem4);
     for (int i = 0; i < 6; i++)
     {
         rowViewItem4.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.TextEditViewItem("可编辑:第 " + (i + 1) + " 个")
         {
             Width = 120
         });
     }
     //
     GISShare.Controls.WinForm.WFNew.View.RowViewItem rowViewItem5 = new Controls.WinForm.WFNew.View.RowViewItem()
     {
         Height = 22
     };
     this.viewItemListBox1.ViewItems.Add(rowViewItem5);
     for (int i = 0; i < 6; i++)
     {
         rowViewItem5.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.TextEditViewItem("不可编辑:第 " + (i + 1) + " 个")
         {
             Width = 120, CanEdit = false
         });
     }
     //
     GISShare.Controls.WinForm.WFNew.View.FlexibleRowViewItem flexibleRowViewItem = new Controls.WinForm.WFNew.View.FlexibleRowViewItem()
     {
         Height = 22, CanExchangeItem = true
     };
     this.viewItemListBox1.ViewItems.Add(flexibleRowViewItem);
     for (int i = 0; i < 2; i++)
     {
         flexibleRowViewItem.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.TextEditViewItem("可调节行高、单元宽度以及交换单元位置:第 " + (i + 1) + " 个")
         {
             Width = 290, CanEdit = false
         });
     }
     #endregion
     //
     //
     //
     #region 嵌入ViewItemListBoxItem
     GISShare.Controls.WinForm.WFNew.View.ViewItemListBoxItem viewItemListBoxItem = new GISShare.Controls.WinForm.WFNew.View.ViewItemListBoxItem();
     //viewItemListBoxItem.Size = new System.Drawing.Size(120,100);
     viewItemListBoxItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     viewItemListBoxItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     viewItemListBoxItem.Margin           = new Padding(10, 10, 10, 0);
     for (int i = 0; i < 5; i++)
     {
         viewItemListBoxItem.ViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.ViewItem("元素计数:" + i));
     }
     GISShare.Controls.WinForm.WFNew.View.ResizeSuperViewItem superViewItem6 = new GISShare.Controls.WinForm.WFNew.View.ResizeSuperViewItem();
     //superViewItem6.Width = 100;
     superViewItem6.Height         = 100;
     superViewItem6.BaseItemObject = viewItemListBoxItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem6);
     #endregion
     //
     //
     //
     #region 嵌入NodeViewItemTreeItem
     GISShare.Controls.WinForm.WFNew.View.NodeViewItemTreeItem nodeViewItemTreeItem = new GISShare.Controls.WinForm.WFNew.View.NodeViewItemTreeItem();
     //nodeViewItemTreeItem.Size = new System.Drawing.Size(120,100);
     nodeViewItemTreeItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     nodeViewItemTreeItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     nodeViewItemTreeItem.Margin           = new Padding(10, 10, 10, 0);
     for (int i = 0; i < 5; i++)
     {
         nodeViewItemTreeItem.NodeViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.NodeViewItem("节点计数:" + i));
         for (int j = 0; j < 5; j++)
         {
             nodeViewItemTreeItem.NodeViewItems[i].NodeViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.NodeViewItem("节点计数:" + j));
         }
     }
     GISShare.Controls.WinForm.WFNew.View.ResizeSuperViewItem superViewItem7 = new GISShare.Controls.WinForm.WFNew.View.ResizeSuperViewItem();
     //superViewItem6.Width = 100;
     superViewItem7.Height         = 100;
     superViewItem7.BaseItemObject = nodeViewItemTreeItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem7);
     #endregion
     //
     //
     //
     #region 嵌入ViewItemListBoxItem
     GISShare.Controls.WinForm.WFNew.View.GridViewItemListBoxItem gridViewItemListBoxItem = new GISShare.Controls.WinForm.WFNew.View.GridViewItemListBoxItem();
     //gridViewItemListBoxItem.Size = new System.Drawing.Size(120,100);
     gridViewItemListBoxItem.eVAlignmentStyle = GISShare.Controls.WinForm.WFNew.VAlignmentStyle.eStretch;
     gridViewItemListBoxItem.eHAlignmentStyle = GISShare.Controls.WinForm.WFNew.HAlignmentStyle.eStretch;
     gridViewItemListBoxItem.Margin           = new Padding(10, 10, 10, 0);
     for (int i = 0; i < 10; i++)
     {
         gridViewItemListBoxItem.ColumnViewItems.Add(new GISShare.Controls.WinForm.WFNew.View.ColumnViewItem()
         {
             Text = "Volumn_" + i, Width = 60
         });
     }
     for (int i = 0; i < 100; i++)
     {
         gridViewItemListBoxItem.AddRowViewItem(GISShare.Controls.WinForm.WFNew.View.RowCellViewStyle.eSystemRow, i.ToString());
     }
     GISShare.Controls.WinForm.WFNew.View.ResizeSuperViewItem superViewItem8 = new GISShare.Controls.WinForm.WFNew.View.ResizeSuperViewItem();
     //superViewItem8.Width = 100;
     superViewItem8.Height         = 160;
     superViewItem8.BaseItemObject = gridViewItemListBoxItem;
     this.viewItemListBox1.ViewItems.Add(superViewItem8);
     #endregion
 }