Example #1
0
        public void RemoveAt(int index)
        {
            ToolBarItem item = (ToolBarItem)items[index];

            items.RemoveAt(index);
            RaiseChanged();
        }
Example #2
0
        public void AddButton(params RsToolbarButton[] buttons)
        {
            foreach (RsToolbarButton b in buttons)
            {
                ToolBarItem item = new ToolBarItem();

                if (b == RsToolbarButton.Separator)
                {
                    item.Type = ToolBarItemType.Separator;
                }
                else if (b == RsToolbarButton.DropDownMenu)
                {
                    ToolBarItemCollection coll   = base.ItemTemplates;
                    ToolBarItem           item11 = new ToolBarItem();
                    item11.Type = ToolBarItemType.Custom;
                    coll.Add(item11);

                    ToolBarItemCollection col2  = base.Items;
                    ToolBarItem           item1 = new ToolBarItem();
                    item1.Type = ToolBarItemType.Custom;
                    col2.Add(item1);
                }
                else
                {
                    item.Type        = ToolBarItemType.Button;
                    item.CommandName = b.ToString("d");
                    item.ImageUrl    = "~/Web/Img/Toolbar/" + b.ToString("d") + ".png";
                }


                base.Items.Add(item);
            }
        }
Example #3
0
        public MenuItem GetItem(ToolBarItem item)
        {
            switch (item)
            {
            case ToolBarItem.Delete:
                return(FindItem("刪除"));

            case ToolBarItem.Approve:
                return(FindItem("審核"));

            case ToolBarItem.Edit:
                return(FindItem("編輯"));

            case ToolBarItem.New:
                return(FindItem("新增"));

            case ToolBarItem.Search:
                return(FindItem("查找"));

            case ToolBarItem.Export:
                return(FindItem("導出"));

            case ToolBarItem.Import:
                return(FindItem("導入"));

            case ToolBarItem.Help:
                return(FindItem("幫助"));

            case ToolBarItem.Clear:
                return(FindItem("清除"));

            default:
                throw new NotSupportedException();
            }
        }
Example #4
0
 public void RemoveButton(ToolBarItem item)
 {
     if (item.ControlObject != null)
     {
         Control.Remove((Gtk.Widget)item.ControlObject);
     }
 }
Example #5
0
        public virtual ToolBarItemBuilder Add()
        {
            var item = new ToolBarItem();

            container.Add(item);

            return new ToolBarItemBuilder(item);
        }
Example #6
0
        private void chartToolbar_SelectedItemChanged(object sender, ChartToolBarArgs e)
        {
            ToolBarItem oldItem = (ToolBarItem)e.OldValue;
            ToolBarItem newItem = (ToolBarItem)e.NewValue;

            this.AssociatedObject.txt_oldValue.Text = oldItem.ToolTip.ToString();
            this.AssociatedObject.txt_newValue.Text = newItem.ToolTip.ToString();
        }
Example #7
0
        public static ToolBarItem CommandItem(string command, string text, string imageUrl, string clientSideCommand)
        {
            ToolBarItem item = CommandItem(command, text, imageUrl);

            item.ID = command;
            item.ClientSideCommand = clientSideCommand;
            return(item);
        }
Example #8
0
 public void Remove(ToolBarItem item)
 {
     if (!items.Contains(item))
     {
         return;
     }
     items.Remove(item);
     RaiseChanged();
 }
Example #9
0
    public void AddRange( ToolBarItem[] array )
    {
      RemovePlaceHolder();

      foreach( ToolBarItem item in array )
      {
        List.Add( item );
      }
    }
Example #10
0
        private void btn_addTBItem_Click(object sender, RoutedEventArgs e)
        {
            ToolBarItem toolBarItem = new ToolBarItem();

            toolBarItem.Text       = "New";
            toolBarItem.IsDropDown = false;
            toolBarItem.ToolTip    = "New Item";
            this.AssociatedObject.Chart1.ToolBar.Items.Add(toolBarItem);
        }
