CLVEasyItem

 

Derived from: public CLVListItem

Declared in: CLVEasyItem.h

Library: none


Overview

 

A CLVEasyItem is a list item that automates display of text and graphics, automates string truncation of items that don't fit in the column, and automates sorting of the items based on the text. In most cases, it is best to use a CLVEasyItem instead of a CLVListItem, since it can save you a lot of work and gives nice results.


Constructor and Destructor


CLVEasyItem()

 

      CLVEasyItem(uint32 level = 0, bool superitem = false, bool expanded = true, float minheight = 0.0) 
      CLVEasyItem(BMessage *archive)    /*Not implemented*/

Marks the CLVEasyItem as being at the specified outline level , as being an expandable superitem if the superitem flag is true, and as controlling an expanded section of the outline if the expanded flag is true or a collapsed section if expanded is false. Minheight specifies the minimum height that the item may be. This is useful if the item's height is to vary to respond to user preferences, but elements of the item (an icon, for example), place a constraint on how small the item may be. Outline levels are indicated by an index, with 0 as the outer level, 1 for one level of indentation, 2 for two levels of indentation, and so on.

Initially, the item has a width and height of 0.0 coordinate units, is enabled, and is not selected.

Construction from an archive is currently not implemented. It isn't high on my priorities, since archival is not something I'm making use of. If someone needs this functionality and fills it in, please send me the modified code so that others can benefit from it.


~CLVEasyItem()

 

      virtual ~CLVEasyItem() 

 

Frees all memory used for storing the item's column contents.


Member Functions

 


Archive()

 

      virtual status_t Archive(BMessage *archive, bool deep = true) const
 

Currently not implemented. It isn't high on my priorities, since archival is not something I'm making use of. If someone needs this functionality and fills it in, please send me the modified code so that others can benefit from it.

See also: BArchivable::Archive(), Instantiate() static function


SetColumnContent()

 

      virtual void SetColumnContent(int column_index, const char *text, bool truncate = true)
      virtual void SetColumnContent(int column_index, const BBitmap *bitmap, float horizontal_offset = 2.0,
            bool copy = true); ;
 
 

For the text version, sets the column column_index to display the specified text. If truncate is true, if the text does not fit in the column, it will be truncated with an ellipsis instead of being chopped off at the edge of the column. If truncate is true, the CLVColumn for column_index should have its CLV_HEADER_TRUNCATE flag set, and must have its CLV_TELL_ITEMS_WIDTH flag set.

For the bitmap version, sets the column column_index to display the specified bitmap. It will be rendered horizontal_offset pixels to the right of the left edge of the column. If copy is true, it will make a copy of the bitmap. Otherwise, it will just store a pointer to bitmap, and the application must not delete bitmap as long as the item is using it.


By Brian Tietz

Copyright 1997

Bug reports (including documentation errors) and feature requests can be sent to briant@digaudio.com.