How to customize Skin Gallery - Remove / rename skins and groups

1. REMOVE (HIDE) A SPECIFIC SKIN 
Traverse through the gallery group collection, then through its gallery item collection and hide a corresponding item:

private void InitRibbonSkinGallery() {
            SkinHelper.InitSkinGallery(skinGalleryBarItem);
}

string[] skinsToHide = {"Black","Blue","Seven","Sharp" }; // populate with names of unnecessary skins
private void HideSkins(string[] skinsToHide) {
            for(var i = 0; i < skinGalleryBarItem.Gallery.Groups.Count; i++) {
                var group = skinGalleryBarItem.Gallery.Groups[i];
                if(group == null) {
                    continue;
                }
                for(var j = 0; j < group.Items.Count; j++) {
                    var item = group.Items[j];
                    if(item == null) {
                        continue;
                    }
                    foreach(var skin in skinsToHide) {
                        if(String.Equals(item.Caption, skin)) {
                            item.Visible = false;
                        }
                    }
                }
            }
}
Private Sub InitRibbonSkinGallery()
            SkinHelper.InitSkinGallery(skinGalleryBarItem)
End Sub

Private skinsToHide() As String = {"Black","Blue","Seven","Sharp" } ‘populate with names of unnecessary skins
Private Sub HideSkins(ByVal skinsToHide() As String)
            For i = 0 To skinGalleryBarItem.Gallery.Groups.Count - 1
                Dim group = skinGalleryBarItem.Gallery.Groups(i)
                If group Is Nothing Then
                    Continue For
                End If
                For j = 0 To group.Items.Count - 1
                    Dim item = group.Items(j)
                    If item Is Nothing Then
                        Continue For
                    End If
                    For Each skin In skinsToHide
                            If String.Equals(item.Caption, skin) Then
                            item.Visible = False
                        End If
                    Next skin
                Next j
            Next i
End Sub

This is discussed in the How to remove certain skins from the bonus skins collection  ticket.

2. REMOVE  A SPECIFIC SKIN GROUP 
Remove a required group from the collection:

string skinGroup = "Standard Skins";
RemoveSkinGroups(skinGroup);

void RemoveSkinGroups(string skinGroup) {
            skinGalleryBarItem.Gallery.Groups.Remove(skinGalleryBarItem.Gallery.Groups.OfType<GalleryItemGroup>().First(x => String.Equals(x.Caption, skinGroup)));
}
Private skinGroup As String = "Standard Skins"
RemoveSkinGroups(skinGroup)

void RemoveSkinGroups(String skinGroup)
            skinGalleryBarItem.Gallery.Groups.Remove(skinGalleryBarItem.Gallery.Groups.OfType(Of GalleryItemGroup)().First(Function(x) String.Equals(x.Caption, skinGroup)))

This issue is discussed in the How to remove the "Theme Skin" skin group from the In-Ribbon gallery populated with available skins  thread.

3. REMOVE GROUPING 

Fill the In-Ribbon and In-Dropdown gallery with required skins manually. 
To obtain all available skins in your project, use the SkinManager.Skinsproperty. To populate the In-Dropdown gallery, handle theRibbonGalleryBarItem.GalleryInitDropDownGalleryevent:

DevExpress.XtraBars.RibbonGalleryBarItem skinGalleryBarItem;
SkinContainerCollection skins;

void InitSkinGallery() {
            //SkinHelper.InitSkinGallery(skinGalleryBarItem, true);
            skins = SkinManager.Default.Skins;

            for (int i = 0; i < 14; i++) {
                int index = rgbiSkins.Gallery.Groups[0].Items.Add(new GalleryItem());
                GalleryItem item = skinGalleryBarItem.Gallery.Groups[0].Items[index];
                item.Description = skins[index].SkinName;
                item.Image = galleryImageCollection.Images[i];
            }
}

private void skinGalleryBarItem_GalleryInitDropDownGallery(object sender, InplaceGalleryEventArgs e) {
            e.PopupGallery.AllowHoverImages = false;
            e.PopupGallery.ItemClick += new GalleryItemClickEventHandler(PopupGallery_ItemClick);
            for (int i = 0; i < e.PopupGallery.Groups[0].Items.Count; i++) {
                GalleryItem item = e.PopupGallery.Groups[0].Items[i];
                item.Description = skins[i].SkinName;
                item.Caption = skins[i].SkinName;
            }
}
void PopupGallery_ItemClick(object sender, GalleryItemClickEventArgs e) {
            defaultBarAndDockingController1.Controller.LookAndFeel.SkinName = e.Item.Description;
}
Private skinGalleryBarItem As DevExpress.XtraBars.RibbonGalleryBarItem
Private skins As SkinContainerCollection

Private Sub InitSkinGallery()
            ‘SkinHelper.InitSkinGallery(skinGalleryBarItem, true);
            skins = SkinManager.Default.Skins

            For i As Integer = 0 To 13
                Dim index As Integer = rgbiSkins.Gallery.Groups(0).Items.Add(New GalleryItem())
                Dim item As GalleryItem = skinGalleryBarItem.Gallery.Groups(0).Items(index)
                item.Description = skins(index).SkinName
                item.Image = galleryImageCollection.Images(i)
            Next i
End Sub

