Пример #1
0
 public cmnESW()
 {
     this.mESW = new PaletteSet("Command Manager", new Guid("673C2600-D8CC-44C7-932B-2A205AA45DD7"));
     this.mESW.Name = "Command Manager";
     this.mESW.DockEnabled = DockSides.Right | DockSides.Left | DockSides.Top | DockSides.Bottom;
     this.mESW.Dock = DockSides.None;
     this.mESW.Load += new PalettePersistEventHandler(this.OnLoad);
     this.mESW.Save += new PalettePersistEventHandler(this.OnSave);
     this.mESW.StateChanged += new PaletteSetStateEventHandler(this.OnStateChange);
     this.mESW.Icon = (Icon)GlobalResource.ResourceManager.GetObject("calc_icon");
     this.mCmnControl = new CMNControl(this);
     this.mESW.Size = CMNControl.UIData.mESWDefaultSize;
     this.mESW.MinimumSize = CMNControl.UIData.mESWMinSize;
     this.mCmnControl.BackColor = CMNApplication.Theme.ESWBackground;
     this.Add("Command Manager", this.mCmnControl);
     //this.mCmnControl.CurrentDocData = (PerDocData)CMNApplication.mDocDataCollection[(object)Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument];
     //this.mCmnControl.RestoreFromCurrentData(false);
     Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentActivated += new DocumentCollectionEventHandler(this.documentActivated);
     Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentToBeDestroyed += new DocumentCollectionEventHandler(this.docToBeDestroyed);
     this.addEdiotrReactors(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument);
 }
Пример #2
0
        public void Initialize()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(SystemObjects.DynamicLinker.ProductLcid, true);
            //ResourceManager resourceManager = new ResourceManager(typeof(CalculatorForm));
            //resourceManager.GetString("panel_.AccessibleDescription", new CultureInfo(SystemObjects.DynamicLinker.ProductLcid, true));
            if (CMNControl.UIData == null)
            {
                CMNControl.DeserializeUiLayout();
            }
            CMNApplication.mDocDataCollection = new Hashtable();
            IEnumerator enumerator = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.GetEnumerator();

            while (enumerator.MoveNext())
            {
                PerDocData perDocDatum = new PerDocData((Document)enumerator.Current);
                CMNApplication.mDocDataCollection.Add((Document)enumerator.Current, perDocDatum);
            }
            Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentToBeDestroyed   += new DocumentCollectionEventHandler(this.docToBeDestroyed);
            Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentToBeDeactivated += new DocumentCollectionEventHandler(this.documentToBeDeactivated);
            Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentActivated       += new DocumentCollectionEventHandler(this.documentActivated);
            Autodesk.AutoCAD.ApplicationServices.Application.SystemVariableChanged += new SystemVariableChangedEventHandler(this.sysvarChanged);
            //CalcDialogCreator.SetCreatorFunc(new ShowModalFunc(CMNApplication.ShowModalCalculator));
        }
