Different kinds of buttons on CToolBar - c++

Give me a tip please how to add different kinds of buttons (I need to have pushbuttons and radio buttons) on the same CToolBar.

You need to use CMFCToolbar::ReplaceButton.
You replace the regular button with either one of the default CMFCToolBarButton derived classed or with one of your own derived class.
The toolbar need to have a "placeholder" button (empty button) at the position you want to replace the button.
for example to replace a toolbar button with a combo box:
CMFCToolBarComboBoxButton myCombo(IDC_BUTTON_TO_REPLACE, GetCmdMgr()->GetCmdImage(IDC_BUTTON_TO_REPLACE, FALSE), CBS_DROPDOWNLIST, 80);
myCombo.m_strText.LoadString(IDS_MY_STRING);
myToolbar.ReplaceButton(IDC_BUTTON_TO_REPLACE, myCombo);
There are a couple of standard "buttons" available (in particular):
CMFCToolBarEditBoxButton to replace a toolbar button with an edit box.
CMFCToolBarDateTimeCtrlImpl to replace a toolbar button with a date picker
CMFCToolBarComboBoxButton to replace a toolbar button with a combo box.
(there are a couple more for menus and one for "outlook" ).
Good luck.

Related

apex5.0, disable button when another button is clicked

How to disable a button in oracle apex if another button is clicked.
I have buttons in a classic report.
btn1: Update
btn2: Delete
btn3: Save
I would like when one of the button is clicked, the others buttons should be disabled.
Pls advise how to do that
What happens when one of the buttons is clicked? Knowing this could provide a better way of doing what you want, such as with a server-side condition.
Not knowing this, you could do it with dynamic actions - on button click of particular button, disable / hide the other buttons (set multiple true actions). You would also want to specify when to reset them.

Replace button on email form in CRM 2011

Please look at the below E-Mail form.
And you can see one button called "Insert Template" highlighted with red color. How can we replace(hide it and add new one) this button with our own custom button like, we can hide the same named button on ribbon through XML...?
That button isn't on the ribbon, it's a part of the rich editor control. There is no supported way to change those buttons that I know, so you'll have to go with some JavaScript as #lazarus suggested.

deactivate an item in the file button "jewel" in crm 2011

is it possible to hide or deactivate a menu item in the file button called also jewel button? I´m able to hide completely the file button with javascript, but I want to hide or disable only some menu items in the flyout menu.
Thank you in advance
You will find these Jewel buttons within the application ribbon. You can choose to hide these buttons in your customizations.xml via some hide HideCustomActions. The names of some of the Jewel buttons you will find are:
- Mscrm.Jewel.NewMenu.NewActivity
- Mscrm.Jewel.NewMenu.NewRecord;
For example, within your appointment ribbondiffxml section within your customizations.xml, you could have a HideCustomAction like:
<HideCustomAction HideActionId="CustomHideAction.JewelMenu.NewActivity" Location="Mscrm.Jewel.NewMenu.NewActivity" />

Radio buttons in MFC (re-written)

So I'm working on a class project that uses MFC. I never had to learn how to work with MFC since I was making the character class stuff (D&D game).
I currently have the radio buttons working. So I know which was pressed and can retrieve it.
My problem is this: I have 2 radio buttons, which represent the 2 sets of 6 dice rolls to be used for stats.
I want to display a string containing the set for the specific radio button. So what I'm wondering is: is there a way to have the caption string for a radio button be equal to a specific string that can change between the times the dialog with said radio button is opened?
Edit: I changed the whole question since I solved all but this part of the original.
MFC wraps radio buttons in CButton instances, so you can use their SetWindowText() method:
yourRadioButton.SetWindowText(_T("New Text"));

Adding drop down arrows to CMFCToolBar buttons

Can anyone explain how to add dropdown arrows to CMFCToolBar toolbar buttons - like for undo/redo buttons. We had this with CToolBar by using the TBSTYLE_EX_DRAWDDARROWS style and TBN_DROPDOWN notification. This doesn't seem to work with CMFCToolBar. These dropdown arrows i believe are added to the VisualStudioDemo MFC feature pack demo but i can not figure out how.
In the VisualStudioDemo sample, in CMainFrame::OnToolbarReset they replace the Undo button of the toolbar with a custom class called CUndoButton, like this:
m_wndToolBar.ReplaceButton(ID_EDIT_UNDO, CUndoButton(ID_EDIT_UNDO, _T("&Undo")));
CUndoButton is declared in file "UndoBar.h" of the sample project, so you can use it or change it however you like.