MapInfo Pro

Expand all | Collapse all

Access to icon for buttons

  • 1.  Access to icon for buttons

    Posted 10-25-2020 16:13
    Hello,
    I use MapInfo 19 and in MapBasic I try to add an icon to a button following to your example:
      Call SetRbnBtnCtrlLargeIcon(button1, New_Uri("pack://application:,,,/MapInfo.StyleResources;component/Images/Mapping/openTable_32x32.png", 0))
    But when I open the mbx-file in MapInfo I get an error:
      MapInfo
    ---------------------------
    (modulemain.mb:48) Unhandled exception in external method (UriFormatException): Invalid URI: Invalid port specified.

    It means that the the path is not found. How can I solve this problem?
    And one more question: is there another way to add an icon like it was in old version where it was possible to write just
    the following:
    Icon MI_ICON_SEARCH_RECT
    in the definition of ToolButton or PushButton ?
    Thank you

    ------------------------------
    Evgeny Kleiman
    Knowledge Community Shared Account
    ------------------------------


  • 2.  RE: Access to icon for buttons

    Posted 10-25-2020 17:39
    Sorry, I found that I missed command

    Call RegisterUriParser(New_GenericUriParser(1), "pack", -1)
    So the problem is solved.  But may be there is answer to my second question?



    ------------------------------
    Evgeny Kleiman
    Knowledge Community Shared Account
    ------------------------------



  • 3.  RE: Access to icon for buttons

    Posted 10-26-2020 06:36
    If you are creating a very basic interface, you can just stick to using the Create/Alter Buttonpad statement. We have modified this slightly so that it has better support for placing your controls/buttons anyway on the ribbon.

    There is a post on that topic here: Adding control to the ribbon using the Alter/Create buttonpad statement.

    These statements now lets you specify the tab and also the size of the control. And you do of course not have to change the icon used.

    You can also use the "old" icon definition when adding control using the new way of building the control. It has been discussed here: Using legacy icons in applications for 64 bit MapInfo Pro.


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



  • 4.  RE: Access to icon for buttons

    Posted 10-26-2020 07:10
    Thank you very much. It was really helpful.

    ------------------------------
    Evgeny Kleiman
    Knowledge Community Shared Account
    ------------------------------



  • 5.  RE: Access to icon for buttons

    Posted 10-31-2020 02:39
    Dear Peter,
    I have a Knowledge Community Shared Account in the community as Evgeny Kleiman. Yesterday the site requested from me mail and password and then I got a message that it is wrong and the account will be locked after 6 attempts. I selected the option "Forgot password" and gave this address to send me a link to reestablish the password. The link was sent   but I did not receive it and it was sent 3 times.  So I do not have the possibility to write new questions to discussions.
      Could you please help me to reestablish my account?
    Thank you
    Evgeny Kleiman