Led 3.0 Class Library Documentation

Module HiddenText

Classes and Global Functions Index

Module Description:

This module provides generic support for keeping arbitrary ranges of text hidden within a Led buffer, but making it available for later display.


Class: ColoredUniformHidableTextMarkerOwner [public]

Base Classes: UniformHidableTextMarkerOwner

A UniformHidableTextMarkerOwner where you can specify (simply) a color for the hidable text markers (when they are shown).

Class: HidableTextMarkerHelper < BASECLASS > [public]

Base Classes: BASECLASS

Class: HidableTextMarkerOwner [public]


HidableTextMarkerOwner is a MarkerOwner class, collecting together a set of HidableTextMarkerOwner::HidableTextMarker elements. Each of these hidden-text elements can contain either currently hidden text, or text which could potentially be hidden.

Note that not all HidableTextMarkerOwner::HidableTextMarker elements need to share the same 'hidden' / 'shown' state. Some can be hidden while others shown. And markers of different subclasses of HidableTextMarkerOwner::HidableTextMarker can be collected together in a single, or in multiple HidableTextMarkerOwners.

See HidableTextMarkerOwner::HidableTextMarker for more details, and subclasses.

Implemenation Note:
I considered implementing this using a map<> for its red-black tree implementation. That might turn out to be faster if you have lots of hidden text. But the APIs STL provides you when you try todo this are not very friendly. I battled them for a while (you must make a map with a second bogus field, and then everywhere try to say 'first' after you access the interator - and thats not so bad in MY code - but when I use the builtin STL helpers - its more of a pain, and then the lookup - find routine was a real pain - cuz I don't want to lookup by Marker* - but by POSITION).

Member Details

HidableTextMarkerOwner::CollapseMarker [public]

void HidableTextMarkerOwner::CollapseMarker (HidableTextMarker* m)

HidableTextMarkerOwner::GetHidableRegions [public]

DiscontiguousRun < bool > HidableTextMarkerOwner::GetHidableRegions (size_t from, size_t to) const

Return a DiscontiguousRun list (where DATA=void) of regions of hidable text. Regions returned are relative to offset 'from'. So - for example - if we have hidden text from 5..8, and you call GetHidableRegions (2,8) you'll get back the list [[3,3]].

NB: this routine only returns the hidable regions which are currently being SHOWN - not any invisible ones. This is because otherwise the run information would be useless, and not convey the actual sizes of the hidden text.

See also HidableTextMarkerOwner::GetHidableRegionsWithData.

HidableTextMarkerOwner::GetHidableRegionsContiguous [public]

bool HidableTextMarkerOwner::GetHidableRegionsContiguous (size_t from, size_t to, bool hidden) const

If 'hidden' is true - then return true - iff the entire region from 'from' to 'to' is hidden. If 'hidden' is false, then return true iff the entire region from 'from' to 'to' contains no hidden elements.

HidableTextMarkerOwner::HideAll [public]

void HidableTextMarkerOwner::HideAll ()

Tell all the existing 'hidden text' markers (optionally restricted to those intersecting the 'from' .. 'to' range) to hide themselves. This does not create any new HidableTextMarkerOwner::HidableTextMarkers. Call HidableTextMarkerOwner::MakeRegionHidable for that.

See HidableTextMarkerOwner::ShowAll to re-show them.

HidableTextMarkerOwner::MakeHidableTextMarker [public]

HidableTextMarkerOwner::HidableTextMarker* HidableTextMarkerOwner::MakeHidableTextMarker ()

This routine creates the actual marker objects to be used to hide text.

By default - it creates HidableTextMarkerOwner::FontSpecHidableTextMarker markers. You can override this to create different style markers, or to set differnt color etc attributes for use in your HidableTextMarkerOwner subclass.

HidableTextMarkerOwner::MakeRegionHidable [public]

void HidableTextMarkerOwner::MakeRegionHidable (size_t from, size_t to)

Mark the region from 'from' to 'to' as hidable. This could involve coalescing adjacent hidden text markers (though even adjacent markers are sometimes NOT coalesced, if they differ in shown/hidden state, or if one is already hidden - cuz then it would be too hard to combine the two).

This routine assures that after the call - all text in the given range is encapsulated by a hidden-text marker or markers.

Note - this does NOT actually hide the text. You must then call HidableTextMarkerOwner::HideAll and give it the same range given this function to get the text to actaully disapear from the screen.

See also HidableTextMarkerOwner::MakeRegionUnHidable

HidableTextMarkerOwner::MakeRegionUnHidable [public]

void HidableTextMarkerOwner::MakeRegionUnHidable (size_t from, size_t to)

Remove any hidable-text markers in the given range. The markers could be either hidden or shown at the time. This could involce splitting or coalescing adjacent markers.

See also HidableTextMarkerOwner::MakeRegionHidable.

HidableTextMarkerOwner::ReifyMarker [public]

void HidableTextMarkerOwner::ReifyMarker (HidableTextMarker* m)

HidableTextMarkerOwner::SetExternalizer [public]

void HidableTextMarkerOwner::SetExternalizer (const Led_RefCntPtr < FlavorPackageExternalizer > & e)

Sets the externalizer (FlavorPackageExternalizer subclass). to be used with this class. It defaults to FlavorPackageExternalizer.

HidableTextMarkerOwner::SetInternalizer [public]

void HidableTextMarkerOwner::SetInternalizer (const Led_RefCntPtr < FlavorPackageInternalizer > & i)

Sets the internalizer (FlavorPackageInternalizer subclass). to be used with this class. It defaults to FlavorPackageInternalizer.

HidableTextMarkerOwner::ShowAll [public]

void HidableTextMarkerOwner::ShowAll ()

Tell all the existing 'hidden text' markers (optionally restricted to those intersecting the 'from' .. 'to' range) to show themselves. This does not destroy any new HidableTextMarkerOwner::HidableTextMarkers. It merely re-installs their context into the document so that it can be seen and edited.

See also HidableTextMarkerOwner::HideAll.

Class: HidableTextMarkerOwner::FontSpecHidableTextMarker [public]

Base Classes: SimpleStyleMarkerByFontSpec < BASECLASS > , where BASECLASS = @HidableTextMarkerHelper < BASECLASS > ' where BASECLASS = HidableTextMarkerOwner::HidableTextMarker

Adds the argument style specification to the selected text. Smart enough to handle style overlaps with some kinds of style markers (most importantly - StandardStyledTextImager::StandardStyleMarker).

May have to also add embedding support to this. And may want to move this functionality out of here, and into some other helper file, and just USE the functionality here.

See also HidableTextMarkerOwner::LightUnderlineHidableTextMarker.

Class: HidableTextMarkerOwner::HidableTextMarker [public]

Base Classes: StyledTextImager::StyleMarker

Class: HidableTextMarkerOwner::LightUnderlineHidableTextMarker [public]

Base Classes: HidableTextMarkerHelper < BASECLASS > , where BASECLASS = SimpleStyleMarkerWithLightUnderline < BASECLASS > , where BASECLASS = @HidableTextMarkerOwner::HidableTextMarker'

Adds a light dashed underline to the given region. One advantage of this over HidableTextMarkerOwner::FontSpecHidableTextMarker is that it works well with other embeddings and display markers, cuz it lets them do their drawing, and simply adds the underline.

Class: UniformHidableTextMarkerOwner [public]


UniformHidableTextMarkerOwner is a HidableTextMarkerOwner class, which has a notion of whether or not all the hidden text markers are hidden or not. You can manually change the hidden state of particular markers - if you wish (via HidableTextMarkerOwner::HideAll () commands with a from/to range).

But the default behavior is that all the markers share this hidden or not hidden state, and NEWLY created 'hiding' markers inherit this state.

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