RibbonBar System Menu |
Post Reply |
Author | |
markp.uk
Groupie Joined: 23 August 2006 Status: Offline Points: 38 |
Post Options
Thanks(0)
Posted: 02 May 2008 at 9:00am |
In the ribbon bar sample you have a system menu with 3 print options in the popup bar, i may be missing something, but how do you set the descriptive text underneath the caption, as show highlighted below.
I have searched the code and image resources and cannot find any mention of this descriptive text. |
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
Hi,
its the description property. in your code put something like: AddButton PopupBar.Controls, xtpControlButton, ID_FILE_QUICKPRINT, "&Quick Print", False _ , "Send the document directly to the default printer without making changes" then have the addbutton function: Private Function AddButton(Controls As CommandBarControls, ControlType As XTPControlType, Id As Long, _ Optional MCaption As String, Optional BeginGroup As Boolean = False, Optional description As String, _ Optional ButtonStyle As XTPButtonStyle = xtpButtonAutomatic) As CommandBarControl Dim Control As CommandBarControl Set Control = Controls.Add(ControlType, Id, MCaption) Control.BeginGroup = BeginGroup Control.DescriptionText = description Control.Style = ButtonStyle Set AddButton = Control End Function hope this will help :) |
|
markp.uk
Groupie Joined: 23 August 2006 Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Cheers, I found it about 10 minutes after i posted the question.
Thanks for the assistance all the same. |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
I need to ask the same question.
Looking at the RibbonSample, when I run it the Print Setup menu has description text underneath of: "Change the printer and printing options". Where is that description text stored???? I can't find it in any of the code. I found the CommandBars Designer (right Click on CommandBars control and select Edit) and under Actions I found a Print Setup item with description as above -- however, when I try changing it and SAVE, it reverts back to its original text. So maybe this is a built-in default item that can't be altered?? |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
Nobody knows the answer ??
|
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
CommandBarControl->DescriptionText
|
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
Thanks. I see how to set my own Description Text for an item I create in code.
But I still cannot see where the Description Text in the Ribbon Sample comes from -- ie. I can see where the control is created in code, but there is no Description Text in any of the code I can see. This remains a mystery, but it is not important. A related question. My Description Text appears nicely in the Popup Menu, and if I pause the mouse over it, that text then also appears in the StatusBar (ID=0). This is sort of nice, but pointless. Is it possible to turn Off the Description Text.visible in the Menu, so you got useful extra text when you pause mouse on Menu, or to have some other property text automatically appear in the StatusBar, eg Tag or ToolTip? Or am I missing the point somehow? |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
It is magic
Actually that text is the default text in the standard MFC Resources. Which is why you can't find it. It is controlled by the ID given to the control. In this case, 57606 or 0xE106. If you want to use your own text then you can just use a different ID or manually set the Description text. If no Description text is found it will use the default MFC string when using this ID. These "special" default MFC resource ID can be found in AFXRES.h, which is a standard MFC file, not a Codejock file. Just some commands from the file (not the ID is in Hexadecimal): // File commands #define ID_FILE_NEW 0xE100 #define ID_FILE_OPEN 0xE101 #define ID_FILE_CLOSE 0xE102 #define ID_FILE_SAVE 0xE103 #define ID_FILE_SAVE_AS 0xE104 #define ID_FILE_PAGE_SETUP 0xE105 #define ID_FILE_PRINT_SETUP 0xE106 #define ID_FILE_PRINT 0xE107 #define ID_FILE_PRINT_DIRECT 0xE108 #define ID_FILE_PRINT_PREVIEW 0xE109 #define ID_FILE_UPDATE 0xE10A #define ID_FILE_SAVE_COPY_AS 0xE10B #define ID_FILE_SEND_MAIL 0xE10C // Edit commands #define ID_EDIT_CLEAR 0xE120 #define ID_EDIT_CLEAR_ALL 0xE121 #define ID_EDIT_COPY 0xE122 #define ID_EDIT_CUT 0xE123 #define ID_EDIT_FIND 0xE124 #define ID_EDIT_PASTE 0xE125 #define ID_EDIT_PASTE_LINK 0xE126 #define ID_EDIT_PASTE_SPECIAL 0xE127 #define ID_EDIT_REPEAT 0xE128 #define ID_EDIT_REPLACE 0xE129 #define ID_EDIT_SELECT_ALL 0xE12A #define ID_EDIT_UNDO 0xE12B #define ID_EDIT_REDO 0xE12C // Window commands #define ID_WINDOW_NEW 0xE130 #define ID_WINDOW_ARRANGE 0xE131 #define ID_WINDOW_CASCADE 0xE132 #define ID_WINDOW_TILE_HORZ 0xE133 #define ID_WINDOW_TILE_VERT 0xE134 #define ID_WINDOW_SPLIT 0xE135 The text for these IDs can be found in MFC42.DLL In short, if you don't like the text or need something different use a different ID from the list above or be sure to set the Description Text. We recommend you use IDs from 100 to 9000 to avoid conflicts like this. These IDs are not reserved in MFC or Codejock sources. But as you can see, they can be useful, so they are an undocumented feature Hope this clears things up. |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
Very useful posting -- thank you very much.
|
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |