MojoX responsive Pushbutton?

About Monkey 2 Forums Monkey 2 Programming Help MojoX responsive Pushbutton?

This topic contains 4 replies, has 2 voices, and was last updated by  CopperCircle 1 year, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10576

    CopperCircle
    Participant

    Hi, I am having a play with MojoX and wondered what would be the best way to create a pushbutton (with icon) that would word wrap its label based on its width, so if there is not enough width to draw the text label, it wraps to the next line and the button height grows?

    It would also be good to have a MojoX section on the forums as there are lots of snippets and classes that extend its functionality, but its hard to find them all, Ted2Go has lots of cool extensions be nice to put them somewhere as a bunch of code snippets.

    #10580

    nerobot
    Participant

    For pushbutton icon – something like IconAnchor, or Left/Right/Top/Bottom-Icon properties.

    #10592

    CopperCircle
    Participant

    Is it possible to set a pushbutton label text to wrap?

    #10600

    nerobot
    Participant

    No, but you can create own version of Label.

    Override onMeasure and onRender methods.

    But note that wrap mode needs a trick with size measuring. If you want to use preferred width via setting MinSize / MaxSize then no problem with measure.

    You can see sources of mojox.TextView to (try) understand how wrap works.

    #10607

    CopperCircle
    Participant

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.