Gadgets > Rogue Wave Views Gadgets > Customizing the Look and Feel > Making a User-Defined Component Look-and-Feel Dependant > Subclassing the Object Look-and-Feel Handler
 
Subclassing the Object Look-and-Feel Handler
Once the API of the object look-and-feel handler has been defined, you can implement various subclasses corresponding to different look-and-feel styles. For example, here we create the subclass of MyComponentLFHandler dedicated to the Motif look, the MyComponentMLFHandler class:
class MyComponentMLFHandler : public MyComponentLFHandler
{
MyComponentMLFHandler(IlvLookFeelHandler* lfh) :
MyComponentLFHandler(lfh) {}
...
virtual void draw(const MyComponent* object,
IlvPort* dst,
const IlvTransformer* t,
const IlvRegion* clip) const;
virtual IlBoolean handleEvent(MyComponent* object,
IlvEvent& event) const;
...
};
You need now to install your object look-and-feel handlers so that they will be used when the corresponding look and feel is set.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.