DevExpress Ribbon怎么屏蔽customize fences汉化quick access toolbar和rec

【转rarnu】实现Ribbon风格的窗体
随着office2007的兴起,微软让我们看到了Ribbon风格的窗体,现在很多软件也都开始使用Ribbon风格。
那么我们如果要自己开发,应当怎么做呢?本文就是为大家解开这个疑团的。
首先,Delphi本身并没有Ribbon风格的窗口可以直接拿来使用,而市面上很多类似于Ribbon的风格都是用截图法做出来的,那样做很麻烦,而且对于图片的控制要求非常高。这样无疑是增加了软件的成本,这里介绍的方法是使用第三方控件,DevExpress
Bar 6 来完成Ribbon风格的界面。
首先下载并安装DevExpress Bar
6,注意必须是6,以往的版本没有Ribbon风格,然后将它安装到Delphi2007中。接下来就能够开始进入正题了。
一、拖放必要的控件
  这些控件都是Ribbon必备的,将它们都拖到窗体上。
  拖上后的界面如图所示,可以看到,Ribbon的Tab已经显示出来了,但还不是我们要的效果。接下来,继续设置控件的属性。
  设置dxRibbon的BarManager属性为DxBarManager控件,设置dxRibbonPopupMenu的Ribbon属性为dxRibbon控件。双击dxBarManager控件,然后新建一个ToolBar。
  然后在Object
Inspector中会多出一个ToolBar,名称为dxBarManager1Bar1。设置dxRibbon的QuickAccessToolBar.ToolBar属性为dxBarManager1Bar1,马上可以看到,ApplicationMenu已经显示出来了。
  右键点击ApplicationMenu右边的小箭头,添加几个Button。然后再双击dxBarManager,添加ToolBar,在dxRibbon上点击右键,选择Tabs
Editor,在弹出的窗口中选中Tab。双击Groups属性,添加一个Group,然后将新增的ToolBar关联到Group中。得到的程序界面如图所示
  现在运行一下程序,看看效果
  大致已经看得到效果了,不过和office2007还有一点不同,我们得把标题栏去掉,让标题栏的文字显示在Ribbon中。这个地方需要一个小技巧。按F12切换到代码视图,在uses下添加
