コード例 #1
0
        public void ApplyCustomTheme()
        {
            var theme = UIController.Get().GetTheme();

            this.listView.BackColor             = theme.ColorPalette.ToolWindowTabSelectedInactive.Background;
            this.listView.AlternateRowBackColor = theme.ColorPalette.OverflowButtonHovered.Background;

            this.listView.ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text;
            HeaderFormatStyle hfs = new HeaderFormatStyle()
            {
                Normal = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.DockTarget.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                },
                Hot = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.OverflowButtonHovered.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                },
                Pressed = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.CommandBarToolbarButtonPressed.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                }
            };

            this.listView.HeaderFormatStyle     = hfs;
            listView.UnfocusedSelectedBackColor = theme.ColorPalette.CommandBarToolbarButtonPressed.Background;
        }
コード例 #2
0
        public void ApplyCustomTheme()
        {
            var theme = MainController.Get().GetTheme();

            MainController.Get().ToolStripExtender.SetStyle(toolStrip, VisualStudioToolStripExtender.VsVersion.Vs2015, theme);

            this.objectListView.BackColor             = theme.ColorPalette.ToolWindowTabSelectedInactive.Background;
            this.objectListView.AlternateRowBackColor = theme.ColorPalette.OverflowButtonHovered.Background;

            this.objectListView.ForeColor = Color.Black;
            HeaderFormatStyle hfs = new HeaderFormatStyle()
            {
                Normal = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.DockTarget.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                },
                Hot = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.OverflowButtonHovered.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                },
                Pressed = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.CommandBarToolbarButtonPressed.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                }
            };

            this.objectListView.HeaderFormatStyle     = hfs;
            objectListView.UnfocusedSelectedBackColor = theme.ColorPalette.CommandBarToolbarButtonPressed.Background;
        }
コード例 #3
0
ファイル: frmChunkList.cs プロジェクト: DaveCS1/Wolven-kit
        public void ApplyCustomTheme()
        {
            var theme = MainController.Get().GetTheme();

            MainController.Get().ToolStripExtender.SetStyle(toolStrip1, VisualStudioToolStripExtender.VsVersion.Vs2015, theme);

            this.treeListView.BackColor  = theme.ColorPalette.TabButtonSelectedInactivePressed.Background;
            toolStripSearchBox.BackColor = theme.ColorPalette.ToolWindowCaptionButtonInactiveHovered.Background;

            this.treeListView.ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text;
            HeaderFormatStyle hfs = new HeaderFormatStyle()
            {
                Normal = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.ToolWindowTabSelectedInactive.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                },
                Hot = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.OverflowButtonHovered.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                },
                Pressed = new HeaderStateStyle()
                {
                    BackColor = theme.ColorPalette.CommandBarToolbarButtonPressed.Background,
                    ForeColor = theme.ColorPalette.CommandBarMenuDefault.Text,
                }
            };

            this.treeListView.HeaderFormatStyle     = hfs;
            treeListView.UnfocusedSelectedBackColor = theme.ColorPalette.CommandBarToolbarButtonPressed.Background;
        }
コード例 #4
0
        private void ListViewConfig(ObjectListView olv)
        {
            olv.View               = View.Details;
            olv.FullRowSelect      = false;
            olv.GridLines          = false;
            olv.AllowColumnReorder = false;
            olv.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            olv.HideSelection = false;
            //olv.UseFiltering = true;
            olv.HeaderStyle           = ColumnHeaderStyle.Nonclickable;
            olv.ShowItemToolTips      = true;
            olv.HeaderWordWrap        = true;
            olv.UseHotItem            = true;
            olv.UseTranslucentHotItem = true;
            olv.HeaderMaximumHeight   = 80;
            olv.HeaderMinimumHeight   = 0;
            HeaderFormatStyle HeaderStyle = new HeaderFormatStyle();

            HeaderStyle.SetFont(new Font(olv.Font.FontFamily, olv.Font.Size, FontStyle.Bold));
            olv.HeaderFormatStyle = HeaderStyle;
            //olv.AlwaysGroupByColumn = GetGroupColumn();
            olv.CellEditActivation       = ObjectListView.CellEditActivateMode.SingleClickAlways;
            olv.ShowGroups               = false;
            olv.CellEditUseWholeCell     = true;
            olv.CellEditEnterChangesRows = true;
        }
コード例 #5
0
ファイル: mainForm.cs プロジェクト: roundy7722/rpftool
        public mainForm(string gameSelected, gameSelection gsF)
        {
            currentGame    = gameSelected;
            gameSelectForm = gsF;
            bgwListBuilder.WorkerReportsProgress = true;
            bgwListBuilder.DoWork             += new DoWorkEventHandler(bgwListBuilder_DoWork);
            bgwListBuilder.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgwListBuilder_RunWorkerCompleted);
            InitializeComponent();
            tb_search.Edit.KeyDown += new KeyEventHandler(tb_search_KeyDown);
            setImage();
            // Initialize hot item style
            this.hotItemStyle1.ForeColor = highlightCellColor;
            RowBorderDecoration rbd = new RowBorderDecoration();

            rbd.BorderPen                 = new Pen(primaryCellColor, 0.5f);
            rbd.FillBrush                 = new SolidBrush(Color.FromArgb(32, Color.White));
            rbd.CornerRounding            = 0;
            rbd.BoundsPadding             = new Size(0, 0);
            rbd.LeftColumn                = 1;
            this.hotItemStyle1.Decoration = rbd;
            HeaderFormatStyle headerstyle = new HeaderFormatStyle();

            headerstyle.SetBackColor(headerBackColor);
            filelistview.HeaderFormatStyle = headerstyle;
        }
コード例 #6
0
        void UpdateFormCustomizer()
        {
            formCustomizer.setTitleBar(panelControlBox);
            formCustomizer.setTitleLabel(labelWindowTitle);
            formCustomizer.setMenuStrip(menuStrip1);
            formCustomizer.setIcon(pictureBoxWindowicon);
            formCustomizer.setCloseButton(buttonClose);
            formCustomizer.setMaxiButton(buttonMax);
            formCustomizer.setMiniButton(buttonMin);
            formCustomizer.setStatusStrip(panelStatusStrip);

            service.BackColor   = formCustomizer.BackColor;
            service.BorderColor = formCustomizer.BorderColor;

            panelContent.BackColor = formCustomizer.BackColor;

            panelStatusStrip.BackColor = formCustomizer.BorderColor;
            labelStatusStrip.ForeColor = formCustomizer.TextStatusStripColor;

            fOlvCustomers.BackColor             = formCustomizer.BackColor;
            fOlvCustomers.ForeColor             = Color.WhiteSmoke;
            fOlvCustomers.AlternateRowBackColor = formCustomizer.ShadowColor;

            fOlvCustomers.SelectedBackColor = formCustomizer.BorderColor;
            fOlvCustomers.SelectedForeColor = Color.Black;

            foreach (OLVColumn item in fOlvCustomers.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(formCustomizer.BackColor);
                headerstyle.SetForeColor(Color.WhiteSmoke);
                item.HeaderFormatStyle = headerstyle;
            }
        }
コード例 #7
0
        /// <summary>
        /// Configures the object lis view.
        /// </summary>
        private void ConfigureObjectLisView()
        {
            var headerFormatStyle = new HeaderFormatStyle
            {
                Normal = new HeaderStateStyle
                {
                    Font = new Font("Calibri", 9F, FontStyle.Bold, GraphicsUnit.Point, 0)
                }
            };

            container.HeaderFormatStyle        = headerFormatStyle;
            container.CellToolTip.HasBorder    = true;
            container.CellToolTip.IsBalloon    = true;
            container.CellToolTip.InitialDelay = 0;
            container.CellToolTip.StandardIcon = ToolTipControl.StandardIcons.Info;
            container.CellToolTip.Title        = "Detalles de vuelo";
            container.CellToolTip.Font         = new Font("Microsoft Sans Serif", 7.25F, FontStyle.Bold, GraphicsUnit.Point, 0);

            CompanyName.ImageGetter += (row) =>
            {
                var flight = (IFlight)row;
                if (flight.OwnerCompany.Equals("InterJet"))
                {
                    return(0);                               // indice de posicion en el imageList
                }
                if (flight.OwnerCompany.Equals("Volaris"))
                {
                    return(1);                              // indice de posicion en el imageList
                }

                return("");
            };

            container.CellToolTipShowing += container_CellToolTipShowing;
        }
コード例 #8
0
        public Form1()
        {
            InitializeComponent();
            HeaderFormatStyle hs = new HeaderFormatStyle();

            hs.SetBackColor(Color.FromArgb(241, 199, 22));
            hs.SetFont(new Font(FontFamily.GenericMonospace, 10, FontStyle.Bold));
            listView.HeaderFormatStyle = hs;
        }
コード例 #9
0
 private void ReloadColumns()
 {
     foreach (OLVColumn item in stListView1.AllColumns)
     {
         var headerstyle = new HeaderFormatStyle();
         headerstyle.SetBackColor(FormThemes.BaseTheme.FormBackColor);
         headerstyle.SetForeColor(FormThemes.BaseTheme.FormForeColor);
         item.HeaderFormatStyle = headerstyle;
     }
 }
コード例 #10
0
 internal static void adjustMyObjectListViewHeader(ObjectListView vOLVList, Color vForeColour, Color vBackColour)
 {
     foreach (OLVColumn item in vOLVList.Columns)
     {
         var headerstyle = new HeaderFormatStyle();
         headerstyle.SetBackColor(vBackColour);
         headerstyle.SetForeColor(vForeColour);
         item.HeaderFormatStyle = headerstyle;
     }
 }
