I need to create a underlined label in a form using wxWidgets. When user clicks on that label I have to execute 1 function. Can we create such hypertext in wxwidgets? Now I am using a button for this, when user clicks on button some event is triggered. But instead of button underlined label will look too good.
#aromahola,
Look up wxHyperLink in the wx documentation.
The class you want is wxHyperLinkCtrl.
Related
I have a set of normal CButtons in MFC when a user clickes on one button its appearence should be changed to reflex the idea that it has been clicked sth like in the picture
i tried to change the style of the clicked button using the following code
button->SetButtonStyle(BS_DEFPUSHBUTTON);
Invalidate();
but the problem with this approach is that just one button at time is allowed to be marked so any ideas ? is the only way is to use a bitmap ?
Use CButton::SetState
This page has an example of what you want to do:
http://msdn.microsoft.com/en-us/library/ebw1hfe8(v=vs.90).aspx
I am developing an application for my Nokia N8 running Nokia Belle and would like to add buttons in between the left arrow button and the menu button on the bar at the bottom of the screen.
An example of what I mean can be seen when playing a station in the Nokia Internet Radio application, which, I understand, is a Mobile Qt Widget Application (not Qt Quick).
After searching around (http://www.developer.nokia.com/Community/Discussion/showthread.php?233396-QMenu-in-Symbian-Belle-in-Qt-C), I tried this code, but the button does not appear:
QAction *pDeleteButton = new QAction(style()->standardIcon(QStyle::SP_TrashIcon),QString(tr("Delete")), this);
pDeleteButton->setSoftKeyRole(QAction::NoSoftKey);
addAction(pDeleteButton);
I put this code in the constructor of the mainwindow.cpp.
Thank you for your help!
I am no expert in programming for mobile phones, but the QAction you are creating has no parent widget. If you look at the example you are linking, you will find that the original poster assigned a menu for the action via setMenu(). Did you try something like this already? If so, I would suggest you add some more context to your code and maybe a minimal example.
I have a C++ MFC MDI application. I have a tool bar with some buttons on it. I need to add some check boxes to this toolbar and i need them to have custom bitmaps just as my buttons do. Thanks
EDIT:
By bitmpas i refer to the pixel images that can be created using the tool bar editor in visual stuidos 2008. I would like a picture (of my creation) instead of the usual tick box.
You don't use checkboxes on toolbars.
You should rather use regular buttons in Check mode. That means that the button stays pressed when user releases it. Clicking it a second time releases the button. This is the same behaviour as a checkbox.
You can either set a toolbar button as checkable by code:
m_ToolBar.SetButtonStyle(nButtonId, TBBS_CHECKBOX);
Or by enabling the corresponding property in the resource editor.
If you want to modify the image displayed when the button is pressed, in your ON_UPDATE_COMMAND_UI handler, use m_ToolBar.GetButtonInfo() to check if the image matches the state. If not, change it using m_ToolBar.SetButtonInfo() and specify the index of an extra image added to the image list of the toolbar.
The following is a link which might help you
http://www.ucancode.net/Visual_C_Control/Place-Combo-Edit-Box-Progress-Control-On-ToolBar-CToolBar-VC-Example.htm
I am trying to make a dialog box like below in QT, the only problem is I have no idea what the widget is called. The bar on the left is like a tree-view widget, but when you click on it, it updates the text on the right. Does anybody happen to know what the widget is called or what widget(s) are required to perform this? I am using QT C++ on Windows.
There is an example with Qt showing you how to do this.
https://doc-snapshots.qt.io/4.8/dialogs-configdialog.html
If you're using Qt Creator as IDE, you can find it under the "Demos and Examples" tab in the Welcome Screen too.
It uses a QListWidget for the selector, and QStackedWidget to control the different pages. Connect the currentItemChanged signal of the list widget to change what page should be shown. Everything you'll need is in configdialog.cpp.
If you realy need to add QPushButton into QListWidget, use setItemWidget, or into ListView use QAbstractItemView::setIndexWidget
I would like to add a simple text button to my c++ win32 application. I'm creating the button using CreateWindowEx function, but can't figure out the correct style to do so. I would like to display a text only button and be able to recive messages when the user clicks on it. The style i would like to get is identical to the text button in windows 7 system volume control (where it says "Mixer"). If possible i would like to display a tooltip also.
That mixer control looks more like a hyperlink control than a button. I'd go for the SysLink control if that's what you need.
You could create a "Button" class window with the BS_OWNERDRAW style and handle the WM_DRAWITEM messages. In your WM_DRAWITEM message handler you can simply display the text.
Actually that button is an owner draw button - it listens to mouse move messages and when you hover over it, it underlines the text (the syslink control doesn't have this behavior). Otherwise it's a stock button.