-
Notifications
You must be signed in to change notification settings - Fork 0
MUI_Title
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.
Attribute | Version | ISG | Type |
---|---|---|---|
MUIA_Title_Clickable | V20 | I.. | LONG |
MUIA_Title_Closable | V20 | ISG | BOOL |
MUIA_Title_EventHandlerPriority | V20 | I.. | LONG |
MUIA_Title_Newable | V20 | ISG | BOOL |
MUIA_Title_OnLastClose | V21 | IS. | LONG |
MUIA_Title_Position | V20 | ISG | LONG |
MUIA_Title_Sortable | V20 | ISG | BOOL |
Method | Version |
---|---|
MUIM_Title_Close | V20 |
MUIM_Title_FindPage | V22 |
MUIM_Title_New | V20 |
MUIA_Title_Clickable -- V20 [I..], LONG
, 0x80425959
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 -- V20 [ISG], BOOL
, 0x80420402
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 class to handle the method.
Defaults to FALSE.
See supplied Title demo.
MUIA_Title_EventHandlerPriority -- V20 [I..], LONG
, 0x804286bc
- MUIV_Title_EventHandlerPriority_Default
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_Newable -- V20 [ISG], BOOL
, 0x80424145
Setting this attribute to TRUE will add a "+" button after the rightmost tab object. Clicking the "+" button will invoke the MUIM_Title_New method to let the application add a new title button object and a new page object. Title class will NOT add the new tab itself. This task remains the responsibility of the implementing class and hence also requires the developer to implement a subclass of Title class to handle the method.
Defaults to FALSE.
See supplied Title demo.
MUIA_Title_OnLastClose -- V21 [IS.], LONG
, 0x804253cf
- MUIV_Title_OnLastClose_Remove
- MUIV_Title_OnLastClose_WindowAction
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.
MUIA_Title_Position -- V20 [ISG], LONG
, 0x804273a3
- MUIV_Title_Position_Top
- MUIV_Title_Position_Bottom
- MUIV_Title_Position_Left
- MUIV_Title_Position_Right
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 -- V20 [ISG], BOOL
, 0x804211f1
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 -- V20, 0x8042303a
DoMethod(obj, MUIM_Title_Close, Object *tito);
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.
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.
See supplied Titles demo.
MUIM_Title_FindPage -- V22, 0x80423d0d
DoMethod(obj, MUIM_Title_FindPage, Object *titlebutton);
This method will find the page object to the given title button object.
Object *titlebutton
a ponter to a valid title button object
A pointer to the found page object or NULL if the title button object points to no valid page object.
MUIM_Title_New -- V20, 0x804247a6
DoMethod(obj, MUIM_Title_New);
This method will be invoked whenever a new page is to be created when MUIA_Title_Newable is set to TRUE and the user clicked on the "New" button. This method must add a new title button object to the Title object and a new page object to the surrounding Group object.
This method is actually not yet fully implemented.
Copyright © 1992-2006 by Stefan Stuntz Copyright © 2006-2021 by Thore Böckelmann, Jens Maus |
MUI for AmigaOS Homepage MUI for AmigaOS Wiki |
Updated: 11-Oct-2021 |