Esempio n. 1
0
        private void InitFileToolbar(IToolbar bar)
        {
            var items = bar.Items;

            items.AddButton(_commands[MenuKeys.NewMap]);
            items.AddButton(_commands[MenuKeys.OpenProject]);
            items.AddButton(_commands[MenuKeys.SaveProject]);
            items.AddButton(_commands[MenuKeys.SaveProjectAs]);
            items.AddButton(_commands[MenuKeys.AddLayer], true);
            items.AddButton(_commands[MenuKeys.AddVectorLayer]);
            items.AddButton(_commands[MenuKeys.AddRasterLayer]);
            items.AddButton(_commands[MenuKeys.AddDatabaseLayer]);
            items.AddButton(_commands[MenuKeys.AddWmsLayer]);
            items.AddButton(_commands[MenuKeys.RemoveLayer]);
            items.AddButton(_commands[MenuKeys.Settings], true);

            #if DEBUG
            if (DebugHelper.ShowDebugMenuElements)
            {
                items.AddButton(_commands[MenuKeys.Test], true);
            }
            #endif

            items.InsertBefore = items[items.Count - 2];    // before settings

            bar.Update();
        }
 public ToolbarSettingItem(IToolbar toolbar)
 {
     this.BandIndex = toolbar.BandIndex;
     this.Band      = toolbar.Band;
     this.Header    = toolbar.Header;
     this.IsChecked = toolbar.IsChecked;
 }
Esempio n. 3
0
        }// Command

        //-------------------------------------------------------
        // Methods for IExtendControlbar
        //-------------------------------------------------------

        //-------------------------------------------------
        // SetControlbar
        //
        // This function will add items to the toolbar
        //-------------------------------------------------
        public void SetControlbar(IControlbar pControlbar)
        {
            if (pControlbar != null && false)
            {
                Object newcontrol;
                // Create a toolbar that we can "integrate" into the default toolbar
                pControlbar.Create(MMC_CONTROL_TYPE.TOOLBAR, this, out newcontrol);

                m_Toolbar = (IToolbar)newcontrol;

                // Add our bitmap to the toolbar's imagelist
                m_Toolbar.AddBitmap(1, m_hToolbarBMP, 16, 16, 0x00FFFFFF);

                // Now create the button we'll be adding to the toolbar
                MMCBUTTON newButton = new MMCBUTTON();
                newButton.nBitmap       = 0;
                newButton.idCommand     = 1;
                newButton.fsState       = TBSTATE.ENABLED;
                newButton.fsType        = TBSTYLE.BUTTON;
                newButton.lpButtonText  = "Go to the Black Page";
                newButton.lpTooltipText = "This button will take you to the Black page";

                m_Toolbar.AddButtons(1, ref newButton);

                // Now attach the toolbar we just created to MMC's toolbar
                pControlbar.Attach(MMC_CONTROL_TYPE.TOOLBAR, m_Toolbar);
            }
        }// SetControlbar
Esempio n. 4
0
        public ToolbarStrip(IToolbar toolbar, ToolStripContainer container)
        {
            _toolbar   = toolbar;
            _container = container;

            base.ParentChanged += new EventHandler(base_ParentChanged);
        }
Esempio n. 5
0
        private void InitMapToolbar(IToolbar bar)
        {
            var items = bar.Items;

            items.AddButton(_commands[MenuKeys.ZoomIn]);
            items.AddButton(_commands[MenuKeys.ZoomOut]);
            items.AddButton(_commands[MenuKeys.ZoomMax]);
            items.AddButton(_commands[MenuKeys.ZoomPrev]);
            items.AddButton(_commands[MenuKeys.ZoomNext]);
            items.AddButton(_commands[MenuKeys.ZoomToLayer]);
            items.AddButton(_commands[MenuKeys.Pan]);
            items.AddButton(_commands[MenuKeys.SetProjection], true);
            items.AddButton(_commands[MenuKeys.FindLocation]);

            items.AddButton(_commands[MenuKeys.MeasureDistance], true);
            items.AddButton(_commands[MenuKeys.MeasureArea]);

            // select drop down
            var dropDown = items.AddDropDown("Select", MenuKeys.SelectDropDown, PluginIdentity.Default);

            dropDown.BeginGroup = true;
            dropDown.Icon       = new MenuIcon(Resources.icon_select);

            dropDown.SubItems.AddButton(_commands[MenuKeys.SelectByRectangle]);
            dropDown.SubItems.AddButton(_commands[MenuKeys.SelectByPolygon]);

            items.AddButton(_commands[MenuKeys.ZoomToSelected]);
            items.AddButton(_commands[MenuKeys.ClearSelection]);

            bar.Update();
        }