Example #11
0
        public void RemoveButton(ToolBarItem item)
        {
            var handler = item.Handler as IToolBarBaseItemHandler;
            var index   = items.IndexOf(handler);

            items.Remove(handler);
            //var handler = item.Handler as IToolBarItemHandler;
            Control.RemoveItem(index);
            //Control.ValidateVisibleItems();
        }
Example #12
0
        public static ToolBarItem Break()
        {
            ToolBarItem item = new ToolBarItem();

            item.ItemType    = ToolBarItemType.Separator;
            item.ImageUrl    = "break.gif";
            item.ImageHeight = Unit.Pixel(16);
            item.ImageWidth  = Unit.Pixel(2);
            return(item);
        }
Example #13
0
 private void Awake()
 {
     m_items = new List <ToolBarItem>(GetComponentsInChildren <ToolBarItem>());
     for (int i = 0; i < m_items.Count; ++i)
     {
         ToolBarItem item = m_items[i];
         item.Selected += OnItemSelected;
         item.Selected += OnItemDeselected;
     }
 }
Example #14
0
    public bool DropToolbarItemAtPosition(ToolBarItem toolbarItem, Vector3 worldPos)
    {
        Vector2 tileCoord    = GameManager.map.GetTileCoordFromWorldPos(worldPos);
        Vector3 tileWorldPos = GameManager.map.GetWorldPositionFromTileCoord(tileCoord);

        Instantiate(toolbarItem.gameplayPrefab, tileWorldPos, Quaternion.identity);
        Debug.LogFormat("Toolbar item added to map at tile: {0},{1} pos: {2},{3}", tileCoord.x, tileCoord.y, tileWorldPos.x, tileWorldPos.y);
        //TODO Add a check for tile
        return(true);
    }
Example #15
0
        private void CreateToolbarItems()
        {
            var saveCodeToolbarItem = new ToolBarItem {
                Name     = "Download code",
                IconPath = "dist/icons/file-text.svg",
                Id       = "download-code"
            };

            saveCodeToolbarItem.OnClick += HandleSaveCodeClicked;
            Layout.AddToolbarItem(saveCodeToolbarItem);
        }
        private void CreateToolbarItems()
        {
            var saveCodeToolbarItem = new ToolBarItem {
                Name     = "Converted code",
                IconName = "file-earmark-code",
                Id       = "download-code"
            };

            saveCodeToolbarItem.OnClick += HandleSaveCodeClicked;
            Layout.AddToolbarItem(saveCodeToolbarItem);
        }
Example #17
0
        public static ToolBarItem CommandItem(string command, string text, string imageUrl)
        {
            ToolBarItem item = new ToolBarItem();

            item.ID                   = command;
            item.ItemType             = ToolBarItemType.Command;
            item.ToolTip              = text;
            item.Value                = command;
            item.ImageUrl             = imageUrl;
            item.AutoPostBackOnSelect = true;
            return(item);
        }
Example #18
0
        private void CreateSaveDiagramToolbarButton()
        {
            var saveDiagramButton = new ToolBarItem {
                Description = "Save the diagram as .png",
                IconPath    = "dist/icons/card-image.svg",
                Id          = "download-diagram",
                Name        = "Download diagram"
            };

            saveDiagramButton.OnClick += HandleSaveDiagram;
            Layout.AddToolbarItem(saveDiagramButton);
        }
Example #19
0
        public void AddButton(ToolBarItem item)
        {
            var handler = item.Handler as IToolBarBaseItemHandler;

            items.Add(handler);
            Control.InsertItem(handler.Identifier, items.Count - 1);
            if (handler != null)
            {
                handler.ControlAdded(this);
            }
            //Control.ValidateVisibleItems();
        }
Example #20
0
        private static ToolBarItem CreateItem(string text, ICommand command, string icon = null, string toolTip = null)
        {
            var bt = new ToolBarItem
            {
                Text      = text,
                Command   = command,
                ToolTip   = toolTip,
                Icon      = icon,
                IsEnabled = command != null
            };

            return(bt);
        }
