wiki:Documentation/API/MUI_Title

Title.mui

Super class

Group.mui

Background

Title class is the new replacement class for the old register class. It offers much more flexibility regarding dynamic page adding/removal as well as improved handling of many tabs and possibilities for the tab titles itself.

The most basic way to make use of Title class looks like this:

VGroup,
  Child, TitleObject,
    Child, TextObject, MUIA_Text_Contents, "page 1", End,
    Child, TextObject, MUIA_Text_Contents, "page 2", End,
    Child, TextObject, MUIA_Text_Contents, "page 3", End,
  End,

  Child, [page 1 contents],
  Child, [page 2 contents],
  Child, [page 3 contents],
End

The title class object always must be the very first object within the surrounding group. All following children of the surrounding group correspond to the individual pages. Unlike Register class the tabs titles are no longer simple texts but true objects now. This means that an application can use any combination of groups, texts and images with arbitrary layout instead of just plain texts. In addition to Register class Title class can handle an infinite amount of tabs. If there is not enough space to display all tabs only a few tabs will be displayed along with scroll buttons to make the currently invisible tabs visible. These scroll buttons also feature a context menu to let the user choose the active page from all available pages.

The Title demo implements a custom class as subclass of Title class to show how dynamic adding/removal of tabs/pages is to be done.

Attributes

Attribute Version ISG Type
MUIA_Title_Clickable V20I..LONG
MUIA_Title_Closable V20ISGBOOL
MUIA_Title_EventHandlerPriority V20I..LONG
MUIA_Title_OnLastClose V21IS.LONG
MUIA_Title_Position V20ISGLONG
MUIA_Title_Sortable V20ISGBOOL


Methods

Method Version
MUIM_Title_Close V20


MUIA_Title_Clickable

NAME

MUIA_Title_Clickable — V20 [I..], LONG, 0x80425959

FUNCTION

Setting this attribute to FALSE will let the Title object ignore all clicks on its tabs and hence prevent page changes.

Defaults to TRUE.

MUIA_Title_Closable

NAME

MUIA_Title_Closable — V20 [ISG], BOOL, 0x80420402

FUNCTION

Setting this attribute to TRUE will add a close button to each tab object. Clicking the close button will invoke the MUIM_Title_Close method with a pointer to the tab object the close buttons corresponds to. Title class will NOT close the tab itself. This task remains the responsibility of the implementing class and hence also requires the developer to implement a subclass of Title.mui to handle the method.

Defaults to FALSE.

EXAMPLE

See supplied Title demo.

SEE ALSO

MUIM_Title_Close

MUIA_Title_EventHandlerPriority

NAME

MUIA_Title_EventHandlerPriority — V20 [I..], LONG, 0x804286bc

SPECIAL INPUTS

  • MUIV_Title_EventHandlerPriority_Default

FUNCTION

Defines the priority of the internal eventhandler. This attribute is of use only if you need to do something before the internal eventhandler and eventually might eat the events you are interested in.

Defaults to MUIV_Title_EventHandlerPriority_Default.

MUIA_Title_OnLastClose

NAME

MUIA_Title_OnLastClose — V21 [IS.], LONG, 0x804253cf

SPECIAL INPUTS

  • MUIV_Title_OnLastClose_Remove
  • MUIV_Title_OnLastClose_WindowAction

FUNCTION

This attribute defines how the object will react when the last tab is to be closed. Setting this attribute to MUIV_Title_OnLastClose_Remove will invoke the usual MUIM_Title_Close method on the object. Setting the attribute to MUIV_Title_OnLastClose_WindowAction will trigger a close request on the object's window.

Defaults to MUIV_Title_OnLastClose_Remove.

SEE ALSO

MUIM_Title_Close

MUIA_Title_Position

NAME

MUIA_Title_Position — V20 [ISG], LONG, 0x804273a3

SPECIAL INPUTS

  • MUIV_Title_Position_Top
  • MUIV_Title_Position_Bottom
  • MUIV_Title_Position_Left
  • MUIV_Title_Position_Right

FUNCTION

Defines the position of the tab titles. Currently only top and bottom placement is implemented. Left and right placement will hopefully be implemented in near future.

Defaults to MUIV_Title_Position_Top.

MUIA_Title_Sortable

NAME

MUIA_Title_Sortable — V20 [ISG], BOOL, 0x804211f1

FUNCTION

Define whether the individual tabs can be rearranged by drag'n'drop operations. Title class will rearrange both the tab title objects as well as the page objects after a drag'n'drop operation.

Defaults to FALSE.

MUIM_Title_Close

NAME

MUIM_Title_Close — V20, 0x8042303a

SYNOPSIS

DoMethod(obj, MUIM_Title_Close, Object *tito);

FUNCTION

This method will be invoked with a pointer to the to be closed tab object when MUIA_Title_Closable is set to TRUE and the user clicks the close button. The tab object as well as its corresponding page object will be removed and disposed.

NOTES

This method will actually be pushed onto the application's method stack instead of being invoked directly to avoid possible crashes due to how MUI handles input stuff internally. So don't be surprised if the method is eventually invoked a tiny little bit later as you might expect it.

EXAMPLE

See supplied Titles demo.

SEE ALSO

MUIA_Title_Closable


Copyright © 1992-2006 by Stefan Stuntz
Copyright © 2006-2017 by Thore Böckelmann, Jens Maus

MUI for AmigaOS - MUI-Autodocs

Updated: 13-Dec-2017

Last modified 9 months ago Last modified on Mar 27, 2017, 4:10:16 PM