Esempio n. 6
0
        /// <inheritdoc />
        protected override void DefineFeatureContextualToolbar(IToolbar toolbar)
        {
            this.radiusValueBox               = toolbar.CreateValueTextBox();
            this.radiusValueBox.Tooltip       = "Top radius";
            this.radiusValueBox.Title         = "r=";
            this.radiusValueBox.StateChanged += (control, eventArgs) =>
            {
                foreach (var component in this.Components)
                {
                    this.ModifyComponent(component, TransitionSectionPluginPropertyNames.CircleRadius, this.radiusValueBox.Value);
                }
            };

            this.widthValueBox               = toolbar.CreateValueTextBox();
            this.widthValueBox.Tooltip       = "Bottom width";
            this.widthValueBox.Title         = "w=";
            this.widthValueBox.StateChanged += (control, eventArgs) =>
            {
                foreach (var component in this.Components)
                {
                    this.ModifyComponent(component, TransitionSectionPluginPropertyNames.RectangleWidth, this.widthValueBox.Value);
                }
            };

            this.heightValueBox               = toolbar.CreateValueTextBox();
            this.heightValueBox.Tooltip       = "Bottom height";
            this.heightValueBox.Title         = "h=";
            this.heightValueBox.StateChanged += (control, eventArgs) =>
            {
                foreach (var component in this.Components)
                {
                    this.ModifyComponent(component, TransitionSectionPluginPropertyNames.RectangleHeight, this.heightValueBox.Value);
                }
            };
        }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of <see cref="PluginConfig"/>
 /// </summary>
 /// <param name="scene">Scene</param>
 /// <param name="toolbar">Toolbar</param>
 /// <param name="console">Console</param>
 /// <param name="palette">Palette</param>
 public PluginConfig(IScene scene, IToolbar toolbar, IConsole console, IPalette palette)
 {
     this.Scene   = scene;
     this.Toolbar = toolbar;
     this.Console = console;
     this.Palette = palette;
 }
Esempio n. 8
0
 void IItem_Click(object sender, EventArgs e)
 {
     _needRefresh = false;
     try
     {
         IItem item = (sender as ToolStripItem).Tag as IItem;
         if (item == null)
         {
             return;
         }
         if (item is ICommand) //ICommand,ITool
         {
             if (item is ITool)
             {
                 _currentTool = item as ICommand;
                 ToolStrip c       = (sender as ToolStripItem).Owner;
                 IToolbar  toolbar = c.Tag as IToolbar;
                 //ClearCurrentToolFromAllToolbars();
                 //toolbar.CurrentTool = _currentTool;
             }
             (item as ICommand).Click();
         }
     }
     finally
     {
         _needRefresh = true;
     }
 }
Esempio n. 9
0
 /* Agricast CR - R6 - Add wind icons and legend for Humidity - End */
 /* Agricast CR - R3 - Web service changes (background Image for each cell and color) and chart zooming feature - End */
 /// <summary>
 /// constructor
 /// </summary>
 public ServicePresenter(IToolbar ITool)
 {
     if (ITool != null)
     {
         objITool = ITool;
     }
 }
Esempio n. 10
0
 public ToolbarSettingItem(IToolbar toolbar)
 {
     this.BandIndex = toolbar.BandIndex;
     this.Band      = toolbar.Band;
     this.Key       = toolbar.Key;
     this.IsChecked = toolbar.IsChecked;
 }