Private Sub skinGalleryBarItem_GalleryInitDropDownGallery(ByVal sender As Object, ByVal e As InplaceGalleryEventArgs)
            e.PopupGallery.AllowHoverImages = False
            AddHandler e.PopupGallery.ItemClick, AddressOf PopupGallery_ItemClick
            For i As Integer = 0 To e.PopupGallery.Groups(0).Items.Count - 1
                Dim item As GalleryItem = e.PopupGallery.Groups(0).Items(i)
                item.Description = skins(i).SkinName
                item.Caption = skins(i).SkinName
            Next i
End Sub
Private Sub PopupGallery_ItemClick(ByVal sender As Object, ByVal e As GalleryItemClickEventArgs)
            defaultBarAndDockingController1.Controller.LookAndFeel.SkinName = e.Item.Description
End Sub

See Skin Gallery - How to remove skin grouping ticket to learn more.

4. CHANGE A SKIN NAME 
Traverse through the gallery group collection, then through its gallery item collection, obtain a required GalleryItem  and change the GalleryItem.Caption property for this purpose. 
See How to change/remove the DevExpress Style caption from the Skin Menu/Drop-down gallery  for more information.

5. CHANGE A SKIN ICON 

Traverse through the gallery group  collection, then through its gallery item  collection, obtain a required GalleryItem  and set the Image and HoverImage properties. 
See Skin Gallery - How to change a skin icon (image) and name (caption)  for more information.

时间: 2024-10-12 22:02:48

How to customize Skin Gallery - Remove / rename skins and groups的相关文章

link,unlink,remove, rename函数

link函数:创建一个指向现有文件的链接的方法是使用 个人理解为cp命令 #include <unistd.h> int link( const char *existingpath, const char *newpath ); 返回值:若成功返回0,若出错返回-1 此函数创建一个新目录项newpath,它引用现有的文件existingpath.如若newpath已经存在,则返回出错. 只创建newpath中的最后一个分量,路径中的其他部分应当已经存在. 创建新目录项以及增加链接计数应当是个

Use the Profile Manager to create and remove Firefox profiles

Skip to main content Switch language Skip to search Ask a question Sign In English Firefox Editing Tools Learn the Basics: get started Download, install and migration Firefox Sync Customize controls, options and add-ons Privacy and security settings

LAYERSLIDER 5插件源码破解

function lsShowNotice(e, t, n) { var r; if (typeof e == "string") { r = jQuery("#" + e) } else if (typeof e == "object") { r = e } var i, s; switch (t) { case "jquery": i = "multiple jQuery issue"; s = 'It

COC建筑拖动的实现

最近在玩COC,多体验一下手游的体验,因为自己毕竟一直是做页游的,有些观念需要转变一下. 好像偏了,玩了几次之后突然想起COC那个地图拖动的自己之前实现过,那是2010年左右的时候,模拟经营类页游大行其道的时候,我做了个类似的功能. 核心内容应该是通过直线方程确定建筑的位置,想想那时候的自己还是干劲十足的,哪像现在,犹豫踟蹰,徘徊不前,对未来充满迷茫. 特从旧电脑上把相关的几个类拷下来,公布于此,虽然今时今日去看,粗糙得很,有很多需要改进的地方,但是还是觉得有一些学习的意义的. 为了填满全页,主

关于分页SQL的小总结

findPage 和findPageTotal条件分页中的条件 较为复杂点的关联查询 有取别名的 <select id="findPage" resultMap="MinOrderInfo" parameterType="map"> SELECT o.*,w.name buyName,w.MOBILE buyMobile,aa.name sellName,aa.MOBILE sellMobile,rs.CAR_BRAND_NAME c

1、简单程序 &quot;hello,word&quot;

#include<stdio.h> //.h的文件是头文件:stdio 就是指 “standard input & output"(标准输入输出),因此用到标准输入输出函数时,就要包含这个头文件; 头文件定义:1.#include<stdio.h> 2.#include "stdio.h" int main() //有返回值时:数据类型 函数名():如果需要带入变量: 数据类型 函数名(数据类型 变量):没有返回值可以:void 函数名():如

标准库常用包介绍

标准库 https://godoc.org/-/go builtin 包 常量 true,false,iota 函数 len cap close(c chan Type) delete(map,key) make new panic recover 类型 int8 ~ int64 uint8(byte) ~ uint64 uint int  uintptr float32 float64 rune bool error string strings 包 函数 Contains  Index Sp

第四课 文件系统(下)

====================第四课 文件系统(下)==================== 一.sync/fsync/fdatasync------------------------ 1. 大多数磁盘I/O都通过缓冲进行, 写入文件其实只是写入缓冲区,直到缓冲区满, 才将其排入写队列. 2. 延迟写降低了写操作的次数,提高了写操作的效率, 但可能导致磁盘文件与缓冲区数据不同步. 3. sync/fsync/fdatasync用于强制磁盘文件与缓冲区同步. 4. sync将所有被修改

stdio.h和math.h文件内容

下面的头文件来自CodeBlocks 13.12配套的MINGW,主要是为了方便好奇的同学. 第一个文件是stdio.h. EOF在第47行 printf在第294行 FILE在第139行 stdin在第158行 1 /* 2 * stdio.h 3 * This file has no copyright assigned and is placed in the Public Domain. 4 * This file is a part of the mingw-runtime packa