示例#1
0
        public void AddItem(String strGroupName, String strItemName, Type type)
        {
            TypeResolutionService.AddType(type);

            if (DefaultIcon == null)
            {
                DefaultIcon = GetIcon(typeof(ABCControls.ABCGroupControl), false);
            }

            DevExpress.XtraNavBar.NavBarItem item = new DevExpress.XtraNavBar.NavBarItem();
            item.Caption = strItemName;
            item.Name    = strItemName;

            ABCToolboxItem toolboxItem = new ABCToolboxItem(type);

            toolboxItem.Binding           = new ABCControls.ABCBindingInfo();
            toolboxItem.Binding.FieldName = strItemName;
            item.Tag = toolboxItem;

            Bitmap icon = GetIcon(type, false);

            if (ImageCompareString(icon, DefaultIcon))
            {
                icon = GetIcon(type, true);
            }

            //    icon.Save( String.Format(@"Icons\{0}.png" , strItemName ));
            item.SmallImage = icon;
            this.navBarControl.Items.Add(item);
            this.navBarControl.Groups[strGroupName].ItemLinks.Add(item);

            HostSurfaceManager.CreateTemplateComponent(type);
        }
示例#2
0
        /// <summary>
        /// Adds custom services to the HostManager like TGoolbox, PropertyGrid,
        /// SolutionExplorer.
        /// OutputWindow is added as a service. It is used by the HostSurfaceManager
        /// to write out to the OutputWindow. You can add any services
        /// you want.
        /// </summary>
        private void CustomInitialize()
        {
            _hostSurfaceManager = new HostSurfaceManager();
            _hostSurfaceManager.AddService(typeof(IToolboxService), this.toolbox1);
            //_hostSurfaceManager.AddService(typeof(ToolWindows.SolutionExplorer), this.solutionExplorer1);
            _hostSurfaceManager.AddService(typeof(ToolWindows.OutputWindow), this.OutputWindow);
            _hostSurfaceManager.AddService(typeof(System.Windows.Forms.PropertyGrid), this.propertyGrid1);

            codeDomDesignerLoaderMenuItem_Click(null, null);
            this.tabControl1.SelectedIndexChanged += new EventHandler(tabControl1_SelectedIndexChanged);
            this.noLoaderMenuItem_Click(null, null);

            // Register Hotkeys
            RegisterHotKey(Handle, 100, 2, Keys.C);
            RegisterHotKey(Handle, 200, 2, Keys.V);
            RegisterHotKey(Handle, 300, 2, Keys.X);
            RegisterHotKey(Handle, 400, 0, Keys.Delete);
            RegisterHotKey(Handle, 500, 2, Keys.Z);
            RegisterHotKey(Handle, 600, 2, Keys.Y);

            // Create default form
            try
            {
                _formCount++;
                HostControl hc = _hostSurfaceManager.GetNewHost(typeof(Form), LoaderType.NoLoader /*CurrentMenuSelectionLoaderType*/);
                AddTabForNewHost("Form" + _formCount.ToString() + " - " + Strings.Design, hc);
            }
            catch (Exception e)
            {
                MessageBox.Show("Error in creating new host", "Shell Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        // private HostSurfaceManager m_hostSurfaceManager = null;
        // private HostControl hc = null;

        public RunTimeFormMng(MainForm mf)
        {
            InitializeComponent();
            myMainform = mf;

            btDeCoilCwList   = myMainform.btDeCoilCwList;
            btDeNoCoilCwList = myMainform.btDeNoCoilCwList;
            btDeCoilHpList   = myMainform.btDeCoilHpList;
            btDeNoCoilHpList = myMainform.btDeNoCoilHpList;
            btReAdjHwList    = myMainform.btReAdjHwList;
            btReNoAdjHwList  = myMainform.btReNoAdjHwList;
            btReAdjHpList    = myMainform.btReAdjHpList;
            btReNoAdjHpList  = myMainform.btReNoAdjHpList;


            try
            {
                #if DEBUG
                mXDoc.Load("..\\..\\DrawTool\\Components.xml");
                #else
                mXDoc.Load("DrawTool\\Components.xml");
                #endif
            }
            catch
            {
                MessageBox.Show("Load component property error!");
            }
            rtdm                = new DataBus.DataRefresh.CRealTimeDataManager();
            m_RTmainWindow      = new RunTimeMainForm(this);
            _hostSurfaceManager = new HostSurfaceManager();//temp
            openedForms         = new ArrayList();
            OpenSolution();
            m_RTmainWindow.FormClosed += new FormClosedEventHandler(m_RTmainWindow_Disposed);
        }
示例#4
0
        public void Initialize(bool isEndUser)
        {
            Worker         = new UIWorker(this);
            SurfaceManager = new HostSurfaceManager();
            SurfaceManager.AddService(typeof(IToolboxService), this.Toolbox);

            //  InitializeSkins();

            #region ControlListsGrid
            ControlListsGrid      = new ControlCollectionGrid(this);
            ControlListsGrid.Dock = DockStyle.Fill;
            dockPanel6.Controls.Add(ControlListsGrid);

            #endregion


            #region ViewTreeList
            ViewTreeList.OwnerStudio = this;
            ViewTreeList.Initialize();
            ViewTreeList.RefreshViewList();

            #endregion


            #region Toolbox

            this.Toolbox.InitializeToolbox();

            #endregion

            #region FieldBindingTree
            FieldBindingTree.OwnerStudio = this;
            FieldBindingTree.Initialize();

            #endregion

            #region TabViewControl

            TabViewControl.SelectedPageChanged += new DevExpress.XtraTab.TabPageChangedEventHandler(TabViewControl_SelectedPageChanged);
            TabViewControl.CloseButtonClick    += new EventHandler(TabViewControl_CloseButtonClick);

            #endregion

            #region BarManager

            StudioBarManager.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(Toolbar_ItemClick);

            #endregion

            #region PropertyGrid
            //    PropertyGrid.AutoGenerateRows=true;
            //  PropertyGrid.CustomPropertyDescriptors+=new DevExpress.XtraVerticalGrid.Events.CustomPropertyDescriptorsEventHandler( PropertyGrid_CustomPropertyDescriptors );

            #endregion
        }