Example #21
0
        public static void AddControlItem(ToolBar toolbar, System.Web.UI.Control control)
        {
            ToolBarItem item = new ToolBarItem();

            item.ItemType        = ToolBarItemType.Separator;
            item.CustomContentId = toolbar.ID + "_" + control.ID;
            toolbar.Items.Add(item);

            ToolBarItemContent c = new ToolBarItemContent();

            c.ID = toolbar.ID + "_" + control.ID;
            c.Controls.Add(control);
            toolbar.Content.Add(c);
        }
Example #22
0
    public void Remove( ToolBarItem item )
    {
      // Remove the item from the ToolBar first
      int index = IndexOf( item );
      
      if( parentToolBar != null )
      {
        parentToolBar.RemoveToolBarItem( index );
      }
      
      if( !InnerList.Contains( item ) ) return;

      List.Remove( item );

      // If we don't have any items left
      if ( InnerList.Count == 0 && parentToolBar.PlaceHolderAdded == false )
      {
        parentToolBar.AddPlaceHolderToolBarItem();
      }
    }
Example #23
0
        public ToolBarEx CreateToolBarFromCodon(object owner, ToolBarCodon codon)
        {
            ToolBarEx bar = new ToolBarEx(BarType.ToolBar);

            foreach (ToolBarItemCodon childCodon in codon.SubItems)
            {
                ToolBarItem item = new ToolBarItem();
                item.Text = childCodon.ToolTip;
                if (childCodon.Class != null)
                {
                    object o = childCodon.AddIn.CreateObject(childCodon.Class);
                    if (o is IMenuCommand)
                    {
                        item.Click += new EventHandler(new ToolBarItemWrapper((IMenuCommand)o).Execute);
                    }
                    bar.Items.Add(item);
                }
            }
            return(bar);
        }
Example #24
0
        private void CreateToolbarItems()
        {
            var saveDiagramSvgItem = new ToolBarItem
            {
                Name     = "Diagram as svg",
                IconName = "filetype-svg",
                Id       = "download-svg"
            };

            saveDiagramSvgItem.OnClick += HandleSaveToSvgClicked;
            Layout.AddToolbarItem(saveDiagramSvgItem);
            var saveDiagramPngItem = new ToolBarItem
            {
                Name     = "Diagram as png",
                IconName = "file-earmark-image",
                Id       = "download-png"
            };

            saveDiagramPngItem.OnClick += HandleSaveToPngClicked;
            Layout.AddToolbarItem(saveDiagramPngItem);
        }
Example #25
0
        private void CreateSaveDiagramToolbarButton()
        {
            var saveDiagramAsSvgButton = new ToolBarItem
            {
                IconName = "filetype-svg",
                Id       = "bpmn-download-svg",
                Name     = "Diagram as svg"
            };

            saveDiagramAsSvgButton.OnClick += HandleSaveDiagramAsSvg;
            Layout.AddToolbarItem(saveDiagramAsSvgButton);

            var saveDiagramAsPngButton = new ToolBarItem
            {
                IconName = "file-earmark-image",
                Id       = "bpmn-download-png",
                Name     = "Diagram as png"
            };

            saveDiagramAsPngButton.OnClick += HandleSaveDiagramAsPng;
            Layout.AddToolbarItem(saveDiagramAsPngButton);
        }
Example #26
0
        public void Remove(ToolBarItem item)
        {
            // Remove the item from the ToolBar first
            int index = IndexOf(item);

            if (parentToolBar != null)
            {
                parentToolBar.RemoveToolBarItem(index);
            }

            if (!InnerList.Contains(item))
            {
                return;
            }

            List.Remove(item);

            // If we don't have any items left
            if (InnerList.Count == 0 && parentToolBar.PlaceHolderAdded == false)
            {
                parentToolBar.AddPlaceHolderToolBarItem();
            }
        }
