I'm using sap.m.SelectList in the XML-View to give a possibility to choose key/value pairs and need to extend it with context menu which is available in sap.m.List. I have problems with it, because ContextMenu is defined in sap.m.ListBase, sap.m.List inherits it, but sap.m.SelectList does not.
What is the simplest or recommended approach? My restriction is, I've to use XML-View (but can extend it in JS).
Regards,
Annie
Related
I am using Qt 5.7 (C++) and want to add custom functionality like a reset option to a QSpinBox (as well as QDoubleSpinBox and maybe some other input widgets). This functionality should be accessible via the context menu. However I do not want to replace the default context menu. Instead I want to add my custom actions on top or below the already existing actions.
I found almost matching answers to this question:
https://forum.qt.io/topic/81946/add-item-to-top-of-standard-context-menu-at-right-click
How to add an entry to toolbar context menu in qt?
However, these do not help in my case since it relies on the Widget to have a method that creates and returns the standard context menu (like QLineEdit::createStandardContextMenu()). The spin boxes do not have such a method.
I also tried to go the cheap way and copy the code that creates the default options directly from source (https://github.com/qt/qtbase/blob/5.7/src/widgets/widgets/qabstractspinbox.cpp line 1249). This is also not really satisfactory since it uses private members of the underlying line edit.
Is there a (standard) way to reuse and augment the default context menu of a Q(Double)SpinBox or any QWidget in general? Or do I have to manually re-implement the default behavior?
https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/widgets/qabstractspinbox.cpp#n1315
Yeah it doesn't look like we have any easy "hook" for customizing it (and you can make a feature request if you like); OTOH it's not that much code to copy, since most of the menu entries are added by QLineEdit::createStandardContextMenu()
For certain controls, the only option I have in Expression Blend is to create a template. I don't always want to create a template; sometimes I just want to create a style. I know that I can just take the template out of the style and leave the style in place. But then if I ever want to change the style I have to go to it directly in the resource dictionary; I can no longer use "Edit Current". It just seems clunky (and wasteful) that I have to create a copy of the template just so I can associate a style with a control. After all, creating a template in expression blend creates a style. It seems that I should be able to just create a style. Is there a way to do this? Is there a reason that I cannot?
What control can you not create a Style for? Did you try the Object > Edit Style menu? It has Edit Current, Edit a Copy, Create Empty, and Apply Resource options. (Be sure you have the correct object type selected).
If that doesn't help, post some more specifics and I'll try to help.
I'm developing BlackBerry 5.0 application with list organized data.
I'm using ObjectListField and manual drawing in overriden drawListRow. I'm afraid this is
wrong, because all positionig inside row si done manualy, and now I have
serious problem how to handle click on small icon inside row. There must be some better way,
maybe using other control or simple HorizontalFieldManager in VerticalFieldManager instead of ListField,
what is recommended and best practise?
In this case I would use a ListField and ListFieldCallback. You will still have to handle the drawing manually, but the ListField will handle the selection semantics. The selection will normally post a context menu for the ListField, but you can change that behaviour to invoke a default action if you want.
I'm making a game GUI API. It is coming along very nicely except for one aspect. I want themes similar to how GTK works. The way I want it to work is that every GUI element will have a default Windows9X-like way of drawing themselves. If it is found that a theme is set for that type of widget, it will be drawn with those bitmaps.
My original concept was to create a Theme class which would have getters and setters for the bitmaps.
for example:
themeManager.setButtonHover(Bitmap *bitmap);
The problem with this, is that it is not flexable if I want to create new types of Widgets. I may eventually want to create a superButton which would use a different theme than a button. This is the flaw with that concept. The concept I'm thinking of going with is that each widget type has static methods to set the theme for itself and the constructor uses that.
Are there better ways of doing this that I'm not thinking of? Since it is an API, I want to avoid reading text files, so reading the theme from a text document is not an option.
Thanks
May be template the superButton on a policy and then have a default policy which does the default and the user has the option of providing a different policy? The policy could then define the attributes of the button (such as the hover image etc.) - does what I describe make sense?
Hi I need to extend the CListControl class in C++/MFC, which will add several new features in the list control,
Any one have good sample code ?
Or could you please tell me how can i start it ?
Thanks in advance!
Or just write the new features and listControl into a ActiveX or COM ??
Which is better ?
TO add functionality such as you suggest in your comments above I wouldn't even make a derivation of CListCtrl. It would make more sense, IMO, to create a CListCtrlManager class that handles things such as you suggest and then handles populating an associated CListCtrl.
Thing is if you wish to derive from a CListCtrl then it is USUALLY done for handling owner draw. There is very little functionality that REQUIRES a derivation. For example I have a derived list ctrl that provides row colouring based on certain information as well as a checkbox in the list view. To handle that I had to set the owener draw flag and handle list ctrl drawing directly, but you do not need to make a derivation to handle the functionality you desire.