Exemple #1
0
        /// <summary>
        /// Set image for tab
        /// </summary>
        /// <param name="tabPage"></param>
        /// <param name="idx"></param>

        internal void SetTabImage(
            XtraTabPage tabPage,
            string viewTypeImageName)
        {
            Image image = Bitmaps.GetImageFromName(Bitmaps.I.ViewTypeImages, viewTypeImageName, true);

            SetTabImage(tabPage, image);
            return;
        }
Exemple #2
0
        /// <summary>
        /// Show the AddView context menu
        /// </summary>

        void ShowAddViewContextMenu()
        {
            List <ResultsViewModel> modelViews = ViewManager.GetResultsViewModels();

            ContextMenuStrip menu = AddViewContextMenu;

            menu.Items.Clear();

            foreach (ResultsViewModel view in modelViews)
            {
                if (!view.ShowInViewsMenu)
                {
                    continue;
                }

                if (Lex.StartsWith(view.Name, "Separator"))
                {
                    menu.Items.Add(new ToolStripSeparator());
                    continue;
                }

                ToolStripMenuItem item = new ToolStripMenuItem();

                ResultsViewModel rvm = view.Clone();                 // get a clone that we can modify
                item.Tag = rvm;

                item.Text = view.Title;

                string imageName = view.CustomViewTypeImageName;
                if (!Lex.IsDefined(imageName))
                {
                    imageName = "Spotfire";
                }

                item.Image = Bitmaps.GetImageFromName(Bitmaps.I.ViewTypeImages, imageName);

                rvm.Query = this.BaseQuery;
                rvm.QueryResultsControl = this;

                item.Click += AddViewMenuItem_Click;

                menu.Items.Add(item);
            }

            int   x = Cursor.Position.X;
            int   y = Tabs.PointToScreen(Tabs.Location).Y + 22;           // +Tabs.DisplayRectangle.Top;
            Point p = new Point(x, y);

            AddViewContextMenu.Show(p);

            return;
        }