How can I create a menu in MFC that has a line with 2 items? - winapi

I did some experiments with MF_MENUBARBREAK, but with this I can only achieve two columns at the top-most level of the menu.
What I want is a menu like this:
It is not the full menu that I want to have two columns, but have two menu (Left and Right) items in the first line. Every other entry will ocupy its own entire line. Is that possible?

No, this is not possible. The native menuing system does not support "split" multi-column menus.
If a drop-down menu has multiple columns, then the entire drop-down menu will have multiple columns. Otherwise, all of the items are displayed in a single column.
You cannot have this (unless you mock it up in Paint like I just did):
Instead, all of the items that come after the one for which you've set the MF_MENUBARBREAK flag will be displayed in a second column. For instance, if the "Right" item has the MF_MENUBARBREAK flag set, your menu will look like this:
You can't get items "One" through "Three" to appear as if they were not in one column or the other. If you added the items before "Right" (the one with the MF_MENUBARBREAK flag), they would all be in the first column, like this:
…but they are still in a column. There's no way around that, short of owner-drawing the menus yourself, which is way more work than it is worth (trust me).
Perhaps you could just duplicate the numbered items under the "Left" and "Right" categories? As long as you gave each of the menu items a unique ID, it wouldn't be an issue to differentiate between them in code.
But then you would still need to find some way to indicate that "Left" and "Right" were column headers and should be treated differently from the items underneath them. I guess you could disable them and/or draw them in bold, but that's still not guaranteed to produce an intuitive UI.
Better yet, I would recommend keeping your "creative" UI design compulsions to a minimum and just adding another top-level menu. Users know how to use top-level menus. They already grasp this mental model. They don't really know how to use your weird custom menus, and anything weird is likely to trip up your users more often than not.
Users also (sort of) understand sub-menus, so you could still have a single top-level menu with "Left" and "Right" items that themselves display sub-menus containing your numbered items. But the usual rules apply—don't nest things too deeply, etc.
On OS X, I've seen something like the following menu structure:
It works well there, where users are accustomed to it. And as a programmer who likes to see things properly nested and placed into categories, I quite like it myself. But I'm not sure how intuitive it'll be to Windows users, for whom it'll be rather unusual. You'll have to do some usability testing.

Related

What are some good UX web designs for selecting multiple items and performing an action

I'm working on redesigning a web interface to provide the same functionality it has currently but with easier use via good UX design. Currently, here is what the design looks like:
I'm less worried about the tofu look and feel, that can come later, I want to nail the UX functionality first. The idea here in this tab is the user can select the items via a checkbox and perform the actions in the "I Want To" drop down (which opens different modal dialogs depending on the action). The 3 dot ellipsis on the right of the items in the list allow the user to perform the same actions via another drop down control, with the idea that they use the top drop down to perform the actions on multiple items, the ellipsis three dot menu for one item.
The obnoxious part of this control is that the list could contain hundreds of items, and the check box takes too much precision to check quickly. The user would select which items they would like to perform the actions on sequentially, then have to scroll up to the top of the page to select the action. This could be 5 seconds of scrolling, which I find obnoxious. I want to develop a good UX pattern to provide the same functionality in less clicks, scrolling, and frustration.
My inital idea was to provide a floating action button. The user could then * somehow * (I haven't thought of an idea yet, at minimum at least a bigger check box) select multiple items then pick what they want to do via the floating action button which is always within the bounds of the screen instead of the horrible scroll back to the top (I don't think a "scroll to top" button is a good solution for this either).
So I need some recommendations on a UX pattern or some general suggestions on how to make this process less frustrating for users. I'm a fan of material design right now, but I'm open to any suggestions, material design guides don't seem to have any paradigms for something like this.
I think the UX steps are in a good track: first select them, then set the action.
Instead of it being only a checkbox to click, the whole top part of each line could be clickable to select the item. This would make it much easier for the user, and less frustrating not being able to hit the checkbox.
Fixing the header on top would be usefull for adding a "Select/Unselect all" option and having the actions always available. Adding a searchbox to filter could be as well a good option if you are thinking of long lists. Combining the search box and the "Select all" option should help the user in their tasks.
If that is the most important action to be done in that screen, making the "What to do" button stand out a bit more would be a good idea to differenciate the primary from the secondary options for the user to do.
I see two simple things you can do to make this more usable with very little effort.
Remove the checkbox and make the entire row tappable, highlighting those selected. Each row would essentially become the checkbox's label, and the checkbox itself would be hidden from view.
Fix the header to the top of the browser window when the user scrolls down.

