зеркало из https://github.com/mozilla/pjs.git
Implement ListenToMessage and trap the message from the IconCache to call a pure virtual. Means subclasses don't have to override ListenToMessage.
This commit is contained in:
Родитель
ff2cf9fa06
Коммит
9b6cf092b1
|
@ -52,6 +52,20 @@ CImageIconMixin :: ~CImageIconMixin ( )
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// ListenToMessage
|
||||
//
|
||||
// Listen for the update of image and then
|
||||
//
|
||||
void
|
||||
CImageIconMixin :: ListenToMessage ( const MessageT inMessage, void* ioData )
|
||||
{
|
||||
if ( inMessage == CIconContext::msg_ImageReadyToDraw )
|
||||
ImageIsReady();
|
||||
|
||||
} // ListenToMessage
|
||||
|
||||
|
||||
//
|
||||
// DrawIcon
|
||||
//
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
//
|
||||
// class CImageIconMixin
|
||||
//
|
||||
// Draw an image, most likely as an icon
|
||||
// Draw an image, most likely as an icon.
|
||||
//
|
||||
class CImageIconMixin : public LListener
|
||||
{
|
||||
|
@ -59,6 +59,13 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
// catch the message that the image is ready to draw
|
||||
virtual void ListenToMessage ( MessageT inMessage, void* ioPtr ) ;
|
||||
|
||||
// called when the image is ready to draw. This should do something like
|
||||
// refresh the view.
|
||||
virtual void ImageIsReady ( ) = 0;
|
||||
|
||||
// Draw a scaled image as an icon. Override to draw differently
|
||||
virtual void DoDrawing ( DrawingState & inState, const Point & inTopLeft,
|
||||
const IconTransformType inTransform, Uint32 inWidth,
|
||||
|
|
Загрузка…
Ссылка в новой задаче