Label::attachToComponent Q / FR


#1

I’d like to be able to find out if a label is attached to another component in my LAF class. Is there a way to this?

If not, could Label be updated to have public getComponentWeAreAttachedTo () and isAttachedOnLeft() methods.


#2

Yes, that’s a pretty reasonable request - how about these:

[code] /** If this label has been attached to another component using attachToComponent, this
returns the other component.

    Returns 0 if the label is not attached.
*/
Component* getAttachedComponent() const throw()                             { return ownerComponent; }

/** If the label is attached to the left of another component, this returns true.

    Returns false if the label is above the other component. This is only relevent if 
    attachToComponent() has been called.
*/
bool isAttachedOnLeft() const throw()                                       { return leftOfOwnerComp; }

[/code]


#3