Looking for a specific control (sketch included)

I am looking for a control many of us probably know, but I don't know it's name and don't have a real screenshot by hand, just this sketch:
In the left box one can select an operation or whatever, which then is moved to the right side. With the up/down arrows on the right, one can move this operation (or whatever kind of meaning the entry has) up or down in the order of execution.
How is this kind of control called? Or is it normally build by developers out of single controls? Is this control available in JavaFX 2? If not, I don't need exactly this control, but a control with the following features:
User can select multiple operations (duplicates allowed) out of all available operations
The user can arrange their order of execution
Thanks for any hint :-)
You need to use multiple controls to build up your interface. Use two ListViews with a MultipleSelectionModel for each (or at least the left one) and add a couple of buttons, that copy selected items from one list to the other and another couple of buttons which modify the position of selected items in the right list view by modifying the view's underlying item list.
listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

UI icon - should it be A-Z or Z-A when the current list is sorted in ascending order?

I have a "sort by alphabet" icon in the application bar. If the list of items is currently listing:
1
a
b
Then should the icon show what the listing is currently sorted by (A-Z) or what it WILL be sorted by if you press the button (Z-A)?
The only example I can find on the phone is setting the volume to ring or vibrate (If it is set to ring, it shows a bell) but would like more examples / confirmation from people here.
If it's clear how the list is currently sorted by looking at it then I'd recommend displaying what the list will be changed to by pressing the button.
If the list can be sorted in any ways other than just ascending or descending alphabetical order you will probably need a button for setting each of the sort orders.
If it's not clear how the list is sorted by looking at it then this indicator should be separate.
Overall I'd question the value of having this sorting functionality. If you have a long list I'd use the LongListSelector from the Toolkit and then always have it sorted A-Z. This will simplify your UI (by not requiring a button to change the sort order) and will require less code.
If the button is closely associated visually with the list, like a column header is with a column in a grid, then I would say you could show what the current state is just like headers in columns of grids tend to do that offer this capability.
In this case, whichever way you do it, I would say the user would adapt fairly quickly by looking at the list to see how it works. There will be some who initially expect one way, and some the other I expect. Arguably there isn't a correct way to do it. It's a good idea to look at what other apps on the platform are doing, but there may not really be much to go on just yet.
The visual cue in this case is the tight visual association of the list and the button, suggesting to me that that button reflects the lists current state and that you can press to change it.
If however you had some form of a label that the button was associated visually to, then that button's text could provide the necessary context and your decision could be driven by that. For example your label could read "change sort to" or it could read "current sort is". This probably offers the most clarity, alleviating unsure users of the need to press the button a couple of times to learn how it works, but comes at the expense of valuable screen real estate.
If you walk into a hotel and your room number is 301, you want to go to the 3rd floor.
So you step inside the elevator and press the '3rd floor' button.
Therefore I think buttons should always show possible options, not the current state (i.e. ground floor).
So I think the button should show 'Z-A'.

Preferred UX for an empty-but-selectable item in a menu

