MapInfo Pro Developers User Group

Welcome to the MapInfo Pro Developers community!  We are a group dedicated to the discussion and understanding of MapBasic and .Net MapInfoPro AddIn development. Bring your questions and ideas here. This group includes several members of the Pro development team from around the world.

Please feel free to start a discussion in the discussion tab or join in a conversation.

Product Information  Ideas Portal  MapInfo Community Downloads

Discussions

Members

Resources

Events

 View Only
  • 1.  icon menu

    Posted 04-22-2024 07:34
    Edited by Peter Møller 04-23-2024 03:03
    Hello. I have this code where a menu is displayed, how can I configure the menu icon
    EielRTab = RbnTabCollAddStrStr (RibbonTabColl, "EIELTab", "EIEL")
    EielGroupColl =  GetRbnTabGrps(EielRTab)
    
    'a?dimos un grupo a la pesta?a
    EielGroup = RbnCtrlGrpCollAddStrStr(EielGroupColl, "MBGroup", "EIEL")
    EielControlCol = GetRbnCtrlGrpCtrls(EielGroup)
    
    Dim DropArchivo as This
    DropArchivo = MICtrlCollAddStrStrInt(EielControlCol, "DropArchivo", "Archivo    ", ControlType_DropDownButton)
    
    Dim DropControlArchivo as This
    DropControlArchivo = GetRbnDropDownCtrlCtrls(DropArchivo)
    
    Dim btnAbrirA, btnCerrarA, btnGuardarA, btnGuardarCA, btnENucleo, btnEMunicipio, btnIRegistro, btnImprimir, btnSalir, sepArchivo1,  sepArchivo2, sepArchivo3, sepArchivo4 as This
    
    btnAbrirA = MICtrlCollAddStrStrInt(DropControlArchivo, "OpenBtn", "Abrir", ControlType_Button)
    Call SetRbnBtnCtrlSmallIcon(btnAbrirA, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/openFolder_16x16.png", 0))
    Call SetRbnBtnCtrlCallingHandler (btnAbrirA, "Abrir") 
    
    btnCerrarA = MICtrlCollAddStrStrInt(DropControlArchivo, "OpenBtn", "Cerrar", ControlType_Button)
    Call SetRbnBtnCtrlSmallIcon(btnCerrarA, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/closeAll_16x16.png", 0))
    Call SetRbnBtnCtrlCallingHandler (btnCerrarA, "Cerrar") 
    
    sepArchivo1 = MICtrlCollAddStrStrInt(DropControlArchivo, "Sep", "Sep", ControlType_MenuItemSeparator) 
    
    btnGuardarA = MICtrlCollAddStrStrInt(DropControlArchivo, "OpenBtn", "Guardar", ControlType_Button)
    Call SetRbnBtnCtrlSmallIcon(btnGuardarA, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/saveAll_16x16.png", 0))
    Call SetRbnBtnCtrlCallingHandler (btnGuardarA, "Guardar_Tablas") 
    
    btnGuardarCA = MICtrlCollAddStrStrInt(DropControlArchivo, "OpenBtn", "Guardar copia como...", ControlType_Button)
    Call SetRbnBtnCtrlSmallIcon(btnGuardarCA, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/saveCopyAs_16x16.png", 0))
    Call SetRbnBtnCtrlCallingHandler (btnGuardarCA, "Guardar_Copia_Tabla") 
    Thanks



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



  • 2.  RE: icon menu

    Employee
    Posted 04-23-2024 03:10

    You can set the icon for the DropDown Button after creating it:

    Call SetRbnDropDownCtrlSmallIcon(DropArchivo, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/openFolder_16x16.png", 0))



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



  • 3.  RE: icon menu

    Posted 04-23-2024 15:35

    Ok. 

    Thanks



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



  • 4.  RE: icon menu

    Posted 04-24-2024 17:29
    Another thing, how can I put an image from the icon.def file as an icon to a button and not URI
    
    Dim btnPunto, btnPuntoCoor as This
      btnPunto = MICtrlCollAddStrStrInt(EielControlColPunt, "Punto", "Punto", ControlType_ToolButton) 'ControlTypes are defined in Enums.def
    Call SetRbnToolBtnCtrlDrawMode(btnPunto, DM_CUSTOM_POINT) 'DrawModes are define din Icons.def
    Call SetRbnToolBtnCtrlCallingHandler(btnPunto, "Punto2")
    Call SetRbnToolBtnCtrlCursor(btnPunto, "3")
    Call SetRbnToolBtnCtrlIsLarge (btnPunto, TRUE)
    Call SetRbnToolBtnCtrlLargeIcon(btnPunto, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Table/createPoints_32x32.png", 0))
    ?


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



  • 5.  RE: icon menu

    Posted 04-25-2024 01:57
    I already found the function

    Call SetRbnToolBtnCtrlLargeIcon(btnPuntoCoor, New_Uri("pack://legacyorigin:,,,/"&  MI_ICON_CROSSHAIR & ";Large", 0))    


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