MapInfo Pro Developers User Group

 View Only
  • 1.  github.com

    Posted 10-28-2017 15:46
      |   view attached

    Hi All,

    Last year I started working on a wrapper for @Peter Horsbøll Møller?'s RIBBONLib. These days I barely use MapBasic, but I know the library will be useful to someone who is just getting to grips with the ribbon interface!

    You can find the library here:

    https://github.com/sancarn/MapBasic_SimpleRibbonButtons/

    And here's an example demonstrating how easy it is to use:

    See Attachment

     Notice you don't need to create the tabs and groups, or mess around with ControlIDs. All of that is done automatically by the library!

    The library is far from complete, and that's not helped by me not using MapBasic much these days... Anyway if you want to keep developing on it, be my guest! :) As far as I remember I was half way through implementation of a simple split button, when I stopped developing the library.

    Anyway this will help those who are making a simple small application with MapBasic, who doesn't need the full power of the ribbon.

    Happy coding!



  • 2.  RE: github.com

    Employee
    Posted 11-07-2017 03:49

    I like your thinking, James.

    I too have had some considerations on creating an even easier way to build the ribbon interface than the current implementation of the RIBBONLib.

    My thinking sofar had been to omit the "position" for the control to be added in all the creating procedures and add a way to set the current position instetad.

    For instance you could do like this:

    Call AddTAB("somename", "somecaption")

    Call AddGroup("somename", "somecaption")

    Call AddButton("somename", "somecaption", "somehandler", "someicon")

    The idea here is that when you create a new tab, this becomes the current tab. When you add a new group, this becomes the current group. And the AddButton would basically use the current tab and group as that typically is what developers would expect.

    Of course there should also be procedures for setting the current tab, current group and potentially a current control too so that you can add controls to a control, for instance a SplitButton or a DropdownButton.

    Sofar, this is still a "work in progress" that hasn't gone further than my mind.

    Do you think that would make sense?

    Any other suggestions?



  • 3.  RE: github.com

    Posted 11-08-2017 07:07

    Hmm yeah. That actually sounds like a really good idea! It'd at least bring a more object oriented feel to MapBasic. Currently the system is pretty old school, like the win32 api :P Seeing this implementation would definitely simplify everything a great deal :)



  • 4.  RE: github.com

    Employee
    Posted 11-08-2017 11:16

    And it might even make some things more simple like building nested menus which the RIBBONLib currently doesn't support.

    I would however have to change the way I currently store the controls added via the RIBBONLib but I do have some ideas around this too.