How to arrange the MenuItems that we add in menu - blackberry

I wrote a program that adds some options in the menu. It successfully added all the items that i inserted. Now i arranged all the items also. But the "switch application" option is still at the top. How can I change its position?
MenuItem mi1 = new MenuItem("leave",0x00010004,0);
addMenuItem(mi1);
MenuItem mi2 = new MenuItem("importrouteplan",0x00020005,0);
addMenuItem(mi2);
MenuItem mi4 = new MenuItem("get5daysplan",0x00020005,0);
addMenuItem(mi4);
MenuItem mi3 = new MenuItem("gettodaysplan",0x00020005,0);
addMenuItem(mi3);
MenuItem mi6 = new MenuItem("stoptracktime",0x00030006,0);
addMenuItem(mi6);
MenuItem mi5 = new MenuItem("starttracktime",0x00030006,0);
addMenuItem(mi5);

Well, it turns out it depends on OS level.
For instance, on OS 4.7 "Switch Application" is always in the bottom section near the "Close". However if you open any native BB app in OS 6 simulator, then you'll see RIM changed the this behaviour - "Switch Application" is always in the top section while they left "Close" in the bottom.
So basically your code is fully Ok as is and you don't need to change it. However if you do need to put any item above the "Switch Application", then you can do it by using the same top-most ordinal:
new MyMenuItem("Above Switch Application", 0 /*ordinal*/, 0);
Note despite in this case "Above Switch Application" IS above the "Switch Application", it shares the same ordinal group (0) so there will be no separator between the two (which I guess in not acceptable for the majority of the cases).

MenuItem mi1 = new MenuItem("leave",0x00010004,0);
The last argument in MenuItem is for Priority in the Menu.
So don't pass it as 0.
The priority of the menu item.
A lower value indicates a higher priority,
conversely a higher value indicates a lower priority.
Change the priority and try.

Related

Create items last on backlog

We would like new items to end up last on the backlog. I updated the WIT field Backlog Priority in the first transition and set that to 2000000 but it was changed back to a lower number automatically (with a 2nd revision)
Anyway this can be accomplished?
TFS 2015 update 3 on prem.
Thanks!
Just as nschonni commented, new items will automatically appear at the last on backlog.
After you've got some items on your backlog, you can order them and create a prioritized list of work. Frequently reviewing and prioritizing your backlog can help your team know what's most important to deliver next.
Reorder your backlog by simply dragging work items. Or, if you prefer the keyboard, hold the Alt key and use the up and down arrows.
You should refrain from using the bulk modify function to change
the backlog priority of work items. While you can assign a value to
the Backlog Priority (Scrum) or Stack Rank (Agile and CMMI) fields,
you'll be assigning the same value to all items you've selected for
bulk edit. These fields are used by the system to track the relative
ranking of items on the product, feature, or epic backlogs.
Source Link
Update
When you use the quick add, the new crated item either in the top or bottom is based on the position of your mouse.
For example, if you put the mouse at the top, the new created item should also at the top. If you put the mouse at the bottom, then it will also appear at the bottom. More if you want the created at a specific position, you just need to move your mouse.
The select items should have a grey background.

Why does FireMonkey TListBox Animation prevent item deselection on Windows32 platform

