MapInfo Pro

 View Only
  • 1.  Disable menu ribbon

    Posted 03-25-2024 09:30
    Edited by Peter Møller 04-02-2024 01:53
    Hello. I have a menu with its options and I want the option to be disabled. And then with a code that can activate it. That is, I want an analogue of ALTER MENU ID 150 DISABLED
    Dim DropObjeto as This
    DropObjeto = MICtrlCollAddStrStrInt(EielControlCol, "DropObjeto", "Objetos    ", ControlType_DropDownButton)
    
    Dim DropControlObjeto as This
    DropControlObjeto = GetRbnDropDownCtrlCtrls(DropObjeto)
    
    Dim btnMarca, btnMarca2, btnCombinar, btnDividir, btnDividir2, btnBorrar1, btnBorrar2, btnCRegiones, btnCPoli, sepObjeto1, sepObjeto2, sepObjeto3 as This
    
    btnMarca = MICtrlCollAddStrStrInt(DropControlObjeto, "OpenBtn", "Establecer marca", ControlType_Button)
    Call SetRbnBtnCtrlSmallIcon(btnMarca, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/openTable_32x32.png", 0))
    Call SetRbnBtnCtrlCallingHandler (btnMarca, "SelectTarget")
    Thanks



    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------



  • 2.  RE: Disable menu ribbon

    Employee
    Posted 04-02-2024 02:02

    Hi Mayca

    If you have used the RibbonLib from the MapBasic Common Libraries, you may also be aware of the many procedures in this module for handling controls.

    The one you want to look at is RBNControlEnableThs.

    It holds numerous calls to the various dedicated methods for the specific control type.

    For the Button control type, you want to use this:

    Call SetRbnBtnCtrlEnabled(rbnControl, bEnabled)

    The bEnabled variable can be True or False depending on whether you want to Enable to Disable to control.



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: Disable menu ribbon

    Posted 04-02-2024 05:17

    Ok. Thanks



    ------------------------------
    Mayca González Pérez
    COMUNIDAD. AUT. REG MURCIA
    ------------------------------