dxRibbonForm的引用,把窗体的基类从TForm修改为TDxRibbonForm。把dxRibbon控件的SupportNonClientDrawing属性设为True。再次运行程序。
  现在看到的效果就是Ribbon了,但是ApplicationMenu点下去还是没有东西,我们要在ApplicationMenu下加一个菜单。双击dxBarApplicationMenu控件的ItemLinks属性,在屏幕左上方会发现一个小窗口,这个窗体就是用来做ApplicationMenu的,向里面添加按钮和组即可。
  dxRibbon属性ApplicationButton下的Menu设置为ApplicationMenu,即可。
  再次运行程序,点击左上角的圆形图案,即可看到ApplicationMenu,我们的Ribbon窗体制作也到此结束了。
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Deploying a Customized Ribbon and Quick Access Toolbar in Office 2010
Expand the table of content
Deploying a Customized Ribbon and Quick Access Toolbar in Office 2010
Office 2010
Summary: Deploying a customized Ribbon and Quick Access Toolbar is an often requested action for developers and administrators. Learn how to deploy a customized Microsoft Office UI to users, place the file at a particular location, and restrict further customizations. (8 printed pages)
Last modified:
April 24, 2015
Applies to:
Excel 2010 | Office 2007 | Office 2010 | Open XML | PowerPoint 2010 | SharePoint Server 2010 | VBA | Word 2010
Published:
November 2009
Provided by:
Melissa Kerr, Microsoft Corporation
The Microsoft Office Fluent User Interface (UI) includes the Ribbon and the Quick Access Toolbar. These items are customized by using XML to define the components of the UI and with programming code, also known as callback procedures, to give the components their functionality. Customizing the UI is simply a matter of updating the XML and, optionally, updating or adding new callback procedures.
You can add the updated XML to a single program file by modifying the Microsoft Office Open XML file. This is completed by opening the file as a Zip package, inserting a part that contains the XML, and then updating the relationship part so that it is recognized as part of the package. You can also add the updated XML to the Office 2010 application so that the customized UI is available in any file opened in the application. You can do this by creating a COM add-in that loads when the application starts.
You can also customize the UI by placing an *.officeUI file in a specific location on a user’s computer. Then, the next time that the user starts the application, the customized UI is displayed.
This article provides an example of a customization file and how it is deployed to a group of users. It also demonstrates how you can restrict further customization to the UI files after deployment.
Assume that you have customized the UI in your Office 2010 application. What if you want the customized UI to be distributed to a wide range of users? How do you do this? When you customize the UI in a particular application, Office 2010 creates an *.officeUI file for that application that contains the customization XML. With this understanding, you can do one of the following.
Modify an existing *.officeUI file with the desired customizations by updating the XML code.
Create the desired customizations by using the Customization dialog in the Microsoft Office application, apply the customizations, and then browse to the *.officeUI file.
If you reset the UI customizations to the default, the *.officeUI file is replaced.
When the *.officeUI file is available, you can then use a script to load the file onto the user’s computer upon log in. An example of this kind of script is presented later in this article.
Any customizations to the Ribbon UI or Quick Access Toolbar are removed when the new *.officeUI file is loaded.
The value of the "*" depends on the particular Office 2010 application as seen in the following table.
Table 1. Information about *.officeUI files
Application
Description Of .Ribbon File
.officeUI File Name
Outlook 2010
Outlook Explorer
olkexplorer.officeUI
Outlook 2010
olkaddritem.officeUI
Outlook 2010
Appointment/Meeting (organizer on compose, organizer after compose, attendee)
olkapptitem.officeUI
Outlook 2010
Contact Group (formerly known as Distribution List)
olkdlstitem.officeUI
Outlook 2010
Journal Item
olklogitem.officeUI
Outlook 2010
Mail Compose
olkmailitem.officeUI
Outlook 2010
olkmailread.officeUI
Outlook 2010
Multimedia Message Compose
olkmmsedit.officeUI
Outlook 2010
Multimedia Message Read
olkmmsread.officeUI
Outlook 2010
Received Meeting Request
olkmreqread.officeUI
Outlook 2010
Forward Meeting Request
olkmreqsend.officeUI
Outlook 2010
Post Item Compose
olkpostitem.officeUI
Outlook 2010
Post Item Read
olkpostread.officeUI
Outlook 2010
olkreportitem.officeUI
Outlook 2010
Send Again Item
olkresenditem.officeUI
Outlook 2010
Counter Response to a Meeting Request
olkrespcounter.officeUI
Outlook 2010
Received Meeting Response
olkresponseread.officeUI
Outlook 2010
Edit Meeting Response
olkresponsesend.officeUI
Outlook 2010
olkrssitem.officeUI
Outlook 2010
Sharing Item Compose
olkshareitem.officeUI
Outlook 2010
Sharing Item Read
olkshareread.officeUI
Outlook 2010
Text Message Compose
olksmsedit.officeUI
Outlook 2010
Text Message Read
olksmsread.officeUI
Outlook 2010
Task Item (Task/Task Request, etc.)
olktaskitem.officeUI
Access 2010
Access Ribbon
Access.officeUI
Excel 2010
Excel Ribbon
Excel.officeUI
InfoPath 2010
InfoPath Designer Ribbon
IPDesigner.officeUI
InfoPath 2010
InfoPath Editor Ribbon
IPEditor.officeUI
OneNote 2010
OneNote Ribbon
OneNote.officeUI
PowerPoint
PowerPoint Ribbon
PowerPoint.officeUI
Project 2010
Project Ribbon
MSProject.officeUI
Publisher 2010
Publisher Ribbon
Publisher.officeUI
*SharePoint 2010
SharePoint Workspaces Ribbon
GrooveLB.officeUI
*SharePoint 2010
SharePoint Workspaces Ribbon
GrooveWE.officeUI
SharePoint Designer 2010
SharePoint Designer Ribbon
spdesign.officeUI
Visio 2010
Visio Ribbon
Visio.officeUI
Word Ribbon
Word.officeUI
The product name is SharePoint Workspaces but the file name is still GrooveLB.officeUI or GrooveWE.officeUI.
You can follow these steps in Office 2010 to customize the UI and create an *.officeUI file.
On the File tab, click Options, and then click Customize Ribbon to open the Ribbon customization dialog.
On the File tab, click Options, and then click Quick Access Toolbar to open the Quick Access Toolbar customization dialog.
You can also export your Ribbon and Quick Access Toolbar customizations into a file that you can then use to on other computers.
On the File tab, click Options, click Customize Ribbon or Quick Access Toolbar.
Create your customizations, click Import/Export, and then click Export all customizations.
You can use the *.exportedUI file to create the same customizations on another computer by importing the file.
On the File tab, click Options, click Customize Ribbon or Quick Access Toolbar.
Click Import/Export, and then click Import customization file. Navigate to the *.exportedUI you created previously.
The following listing is an example of an *.exportedUI customization file for Microsoft Excel.
The difference between the *.exportedUI and the *.officeUI files is that a metadata tag (&mso:cmd&) is added to the *.exportedUI
file. If an *.exportedUI file is incorrectly identified and is placed in the \AppData\ directory as an *.officeUI file, then the file would fail to parse and not apply any customizations.
&mso:customUI xmlns:mso="/office/2009/07/customui"&
&mso:ribbon&
&mso:qat/&
&mso:tabs&
&mso:tab idQ="mso:TabHome" visible="false"/&
&mso:tab id="mso_c1.23401CCC" label="My Favourites" insertBeforeQ="mso:TabInsert"&
&mso:group id="mso_c2.23401CCC" label="File tab" imageMso="ViewFullScreenView" highDensityLayout="true"&
&mso:control idQ="mso:FileSendAsAttachment" visible="true"/&
&mso:control idQ="mso:AccessibilityChecker" visible="true"/&
&mso:control idQ="mso:FileOpenRecentFile" visible="true"/&
&/mso:group&
&mso:group id="mso_c3." label="Alignment" imageMso="LeftArrow2" autoScale="true"&
&mso:control idQ="mso:AlignTopExcel" visible="true"/&
&mso:control idQ="mso:AlignMiddleExcel" visible="true"/&
&mso:control idQ="mso:AlignBottomExcel" visible="true"/&
&mso:control idQ="mso:WrapText" visible="true"/&
&mso:control idQ="mso:BorderDoubleBottom" visible="true"/&
&mso:control idQ="mso:BorderThickOutside" visible="true"/&
&/mso:group&
&mso:group id="mso_c4.2341A4DF" label="Workbook" imageMso="TableSelect" autoScale="true"&
&mso:control idQ="mso:SortCustomExcel" visible="true"/&
&mso:control idQ="mso:ConditionalFormattingHighlightTextContaining" visible="true"/&
&mso:gallery idQ="mso:ConditionalFormattingColorScalesGallery" showInRibbon="false" visible="true"/&
&mso:control idQ="mso:SheetColumnsDelete" visible="true"/&
&mso:control idQ="mso:SheetRowsDelete" visible="true"/&
&mso:control idQ="mso:FormatCellsNumberDialog" visible="true"/&
&/mso:group&
&mso:group id="mso_c5.2342E20D" label="Charts" imageMso="Chart3DColumnChart" highDensityLayout="true"&
&mso:gallery idQ="mso:ChartTypeColumnInsertGallery" showInRibbon="false" visible="true"/&
&mso:gallery idQ="mso:ChartTypeLineInsertGallery" showInRibbon="false" visible="true"/&
&mso:control idQ="mso:InsertLineSparkline" visible="true"/&
&mso:control idQ="mso:InsertColumnSparkline" visible="true"/&
&mso:control idQ="mso:InsertWinLossSparkline" visible="true"/&
&/mso:group&
&mso:group id="mso_c6." label="Other" imageMso="TagMarkComplete" autoScale="true"&
&mso:control idQ="mso:PrintAreaSetPrintArea" visible="true"/&
&mso:control idQ="mso:CalculateSheet" visible="true"/&
&mso:control idQ="mso:RefreshAll" visible="true"/&
&mso:control idQ="mso:Spelling" visible="true"/&
&mso:gallery idQ="mso:ViewFreezePanesGallery" showInRibbon="false" visible="true"/&
&/mso:group&
&mso:group id="mso_c1.234A023A" label="Review" imageMso="Delete" autoScale="true"&
&mso:control idQ="mso:ReviewNewComment" visible="true"/&
&mso:control idQ="mso:ReviewDeleteComment" visible="true"/&
&mso:control idQ="mso:ReviewPreviousComment" visible="true"/&
&mso:control idQ="mso:ReviewNextComment" visible="true"/&
&/mso:group&
&mso:group id="mso_c2.234A3E6F" label="Macros" imageMso="ResultsPaneStartFindAndReplace" highDensityLayout="true"&
&mso:control idQ="mso:PlayMacro" visible="true"/&
&mso:control idQ="mso:MacroRecord" visible="true"/&
&/mso:group&
&/mso:tab&
&mso:tab idQ="mso:TabInsert" visible="false"/&
&mso:tab idQ="mso:TabPageLayoutExcel" visible="false"/&
&mso:tab idQ="mso:TabFormulas" visible="false"/&
&mso:tab idQ="mso:TabData" visible="false"/&
&mso:tab idQ="mso:TabReview" visible="false"/&
&mso:tab idQ="mso:TabView" visible="false"/&
&mso:tab idQ="mso:TabAddIns" visible="false"/&
&mso:tab idQ="mso:TabBackgroundRemoval" visible="false"/&
&/mso:tabs&
&/mso:ribbon&
&/mso:customUI&
The XML code adds custom tabs with various controls. It also hides several built-in tabs.
As stated previously, you can use operating system scripts to place the *.officeUI file onto the user’s computer. These scripts are run when the user logs on to her computer. The exact location of the file depends on whether the policy regkey is set on the user’s computer. The *.officeUI file is located at one of the following locations.
Roaming Registry key is not set:
%LocalAppData%\Microsoft\Office\*.officeUI
Roaming Registry key is set:
%AppData%\Microsoft\Office\*.officeUI
You can find more information on configuring roaming user profiles in the article .
The following code is an example of a script to copy .officeUI files.
A basic script to copy .officeUI files from a network share into the user's local AppData directory, if no .officeUI file currently exists there.
Can easily be modified to use the roaming AppData directory (replace %localappdata% with %appdata%) or to include additional ribbon customizations.
set userdir=%localappdata%\Microsoft\Office
set remotedir=\\MyServer\LogonFiles\public\OfficeUI
for %%r in (Word Excel PowerPoint) do if not exist %userdir%\%%r.officeUI cp %remotedir%\%%r.officeUI %userdir%\%%r.officeUI
During deployment of the *.officeUI customization file, you can also use administrative policies to further restrict customization of the UI. The following table summarizes the administrative policies that you can set for UI customizations.
Table 2. Administrative Policies for UI customization
Description
New for Office 2010 or Existing Policy
Affects Ribbon or Quick Access Toolbar
Turn off user customizations via UI
This policy setting prevents users from customizing both the Quick Access Toolbar and Ribbon through the user interface (UI).
This policy setting does not affect existing customizations that load when the application starts, or load when an associated document or template is opened.
If you enable this policy setting, the following UI entry points are turned off: the Quick Access Toolbar and Ribbon tabs in the application's Office Center dialog box, and the Quick Access Toolbar and Ribbon customization options on the right-click menu on the Ribbon.
If you disable or do not configure this policy setting, users can customize the Quick Access Toolbar and Ribbon through both the application’s Office Center dialog box, and the right-click menu on the Ribbon.
Turn off all user customizations
This policy setting prevents users from making any Quick Access Toolbar and the Ribbon customizations. This includes customizations made through user interface (UI) entry points, or loaded from documents or templates. Existing customization files do not load when the application starts.
If you enable this policy setting, users cannot customize the Quick Access Toolbar and Ribbon through either the Quick Access Toolbar and Ribbon tabs in the application's Office Center dialog box, or the right-click menu on the Ribbon. In addition, Quick Access Toolbar and Ribbon customizations originating from documents or templates are not loaded when these documents are opened. In addition, existing customization files (*.officeUI) are not loaded when the application starts. Users will be unable to Import a Customization file (*.exportedUI).
If you disable or do not configure this policy setting, users can make Quick Access Toolbar and Ribbon customizations through the UI and load them from documents and templates, or customization files.
Disable UI extending from documents and templates
This policy setting controls whether Office 2010 applications load any custom user interface (UI) code included with a document or template. The Office 2010 release enables you to extend the UI with customization code that is included in a document or template.
If you enable this policy setting, Office 2010 applications cannot load any UI customization code included with documents and templates.
If you disable or do not configure this policy setting, Office 2010 applications load any UI customization code included with a document or template when you open it.
Not applicable
Allow roaming of all user customizations
This policy setting allows roaming of both the Quick Access Toolbar and Ribbon customizations.
If you enable this policy setting, users' Quick Access Toolbar and Ribbon customizations will be available to them on any computer on their network when they log on.
If you disable or do not configure this policy setting, users' Quick Access Toolbar and Ribbon customizations will only be available to them on the computer on which they made the customizations.
You can follow these steps to set or clear the administrative policies related to the Microsoft Office Fluent User Interface.
Open the Group Policy Management Console. Right-click the Group Policy object that you want to edit and then click Edit.
In the console tree, under User Configuration, expand Administrative Templates.
Click Classic Administrative Templates, Microsoft Office 2010 system, Global Options, and then click Customize.
Customizations to the Microsoft Office Fluent UI are saved by Office 2010 in a file that has the extension *.officeUI. You can deploy these files to users by using operating scripts which are run when the user logs on to his or her computer. The location of the file is determined by whether the policy regkey is on the user’s profile. You can restrict further customizations of the deployed UI by setting administrative policies.
For more information about the topics discussed in this article, see the following resources:
Was this page helpful?
Your feedback about this content is important.Let us know what you think.
Additional feedback?
1500 characters remaining
Thank you!
We appreciate your feedback.  摘要:阐述DevExpress VCL控件在C++ Builder下的安装、编译及使用。通过采用该控件中强大的Grid" />
免费阅读期刊
论文发表、论文指导
周一至周五
9:00&22:00
C++ Builder中采用DevExpressVCL控件开发浅析
&&&&&&本期共收录文章20篇
  摘要:阐述DevExpress VCL控件在C++ Builder下的安装、编译及使用。通过采用该控件中强大的Grid组件,实现数据库开发中复杂表单的设计,采用Ribbon组件,实现最新的Office Ribbon界面,增强开发软件的用户操作性。 中国论文网 /8/view-6015695.htm  关键词:C++ Builder;DevExpress;Ribbon;Grid   中图分类号:TP311 文献标识码:A 文章编号:(2-07   在Windows平台Win32软件开发领域,由于Microsoft的大力推广及不断更新,Visual Studio系列可以说是目前最为流行的开发平台。当然,任何领域都不可能只有一家独大,在软件开发工具的进化历史长河中,有家公司一直与Microsoft竞争,那就是Borland软件公司。但随着Microsoft在Visual Studio系列上的逐渐发力,Borland的竞争逐渐处于下风,最终将开发工具业务出售给现在的Embarcadero,Embarcadero将Delphi和C++ Builder等开发工具放在一起称为RAD Studio。近几年,虽然Embarcadero不断推陈出新,几乎每年升级RAD Studio,无奈市场占有率不断下降,但这并不能否定目前最新版本的RAD Studio XE6是非常优秀的开发工具。   笔者从Delphi 5.0时代开始,一直使用C++ Builder 作为主要开发工具,现在使用的版本是C++ Builder 2010。RAD Studio从2009版本开始,几乎每年一升级,经历了2010、XE、XE2、XE3、XE4,直到目前最新的XE6,最新版本支持原生Android移动平台开发,有很大发展前景。由于目前我的工作基本上只用到Windows平台,所以一直使用的是2010版本。   在Delphi和C++ Builder开发领域,有一款重量级的开发控件,那就是DevExpress公司开发的用于Delphi与C++ Builder的DevExpress VCL Controls。这套控件功能十分强大,涵盖了界面设计、数据表单等方方面面。由于功能的强大,也造成这套控件的使用也非常复杂,该文就从这套控件在C++ Builder中的安装开始,对它在开发使用过程中的一些技巧及问题做一阐述。   1 DevExpress VCL Controls的编译与安装   DevExpress VCL Controls的版本更新很快,每当RAD Studio新版本发布,DevExpress都会及时跟进,使自己的控件能够兼容最新的Delphi和C++ Builder。目前官网上最新的版本是13.2,支持C++ Builder 2007至最新的C++ Builder XE6,而我们能够从网上获取到的最新版本为13.1.4。该控件的很多版本分为多种安装格式,最完整的是第三方制作的带源码、实例及帮助的完整版安装程序,只需要一步步安装即可,非常方便;但另外一种是只有源代码、实例,而没有安装程序。这种只有源代码的包安装起来很复杂,因为整个DevExpress VCL包含超过180个控件,将近30个package,需要在C++ Builder中将每个package的源代码编译安装,且有一定的安装顺序。这个编译安装过程相当繁琐,造成每次需要安装DevExpress VCL的过程经常出现问题。   笔者依据近几年开发的经验,参考Delphi的dcc32编译器的详细使用帮助,采用命令行编译的方式,将每个package用dcc32进行命令行编译,代码格式如下:   dcc32.exe "..\..\ExpressCore Library\Packages\dxCoreRS14.dpk" -JL -B -U"..\..\ExpressCore Library\Sources;..\..\Library\RS14" -R"..\..\ExpressCore Library\Sources" -N"." -LE"." -LN"." -NH"." -NO"."   这条编译命令中所用到的参数说明:   -JL = 生成C++需要的 .lib,.bpi以及所有的.hpp文件   -B = 编译所有单元文件   -U = 单元文件所在目录   -R = 资源文件所在目录(dcr等文件)   -LE = .bpl文件输出目录   -LN = .dcp文件输出目录   -NH = .hpp文件输出目录   -NO = .obj文件输出目录   其中所有的输出文件指定的目录都是“.”,表示该批处理文件运行时所在的目录,方便最后C++ Builder进行开发时,搜索需要的各种文件。   这是单个dpk文件的编译命令,将所有的dpk文件编译命令生成一个批处理,就可以通过运行该批处理文件,一次性将所有的dpk文件编译完成。在批处理中,由于各个dpk之间的相互依赖关系,有一定的先后顺序,经过测试,确定了整个DevExpress VCL控件编译的顺序,保证所有控件都能正常编译,生成的批处理文件如图1所示:   将下载获取的DevExpress VCL控件源码包解压,复制到自己想要存放的目录,笔者参考自动安装程序的目录,存放到Program Files(x86)\DevExpress VCL,并且在该目录下创建Library\RS14,用于RAD Studio 2010版本的编译后的文件存放,这样方便识别,如果想要编译其他版本,就创建RS15等等其他目录。将我自己创建的批处理文件manuinstallRS14.bat复制到RS14,以管理员身份运行command命令,执行该批处理,稍等片刻,所有的控件就编译好了,文件都生成在RS14目录。
  运行C++ Builder 2010,进入Install Packages,添加编译生成的所有以dcl开头的bpl控件,这是设计时控件,这样DevExpress VCL就全部安装完成,可以在C++ Builder中看到这些控件。后面还要在Options中设置软件开发中使用这些控件的编译路径,这个一般程序员都应该清楚,就不多说了。   2 DevExpress VCL中Ribbon控件的使用   DevExpress VCL这套控件包中有超过180个控件,几乎涵盖了软件开发过程中界面设计的方方面面,可以说,有了这套控件,基本上可以不需要安装其他第三方控件。其中的Ribbon控件就是用于开发Ribbon界面的有力工具,Microsoft自从2007年发布Office2007后,其标志性的Office Ribbon界面目前已成为流行软件开发的标准UI,现在许多软件的操作界面都采用Ribbon,包括现在最新的Win8/Win8.1系统,很多地方都已经集成Ribbon操作。RAD Studio从2009版本开始也自带了Ribbon控件,但是自带的这个控件使用起来很麻烦,而且功能不强,比起DevExpress VCL中的Ribbon控件有很大的差距。下面以笔者自己写的几个软件为例,简单介绍一下Ribbon控件的开发使用。   Ribbon控件位于ExpressBars分类中,名称显示为TdxRibbon,TdxRibbon要与TdxBarManager配合使用,先将一个TdxBarManager放置于Form上,然后放置TdxRibbon,TdxRibbon会自动与TdxBarManager关联,缺省情况下,Ribbon栏只有一个Tab,且是Office 2007 Ribbon的风格,一般与Ribbon相配合的还有一个TdxRibbonStatusBar,也放在Form上即可。很简单的三步,一个Ribbon界面的Form即设计好了。在缺省的Tab上面点击右键,就会弹出右键菜单,可以增加或者删除Tab,可以增加Group。每个Tab就是Ribbon栏上一个选项卡,每个选项卡下面可以增加多个Group,在Group中创建各种工具按钮。如下图所示,就是一个简单的Ribbon空界面。在Ribbon控件的属性设置中,有个Style属性,可以设置Office 、2013这三种风格。的设置还不一样,我们选择2010即可。在现在这个阶段,Ribbon界面左边的那个File菜单还没有出现,对于2010的风格,我们需要放置TdxRibbonBackstageView控件,将TdxRibbon属性中ApplicationButton下Menu关联至TdxRibbonBackstageView,Text属性中输入菜单显示的文字,比如File,同时,在TdxBarManager中创建一个ToolBar,将TdxRibbon的QuickAccessToolbar属性下的Toobar属性关联至这个新创建的Toolbar,这样,Ribbon的菜单就出来了。运行一下这个程序,就可以看到如图2的界面了。   这时候,你会发现一个小小的问题,那就是Windows系统自己的标题栏还是存在的,而真正的Ribbon界面程序,是没有这个标题栏的。这个问题笔者是参考Devexpress提供的demo解决的,首先将TdxRibbon的SurpportNonClientDrawing属性设为true,然后修改该Form创建的基类。即将BCB缺省创建的基类class TForm1 : public TForm,修改为class TForm1 : public TdxCustomRibbonForm,重新编译运行,是不是成功了?   由于Ribbon栏上面众多的Group,每个Group中又有众多的按钮,所以,需要我们在TdxBarManaager控件中详细分类设置好每个Tab,每个Group中对应的按钮,这是个细活,不能着急。以上就是TdxRibbon控件的关键几个问题,注意这几个问题,整个Ribbon界面就搭建好了,其他的Tab栏上面各种按钮控件一个个试用一下即可掌握使用方法。   3 DevExpress VCL中TcxGrid控件的使用   用到DevExpress VCL的控件,我们就不得不提到其中的TcxGrid控件,笔者最初就是从使用这个强大的Grid表格控件开始的。   3.1 TcxGrid基础应用   使用TcxGrid控件创建一个表格应用很简单,首先设置好连接数据库的各种控件,根据连接方式的不同,有不同的设置方法,比如,笔者使用的是ADO连接SQL Server,这也是数据库开发常用的一种方式,设置好TADOQuery和TDataSource控件,将TcxGrid放置在Form上,TcxGrid控件中有两个概念需要理清:Level和View。Level相当于TcxGrid自带的PageControl控件,每个Level下链接一个View,这个View就是具体的表格。图3就是基础的TcxGrid形态。   3.2 TcxGrid分组统计功能   TcxGrid自带很多强大的功能,比如汇总、分组查询,可以得到强大的统计功能。图4显示的是以“发货日期”为一级分组,“市县”为二级分组,这样就能显示某一天中,某个县详细的学校清单,县一级有合计,当天那一级也有合计,非常清楚明晰。   4 结束语   采用Devexpress的控件解决方案,极大地提高了软件开发的效率,降低系统维护的复杂性,也同时降低了投资成本和后期管理成本,具有很高的实用性。该文主要针对支持Delphi与C++ Builder的VCL控件进行介绍,Devexpress的控件,尤其是TcxGrid还有深入的开发方法,需要更深层次的使用与挖掘。   参考文献:   [1] 陈宽达. C++ Builder深度历险[M]. 上海:华中科技大学出版社,2002.   [2] Satya Sai Kolachina.C++Builder6 Developer’s Guide[M]. Wordware Publishing, Inc,2003.
转载请注明来源。原文地址:
【xzbu】郑重声明:本网站资源、信息来源于网络,完全免费共享,仅供学习和研究使用,版权和著作权归原作者所有,如有不愿意被转载的情况,请通知我们删除已转载的信息。
xzbu发布此信息目的在于传播更多信息,与本网站立场无关。xzbu不保证该信息(包括但不限于文字、数据及图表)准确性、真实性、完整性等。}

我要回帖

更多关于 quick access toolbar 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信