Esempio n. 11
0
 public ToolbarSettingItem(IToolbar toolbar)
 {
     BandIndex = toolbar.BandIndex;
     Band      = toolbar.Band;
     Header    = toolbar.Header;
     IsChecked = toolbar.IsChecked;
 }
Esempio n. 12
0
 public ToolbarSettingItem(IToolbar toolbar)
 {
     this.BandIndex = toolbar.BandIndex;
     this.Band = toolbar.Band;
     this.Header = toolbar.Header;
     this.IsChecked = toolbar.IsChecked;
 }
Esempio n. 13
0
 public bool isVisible(IToolbar currentMod)
 {
     if (currentMod.onClick != null && currentMod.activeScences.Contains(HighLogic.LoadedScene))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 14
0
        public ShellViewModel(IToolbar toolbar, IWorkbench workbench)
        {
            Contract.Requires(toolbar != null);
            Contract.Requires(workbench != null);

            this.toolbar = toolbar;
            this.workbench = workbench;
        }
Esempio n. 15
0
 public ToolBarPresenter(IToolbar ITool)
 {
     if (ITool != null)
     {
         objITool = ITool;
         objSvcInfo = (ServiceInfo)HttpContext.Current.Session["objServiceInfo"];
     }
 }
Esempio n. 16
0
        public ShellViewModel(IToolbar toolbar, IWorkbench workbench)
        {
            Contract.Requires(toolbar != null);
            Contract.Requires(workbench != null);

            this.toolbar   = toolbar;
            this.workbench = workbench;
        }
Esempio n. 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TabContainer"/> class.
 /// </summary>
 /// <param name="another">Another <see cref="TabContainer"/> instance to copy data from.</param>
 protected TabContainer(TabContainer another)
     : base(another)
 {
     if (another.Toolbar != null)
     {
         Toolbar = (IToolbar)another.Toolbar.Clone();
     }
 }
 public UomViewCell(IToolbar pageView)
 {
     PageView = pageView;
     InitializeComponent();
     NameLabel        = ItemNameLabel;
     DescriptionLabel = ItemDescriptionLabel;
     DeleteIcon       = ItemDeleteIcon;
     EditIcon         = ItemEditIcon;
 }
Esempio n. 19
0
 /// <summary>
 /// Initializes a new instance of <see cref="PluginConfig"/>
 /// </summary>
 /// <param name="model">Model of the editor, allows to manipulate repository and keep consistence
 /// with editor.</param>
 /// <param name="scene">Scene</param>
 /// <param name="toolbar">Toolbar</param>
 /// <param name="console">Console</param>
 /// <param name="palette">Palette</param>
 /// <param name="leftPanelGrid">Grid where left panel elements are located. Empty by default, but plugins can
 ///     use it to add some new tools.</param>
 public PluginConfig(IModel model, IScene scene, IToolbar toolbar, IConsole console, IPalette palette, Grid leftPanelGrid)
 {
     this.Model         = model;
     this.Scene         = scene;
     this.Toolbar       = toolbar;
     this.Console       = console;
     this.Palette       = palette;
     this.LeftPanelGrid = leftPanelGrid;
 }
Esempio n. 20
0
        public void OnDispose()
        {
            mControllerNode.Recycle2Cache();
            mControllerNode = null;

            mDisposableList.Dispose();
            mDisposableList         = null;
            mCategoriesSelectorView = null;
        }
Esempio n. 21
0
 /// <summary>
 /// Initializes a new instance of <see cref="PluginConfig"/> 
 /// </summary>
 /// <param name="model">Model of the editor, allows to manipulate repository and keep consistence 
 /// with editor.</param>
 /// <param name="scene">Scene</param>
 /// <param name="toolbar">Toolbar</param>
 /// <param name="console">Console</param>
 /// <param name="palette">Palette</param>
 public PluginConfig(IModel model, IScene scene, IToolbar toolbar, IConsole console, IPalette palette, Dictionary<string, object> properties)
 {
     this.Model = model;
     this.Scene = scene;
     this.Toolbar = toolbar;
     this.Console = console;
     this.Palette = palette;
     this.Properties = properties;
 }
Esempio n. 22
0
        /// <summary>
        /// 创建工具栏实例。
        /// </summary>
        /// <returns></returns>
        public System.Windows.Forms.ToolStrip CreateToolbar()
        {
            System.Reflection.ConstructorInfo ci = this.Type.GetConstructor(new System.Type[] { });
            object objInstance = ci.Invoke(new object[] { });

            IToolbar toolbar = objInstance as IToolbar;

            toolbar.SetApplication(this.m_Application);
            return(toolbar as ToolStrip);
        }
Esempio n. 23
0
 /// <summary>
 /// Initializes a new instance of <see cref="PluginConfig"/>
 /// </summary>
 /// <param name="model">Model of the editor, allows to manipulate repository and keep consistence
 /// with editor.</param>
 /// <param name="scene">Scene</param>
 /// <param name="toolbar">Toolbar</param>
 /// <param name="console">Console</param>
 /// <param name="elementProvider">Element provider</param>
 public PluginConfig(IModel model, IScene scene, IToolbar toolbar, IConsole console, IElementProvider elementProvider, Grid constraintsGrid, Grid rightPanel, Grid sceneGrid)
 {
     this.Model           = model;
     this.Scene           = scene;
     this.Toolbar         = toolbar;
     this.Console         = console;
     this.ElementProvider = elementProvider;
     this.ConstraintsGrid = constraintsGrid;
     this.RightPanel      = rightPanel;
     this.SceneGrid       = sceneGrid;
 }
Esempio n. 24
0
        /// <summary>
        /// Determines whether the specified <see cref="iFactr.UI.IToolbar"/> is equal to this instance.
        /// </summary>
        /// <param name="other">The <see cref="iFactr.UI.IToolbar"/> to compare with this instance.</param>
        /// <returns><c>true</c> if the specified <see cref="iFactr.UI.IToolbar"/> is equal to this instance;
        /// otherwise, <c>false</c>.</returns>
        public bool Equals(IToolbar other)
        {
            Toolbar toolbar = other as Toolbar;

            if (toolbar != null)
            {
                return(Pair == toolbar.Pair);
            }

            return(Pair == other);
        }
Esempio n. 25
0
        public bool Equals(IToolbar other)
        {
            var toolbar = other as iFactr.UI.Toolbar;

            if (toolbar != null)
            {
                return(toolbar.Equals(this));
            }

            return(base.Equals(other));
        }
Esempio n. 26
0
        public void Windows_Uretimi()
        {
            ToolFactory factory = new WindowsFactory();

            IDialog dialog = factory.CreateDialog();

            dialog.GetDialog();

            IToolbar toolbar = factory.CreateToolbar();

            toolbar.GetToolbar();
        }
Esempio n. 27
0
        public ToolbarControl GetControl(IToolbar toolbar, object tag = null)
        {
            var key = new Key(toolbar, tag);

            if (!controlsByKeys.TryGetValue(key, out var toolbarControl))
            {
                toolbarControl = new ToolbarControl(toolbar, window);
                controlsByKeys.Add(key, toolbarControl);
            }

            return(toolbarControl);
        }
Esempio n. 28
0
        public void Macosx_Uretimi()
        {
            ToolFactory factory = new MacosxFactory();

            IDialog dialog = factory.CreateDialog();

            dialog.GetDialog();

            IToolbar toolbar = factory.CreateToolbar();

            toolbar.GetToolbar();
        }
Esempio n. 29
0
        private void setUserServices()
        {
            //Set user services
            try {
                //Set menu states
                IToolbar window = (IToolbar)this.mActiveForm;
                this.msFileNew.Enabled       = this.tsbNew.Enabled = window != null && window.CanNew;
                this.msFileOpen.Enabled      = this.tsbOpen.Enabled = window != null && window.CanOpen;
                this.msFileCancel.Enabled    = this.tsbCancel.Enabled = window != null && window.CanCancel;
                this.msFileSave.Enabled      = this.tsbSave.Enabled = false;
                this.msFileSaveAs.Enabled    = window != null && window.CanSave;
                this.msFilePageSetup.Enabled = true;
                this.msFilePrint.Enabled     = this.tsbPrint.Enabled = window != null && window.CanPrint;
                this.msFilePreview.Enabled   = window != null && window.CanPreview;
                this.msFileExit.Enabled      = true;
                this.msEditSearch.Enabled    = false;
                this.msViewRefresh.Enabled   = this.tsbRefresh.Enabled = window != null;
                this.msViewToolbar.Enabled   = this.msViewStatusBar.Enabled = true;
                this.msToolsConfig.Enabled   = true;
                this.msHelpAbout.Enabled     = true;

                if (this.mActiveForm is IPSPToolbar)
                {
                    IPSPToolbar pspwindow = (IPSPToolbar)this.mActiveForm;
                    this.tsbApprove.Enabled        = pspwindow.CanApproveClient;
                    this.tsbDeny.Enabled           = pspwindow.CanDenyClient;
                    this.tsbPrintLabels.Enabled    = pspwindow.CanPrintLabels;
                    this.tsbPrintPaperwork.Enabled = pspwindow.CanPrintPaperwork;
                }
                else
                {
                    this.tsbApprove.Enabled = this.tsbDeny.Enabled = this.tsbPrintLabels.Enabled = this.tsbPrintPaperwork.Enabled = false;
                }

                if (this.mActiveForm is IQuoteToolbar)
                {
                    IQuoteToolbar quotewindow = (IQuoteToolbar)this.mActiveForm;
                    this.tsbApproveQuote.Enabled = quotewindow.CanApproveQuote;
                    this.tsbTenderQuote.Enabled  = quotewindow.CanTenderQuote;
                    this.tsbViewTender.Enabled   = quotewindow.CanViewTender;
                    this.tsbBookQuote.Enabled    = quotewindow.CanBookQuote;
                }
                else
                {
                    this.tsbApproveQuote.Enabled = this.tsbTenderQuote.Enabled = this.tsbViewTender.Enabled = this.tsbBookQuote.Enabled = false;
                }

                this.ssMain.OnOnlineStatusUpdate(null, new OnlineStatusArgs(FreightGateway.ServiceState, FreightGateway.ServiceAddress));
            }
            catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
            finally { Application.DoEvents(); }
        }
Esempio n. 30
0
        private void AddToolbar(IToolbar toolbar)
        {
            if (toolbar == null)
            {
                return;
            }
            ToolStrip _toolstrip = new ToolStrip();

            _toolstrip.GripStyle = ToolStripGripStyle.Hidden;
            switch (toolbar.DockStyle)
            {
            case DockStyle.Left:
            case DockStyle.Right:
                _toolstrip.BackColor = Color.Gray;
                break;

            default:
                break;
            }
            _toolstrip.Name        = (toolbar as IItem).Name;
            _toolstrip.Tag         = toolbar;
            _toolstrip.Dock        = toolbar.DockStyle;
            _toolstrip.MouseEnter += new EventHandler(_toolstrip_MouseEnter);
            _toolstrip.Visible     = toolbar.Visible;
            (toolbar as BaseToolbar).SetHook(_defaultHook);
            foreach (IItem it in toolbar.Items)
            {
                if (it is IShortcutFilter)
                {
                    _application.ShortcutProcessor.AddShortcutFilter(it as IShortcutFilter);
                }
                if (!(it is ICommand || it is ITool || it is IControlItem))
                {
                    continue;
                }
                if (it is IControlItem)
                {
                    AddControlItem(_toolstrip, it as IControlItem);
                }

                else if (it is ITool)
                {
                    AddTool(_toolstrip, it as ITool);
                }
                else if (it is ICommand)
                {
                    AddCommand(_toolstrip, it as ICommand);
                }
            }
            _toolstrips.Add(_toolstrip);
        }
        /// <inheritdoc />
        protected override void DefineFeatureContextualToolbar(IToolbar toolbar)
        {
            this.radiusValueBox         = toolbar.CreateValueTextBox(TransitionSectionPlugin.DefaultCircleRadius);
            this.radiusValueBox.Tooltip = "Top radius";
            this.radiusValueBox.Title   = "r=";

            this.widthValueBox         = toolbar.CreateValueTextBox(TransitionSectionPlugin.DefaultRectangleWidth);
            this.widthValueBox.Tooltip = "Bottom width";
            this.widthValueBox.Title   = "w=";

            this.heightValueBox         = toolbar.CreateValueTextBox(TransitionSectionPlugin.DefaultRectangleHeight);
            this.heightValueBox.Tooltip = "Bottom height";
            this.heightValueBox.Title   = "h=";
        }
Esempio n. 32
0
        public void Load(IPersistStream stream)
        {
            if (_app == null) return;

            try
            {
                Guid guid = new Guid(stream.Load("GUID") as string);
                IToolbar toolbar = _app.Toolbar(guid);

                if (!(toolbar is IPersistable)) return;
                ((IPersistable)toolbar).Load(stream);
            }
            catch { }
        }
Esempio n. 33
0
        private void InitToolbar(IAppContext context, PluginIdentity identity)
        {
            var items = context.Toolbars.FileToolbar.Items;

            items.AddButton(_commands[MenuKeys.CreateLayer]).BeginGroup = true;
            context.Toolbars.FileToolbar.Update();

            _toolbar           = context.Toolbars.Add(ShapeEditorToolbar, identity);
            _toolbar.DockState = ToolbarDockState.Top;

            items = _toolbar.Items;

            items.AddButton(_commands[MenuKeys.LayerEdit]);

            items.AddButton(_commands[MenuKeys.GeometryCreate], true);
            items.AddButton(_commands[MenuKeys.VertexEditor]);

            items.AddButton(_commands[MenuKeys.SplitShapes], true);
            items.AddButton(_commands[MenuKeys.MergeShapes]);
            items.AddButton(_commands[MenuKeys.MoveShapes]);
            items.AddButton(_commands[MenuKeys.RotateShapes]);

            items.AddButton(_commands[MenuKeys.Copy], true);
            items.AddButton(_commands[MenuKeys.Paste]);
            items.AddButton(_commands[MenuKeys.Cut]);

            var dropDown = items.AddDropDown("Polygon Overlay", MenuKeys.PolygonOverlayDropDown, identity);

            dropDown.BeginGroup = true;
            dropDown.Icon       = new MenuIcon(Resources.icon_geometry_erase_by_polygon);

            dropDown.SubItems.AddButton(_commands[MenuKeys.EraseByPolygon]);
            dropDown.SubItems.AddButton(_commands[MenuKeys.ClipByPolygon]);
            dropDown.SubItems.AddButton(_commands[MenuKeys.SplitByPolygon]);

            items.AddButton(_commands[MenuKeys.SplitByPolyline]);
            items.AddButton(_commands[MenuKeys.Undo], true);

            items.AddLabel("0/0", MenuKeys.HistoryLength, identity);

            items.AddButton(_commands[MenuKeys.Redo]);

            items.AddButton(_commands[MenuKeys.SnapToActiveLayer], true);
            items.AddButton(_commands[MenuKeys.SnapToAlLayers]);
            items.AddButton(_commands[MenuKeys.SnapToVertices], true);
            items.AddButton(_commands[MenuKeys.SnapToSegments]);

            _toolbar.Update();
        }
Esempio n. 34
0
        public void OnDispose()
        {
            mPackageKitWindow = null;
            mSplitView        = null;

            mDisposableList.Dispose();
            mDisposableList = null;

            mCategoriesSelectorView = null;

            mLeftLayout.Dispose();
            mLeftLayout = null;

            mRightLayout.Dispose();
            mRightLayout = null;

            mMarkdownViewer = null;
        }
Esempio n. 35
0
 public void Init() {
     _toolbar = new Toolbar();
     _toolbar.Id( "toolbar" );
     _result = new Str();
 }