Пример #3
0
        protected void CreateControls()
        {
            this.SuspendLayout();
            this.mBottomPanel          = new Panel();
            this.mTopPanel             = new Panel();
            this.mBottomPanel.Location = new Point(20, 48);
            this.mTopPanel.Location    = new Point(20, 28);
            if (this.mSearchTextBox == null)
            {
                this.mSearchTextBox = new SearchTextBox();
                this.mSearchTextBox.Initialize();
                mSearchTextBox.TextChanged += mSearchTextBox_TextChanged;
                this.mSearchTextBox.InitializeText(mSearchTextBox.SearchWaterMark);
            }
            this.mBottomPanel.Width  = this.mSearchTextBox.Width + 28;
            this.mBottomPanel.Height = 300;
            this.mBottomPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            if (this.mStatusRegion == null)
            {
                this.mStatusRegion = new Label();
            }
            this.mStatusRegion.Anchor      = AnchorStyles.Top | AnchorStyles.Left;
            this.mStatusRegion.Location    = new Point(16, 12);
            this.mStatusRegion.BackColor   = this.BackColor;
            this.mStatusRegion.BorderStyle = BorderStyle.None;
            this.mBottomPanel.Controls.Add(this.mStatusRegion);
            this.mbtnExpand                     = new ToolTipButton();
            this.mbtnExpand.Anchor              = AnchorStyles.Top | AnchorStyles.Right;
            this.mbtnExpand.FlatStyle           = FlatStyle.Flat;
            this.mbtnExpand.ForeColor           = this.mbtnExpand.BackColor = this.BackColor;
            this.mbtnExpand.Location            = new Point(312, 10);
            this.mbtnExpand.Size                = new Size(24, 24);
            this.mbtnExpand.Name                = "mbtnExpand";
            this.mbtnExpand.TabIndex            = 10;
            this.mbtnExpand.Click              += new EventHandler(this.ExpandBtn_Click);
            this.mbtnExpand.MouseDown          += new MouseEventHandler(this.ExpandBtn_MouseDown);
            this.mbtnExpand.ImageList           = new ImageList();
            this.mbtnExpand.ImageList.ImageSize = new Size(20, 20);
            this.mbtnExpand.ImageList.Images.Add((System.Drawing.Image)GlobalResource.calc_less, Color.Magenta);
            this.mbtnExpand.ImageList.Images.Add((System.Drawing.Image)GlobalResource.calc_more, Color.Magenta);
            this.mbtnExpand.ImageIndex = 0;
            this.mbtnExpand.ToolTip    = StringResources.ResourceManager.GetString("Less");
            this.mBottomPanel.Controls.Add(this.mbtnExpand);
            this.mTopPanel.Width  = this.mBottomPanel.Width;
            this.mTopPanel.Height = 350;
            this.mCommandList     = new CommandListView();
            this.mCommandList.SelectedIndexChanged += mCommandList_SelectedIndexChange;
            this.mTopPanel.Controls.Add(this.mCommandList);
            this.mCommandList.Initialize();
            this.Controls.AddRange(new Control[2]
            {
                (Control)this.mTopPanel,
                (Control)this.mBottomPanel
            });
            this.Name    = "cmnControl";
            this.Resize += new EventHandler(this.Control_Resize);
            this.SystemColorsChanged += new EventHandler(this.Control_SystemColorsChanged);
            if (CMNControl.UIData == null)
            {
                CMNControl.DeserializeUiLayout();
            }
            if (CMNControl.UIData == null)
            {
                return;
            }
            if (this.InitializeToolbar())
            {
                this.mTopPanel.Controls.Add(this.mToolBar);
            }
            this.mTopPanel.Controls.Add((Control)this.mSearchTextBox);
            this.mGroupPane       = new GroupsPane(this);
            this.mGroupPane.Top   = this.mbtnExpand.Bottom + GroupsPane.GROUP_VERT_SPACE;
            this.mGroupPane.Left  = this.mSearchTextBox.Left;
            this.mGroupPane.Width = this.mSearchTextBox.Width;

            this.mGroupPane.Height = this.mBottomPanel.Height - this.mGroupPane.Top - GroupsPane.GROUP_VERT_SPACE;
            this.mBottomPanel.Controls.Add(this.mGroupPane);
            this.mPaneHeight = this.mGroupPane.Height;

            this.mGroupPane.Populate(CMNControl.UIData);
            this.mSplitter               = new CalculatorSplitter(this.mTopPanel, this.mBottomPanel);
            this.ActiveControl           = this.mSearchTextBox;
            this.mbCreated               = true;
            this.mSearchTextBox.Location = new Point(16, 38);
            ListCommandTable             = EneApplication.EneDatabase.CmdTableRecord;
            CommandListView              = new DataView(ListCommandTable);
            PopulateListView(CommandListView);
            addInfoGroup();
            this.ResumeLayout(false);
            ResizeESWSize();
        }
Пример #4
0
 public GroupsPane(CMNControl parent)
 {
     this.InitializeComponent();
     this.mParent = parent;
 }