Example #27
0
		private static ToolBarItem GetToolBarSeparator()
		{
			//<CA:ToolBarItem ItemType="Separator" ImageUrl="break.gif" ImageHeight="16" ImageWidth="2" />
			ToolBarItem tbItem = new ToolBarItem();
			tbItem.ItemType = ToolBarItemType.Separator;
			tbItem.ImageUrl = "break.gif";
			tbItem.ImageHeight = new Unit(16);
			tbItem.ImageWidth = new Unit(2);
			return tbItem;
		}
 public void Insert( int index, ToolBarItem item )
 {
     RemovePlaceHolder();
       List.Insert( index, item );
 }
        public void Add( ToolBarItem item )
        {
            RemovePlaceHolder();

              List.Add( item );
        }
Example #30
0
 public ToolBarItemBuilder(ToolBarItem settings)
 {
     container = settings;
 }
			public int IndexOf(ToolBarItem item)
			{
				return items.IndexOf(item);
			}
        private void ConfigureToolbar()
        {
            const int toolbarLeftRightPadding = 30;
            int toolbarWidth = 0;
            const int toolbarItemWidth = 22;
            const int separatorBarWidth = 7;

            bool isGalleryWriteable = !this.GalleryPage.GallerySettings.MediaObjectPathIsReadOnly;

            if (!GalleryPage.ShowMediaObjectToolbar)
            {
                tbMediaObjectActions.Visible = false;
                _toolbarWidthEstimate = toolbarWidth;
                return;
            }

            // If we get here either showMediaObjectToolbar or enableSlideShow is true. The enableSlideShow variable overrides showMediaObjectToolbar,
            // so show the slide show control even when showMediaObjectToolbar is false.
            tbMediaObjectActions.ImagesBaseUrl = String.Concat(Utils.GalleryRoot, "/images/componentart/toolbar/");

            ToolBarItem tbItem;

            //<ComponentArt:ToolBarItem ID="tbiInfo" runat="server" ImageUrl="info.png" ItemType="ToggleCheck"
            //ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Info_Tooltip %>" />
            if (GalleryPage.ShowMetadataButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiInfo";
                tbItem.ImageUrl = "info.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Info_Text;
                tbItem.ItemType = ToolBarItemType.ToggleCheck;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Info_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                // Separator
                tbMediaObjectActions.Items.Add(GetToolBarSeparator());

                toolbarWidth += toolbarItemWidth + separatorBarWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiDownload" runat="server" AutoPostBackOnSelect="true" ImageUrl="download.png"
            //Text="Download" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Download_Tooltip %>" />
            if (GalleryPage.ShowMediaObjectDownloadButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiDownload";
                tbItem.ImageUrl = "download.png";
                tbItem.Visible = this.MediaObjectEntity.IsDownloadable;
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Download_Text;
                tbItem.AutoPostBackOnSelect = true;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Download_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiDownloadZip" runat="server" AutoPostBackOnSelect="true" ImageUrl="download.png"
            //Text="Download" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Download_Tooltip %>" />
            if (GalleryPage.ShowMediaObjectZipDownloadButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiDownloadZip";
                tbItem.ImageUrl = "downloadzip.png";
                tbItem.Visible = true;
                //tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_DownloadZip_Text;
                tbItem.AutoPostBackOnSelect = true;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_DownloadZip_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiViewHiRes" runat="server" ItemType="ToggleCheck" ImageUrl="hires.png"
            //Text="View hi-res" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_HiRes_Tooltip %>" />
            if (this.GalleryPage.UserCanViewHiResImage && GalleryPage.ShowHighResImageButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiViewHiRes";
                tbItem.ImageUrl = "hires.png";
                tbItem.Visible = this.MediaObjectEntity.HiResAvailable;
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_HiRes_Text;
                tbItem.ItemType = ToolBarItemType.ToggleCheck;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_HiRes_Tooltip;
                tbItem.Checked = this.ViewHiResImage;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiPermalink" runat="server" ItemType="ToggleCheck" ImageUrl="hyperlink.png"
            //Text="Permalink" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Permalink_Tooltip %>" />
            if (GalleryPage.ShowPermalinkButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiPermalink";
                tbItem.ImageUrl = "hyperlink.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Permalink_Text;
                tbItem.ItemType = ToolBarItemType.ToggleCheck;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Permalink_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            // Separator
            InsertToolBarSeparator();
            toolbarWidth += separatorBarWidth;

            //<ComponentArt:ToolBarItem ID="tbiSlideshow" runat="server" ImageUrl="play.png" Text="Slideshow"
            //ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Slideshow_Tooltip %>" />
            if (GalleryPage.ShowSlideShowButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiSlideshow";
                tbItem.ImageUrl = "play.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Slideshow_Text;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Slideshow_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                // Separator
                tbMediaObjectActions.Items.Add(GetToolBarSeparator());

                toolbarWidth += toolbarItemWidth + separatorBarWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiMove" runat="server" AutoPostBackOnSelect="true" ImageUrl="move.png"
            //Text="Transfer" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Transfer_Tooltip %>" />
            if (isGalleryWriteable && this.GalleryPage.UserCanDeleteMediaObject && GalleryPage.ShowTransferMediaObjectButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiMove";
                tbItem.ImageUrl = "move.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Transfer_Text;
                tbItem.AutoPostBackOnSelect = true;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Transfer_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiCopy" runat="server" AutoPostBackOnSelect="true" ImageUrl="copy.png"
            //Text="Copy" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Copy_Tooltip %>" />
            if (isGalleryWriteable && CanUserCopyCurrentMediaObject() && GalleryPage.ShowCopyMediaObjectButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiCopy";
                tbItem.ImageUrl = "copy.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Copy_Text;
                tbItem.AutoPostBackOnSelect = true;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Copy_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiRotate" runat="server" AutoPostBackOnSelect="true" ImageUrl="rotate.png"
            //Text="Rotate" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Rotate_Tooltip %>" />
            if (isGalleryWriteable && this.GalleryPage.UserCanEditMediaObject && GalleryPage.ShowRotateMediaObjectButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiRotate";
                tbItem.ImageUrl = "rotate.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Rotate_Text;
                tbItem.AutoPostBackOnSelect = true;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Rotate_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            //<ComponentArt:ToolBarItem ID="tbiDelete" runat="server" ImageUrl="delete.png" Text="Delete"
            //ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Delete_Tooltip %>" />
            if (isGalleryWriteable && this.GalleryPage.UserCanDeleteMediaObject && GalleryPage.ShowDeleteMediaObjectButton)
            {
                tbItem = new ToolBarItem();
                tbItem.ID = "tbiDelete";
                tbItem.ImageUrl = "delete.png";
                tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Delete_Text;
                tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Delete_Tooltip;
                tbMediaObjectActions.Items.Add(tbItem);

                toolbarWidth += toolbarItemWidth;
            }

            if (tbMediaObjectActions.Items.Count == 0)
            {
                tbMediaObjectActions.Visible = false;
            }
            else if (tbMediaObjectActions.Items[tbMediaObjectActions.Items.Count - 1].ItemType == ToolBarItemType.Separator)
            {
                // The last item is a separator, which we don't want. Remove it.
                tbMediaObjectActions.Items.Remove(tbMediaObjectActions.Items[tbMediaObjectActions.Items.Count - 1]);
                toolbarWidth -= separatorBarWidth;
            }

            if (toolbarWidth > 0)
            {
                toolbarWidth += toolbarLeftRightPadding;
            }

            _toolbarWidthEstimate = toolbarWidth;
        }
			public void Remove(ToolBarItem item)
			{
				if (!items.Contains(item)) return;
				items.Remove(item);
				RaiseChanged();
			}
			public void AddRange(ToolBarItem[] items)
			{
				foreach (ToolBarItem item in items)
					this.items.Add(item);
				RaiseChanged();
			}
Example #35
0
 private void OnItemDeselected(ToolBarItem item)
 {
 }
 public bool Contains( ToolBarItem item )
 {
     return InnerList.Contains( item );
 }
Example #37
0
 private void OnItemDeselected(ToolBarItem item)
 {
 }
Example #38
0
 private void OnItemSelected(ToolBarItem item)
 {
     m_selectedItem = item;
     GameManager.soundManager.PlaySfx(SoundManager.SFX_SELECT_ITEM);
 }
Example #39
0
 public int  IndexOf(ToolBarItem item)
 {
     return(InnerList.IndexOf(item));
 }
Example #40
0
 private void OnItemSelected(ToolBarItem item)
 {
     m_selectedItem = item;
     GameManager.soundManager.PlaySfx(SoundManager.SFX_SELECT_ITEM);
 }
Example #41
0
 public void SetEnable(bool enabled, ToolBarItem item)
 {
     GetItem(item).Enabled = enabled;
 }
			public void Add(ToolBarItem item)
			{
				items.Add(item);
				RaiseChanged();
			}
Example #43
0
 public void SetVisible(ToolBarItem item)
 {
     ToolBar123.Items.Remove(GetItem(item));
 }
			public void Insert(int index, ToolBarItem item)
			{
				items.Insert(index, item);
				RaiseChanged();
			}
Example #45
0
        public void ChangeText(ToolBarItem item, string newName)
        {
            MenuItem menuItem = GetItem(item);

            menuItem.Text = newName;
        }
			public bool Contains(ToolBarItem item)
			{
				return items.Contains(item);
			}
Example #47
0
 string GetUrl(ToolBarItem item)
 {
     return("javascript:ToolBarMenuItemClick('" + item + "','" + this.ID + "');");
 }
        private ToolBarItem GetToolBarSeparator()
        {
            //<ComponentArt:ToolBarItem ItemType="Separator" ImageUrl="break.gif" ImageHeight="16" ImageWidth="2" />
            if (this._toolbarItemSeparator == null)
            {
                this._toolbarItemSeparator = new ToolBarItem();
                this._toolbarItemSeparator.ItemType = ToolBarItemType.Separator;
                this._toolbarItemSeparator.ImageUrl = "break.gif";
                this._toolbarItemSeparator.ImageHeight = new Unit(16);
                this._toolbarItemSeparator.ImageWidth = new Unit(2);
            }

            return this._toolbarItemSeparator;
        }
Example #49
0
		private void ConfigureToolbar()
		{
			ToolBarItem tbItem;

			Core core = ConfigManager.GetGalleryServerProConfigSection().Core;

			//<CA:ToolBarItem ID="tbiInfo" runat="server" ImageUrl="info.png" ItemType="ToggleCheck"
			//ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Info_Tooltip %>" />
			if (core.EnableImageMetadata)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiInfo";
				tbItem.ImageUrl = "info.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Info_Text;
				tbItem.ItemType = ToolBarItemType.ToggleCheck;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Info_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);

				// Separator
				tbMediaObjectActions.Items.Add(GetToolBarSeparator());
			}

			//<CA:ToolBarItem ID="tbiDownload" runat="server" AutoPostBackOnSelect="true" ImageUrl="download.png"
			//Text="Download" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Download_Tooltip %>" />
			if (core.EnableMediaObjectDownload)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiDownload";
				tbItem.ImageUrl = "download.png";
				tbItem.Visible = this.MediaObjectEntity.IsDownloadable;
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Download_Text;
				tbItem.AutoPostBackOnSelect = true;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Download_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			//<CA:ToolBarItem ID="tbiViewHiRes" runat="server" ItemType="ToggleCheck" ImageUrl="hires.png"
			//Text="View hi-res" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_HiRes_Tooltip %>" />
			if (this.PageBase.UserCanViewHiResImage)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiViewHiRes";
				tbItem.ImageUrl = "hires.png";
				tbItem.Visible = this.MediaObjectEntity.HiResAvailable;
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_HiRes_Text;
				tbItem.ItemType = ToolBarItemType.ToggleCheck;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_HiRes_Tooltip;
				tbItem.Checked = this.ViewHiResImage;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			//<CA:ToolBarItem ID="tbiPermalink" runat="server" ItemType="ToggleCheck" ImageUrl="hyperlink.png"
			//Text="Permalink" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Permalink_Tooltip %>" />
			if (core.EnablePermalink)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiPermalink";
				tbItem.ImageUrl = "hyperlink.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Permalink_Text;
				tbItem.ItemType = ToolBarItemType.ToggleCheck;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Permalink_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			// Separator
			InsertToolBarSeparator();

			//<CA:ToolBarItem ID="tbiSlideshow" runat="server" ImageUrl="play.png" Text="Slideshow"
			//ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Slideshow_Tooltip %>" />
			if (core.EnableSlideShow)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiSlideshow";
				tbItem.ImageUrl = "play.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Slideshow_Text;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Slideshow_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);

				// Separator
				tbMediaObjectActions.Items.Add(GetToolBarSeparator());
			}

			//<CA:ToolBarItem ID="tbiMove" runat="server" AutoPostBackOnSelect="true" ImageUrl="move.png"
			//Text="Transfer" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Transfer_Tooltip %>" />
			if (this.PageBase.UserCanDeleteMediaObject)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiMove";
				tbItem.ImageUrl = "move.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Transfer_Text;
				tbItem.AutoPostBackOnSelect = true;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Transfer_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			//<CA:ToolBarItem ID="tbiCopy" runat="server" AutoPostBackOnSelect="true" ImageUrl="copy.png"
			//Text="Copy" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Copy_Tooltip %>" />
			if (CanUserCopyCurrentMediaObject())
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiCopy";
				tbItem.ImageUrl = "copy.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Copy_Text;
				tbItem.AutoPostBackOnSelect = true;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Copy_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			//<CA:ToolBarItem ID="tbiRotate" runat="server" AutoPostBackOnSelect="true" ImageUrl="rotate.png"
			//Text="Rotate" ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Rotate_Tooltip %>" />
			if (this.PageBase.UserCanEditMediaObject)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiRotate";
				tbItem.ImageUrl = "rotate.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Rotate_Text;
				tbItem.AutoPostBackOnSelect = true;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Rotate_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			//<CA:ToolBarItem ID="tbiDelete" runat="server" ImageUrl="delete.png" Text="Delete"
			//ToolTip="<%$ Resources:GalleryServerPro, UC_MediaObjectView_ToolBar_Delete_Tooltip %>" />
			if (this.PageBase.UserCanDeleteMediaObject)
			{
				tbItem = new ToolBarItem();
				tbItem.ID = "tbiDelete";
				tbItem.ImageUrl = "delete.png";
				tbItem.Text = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Delete_Text;
				tbItem.ToolTip = Resources.GalleryServerPro.UC_MediaObjectView_ToolBar_Delete_Tooltip;
				tbMediaObjectActions.Items.Add(tbItem);
			}

			if (tbMediaObjectActions.Items.Count == 0)
			{
				tbMediaObjectActions.Visible = false;
			}
		}
 public int IndexOf( ToolBarItem item )
 {
     return InnerList.IndexOf(item);
 }
        internal void AddPlaceHolderToolBarItem()
        {
            placeHolderAdded = true;

              // Add it to the "native" ToolBar but not to the collection
              ToolBarItem item = new ToolBarItem();
              item.ToolBar = this;
              TBBUTTON button = new TBBUTTON();
              button.idCommand = 0;
              WindowsAPI.SendMessage(Handle, ( int )ToolBarMessages.TB_INSERTBUTTON, 0, ref button);

              int pos = m_items.IndexOf( item );
              TBBUTTONINFO tbi = (TBBUTTONINFO)m_items[ pos ];   //GetButtonInfo( 0, item );
              WindowsAPI.SendMessage(Handle, ( int )ToolBarMessages.TB_SETBUTTONINFOW, 0, ref tbi);

              UpdateSize();
        }