Custom HorizontalFieldManager menu not showing - blackberry

I have created a class that extends HorizontalFieldManager so that I can display a label and an image on the same line with the label to the left and the image to the right. I want the user to be able to interact with the hfm as if it were a single field. I have everything working (focus, click action, etc) except the menu. When I press the menu button makeMenu and makeContextMenu are not called. How do I make it so that the correct menu shows when the menu button is clicked and focus is on the hfm? Am I going about this the wrong way?

Where do you override makeContextMenu, in the Hfm? You might have to override them in the label and image.
Or, less elegantly, you could just check in the makeMenu() function of your screen if the hfm has focus (or its children) and then add your menu item there.

Related

How to make content navigation button (remains pressed when clicked) in Vaadin

I created basic vertical layout that work as side menu and now I want to place some buttons in it. Few of them gonna work as common side menu buttons, they just change page content so I want to mark that they are clicked in some way, how can I achive that? Or maybe there is better way?
As stated in the 5th version of Vaadin7 manual, you can attach an event listener to the Button.
button.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
// show the button has been clicked with a CSS class:
button.addStyleName("v-button-clicked");
}
});
Don’t forget to define the v-button-clicked class. Of course you’re free to add the class of your liking through the .addStyleName() method.

BlackBerry custom image on "mouseOver" menuitem

Is it possible to change background of active item in menu? (It's SDK6)
Like in picture:
And how I can get rid of this (last repeat of background):
It seems to me that Menu, as an object, is just a customized popupscreen. Maybe extend popupscreen and draw the focus however you'd like it. Submenus will get trickier.

ObjectChoiceField automatically scroll to top after selecting a choice?

I have customized a field which contains an ObjectChoiceField. After clicking a choice,the screen just scrolls to the top and the choice field drops down from the visibile screen。Pls tell me how to prevent this。Thank you。
You can find out custom drop down list implementation in this thread: Issue in PopUpScreen
This custom drop down does what you want.

Why doesn't clicking on my TToolButton show the DropdownMenu?

I'm using Delphi 2010 and I have a TToolButton contained by a TToolBar. Assigned to the 'DropdownMenu' property of my TToolButton is a standard TPopupMenu.
The only way I can get the menu to appear is to click on the area pointed to by the red arrow in the image. Currently, clicking the area pointed to by the green arrow shows the button as pressed, but the dropdown menu does not appear.
What I want is if the user clicks anywhere (pointed to by green arrow or red arrow) for the menu to appear. Is it possible to enable this functionality?
The idea of the tbsDropDown style is to have a button that triggers some default action when clicked, but provides more variations of that action in the drop down menu.
If you don't care about the down arrow disappearing, you can set the style to tbsButton and no matter where the button is clicked, it will show the popup menu.
If you are like me and you do want to have the arrow there to indicate that there are more options behind this button, you can call CheckMenuDropdown in the button's OnClicked event handler.
Set Style to tbsButton. Then you can click anywhere to show the drop-down menu, but you will lose the arrow.

Avoid focus on first screen field in blackberry

I've add some customized buttonfield follow by some label field.
When opening the app, the first buttonfield gets focus, but I don't need the focus when opening the screen. How to avoid the focus on opening the screen?
use NullField like the code below:
NullField field = new NullField();
field.setFocus();
This will avoid the focus on any field in the screen

Resources