os_menu_list
|
 |
A menu list.
An os_menu_list
is a collection of os_list_item objects rendered as
a menu. Within an os_menu_list , each os_list_item
is typically one sentence in length.
Similar to an os_unordered_list
, an os_menu_list is a block-structuring page
element that begins a new block on the page, and typically arranges its items
into a single column, one item per line. Some browsers precede each item with a
bullet. An os_menu_list is typically rendered more
compactly than an os_unordered_list .
Items are inserted into an os_menu_list
through either the add() member function or operator<<
. A header for an os_menu_list can be specified in
the constructor or through the header() member
function.
Note that the HTML feature
supported by os_menu_list is deprecated in HTML
3.0.
Declaration
#include <ospace/web/menulst.h>
class os_menu_list : public os_element_group
Interface
Constructor
os_menu_list()
Constructs an empty menu
list with no header.
Constructor
os_menu_list(
const os_element& header )
Constructs an empty menu
list with a copy of header as its header.
Constructor
os_menu_list(
const string& header )
Constructs an empty menu
list with an os_text element created from header
as its header.
Constructor
os_menu_list(
const os_menu_list& rhs )
Constructs a menu list
that is a copy of rhs .
Destructor
/*
virtual */ ~os_menu_list()
Destroys the menu list.
<<
/*
virtual */ os_menu_list& operator<<( const os_element& element
)
Inserts a list item
containing a copy of element into the menu list,
and returns a reference to the menu list.
<<
os_menu_list&
operator<<( const os_list_item& list_item
)
Inserts a copy of list_item
into the menu list and returns a reference to the menu list.
<<
/*
virtual */ os_menu_list& operator<<( const string&
text )
Inserts a list item
containing a copy of text into the menu list, and
returns a reference to the menu list.
=
os_menu_list&
operator=( const os_menu_list& rhs )
Replaces the contents of
the menu list with a copy of rhs .
add
os_element*
add( const os_list_item& list_item )
Adds a copy of list_item
to the menu list, and returns a pointer to the new list item.
add
/*
virtual */ os_element* add( const os_element& element
)
Adds a list item
containing a copy of element to the menu list, and
returns a pointer to the new list item.
add
/*
virtual */ os_element* add( const string& text
)
Adds a list item
containing a copy of text to the menu list, and
returns a pointer to the new list item.
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the menu list.
header
os_menu_list&
header( const string& header )
Sets the list header to an
os_text element created from header
, and returns a reference to the menu list header.
header
os_element*
header() const
Returns a pointer to the
list header, or 0 if not set.
header
os_menu_list&
header( const os_element& header )
Sets the list header to a
copy of header , and returns a reference to the
menu list.
print
/*
virtual */ void print( ostream& os )
const
Prints the menu list to os
.
report_constraint_violation
/*
virtual */ void report_constraint_violation( const os_element& element
, ostream& os
) const
Prints a constraint
violation notice to os for element
within the menu list.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved