Prevent menu text from ellipsizing - google-glass

I have a fairly straightforward menu that I am showing in an Activity, but some of the menu items have text that is too long to fit on screen. The default behavior for menus appears to be ellipsizing the text, as shown below.
Menu XML that I'm inflating in onCreateOptionsMenu():
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="#+id/menu_too_long"
android:title="This text is a tad too long"
android:icon="#drawable/ic_glass_logo"/>
</menu>
Is it possible to get the menu item text to adjust its size or wrap to a second line when it is too long? In other words, I would like menus inflated from XML to behave more like CardBuilder.Layout TEXT.
I would like to avoid creating my own menu and continue using Glass's built-in menu APIs.

Changing the formatting of the menu labels is not possible through public APIs. From a UX point of view, menu labels longer than two or three words seems undesirable. Consider that if you enable voice menus in your application, those commands should be brief that the user can speak them conveniently.
If the length of your menu text is because there is supplemental information that you can separate from the "action" that the menu performs, consider using MenuUtils.setDescription to move the supplemental information into the footer of the menu item, which can hold more content. You can call this method from within onCreateOptionsMenu or onPrepareOptionsMenu.

Related

Alternative to legacy tabs parent set in current navigation menu in oracle apex?

Just like we could make parent tab set and combine all tabs in it.
Is it possible to do the same with navigation menus?
Basically, how can we convert set of tabs to navigation menus explicitly?
or create a parent list that would contain all the other lists.
Ex: Manager list, employee list all could get combined to one parent list,
Is this possible?
In shot, how can we convert the standard tab set in navigation menu format?
Vini,
Within Lists you can develop structures as many levels deep as you like. To do so just specify the parent list entry.
One customer that comes to mind has a single Navigation Menu list with several hundred entries, numerous levels deep.
With APEX 20.1 you now have the choice of displaying the Navigation Menu on the side, on the top or as a Mega Menu.
Regards,
David

Win32: How to access Windows Listview Header Control Filters

According to MSDN documentation you can add Filter bar to ListView :
By specifying the HDS_FILTERBAR window style for a header control, you can enable the placement of filter edit boxes underneath the column headings. A filter button appears beside the edit box.
I can access filter strings via HDITEM and HDTEXTFILTER but how to change underlying Edits and Buttons ?
Let's assume i would like to change default filter text placeholder from "Enter text here" to "Type here" like it's possible with Edit_SetCueBannerText or change filter button look ?
Assumption : Windows Vista + , Common Control 6.0 +
If you don't mind some hacks - you can get to child windows using for example EnumChildWindows() - then you may be able to send commands, etc. using the hwnd. Use "spy++" on your running program first to investigate the structure of parent/child window relations.

Nested comboboxes in Qt

I'm looking for a way of nesting comboboxes in my GUI application (or to be more precise, I'm looking for a way to have an item displaying similar visual and functionnal properties as nested comboboxes).
Looking first at all the functions provided by the combobox class, it seems comboboxes nesting it's not supported by Qt.
I therefore thought that another solution would be to create a "menu" item outside the menu bar. If I understand correctly this phrase from the offical Qt documentation, it seems to be feasiable :
A menu widget can be either a pull-down menu in a menu bar or a standalone context menu
Not sure though was is meant by the "context" word.
However, there is no such (menu) widget in Qt designer and I haven't found any good examples about how to do it on the internet (and can't get a menu not associated with a menu bar to be displayed on the windows), explaining why I'm currently doubting whether it's feasible or not with a menu item.
I would greaty appreciate if you could provide some code sample along your response.
EDIT :
To clarify my first post, I'm trying to do something similar to this app :
It's the application that comes along the 3D connexion mouse whose usage is to parametrize each button.
As you can see, there are several sub-menu items. By clicking on the arrow next to a textbox, you open a sub-menu containing itself folders that contains themselves paramaters.

How to change the sequence in the MDI Tab document menu?

In the tabbed document view of the MFC feature pack the user can re-order the tabs by dragging and dropping and when there is a larger number of tabs in use you have a drop down list at the end.
The problem is that the menu item for windows with the drop list of the first 9 sessions and more windows, plus the drop down list at the end of the tabbed bar are in document load order.
Does anyone know of a example on how to change the Document order in the CDocManager class in order to stay in sync?
The relevant code can be found in CMFCTabCtrl::OnShowTabDocumentsMenu.
So reorder the internal array and you have what you need.
You have the source code so it shouldn't be a real big thing.
You can use following code for it:
CMFCTabCtrl &t = ((CMainFrame*)m_pMainWnd)->GetMDITabs();
t.MoveTab(<your tab number>, t.GetTabsNum()-1);

Android: How to write text under the icon in the actionbar

I would like to write under the text in the action bar so i use this xml:
<item
android:id="#+id/Home"
android:icon="#drawable/ic_action_home"
android:showAsAction="always|withText"
android:title="home"/>
<item
android:id="#+id/Refresh"
android:icon="#drawable/ic_action_refresh"
android:orderInCategory="100"
android:showAsAction="always|withText"
android:title="refresh"/>
although i write:
android:showAsAction="always|withText"
this what i get :
How could I write text under the icons ?
'always|withText' only works if there is sufficient room. Else, it will only place icon. In your case, you've got several icons there which does not leave any spare room for text.
You've got two options:
Reduce the icons by moving them either to an overflow menu or somewhere else in your UI.
Design images which consist both icon and text and use them as your icons.
Edit: Well, here's a lot better answer: https://stackoverflow.com/a/12225863/2511884