In a project I'm working on, we have a nav menu where items are colored when the relevant section has information beneath it, or faded when there's nothing available to the user. In the case of an admin, these items may have no useful information but may still be clickable (since things like "Add news item" or "Add file" are implemented as sub-menus).
The call from On High has come down to make these admin items stand apart somehow. Since we're already using the faded text for unclickable items, I was wondering if there's an established UI convention for denoting that an item is clickable, yet contains no information.
And yes, I've already asked why we're bothering to show items that aren't available to the user. The short of it: because On High wants to.
Short answer, no I don't think there's a convention for this. Lots of people would say if its not applicable, don't show it. However, there's some debate on this. One of the reasons Microsoft started using The Ribbon in MS Office is because they wanted to get away from dynamic menus where options hid and showed 'intelligently'. Users couldn't figure out the rules for what appered where, and when.
Maybe separate the concerns here: 1) how to indicate the item is clickable, and then 2) how to indicate the item contains no information.
The first one is relatively well established -- blue underlined text. You can also make it look like a button Of course, if you've got a site-specific look for your hyperlinks, use that. Basically don't break the users' expectiations of what things are clickable.
Second, how to show there's nothing there worth clicking on. I think what you want is some visual indication of the priority/utility of these admin links relatively to others. Some options:
Can you move the admin links to the bottom of a list?
Add a number indication how many things are on the other side of the link?
Strikethrough on the text?
Since there are no hard-and-fast conventions on this sort of thing, just remember that anything you do which is consistent will work. Some things will just work better than others.
No matter what you choose, the user will learn after a few tries what the new method of empty indication is.
If it is well thought out and consistent, they will probably get it after a couple of clicks.
Also, remember that too many highlights, colors, fades, and underlines will wash out any amount of effectiveness at visually organizing your menu so it is easy to use. At some point it can actually get harder to use by over-organizing things.
Think about it this way: There are two boxes sitting on a virtual shelf. One is red and the other is blue. The selected box is identified by a differing color than the other box... Now, which is the selected box?

User interface for sorting a table by multiple columns