I am new to FireMonkey (drawn by its new ability to work with Android). I am trying to animate selection of an item with animation of the list box to reveal underlying content (a frequent pattern). However, I am having trouble getting the list box to manage the deselection of the previously-selected item when I animate the disappearance of the list box. Strangely, this only seems to happen on the Windows platform, and not on Android or iPad devices (or the iPad simulator).
To reproduce the problem (in RAD Studio XE5):
1) Create a new FireMonkey Mobile Application, selecting Tablet Master-Detail to use as a starting layout
2) Right-click on Target Platforms, and select 32-bit Windows, to simplify debugging, and select it.
3) Add a new TListBox object, and drop it on the left portion of the window.
4) Use the Structure browser to move it to LeftLayout, making it's parent the LeftLayout.
5) Click on the ListBox1 object
6) Change the Align property to alClient, to fill the LeftLayout
7) In the ObjectInspector, select the Position Property, and the X Sub Property, and select Create New TFloatAnimation. The FloatAnimation will be named FloatAnimation1
8) Create a new OnItemClick handler for ListBox1, and add the following code:
FloatAnimation1.StartFromCurrent := True;
FloatAnimation1.StopValue := 0 - ((LeftLayout.Width) / 1);
FloatAnimation1.Start;
9) Create a new button, and place it on the toolbar at the top of the left window
10) Create a handler for the new button, and add the following code:
FloatAnimation1.StartFromCurrent := True;
FloatAnimation1.StopValue := 0;
FloatAnimation1.Start;
11) Double Click on the ListBox to open the Items Designer, and click the AddItem button three times to add three TListBoxItems
12) Run the app. Click on one of the three items in the ListBox. The ListBox animates to the left, out of view. Click on the button we added to get it back. Click on the other items, and eventually, you will have all three items selected, even though MultiSelect is turned off for the ListBox1.
13) Stop the app. Change the OnItemClick handler code by changing the "1" to a "2", so the ListBox will only move half of the way to the left. Run the app again. Now, when you click on the ListBox, only one item will be selected, and the previously-selected item will be deselected (as it should be for a single-selection list box).
Again, if I run this on iPad, iPad simulator, or an Android tablet, the ListBox works properly: when an item is clicked in the ListBox, the previously-selected item is deselected.
I can't be the first person to find this, since this sort of animation is so common in apps. Why is the ListBox misbehaving, and why is it different in Windows32 if I animate it only part way off the screen, and why is it different in Windows32 than on the iPad or Android tablet?
i have the same problem, Win32 App with XE5 Update2, Listbox moving out left, then coming back but with remainders of the blue selection underlay.
What works (very dirty i know) for me, is starting a Timer right after starting the Animation. Timer Interval is 100ms
Code in Timer
if lb_liste.selected is TListBoxItem then
lb_liste.selected.isselected:= false;
//lb_liste is my Listbox, a problem could be that then no more item is selected, but that was fine for me.
I had this part in the OnProcess Event of the TFloatAnimation before, but strangely this caused an AV whenever i talked to a database over in another form before sliding back to my listbox.
For me this is clearly a bug in FMX, lets wait for XE6,7,8

How to a TFilterComboBox (drop down box) larger?

By default, when I click a Delphi TFilterComboBox it will display only 8 items. To access the rest of them, the user has to scroll down which is such a wast of time. Can I make it display more items (or even all of them)?
I have found an answer that says: "If you click the combobox in the resource template editor, you can drag its "opened" frame size to fit more items".
But I don't know what is this "resource template editor".
Normally one would like to use its DropDownCount property to set the maximum number of items visible in the dropdown window. But that seems to be hidden here (i.e. it is protected). I guess one can send it a message directly:
SendMessage(FilterComboBox1.Handle, CB_SETMINVISIBLE,
WPARAM(YourDropDownCount), 0);

How do you rename a Status Bar Panel in Delphi 2010

I have just added a new panel to StatusBar1 and it is called 5 - TStatusPanel. I want to give it a different name but I can't remember how to do this.
I want to rename 5 - TStatusPanel to 5 - GripArea. As you can see from the image I have done this before (see Num, Caps, AM/PM) but I can't remember how I did this. It sucks to get old.
Just change the Text property of the TStatusPanel. This is what is displayed in the status panel editor. Of course, this will make the text visible in the panel! Normally, in code, you access the status panels using the StatusBar1.Panels[PanelIndex] array. PanelIndex is the zero-based index of the panel. I always declare constants such as
STATUS_FILE_POSITION = 0;
STATUS_FILE_SAVED = 1;
STATUS_LONG_TEXT = 2;
STATUS_ZOOM_CONTROL = 3;
and use these to remember the panels. (The code above is from my text editor.)
So I can do, for instance,
StatusBar.Panels[STATUS_FILE_SAVED].Text := 'Modified';
Here's a tip that would have saved some hunting: right-click on the form, View As Text. Now you'll see the form layed out as properties, and you could have found the control, seen how the other panels were named, and fix the last one.
Alt+F12 to toggle the text view on/off.

How can I change a main menu First level caption?

I have a main menu in an MDI parent form, and it as a main menu.
Now I need to change the first level caption of my first menu item in runtime. How can I do that?
--- Update ---
Sorry. I forgot to tell you that the mainMenu is housed in a TcontrolBar.
I think that is the problem because all answer so far don’t work. I had tried all that before.
But this only occurs for the first level, all other levels change correctly.
Perhaps I'm missing something, but it seems to be very simple:
MainMenu1.Items[0].Caption := '&Hello'; // first top-level item
MainMenu1.Items[1].Caption := '&World'; // second top-level item, etc.
In the Menu Editor (at design time in the IDE), click on the menu you want to change, open the property inspector and change the name to something relevant, i.e MyFirstMenu.
Then in your code, whenever you want to change the menu items caption you can use:
MyFirstMenu.Caption := 'A New Caption';
or if the Main Menu is built dynamically see the answer TOndrej gave above.
[Edit1]
Do you mean you can set the caption successfully on the menu item but do not see the change on the TControlBar?
If you are using the old technique of adding a TToolbar inside of a TControlBar, then adding a tool button for each top menu item, then what you see in the form as top level menu items are actually the tool buttons. Set their caption directly, and everything should work.

Resources