Led 3.0 Class Library Documentation

Module LedHandySimple


Classes and Global Functions Index

Module Description:

A collection of fairly simple, hopefully (for some) handy utility claasses and routines using various parts of Led.This module will probably end up requiring linking in alot of Led - as its fairly diverse in nature. Perhaps that will get fixed in a future release?


Class: WaterMarkHelper < TEXTSTORE,WORDPROCESSOR > [public]

Description:

TEXTSTORE defaults to ChunkedArrayTextStore and WORDPROCESSOR defaults to WordProcessor

This can be used to draw a bit of styled (or other) as a watermark background. For example, you can override TextImager::EraseBackground () like this:

    void	MyLedBasedView::EraseBackground (Led_Tablet tablet, const Led_Rect& subsetToDraw, bool printing)
    {
        inherited::EraseBackground (tablet, subsetToDraw, printing);
        static	WaterMarkHelper<>	waterMarkerImager (LED_TCHAR_OF ("Demo Mode")); // make this static - just as a performance hack. Also could be an instance variable of 'this'.
        waterMarkerImager.DrawWatermark (tablet, GetWindowRect (), subsetToDraw);
    }
	

Note - if you do this - you should also call

	SetUseBitmapScrollingOptimization (false);
	
in your view's constructor, since scrolling bits won't work with a watermark background.


DrawTextBox < WORDWRAPPEDTEXTIMAGER,SIMPLETEXTIMAGER,TEXTSTORE > [public]

template < class WORDWRAPPEDTEXTIMAGER, class SIMPLETEXTIMAGER, class TEXTSTORE >

Trivial wrapper on TrivialImager etc, except it handles case of word wrapping as a parameter. So this is roughly a replacement for the Win32 SDK routine DrawText () - except its implemented by Led (and so UNICODE friendly, for example).

Note - this is done as a template - rather than directly as a function - so as to avoid forcing people who include Led_MFC from also including all these other modules required for this. There is a global function version of this function (Led_DrawText) which will be enabled/included in your program if you define qSupportDrawTextGetTextExtent.

See also GetTextExtent


GetTextExtent < WORDWRAPPEDTEXTIMAGER,SIMPLETEXTIMAGER,TEXTSTORE > [public]

template < class WORDWRAPPEDTEXTIMAGER, class SIMPLETEXTIMAGER, class TEXTSTORE >

Trivial wrapper on TrivialImager etc, except it handles case of word wrapping as a parameter. So this is roughly a replacement for the Win32 SDK routine GetTextExtent() - except its implemented by Led (and so UNICODE friendly, for example).

Note - this is done as a template - rather than directly as a function - so as to avoid forcing people who include LedHandySimple from also including all these other modules required for this.

See also DrawTextBox


Return to Led Page Return to Led ClassLib Documentation Index Return to Led Reference Manual Index
Last Updated 2001-10-20