コード例 #11
0
 private void adjustMyObjectListViewHeader()
 {
     BorderStyle = BorderStyle.None;
     foreach (OLVColumn item in Columns)
     {
         var headerstyle = new HeaderFormatStyle();
         headerstyle.SetBackColor(FormThemes.BaseTheme.FormBackColor);
         headerstyle.SetForeColor(FormThemes.BaseTheme.FormForeColor);
         item.HeaderFormatStyle = headerstyle;
     }
 }
コード例 #12
0
        public void GenerateListView(ObjectListView varListView, List <ListViewColumnsInfo> nameSizeList)
        {
            List <OLVColumn> columnsList = new List <OLVColumn>();
            var totalColumns             = nameSizeList.Count();
            int counter = 0;

            foreach (ListViewColumnsInfo nameSize in nameSizeList)
            {
                counter++;
                OLVColumn columnHeader = new BrightIdeasSoftware.OLVColumn();
                columnHeader.Text       = nameSize.Header;
                columnHeader.IsVisible  = nameSize.Visible;
                columnHeader.AspectName = nameSize.Header;

                // Only for last column
                if (totalColumns == counter)
                {
                    var lastColumn        = nameSizeList.Last();
                    var withoutLastColumn = nameSizeList.Where(x => !x.Header.Equals(lastColumn));
                    var withOfAll         = withoutLastColumn.Sum(x => x.ColumnSize);
                    columnHeader.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
                    int colWidthAfterAutoResizeByContent = columnHeader.Width;
                    if (nameSize.ColumnSize > colWidthAfterAutoResizeByContent)
                    {
                        columnHeader.Width = nameSize.ColumnSize;
                    }
                    else
                    {
                        columnHeader.Width = colWidthAfterAutoResizeByContent;
                    }
                }
                else
                {
                    columnHeader.Width = nameSize.ColumnSize;
                }

                // Set header style
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(Color.FromArgb(83, 83, 91));
                headerstyle.SetForeColor(Color.White);
                columnHeader.HeaderFormatStyle = headerstyle;
                if (nameSize.IsButton)
                {
                    columnHeader.IsButton     = nameSize.IsButton;
                    columnHeader.TextAlign    = HorizontalAlignment.Center;
                    columnHeader.ButtonSizing = OLVColumn.ButtonSizingMode.FixedBounds;
                    columnHeader.ButtonSize   = new Size(15, 15);
                }
                columnsList.Add(columnHeader);
                varListView.AllColumns.Add(columnHeader);
            }
            varListView.Columns.AddRange(columnsList.Cast <System.Windows.Forms.ColumnHeader>().ToArray());
        }
コード例 #13
0
        private void SetColumnHeaderStyles()
        {
            ObjectListGpus.HeaderUsesThemes = false;

            HeaderFormatStyle headerStyle = new HeaderFormatStyle();

            headerStyle.SetBackColor(ThemeColors.ListHeaderNormalBackground);
            headerStyle.SetForeColor(ThemeColors.ListHeaderNormalForeground);
            headerStyle.SetFont(this.Font);
            ObjectListGpus.HeaderWordWrap    = true;
            ObjectListGpus.HeaderFormatStyle = headerStyle;
        }
