bool WHotSpotList::paint() //----------------------- { int offset; int maxRows = numDirtyRows() + _topIndex + firstDirtyRow(); int numElem = count(); int extent; WRect r; getClientRect( r ); for( int i = _topIndex + firstDirtyRow(); i < maxRows && i < numElem; i += 1 ) { const char * str = getString( i ); int hotSpot; if( i == _hotPressIdx && _inHotZone ) { hotSpot = getHotSpot( i, TRUE ); } else { hotSpot = getHotSpot( i, FALSE ); } if( _hs != NULL ) { WPoint hotSize; _hs->hotSpotSize( hotSpot, hotSize ); offset = getHotOffset( i ) + hotSize.x(); drawHotSpot( hotSpot, i - _topIndex, getHotOffset( i ) ); } else { offset = 0; } extent = r.w(); if( width() > extent ) extent = width(); if( i == _selected ) { drawTextExtent( i - _topIndex, offset, str, WPaintAttrMenuActive, extent ); } else { drawTextExtent( i - _topIndex, offset, str, WPaintAttrControlBackground, extent ); } } return TRUE; }
bool WFlashPage::paint() //----------------------- { for( int i=0; i<_text.count(); i++ ) { const char* text = _text.cStringAt( i ); int off = (_width - getTextExtentX( text )) / 2; drawTextExtent( i, off, text, WPaintAttrBackground, _width ); } WPoint hotSize; _hotSpot->hotSpotSize( _idx, hotSize ); drawHotSpot( _idx, _text.count(), (_width - hotSize.x())/2 ); return( true ); }