Deleting default menu items

Hi all

In my application, I use the techniques described here ( http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/... )

to create a tabbed view.

However, when I activate the LabelFields navigation menu, I get a menu title element "copy".  I guess that's the default for a LabelField.

My makeMenu code does not call super.makeMenu (menu, for example).  It creates menus that it needs and then stop.

Does anyone have suggestions on how to remove the 'copy' in the menu?

I need to replace the LabelField, substitute makeMenu and simply do nothing?

Thanks in advance.

Hello

In your

makeMenu(Menu menu, int instance)

I would add

menu.deleteAll();

You should then have:

protected void makeMenu(Menu menu, int instance) {
    menu.deleteAll();

    // add your code here
}

Tags: BlackBerry Developers

Similar Questions

  • Cannot delete default menu options

    I have a HorizontalFieldManager which has a LabelField on it. I want to make a shortcut menu when the user clicks on the label. I don't want the default menu items to show everyone.

    I use menu.deleteAll () to create my menus, and yet I continue to see the default menus.

    I also tried to use navigationClick to try to stop the menus by default to appear.

    It seems to me that I can generate the menu or the LabelField, or the HorizontalFieldManager, depending on how I manage the clicks? However, I am only able to do my menu to appear as well as the menu by default, or, I get no menu at all.

       protected void makeMenu(Menu menu, int context) {
            MenuItem delMenu = new MenuItem("Delete", 1, 0) {
                public void run() {
                    ////////////////////
                }
            };
            menu.deleteAll();
            menu.add(delMenu);
        }
    

    Copy the following code (in my LabelField) product my menu ("Delete") as well as the default menus too.

    I'm still fairly new to this, no option would be appreciated.

    Thank you.

    Application Switch will appear on each menu.  You can get rid of the rest of the default menu items by following this link.

    Control system Menu items

    http://supportforums.BlackBerry.com/T5/Java-development/control-system-menu-items/Ta-p/588809

  • How to avoid the default menu items?

    All of hell

    I'm developing an app for BlackBerry handheld.  I add menu items that are specific to the different screens of my application by substituting the makeMenu (.) method. I DON'T want to include default menu items...

    Select Mode
    Page view
    To find
    Copy
    Call 12093...
    12093 SMS...
    12093 MMS...
    Add to Contacts

    Now I do menu.deleteAll () in the first line of the makeMenu (.) method. Suggest me if this isn't the right way?

    It deletes all the elements default menu above.

    Now, in the application, the specific menu item get highlighted based on the next action of logic, that I do a menu.setDefault (menuItem).

    But for the instance when some contact number is selected on the screen (usually 'call' option get highlighted on the menu, but here we have removed) the highlight of the menu according to my works item IS NOT pathological and it always shows the menu first point highlighted.

    I suspect it might be because the default menu items have been added (by program then deleted). That's why I decided to override the onMenu (.) method where I'll call makeMenu (...) to the new instance of the Menu (that are not default menu items), so I'll see the menu using menu.show () and then return true.

    Now by the fix above, the highlight of the menu on my terms item works fine regardless of some contact number is highlighted on the screen or not, BUT the menu is displayed on the upper right and not on the bottom left where it should be.

    This approach is correct, or there is a better way to approach this?

    Thank you

    Mukesh

    OK guys... I had the problem!

    The problem is that if any time a highlighted menu item is removed (as in our case, menu item 'Call' is deleted by menu.deleteAll (()) the priority agenda menu get highlighted. This is just the reason why the first menu item get highlighted if the phone number is selected.

    To fix this, I highlight the appropriate menu option by setting up priority for her.

  • How not to lose by default menu items?

    I have a screen that extends from screen and have created my own menu items. Now that the menu items I created appear in the menu. I would also like some of the default items, especially "switching applications", appears in the menu.

    How to include these default menu items?

    Thank you

    call super.makeMenu)

  • Can manage us the Application Switch default menu item event?

    Hello

    I want to do a specific action on the Application Switch (supplied default OS) menu, click point, is it possible? If

    Yes, please tell me how?

    I searched a few listener to be implemented for this purpose, but found nothing.

    Note that I use BlackBerry API 4.3 to develop my application; But if you have any suggestions for superior versions can also provide us with.

    Thank you

    MINDUS

    OP has opened a new Thread with a similar, but more complete question.  I suggest that this discussion moves on this Thread.  See:

    http://supportforums.BlackBerry.com/T5/Java-development/can-we-handle-default-menu-key-click-for-SWI...

  • Custom Menu items are not displayed

    With the help of LV 8.5, I want to change my VI by program menu bar.  I'm not using Edit > Run-time Menu...

    I deleted almost all menu items by default ('File', 'Edition', etc) except "Help", and then inserted my own menu 'Config '.

    In the IDE, it works fine; When I make an executable from my menu does not appear.  Instead, the default items

    I deleted have indeed disappeared, and the only point is "Help".

    What I am doing wrong?  I looked at positions where it says add an element name and the element tag and I looked at all the

    Examples of LV for adding a menu.  Things are fine until I build the executable and then my little menu item just does not appear.

    There is no reason why I couldn't use Edit > run Menu... but I thought I could do it programmatically.  Just trying to understand what causes my menu to not appear.

    Now that I see your code, it makes sense. The reason why it does not work the way you had it before, it is that you are actually getting an error when you run the application. The error is because not all of these menus actually exist in the runtime environment. Thus, the function to delete the Menu items generates an error, and the rest of the code is bypassed. The example removes simply all of the menus, and no error is generated, since only the menus that actually exist get deleted.

  • Send the menu item for OS6

    Hey, help me please...

    I sendmenu sourcecode of blackberry Web site, I try to my BB tour 2 (9650) with operating system version 6 does not work...

    import net.rim.blackberry.api.sendmenu.*;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.EditField;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    import org.json.me.JSONException;
    import org.json.me.JSONObject;
    
    public class SendMenuAPIDemo extends UiApplication
    {
        public static void main(String[] args)
        {
            SendMenuAPIDemo theApp = new SendMenuAPIDemo();
            theApp.enterEventDispatcher();
        }
    
        public SendMenuAPIDemo()
        {
            pushScreen(new SendCommandDemoScreen());
        }
    }
    
    class SendCommandDemoScreen extends MainScreen
    {
    
    //In the screen class, declare instance variables to represent
    //an edit field and the text that the user types in this field.
        private EditField _textToSend;
        private String _textString;
    
        public SendCommandDemoScreen()
        {
            setTitle("Send Menu API Demo");
    
    //In the screen constructor, create a new EditField object to represent
    //the field that the user types in.
            _textToSend = new EditField("Send: ", "Type the text to send here",
                                        255, Field.FIELD_HCENTER);
    
    //To specify the appearance of the EditField object, invoke setBorder(),
    //setPadding(), and setMargin(). In this example, a bevel border is created
    //for the EditField object, and a padding area and margin area are added.
            _textToSend.setBorder(BorderFactory.createBevelBorder(new XYEdges(3, 3, 3, 3)));
            _textToSend.setPadding(8, 8, 8, 8);
            _textToSend.setMargin(15, 15, 15, 15);
    
    //Add the EditField object to the screen.
            add(_textToSend);
        }
    
    //Override makeMenu() of the MainScreen class.
        protected void makeMenu(Menu menu, int instance)
        {
    
    //Invoke super.makeMenu() to add the default menu items for BlackBerry
    //device applications to the menu.
            super.makeMenu(menu, instance);
    
    //Invoke getText() of the EditField class to retrieve the text that
    //the user typed in the edit field.
            _textString = _textToSend.getText();
    
    //Create a new JSONObject object to represent the context
    //information for the Send menu.
            JSONObject context = new JSONObject();
    
    //In a try/catch block, invoke put() of the JSONObject object to populate
    //the context information using key-value pairs. Use the constants that
    //are defined in the SendCommandContextKeys class as keys. Catch a
    //JSONException, which indicates that the specified key is null.
            try
            {
                context.put(SendCommandContextKeys.TEXT, _textString);
                context.put(SendCommandContextKeys.SUBJECT, "Your Text");
            }
            catch (JSONException e)
            {
                System.out.println(e.toString());
            }
    
    //Create an array of SendCommand objects to represent the Send menu commands
    //that you want to include in the Send menu. Invoke
    //SendCommandRepository.getInstance() to retrieve the singleton instance of the
    //SendCommandRepository. Invoke get() and specify as parameters the type of content
    //to send, the context information for the content, and a boolean value
    //that indicates whether all of the commands should be retrieved
    //regardless of whether their associated applications can be opened.
            SendCommand[] sendCommands = SendCommandRepository.getInstance().get(
                                             SendCommand.TYPE_TEXT, context, false);
    
    //Determine whether the array of SendCommand objects is not null and
    //contains commands, and if so, create a new SendCommandMenu object to represent
    //these commands and add it to the menu.
            if (sendCommands != null && sendCommands.length > 0)
            {
                menu.add(new SendCommandMenu(sendCommands, 0, 0));
            }
        }
    }
    

    Help me please, when I opened there is always a view from menu error: Module 'net_rim_bbapi_sendmenu' not found.

    API said "since 7.0', you will not be able to use the OS 6.

  • Delete or remove application menu item switch

    Hello

    I use blackberry api 4.3 for my application and I tested this application in my simulators(9500/9530) api 4.7.

    I don't want to remove all of the default menus (like showkeyboard or hide keyboard, see the symbols, close, switch application).

    I want to delete or remove only switchapplication of the menu item. So is it possible then you can you please give some more

    information about this problem.

    Thank you

    MINDUS

    Sorry, my mistake. You're right, you do not see the menu system default items in makeMenu. Instead, you override getMenu, call super.getMenu () and then search & delete. The ordinal is 268501000 (it's a hack, because this number may change).

    I think you should resolve your question a little differently. I suggest that you add your own Application Switch menu only if the OS does not provide its own, as the point provided operating system will work better.

  • 4.7 deleting application Switch menu item

    Hi all.

    Recently, I tested my app on the simulator of the storm and was surprised to see a new menu item 'native' "Switch application" on my menus.
    Of course, there was the "Show keyboard" I love
    The thing is, I already replace makeMenu to remove native menu items as "Change the input language" but I can't seem to remove the application 'Switch '.
    Still more, if I put a breakpoint in makeMenu, the 'application Switch' and 'See the keyboard' are not present, so I can't delete them

    Manipulation of menu has changed since 4.5 or 4.6?
    How can I remove the 'Switch' application while leaving the "Show keyboard"?

    I'll answer myself:

    The 4.7 introduces another mask of menu option:

    Screen.NO_SYSTEM_MENU_ITEMS
    

    I am yet to discover all the consequences of its use, but id did remove the keyboard and the elements of the application menu.

  • Add the Menu item to default custom Blackberry file browser

    Hello

    I try to add the Menu item by default Blackberry file browser.

    I want to add the menu item 'PRINT' files. It is when I browse through the media-> Explore-> photo, we get a list of images and when clicked on the Menu. I expect the element menu to print it.

    I use ApplicationMenuItemRepository to achieve this. And the documentation says.

    MENUITEM_FILE_EXPLORER
              ApplicationMenuIteminstances registered with this ID appear when the file Explorer application is running.

    MENUITEM_FILE_EXPLORER_BROWSE
              ApplicationMenuIteminstances registered with this ID appear when a user uses the Windows Explorer application to browse files and folders.

    MENUITEM_FILE_EXPLORER_ITEM
              ApplicationMenuIteminstances registered with this ID appear when a user uses the file Explorer application to open a file.

    Whence this Explorer of files mentioned in the CIHI means. I added the Menu item in the browser, and I could see the IMPRESSION here. But I don't know where this IMPRESSION would be visible IF we add the menu item to one of them.

    Thanks in advance.

    Provision ApplicationDescriptor solved my problem.

  • [Need help] Menu item delete

    Hello!

    IAM on a small Menu for InDesign to make life easier for my co-workers.

    Somehow, I do not pay attention for a second and added a new menu item which does not seem to have a name.

    Bildschirmfoto 2016-09-05 um 08.39.34.png

    I use this code to remove the old entries menu / clear an iam working one before reloading:

    main2();
    
    function main2(){
            try{
                app.scriptMenuActions.item("Skripte").remove();
            }
        catch(myException){}
        
        try{
            app.menus.item("$ID/Main").submenus.item("Skripte").remove();
            }catch(e){}
        
        
    }
    

    The problem is that it doesn't seem to work if the Menu item does not have a name in itself... any idea on this?

    Maybe there is a way to do it by "ID"? Or I am too blind to see what is obvious?

    Thanks in advance!

    You can try to remove the sumenu index, for example

    App.menus.Item("$ID/main"). Submenus [3] .abolish)

    If your submenu nameless is the fourth menu. To make sure that you use the correct index, display all submenus of the main menu names. Your name of nameless menu should appear as two commas, as in

    File, edit, layout, Type, object, Table, view, window, help, Math

    This shows that there is a submenu without name between object and table or a submenu [5].

    If this does not work you can always restart InDesign and delete the preferences (Ctrl + Alt + Delete on Windows).

    Peter

  • How can I get rid of the default sharpness when you choose the menu items?

    In addition, there is nothing else to choose. I guess I can go to the lower right corner of the program, choose the item and press DELETE. But interested Id just to change it. Once again, during a flight over a menu item, it shows a cat (as in playing cards) - I would delete what I'm doing for a client of wedding DVD menu items.

    It is the image of highlight for the menu you have selected.

    You cannot just delete it unless you do not want a nail.

    Adobe still * using Photoshop to create menus

    You can make these changes in Encore, but I prefer photoshop.

  • How to remove menu items by default in a Mac Air application

    Hello world

    I have an Air application built in Flash Builder, which runs on Windows, as well as in Mac.

    My application has its own menu bar. In windows, it's OK.

    But in Mac above the menu bar of the application, there is a menu bar by default Mac app with four elements (application, file, Edition, Windows name), which is completely useless.

    I want to remove the menu bar of the Mac by default app.

    Help, please.

    Thanks in advance,

    Jameel

    You can remove them by using the NativeApplication.nativeApplication.menu property to access the native menu.

    import flash.desktop.NativeApplication;

    If {(NativeApplication.nativeApplication.supportsMenu)

    NativeApplication.nativeApplication.menu.removeAllItems ();

    }

    The ASDocs said this removes all menu items, but I imagine that he will allow the "App name" menu on Mac OS computers item so that the user knows which app is currently active and so it can be closed or hidden.

    NativeMenu - Adobe ActionScript® 3 (AS3) QAnywhere

    NativeApplication - Adobe ActionScript® 3 (AS3) QAnywhere

  • Problem with default system menu item "Switch Application"

    I used the system menu item in my app screen. If I select 'Application Switch', I noticed that my app icon becomes empty. The problem doesn't stop here. If I go back to the home screen and in all cases, my icon of gets too empty.

    The system has lost somehow, the application icon.

    Anyone see this problem and suggestions on how to fix?

    Version of Blackberry 6, 9800 Simulator.

    Thank you

    Sherry

    So you see your application autostart - unless it is enforcement, not UiApplication. Also focus on the method of Application.acceptsForeground - you might want to tinker with it.

    Check all the icons in the 'Application Switch' strip - it will be your main application with an icon as well.

  • How to persist a delete menu item?

    I'm looking for help on how to remove an item from the menu of my application. Specifically, how to keep my removal of the menu item

    The code example below, removes the menu item, but when I restart the application, the menu item is back.

    Any help on what to do after that call removeMenuItem is appreciated.

    _AddLicenseItem MyMenuItem = new MyMenuItem();

    addMenuItem (_addLicenseItem);

    ...

    ///////////////////////////////////////////////////////////////////

    Inner classes

    ///////////////////////////////////////////////////////////////////

    private class MyMenuItem extends MenuItem

    {

    MyMenuItem() private

    {

    Super ("my Menu", 0 x 00010000, 13);

    }

    public void run()

    {

    removeMenuItem (this);

    }

    }

    Logic for me!

    For this mark as resolved, you can follow the instructions in help, link here:

    http://supportforums.BlackBerry.com/rim/help_faq#solution_whatis

Maybe you are looking for