0

As in create button pad statement:

Create ButtonPad { title_string | ID pad_num } As
        button_definition [ button_definition ... ] 
    [ Title title_string ]
    [ Width w ]
    [ Position ( x, y ) [ Units unit_name ] ]
    [ ToolbarPosition ( row, column ) ]
    [ { Show | Hide } ] 
    [ { Fixed | Float } ]

And In create button

{ PushButton | ToggleButton | ToolButton }
    Calling { procedure | menu_code | OLE methodname | DDE server, topic }
    [ ID button_id ]
    [ Icon n [ File file_spec ] ]
    [ Cursor n [ File file_spec ] ]
    [ DrawMode dm_code ] 
    [ HelpMsg msg ]
    [ ModifierKeys { On | Off } ] 
    [ Enable ] [ Disable ]
    [ Check ] [ Uncheck ]

As for my question the default button may already have ID so how would we know that ID is unique.

1 Answer 1

1

If you want to see what IDs MapInfo assigns to menus, buttonpads and buttons, open the file MENU.def up in a text editor (Notepad is fine, I use Notepad++). The file is installed to the following location:

C:\Program Files\MapInfo\MapBasic (assuming you installed MapBasic in the default location).

This will give you all of the IDs of the menu commands and buttons that MapInfo uses.

1
  • There actually is a good point to your question. Default menu items/buttons do not have any specific ID, but you cna always get to them thru their handle (the ID they are calling). However other applications might use the same ID as you do. So here there is a chance for conflict. But that also let's you call features in other applications - as long as you know their ID. Commented Aug 26, 2011 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.