Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / RibbonSimple / ReadMe.txt
1 SimpleRibbon Example\r
2 ====================\r
3 This project demonstrates how to add a ribbon to a simple window. The \r
4 application uses TRACE to send text to the output window when a ribbon button\r
5 is pressed. It also detects changes to the ribbon height and adjusts the \r
6 view window accordingly.\r
7 \r
8 The ribbon buttons are defined in the Ribbon.xml. This file must be compiled \r
9 using uuic. To compile Ribbon.xml, add it to the set of files to be compiled,\r
10 and modify its properties, specifying the "Custom Build Step" parameters as\r
11 described below.\r
12 \r
13 Prerequisites:\r
14 ==============\r
15 1. Windows 7 operating system\r
16 2. Microsoft Windows SDK v7.0 \r
17 3. Visual Studio 2005, 2008 or 2010 (full or Express Edition)\r
18 \r
19 Compiling Instructions\r
20 ======================\r
21 To compile Ribbon.xml, specify it's custom build properties as follows:\r
22 \r
23 Command Line  uicc.exe ..\src\Ribbon.xml ..\src\Ribbon.bml /header:..\src\RibbonUI.h /res:..\src\RibbonUI.rc\r
24 Outputs       Ribbon.bml;RibbonUI.rc;RibbonUI.h \r
25 \r
26 Note: Ensure that the following VC++ Directories are configured:\r
27 Executables directory:  C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\r
28 Include directory:              C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\r
29 \r
30 \r
31 How it works\r
32 ============\r
33 Microsoft's RibbonUI framework uses COM to implement the ribbon. The COM \r
34 interfaces involved are IUIApplication and IUICommandHandler. The Win32++ \r
35 CRibbon class inherits from both IUIApplication and IUICommandHandler. \r
36 \r
37 To add a ribbon to a simple window, inherit CView from both CWnd and CRibbon. We\r
38 also need to add the Ribbon.xml file containing the definitions for our ribbon\r
39 to the project. To create and interact with the ribbon, we override the relevant\r
40 functions from both IUIApplication and IUICommandHandler.\r
41 \r
42 The functions you may wish to override are:\r
43 IUIApplication::OnCreateUICommand \r
44   Called for each Command specified in the Ribbon markup to bind the Command \r
45   to an IUICommandHandler.  \r
46 IUIApplication::OnDestroyUICommand \r
47   Called for each Command specified in the Ribbon markup when the Ribbon host \r
48   application window is destroyed.  \r
49 IUIApplication::OnViewChanged \r
50   Called when the state of a View changes.\r
51 IUICommandHandler::Execute \r
52   Executes or previews the Commands bound to the Command handler.  \r
53 IUICommandHandler::UpdateProperty\r
54   Sets a property value for a bound Command, for example, setting a Command to \r
55   enabled or disabled depending on the state of a View.\r
56   \r
57 This example demonstratues how to override IUICommandHandler::Execute to respond\r
58 to button clicks on the ribbon.    

UCC git Repository :: git.ucc.asn.au