コード例 #14
0
ファイル: NGListView.cs プロジェクト: 756616071/mRemoteNG
        protected override void OnCreateControl()
        {
            base.OnCreateControl();
            var _themeManager = ThemeManager.getInstance();

            if (!_themeManager.ActiveAndExtended)
            {
                return;
            }
            //List back color
            BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Background");
            ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Foreground");
            //Selected item
            SelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Selected_Background");
            SelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Selected_Foreground");

            //Header style
            HeaderUsesThemes = false;
            var headerStylo = new HeaderFormatStyle
            {
                Normal =
                {
                    BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Background"),
                    ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Foreground")
                }
            };

            HeaderFormatStyle = headerStylo;
            //Border style
            if (DecorateLines)
            {
                UseCellFormatEvents = true;
                GridLines           = false;
                deco = new CellBorderDecoration
                {
                    BorderPen      = new Pen(_themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Border")),
                    FillBrush      = null,
                    BoundsPadding  = Size.Empty,
                    CornerRounding = 0
                };
                FormatCell += NGListView_FormatCell;
            }

            if (Items != null && Items.Count != 0)
            {
                BuildList();
            }
            Invalidate();
        }
コード例 #15
0
        private void adjustMyObjectListViewHeader()
        {
            foreach (OLVColumn item in olvWebsites.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(parentForm.colourDarker);
                headerstyle.SetForeColor(parentForm.colourLightest);
                item.HeaderFormatStyle = headerstyle;
            }

            foreach (OLVColumn item in olvWebsites.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(parentForm.colourDarker);
                headerstyle.SetForeColor(parentForm.colourLightest);
                item.HeaderFormatStyle = headerstyle;
            }
        }
コード例 #16
0
ファイル: ListViewData.cs プロジェクト: chanos-dev/VirusChan
        public static OLVColumn CreateColumn(string name, string text, string aspect, int width)
        {
            HeaderFormatStyle style = new HeaderFormatStyle();

            //style.SetBackColor(Color.FromArgb(240, 240, 240));

            style.SetForeColor(Color.FromArgb(63, 130, 242));
            style.SetFont(new Font("Comic Sans MS", 10, FontStyle.Bold));

            OLVColumn column = new OLVColumn()
            {
                Name              = name,
                Text              = text,
                AspectName        = aspect,
                Width             = width,
                HeaderFormatStyle = style,
            };

            if (name.Equals("Detected"))
            {
                column.AspectGetter = delegate(object obj)
                {
                    if (obj is Detection detection)
                    {
                        if (detection.Detected)
                        {
                            return("Detected");
                        }
                        else
                        {
                            return("Undetected");
                        }
                    }
                    else
                    {
                        return(null);
                    }
                };
            }

            return(column);
        }
コード例 #17
0
        private void ListViewConfig(TreeListView olv)
        {
            olv.View               = View.Details;
            olv.FullRowSelect      = true;
            olv.GridLines          = true;
            olv.AllowColumnReorder = false;
            olv.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            olv.HideSelection         = false;
            olv.UseFiltering          = true;
            olv.HeaderStyle           = ColumnHeaderStyle.Clickable;
            olv.ShowItemToolTips      = true;
            olv.HeaderWordWrap        = true;
            olv.UseHotItem            = true;
            olv.UseTranslucentHotItem = true;
            olv.HeaderMaximumHeight   = 80;
            olv.HeaderMinimumHeight   = 50;
            HeaderFormatStyle HeaderStyle = new HeaderFormatStyle();

            HeaderStyle.SetFont(new Font(olv.Font.FontFamily, olv.Font.Size, FontStyle.Bold));
            olv.HeaderFormatStyle = HeaderStyle;
        }
コード例 #18
0
        public UC_Main_Task_Pane( )
        {
            InitializeComponent();
            oLV_Overview.FullRowSelect = true;

            oLV_Overview.SelectedRowDecoration = new TintedColumnDecoration(oLV_Cl_Fertigungsstatus);

            oLV_Overview.TintSortColumn = true;
            oLV_Overview.SelectedColumn = oLV_Cl_Fertigungsstatus;
            oLV_Overview.Sort(oLV_Cl_Fertigungsstatus);

            oLV_Overview.SelectedColumnTint = Color.FromArgb(45, 248, 131, 121);

            foreach (OLVColumn result in oLV_Overview.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(Color.FromArgb(255, 255, 255, 255));
                result.HeaderFormatStyle = headerstyle;
                result.MinimumWidth      = 30;
            }
        }
コード例 #19
0
        public static HeaderFormatStyle GetHeaderFormatStyle()
        {
            HeaderFormatStyle hfs = new HeaderFormatStyle()
            {
                Normal = new HeaderStateStyle()
                {
                    BackColor = GetPalette().DockTarget.Background,
                    ForeColor = GetPalette().CommandBarMenuDefault.Text,
                },
                Hot = new HeaderStateStyle()
                {
                    BackColor = GetPalette().OverflowButtonHovered.Background,
                    ForeColor = GetPalette().CommandBarMenuDefault.Text,
                },
                Pressed = new HeaderStateStyle()
                {
                    BackColor = GetPalette().CommandBarToolbarButtonPressed.Background,
                    ForeColor = GetPalette().CommandBarMenuDefault.Text,
                }
            };

            return(hfs);
        }
コード例 #20
0
        // helper method creating a list and setting typical list parameters
        virtual protected void CreateObjectListView()
        {
            // FastDataListView FastListView - inherited from VirtualListView and intended to display lists with a large number of entries
            // their feature is that objects are drawn only for those lines that are in the zone of visibility
            // however, this also involves a drawback - the list constantly redraws its visible area
            // DataListView - is designed to work with datasors and it must be set
            // FastDataListView is the same, but behaves differently, because it is inherited from VirtualListView
            // just like FastListView, so it already has its own internal virtual datasource
            //this.listView = new FastDataListView ();
            //this.listView = new FastObjectListView ();
            //listView.VirtualMode = true; Should not be set for normal lists (this field is only for the Fast list and it is set internally.) When using the wizard, it is necessary to monitor whether it was installed.)
            if (isTreeList)
            {
                listView = new TreeListView();
            }
            else
            {
                listView = new ObjectListView();
            }

            listView.Cursor   = Cursors.Default;
            listView.Dock     = DockStyle.Fill;
            listView.Name     = "listView";
            listView.TabIndex = 0;
            //ovl settings
            listView.ShowGroups         = false;
            listView.EmptyListMsg       = FrwCRUDRes.List_No_Records;
            listView.EmptyListMsgFont   = new Font("Tahoma", 9); //todo;
            listView.FullRowSelect      = true;
            listView.IsSimpleDragSource = true;                  // drag drop
            listView.IsSimpleDropSink   = true;                  //drag drop
            listView.UseCompatibleStateImageBehavior = false;
            listView.View = View.Details;

            listView.UseFiltering       = true;//can filter
            listView.UseFilterIndicator = true;
            listView.AllowColumnReorder = true;
            listView.TriStateCheckBoxes = false; //todo If you want the user to be able to give check boxes the Indeterminate value, you should set the ObjectListView.TriStateCheckBoxes property to true.
            listView.TintSortColumn     = true;  //If you set TintSortColumn property to true, the sort column will be automatically tinted. The color of the tinting is controlled by the SelectedColumnTint property.
            listView.ShowItemToolTips   = true;

            //listView.UseHotItem = true;

            listView.UseHyperlinks     = true;
            listView.HyperlinkClicked += ListView_HyperlinkClicked;
            listView.SelectColumnsOnRightClickBehaviour = ObjectListView.ColumnSelectBehaviour.Submenu;
            listView.ShowCommandMenuOnRightClick        = true;
            listView.TintSortColumn           = true;
            listView.GridLines                = true;
            listView.UseAlternatingBackColors = true;
            listView.AlternateRowBackColor    = Color.Azure;
            //Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(240)))), ((int)(((byte)(220))))); //Color.LightGreen;// Color.FromArgb(35, 35, 42) - not working
            //Make sure HeaderUsesThemes is false. If this is true, ObjectListView will use the OS’s theme to draw the header, ignoring the HeaderFormatStyle completely.
            listView.HeaderUsesThemes = false;
            var headerstyle = new HeaderFormatStyle();

            headerstyle.Normal.BackColor = Color.LightBlue;// .SetBackColor(Color.LightBlue);
            listView.HeaderFormatStyle   = headerstyle;
            // support for editing
            // activates by double click
            // it is possible to activate editing by F2 if double-click still has to be occupied by another
            listView.CellEditActivation   = ObjectListView.CellEditActivateMode.DoubleClick;
            listView.CellEditUseWholeCell = false;
            // double click is no longer used for anything
            //listView.ItemActivate += new EventHandler(listView_ItemActivate);
            listView.CellRightClick         += new EventHandler <CellRightClickEventArgs>(this.listView_CellRightClick);
            listView.SelectionChanged       += new EventHandler(listView_SelectionChanged);
            listView.SubItemChecking        += ListView_SubItemChecking;        // A special handler is needed because CellEditFinished does not cover CheckboxColumn
            listView.HeaderCheckBoxChanging += ListView_HeaderCheckBoxChanging; // A special handler is needed because CellEditFinished does not cover CheckboxColumn
            listView.CellEditStarting       += ListView_CellEditStarting;
            listView.CellEditFinished       += ListView_CellEditFinished;
            listView.CanDrop            += ListView_CanDrop;
            listView.Dropped            += ListView_Dropped;
            listView.ModelCanDrop       += ListView_ModelCanDrop;
            listView.ModelDropped       += ListView_ModelDropped;
            listView.CellToolTipShowing += ListView_CellToolTipShowing;
            //add to container
            toolStripContainer1.ContentPanel.Controls.Add(listView);
        }
コード例 #21
0
        public MaxPluginForm()
        {
            InitializeComponent();
            this.DoubleBuffered         = true;
            this.StartPosition          = FormStartPosition.Manual;
            this.Location               = new Point(0, 0);
            this.MaximizeBox            = false;
            this.FormBorderStyle        = System.Windows.Forms.FormBorderStyle.FixedDialog;
            openFileDialog.Filter       = "brg files|*.brg|grn files|*.grn";
            saveFileDialog.Filter       = "brg files|*.brg|grn files|*.grn";
            saveFileDialog.AddExtension = false;

            // Update Colors
            uiUp = CuiUpdater.GetInstance();
            mainMenuStrip.Renderer     = new ToolStripMaxPluginRenderer();
            mainStatusStrip.SizingGrip = false;
            mainStatusStrip.BackColor  = uiUp.GetControlColor();
            mainStatusStrip.ForeColor  = uiUp.GetTextColor();

            for (int i = 0; i < mainTabControl.TabPages.Count; i++)
            {
                mainTabControl.TabPages[i].BackColor = uiUp.GetControlColor();
                mainTabControl.TabPages[i].ForeColor = uiUp.GetTextColor();
            }

            // Brg Tab
            brgDataSplitContainer.Panel2MinSize = 350;
            brgObjectsGroupBox.ForeColor        = uiUp.GetTextColor();
            brgImportGroupBox.ForeColor         = uiUp.GetTextColor();
            brgMeshInterpTypeGroupBox.ForeColor = uiUp.GetTextColor();
            attachpointGroupBox.ForeColor       = uiUp.GetTextColor();
            brgMeshFlagsGroupBox.ForeColor      = uiUp.GetTextColor();
            brgMeshFormatGroupBox.ForeColor     = uiUp.GetTextColor();
            brgMeshAnimTypeGroupBox.ForeColor   = uiUp.GetTextColor();
            brgOptionsGroupBox.ForeColor        = uiUp.GetTextColor();
            brgExportGroupBox.ForeColor         = uiUp.GetTextColor();

            brgMeshFlagsCheckedListBox.ItemCheck    += brgMeshFlagsCheckedListBox_ItemCheck;
            brgMeshFlagsCheckedListBox.BackColor     = uiUp.GetEditControlColor();
            brgMeshFlagsCheckedListBox.ForeColor     = uiUp.GetTextColor();
            brgMeshFlagsCheckedListBox.BorderStyle   = BorderStyle.FixedSingle;
            brgMeshFlagsCheckedListBox.MultiColumn   = true;
            brgMeshFlagsCheckedListBox.CheckOnClick  = true;
            brgMeshFlagsCheckedListBox.ColumnWidth   = 150;
            brgMeshFlagsCheckedListBox.DataSource    = Enum.GetValues(typeof(BrgMeshFlag));
            brgMeshFormatCheckedListBox.ItemCheck   += brgMeshFormatCheckedListBox_ItemCheck;
            brgMeshFormatCheckedListBox.BackColor    = uiUp.GetEditControlColor();
            brgMeshFormatCheckedListBox.ForeColor    = uiUp.GetTextColor();
            brgMeshFormatCheckedListBox.BorderStyle  = BorderStyle.FixedSingle;
            brgMeshFormatCheckedListBox.MultiColumn  = true;
            brgMeshFormatCheckedListBox.CheckOnClick = true;
            brgMeshFormatCheckedListBox.ColumnWidth  = 150;
            brgMeshFormatCheckedListBox.DataSource   = Enum.GetValues(typeof(BrgMeshFormat));

            keyframeRadioButton.CheckedChanged          += brgMeshAnimTypeRadioButton_CheckedChanged;
            nonuniRadioButton.CheckedChanged            += brgMeshAnimTypeRadioButton_CheckedChanged;
            skinBoneRadioButton.CheckedChanged          += brgMeshAnimTypeRadioButton_CheckedChanged;
            interpolationTypeCheckBox.CheckStateChanged += brgMeshInterpolationTypeCheckBox_CheckStateChanged;

            // Tree List View Style
            HeaderFormatStyle treelistviewstyle = new HeaderFormatStyle();

            treelistviewstyle.SetBackColor(uiUp.GetControlColor());
            treelistviewstyle.SetForeColor(uiUp.GetTextColor());
            treelistviewstyle.Normal.FrameColor = uiUp.GetButtonLightShadow();
            treelistviewstyle.Normal.FrameWidth = 1;
            treelistviewstyle.Hot.BackColor     = uiUp.GetEditControlColor();
            treelistviewstyle.Hot.FrameColor    = uiUp.GetButtonLightShadow();
            treelistviewstyle.Hot.FrameWidth    = 1;

            // Brg Objects View
            this.brgObjectsTreeListView.MouseEnter             += TreeListView_MouseEnter;
            this.brgObjectsTreeListView.SelectedIndexChanged   += brgObjectsTreeListView_SelectionChanged;
            this.brgObjectsTreeListView.OwnerDraw               = true;
            this.brgObjectsTreeListView.RowHeight               = 10;
            this.brgObjectsTreeListView.BorderStyle             = BorderStyle.FixedSingle;
            this.brgObjectsTreeListView.OverlayText.BorderColor = uiUp.GetButtonDarkShadow();
            this.brgObjectsTreeListView.OverlayText.BorderWidth = 2;
            this.brgObjectsTreeListView.BackColor               = uiUp.GetEditControlColor();
            this.brgObjectsTreeListView.ForeColor               = uiUp.GetTextColor();
            this.brgObjectsTreeListView.HeaderFormatStyle       = treelistviewstyle;
            this.brgObjectsTreeListView.FullRowSelect           = true;
            this.brgObjectsTreeListView.HideSelection           = false;
            this.brgObjectsTreeListView.CanExpandGetter         = delegate(object rowObject)
            {
                if (rowObject is BrgMesh)
                {
                    return(((BrgMesh)rowObject).MeshAnimations.Count > 0);
                }

                return(false);
            };
            this.brgObjectsTreeListView.ChildrenGetter = delegate(object rowObject)
            {
                if (rowObject is BrgMesh)
                {
                    return(((BrgMesh)rowObject).MeshAnimations);
                }

                return(null);
            };
            OLVColumn nameCol = new OLVColumn("Name", "Name");

            nameCol.Width = 675;
            this.brgObjectsTreeListView.Columns.Add(nameCol);


            // Attachpoints
            attachpointListBox.MouseDoubleClick += attachpointListBox_MouseDoubleClick;
            attachpointListBox.BackColor         = uiUp.GetEditControlColor();
            attachpointListBox.ForeColor         = uiUp.GetTextColor();
            string[] atpts = new string[55];
            Array.Copy(BrgAttachpoint.AttachpointNames, atpts, 55);
            Array.Sort(atpts);
            attachpointListBox.DataSource = atpts;

            // Materials
            extractMatButton.FlatStyle               = FlatStyle.Flat;
            extractMatButton.BackColor               = uiUp.GetEditControlColor();
            extractMatButton.ForeColor               = uiUp.GetTextColor();
            extractMatButton2.FlatStyle              = FlatStyle.Flat;
            extractMatButton2.BackColor              = uiUp.GetEditControlColor();
            extractMatButton2.ForeColor              = uiUp.GetTextColor();
            materialGroupBox.BackColor               = uiUp.GetControlColor();
            materialGroupBox.ForeColor               = uiUp.GetTextColor();
            diffuseMaxTextBox.BackColor              = uiUp.GetEditControlColor();
            diffuseMaxTextBox.ForeColor              = uiUp.GetTextColor();
            ambientMaxTextBox.BackColor              = uiUp.GetEditControlColor();
            ambientMaxTextBox.ForeColor              = uiUp.GetTextColor();
            specularMaxTextBox.BackColor             = uiUp.GetEditControlColor();
            specularMaxTextBox.ForeColor             = uiUp.GetTextColor();
            selfIllumMaxTextBox.BackColor            = uiUp.GetEditControlColor();
            selfIllumMaxTextBox.ForeColor            = uiUp.GetTextColor();
            textureMaxTextBox.BackColor              = uiUp.GetEditControlColor();
            textureMaxTextBox.ForeColor              = uiUp.GetTextColor();
            reflectionMaxTextBox.BackColor           = uiUp.GetEditControlColor();
            reflectionMaxTextBox.ForeColor           = uiUp.GetTextColor();
            bumpMapMaxTextBox.BackColor              = uiUp.GetEditControlColor();
            bumpMapMaxTextBox.ForeColor              = uiUp.GetTextColor();
            opacityMaxTextBox.BackColor              = uiUp.GetEditControlColor();
            opacityMaxTextBox.ForeColor              = uiUp.GetTextColor();
            specularLevelMaxTextBox.BackColor        = uiUp.GetEditControlColor();
            specularLevelMaxTextBox.ForeColor        = uiUp.GetTextColor();
            materialFlagsGroupBox.BackColor          = uiUp.GetControlColor();
            materialFlagsGroupBox.ForeColor          = uiUp.GetTextColor();
            materialFlagsCheckedListBox.ItemCheck   += materialFlagsCheckedListBox_ItemCheck;
            materialFlagsCheckedListBox.BackColor    = uiUp.GetEditControlColor();
            materialFlagsCheckedListBox.ForeColor    = uiUp.GetTextColor();
            materialFlagsCheckedListBox.BorderStyle  = BorderStyle.FixedSingle;
            materialFlagsCheckedListBox.MultiColumn  = true;
            materialFlagsCheckedListBox.CheckOnClick = true;
            materialFlagsCheckedListBox.ColumnWidth  = 150;
            materialFlagsCheckedListBox.DataSource   = Enum.GetValues(typeof(BrgMatFlag));

            // Grn Tab
            grnDataSplitContainer.Panel2MinSize = 350;
            grnExportGroupBox.ForeColor         = uiUp.GetTextColor();
            grnObjectsGroupBox.ForeColor        = uiUp.GetTextColor();
            grnPropsGroupBox.ForeColor          = uiUp.GetTextColor();

            grnPropsListBox.BackColor   = uiUp.GetEditControlColor();
            grnPropsListBox.ForeColor   = uiUp.GetTextColor();
            grnPropsListBox.BorderStyle = BorderStyle.None;

            // Grn Tree View
            this.grnObjectsTreeListView.MouseEnter             += TreeListView_MouseEnter;
            this.grnObjectsTreeListView.SelectedIndexChanged   += grnObjectsTreeListView_SelectedIndexChanged;
            this.grnObjectsTreeListView.OwnerDraw               = true;
            this.grnObjectsTreeListView.RowHeight               = 10;
            this.grnObjectsTreeListView.BorderStyle             = BorderStyle.FixedSingle;
            this.grnObjectsTreeListView.OverlayText.BorderColor = uiUp.GetButtonDarkShadow();
            this.grnObjectsTreeListView.OverlayText.BorderWidth = 2;
            this.grnObjectsTreeListView.BackColor               = uiUp.GetEditControlColor();
            this.grnObjectsTreeListView.ForeColor               = uiUp.GetTextColor();
            this.grnObjectsTreeListView.HeaderFormatStyle       = treelistviewstyle;
            this.grnObjectsTreeListView.FullRowSelect           = true;
            this.grnObjectsTreeListView.HideSelection           = false;
            this.grnObjectsTreeListView.CanExpandGetter         = delegate(object rowObject)
            {
                if (rowObject is GrnBone)
                {
                    int rowIndex = grn.File.Bones.IndexOf((GrnBone)rowObject);
                    return(grn.File.Bones.Exists(x => x.ParentIndex == rowIndex));
                }
                else if (rowObject is GrnMaterial)
                {
                    return(((GrnMaterial)rowObject).DiffuseTexture != null);
                }

                return(false);
            };
            this.grnObjectsTreeListView.ChildrenGetter = delegate(object rowObject)
            {
                if (rowObject is GrnBone)
                {
                    int            rowIndex = grn.File.Bones.IndexOf((GrnBone)rowObject);
                    List <GrnBone> bones    = grn.File.Bones.FindAll(x => x.ParentIndex == rowIndex);
                    bones.Remove((GrnBone)rowObject);
                    return(bones);
                }
                else if (rowObject is GrnMaterial)
                {
                    return(new object[] { ((GrnMaterial)rowObject).DiffuseTexture });
                }

                return(null);
            };
            nameCol       = new OLVColumn("Name", "Name");
            nameCol.Width = 675;
            this.grnObjectsTreeListView.Columns.Add(nameCol);
        }
コード例 #22
0
        void UpdateFormCustomizer()
        {
            formCustomizer.setTitleBar(panelControlBox);
            formCustomizer.setTitleLabel(labelWindowTitle);
            formCustomizer.setIcon(pictureBoxWindowicon);
            formCustomizer.setCloseButton(buttonClose);
            formCustomizer.setMaxiButton(buttonMax);
            formCustomizer.setMiniButton(buttonMin);


            splitContainer1.BackColor        = formCustomizer.BorderColor;
            splitContainer1.Panel1.BackColor = formCustomizer.BackColor;
            splitContainer1.Panel2.BackColor = formCustomizer.BackColor;
            splitContainer1.SplitterWidth    = 2;

            splitContainer2.BackColor        = formCustomizer.BorderColor;
            splitContainer2.Panel1.BackColor = formCustomizer.BackColor;
            splitContainer2.Panel2.BackColor = formCustomizer.BackColor;
            splitContainer2.SplitterWidth    = 2;

            panelContent.BackColor                  = formCustomizer.BackColor;
            fOlvSubscriptions.BackColor             = formCustomizer.BackColor;
            fOlvSubscriptions.ForeColor             = Color.WhiteSmoke;
            fOlvSubscriptions.AlternateRowBackColor = formCustomizer.ShadowColor;

            fOlvSubscriptions.SelectedBackColor = formCustomizer.BorderColor;
            fOlvSubscriptions.SelectedForeColor = Color.Black;

            fOlvSpecialOrders.BackColor             = formCustomizer.BackColor;
            fOlvSpecialOrders.ForeColor             = Color.WhiteSmoke;
            fOlvSpecialOrders.AlternateRowBackColor = formCustomizer.ShadowColor;

            fOlvSpecialOrders.SelectedBackColor = formCustomizer.BorderColor;
            fOlvSpecialOrders.SelectedForeColor = Color.Black;


            fOlvSubPosting.BackColor             = formCustomizer.BackColor;
            fOlvSubPosting.ForeColor             = Color.WhiteSmoke;
            fOlvSubPosting.AlternateRowBackColor = formCustomizer.ShadowColor;

            fOlvSubPosting.SelectedBackColor = formCustomizer.BorderColor;
            fOlvSubPosting.SelectedForeColor = Color.Black;

            foreach (OLVColumn item in fOlvSubscriptions.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(formCustomizer.BackColor);
                headerstyle.SetForeColor(Color.WhiteSmoke);
                item.HeaderFormatStyle = headerstyle;
            }
            foreach (OLVColumn item in fOlvSpecialOrders.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(formCustomizer.BackColor);
                headerstyle.SetForeColor(Color.WhiteSmoke);
                item.HeaderFormatStyle = headerstyle;
            }

            foreach (OLVColumn item in fOlvSubPosting.Columns)
            {
                var headerstyle = new HeaderFormatStyle();
                headerstyle.SetBackColor(formCustomizer.BackColor);
                headerstyle.SetForeColor(Color.WhiteSmoke);
                item.HeaderFormatStyle = headerstyle;
            }
        }