I need a user interface that allows users to sort a table according to multiple columns (e.g. sort by color and then price within color, or alternatively price and then color within price). The only such interface I'm familiar with is the dialogue box found in Excel under data > sort, but this is rather clunky and does not yield itself to quick switching between views. I would much prefer an iTunes-style interface that allows quick sorting by clicking on column headers. However, such interfaces typically only allow sorting by one column (an exception is iTunes itself which has a very limited, apparently hard-coded ability to sort by "Album by Artist" and "Album by Year" by clicking on the Album header).
I can envision an interface where each column header has some numbers, such that clicking on 1 makes the column the primary sort key, clicking on 2 the secondary key, and so on. Alternatively, clicking (or right-clicking) on a column header could bring a drop-down menu with "primary sort", "secondary sort" etc. However, I've never seen such an interface implemented, and I don't have a good intuition of usability issues that may arise.
Are there applications that allow sorting by multiple columns using the column headers? Would you be able to point me to these? Are there any useful usability results regarding such interfaces -- which work better, which less so?
Also, while I am mostly interested in the specification of the interface, any hints to pass on to the people implementing it would be appreciated, e.g. publicly available libraries that provide parts of a solution (especially Java).
Edit: Two people have suggested using an Excel-style dialogue box. This is not going to work. For my application, users need to find the "best match" among existing table entries (which is often not a perfect match). The table is too big to keep in your head, so you need to keep scanning the relevant parts, and it's useful to repeatedly sort the table in order to get multiple views. Having to go through a dialogue box with multiple options for each change of view is just too slow; by the time you're done with the box, you've forgotten the results from the previous view.
I think Outlook supported sorting by multiple columns. After you clicked a columnheader, you would then shift-click additional column headers. I no longer use Outlook so I can't verify this. Hopefully it will be a starting point for you.
I've seen the shift-click interface that caparcode mentioned in a few applications, however I can't name any right now. Here's a nice web-based example though.
I would suggest using a Ctrl-Click (or Shift-click or whatever-click) approach to let the user select multiple columns. Clicking without Ctrl will just sort by the selected column, but holding the Ctrl-key adds the column to the sorter. Clicking again changes the direction. And give a feedback about the current sorter(s) similar as in these pictures. Most of the time the users will only use the single column sorter anyway, only advanced users will want to sort by multiple columns. But you should have the behavior documented somehow in the manual and in the "did you know" thingy.
But since users don't read, there is the risk that nobody will find the feature. But for this maybe you could have a feature like Windows when first started wanting you to click the start-button once to ensure you found the button. When you see the user not using the sorter at all, show him that clicking the column header will sort. Later, when you see he's not using the multi sort feature show him once that the feature exists.
Do it the way Excel does, or rather the way real people use Excel, which almost never involves that clunky dialogue box which you rightly wish to avoid. Basically, Excel preserves your current sort order as much as it can - so if you currently have it sorted in descending order by price, and now you sort by color (using the A-to-Z button on the toolbar*, NOT the dialogue box), the prices within a color will remain in descending order.
This approach does require a bit of reverse thinking from the user, because you sort first by the least important column, but it is very intuitive once you get it. (Yeah, I know, that sounds self-contradictory, but I don't know how else to describe it.)
To implement it, you'd have to store the user's sorting history somewhere; but as far as the interface is concerned, all you'd need is an up arrow and a down arrow in each column. Or, if you only want to allow A-to-Z sorting, just make the column headings themselves into links or buttons or whatever.
* Yes, I know the default Excel toolbars don't have A-Z and Z-A as separate buttons anymore, but one of the first things you do with a new installation of Excel is customize the toolbars to add these as well as Paste Values, right? Right?
How about the following? A single droplist labeled “Sort” in top margin of the table. The dropdown lists all fields to sort. Each field appears twice, once for ascending and once for descending sorts. Beside the dropdown is a button labeled “More” or perhaps simply “+”. The user chooses the field for the primary sort key from the dropdown. The sort is instantly applied (no “Sort” command button). If a secondary sort key is desired, the user clicks the More button and another dropdown list is inserted and opened for the user to select the second key. Additional lower order keys may be added with successive clicks of the More button. Dropdowns each include a “Clear” item to delete a key.
This makes a compact, simple, and uncluttered UI for the simplest and most common case of a single sort key (unlike Excel’s Sort Dialog or having numbers to the column headers), while also supporting the sorting an indefinite number of keys (again unlike Excel’s Sort Dialog). The user can see the sort order at a glance (unlike Excel and more easily than with numbers in the columns). It avoids the clunkinest of a dialog box.
Clickable column headers is a de facto standard that is also a good idea to include along with the above. It’s good practice to do what Outlook and Windows Explorer do and make lower order keys out of former sort orders. So, for example, if the table is sorted by date and the user sorts by category, then the table is sorted first by category and then by date. A user can thus do multi-ordered sorting by picking the lowest order sort field first and working up. However, this has poor discoverability and user may find that working “backwards” is counter-intuitive, so it should be supplemented with something like the dropdowns and More button. Relying on shift-clicking or ctrl-clicking likewise has discoverability issues.
Have you taken a look at Excel? That's a perfect example on how to sort on multiple columns.
Also, I use a detailed listview sometimes, and let the user hold the Ctrl key while selecting one or more columns to sort the info. (Clicking twice on a column does a descending sort.)
Seriously, what you want, Excel does. Why not use an interface people already know how to drive. I would suggest that. Or else you're going to either have to buy from a third party, or roll your own.
Development with Office is facilitated by VSTO (Visual Studio .NET tools for Office). It's up to you how much you want to automate Excel within an inch of its life :). It can be done.
In fact that is what I had to do. I had to read spreadsheets, extract data, convert to objects, then persist to Access (don't ask). Each sheet represents one record, and each directory represents a location, you get the idea. All done using the Office PIA Interop assemblies.
Just a thought.

Resources