wiki:Documentation/API/MUI_Balance

Version 1 (modified by Thore Böckelmann, 4 years ago) (diff)

Balance.mui

Super class

Area.mui

Background

The Balance class is very simple. Inserting objects of this class somewhere in your group (only horizontal or vertical groups, nothing 2-dimensional) allows your users to dynamically change the weight of your children.

Since MUI5 2018R1 (muimaster.library 21.121) Balance class implements the additional features of BetterBalance.mcc. This means that the user can save and restore the balanced weights of the neighboring objects for each Balance object with a unique MUIA_ObjectID during MUIM_Application_Save and MUIM_Application_Load.

Something like this will automatically restore and save the weights of the two Rectangle objects:

HGroup,
  Child, RectangleObject, TextFrame, End,
  Child, BalanceObject, MUIA_ObjectID, 0x12345678, End,
  Child, RectangleObject, TextFrame, End,
End,

// restore the formerly saved weights before the window is opened
DoMethod(app, MUIM_Application_Load, MUIV_Application_Load_ENV);

[... main loop ...]

// save the current weight upon application termination
DoMethod(app, MUIM_Application_Save, MUIV_Application_Save_ENV);

Of course the application might override MUIM_Application_SnapshotWindow to save the weight during snapshotting the window or provide a special "Save" button for that purpose.

Refer to the source of the Balancing demo for more details.

Attributes

Attribute Version ISG Type
MUIA_Balance_Quiet V20I..LONG


MUIA_Balance_Quiet

NAME

MUIA_Balance_Quiet — V20 [I..], LONG, 0x80427486

FUNCTION

If set to TRUE the balance object will show its frame only if the mouse is located over the object. Otherwise it will be invisible.

Defaults to FALSE.


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

MUI for AmigaOS - MUI-Autodocs

Updated: 01-Jul-2020