htmlFrameSet
Frame set management class
[Previous] [Main] [Next]


Description
htmlFrameSet encapsulates the <FRAMESET></FRAMESET> tags, used for creating sets of frames and their individual dimensions. This class is designed to contain htmlFrame objects.  
 
A frameset can specify that the frames it contains are laid out in rows or columns. You can nest htmlFrameSet objects to obtain rows and columns. For example, to obtain a 2x2 frameset, you would define three framesets, A, B, and C. Framesets A and B would each have two rows. Frameset C would have two columns, the first one containing frameset A and the second column containing frameset B.  
 
   htmlPage  page ;  
   htmlFrameSet A, B, C ;  
 
   A.Rows( "*,*" ) ;  // two columns  
   A << htmlFrame( "a1""http://www.dcmicro.com" )  
     << htmlFrame( "a2""http://www.dcmicro.com/crusher" ) ;  
 
   B.Rows( "*,*" ) ;  // two columns  
   B << htmlFrame( "b1""http://www.dcmicro.com/htmlpp" )  
     << htmlFrame( "b2""http://www.dcmicro.com/support" ) ;  
 
   C.Columns( "*,*" ) ;  //  two rows  
   C << A << B ;  //  result is two rows of two columns each  
   page << C ;  
 
Either the rows or the columns attribute of a frameset must be defined. If the browser displays a blank window, it's likely that the dimensions of the rows or columns weren't properly specified. The rows and columns attributes must be specified as a comma-delimited string listing the values for the row or column sizes. Each item in the list can be one of the following:  
  • height/width of a frame in pixels
  • height/width of the frame as a percentage of the parent
  • an asterisk (*) meaning whatever remaining space is available, dividing it equally among all rows/columns that have an asterisk.
 
Several identical attributes are available for framesets and frames, such as border thickness and color. Such attributes for a frameset act as defaults for all frames within it's borders, with attributes for individual frames taking precedence for their own regions of display.  
 
When defining hyperlinks, you can control in which frame the document will load by specifying the frame name as the target of the hyperlink using the target argument of the htmlHyperLink constructor or the htmlHyperLink::Target() method. Using JavaScript, you can create a hyperlink that loads multiple frames at once (see Tutorial : Advanced Topics for more details).  
 
Declaration
#include <dcmicro/htmlpp/frameset.h>  
 
Hierarchy
htmlframeset.gif  

See Also
htmlFrame, htmlNoFrames, htmlPage, htmlHyperLink  
 
Related Constants/Definitions
None.  
 
Constructors
htmlFrameSet()  
Constructs an empty frameset object.  
 
htmlFrameSet( const htmlFrame& frame )  
Constructs a frameset containaing a copy of frame.  
 
htmlFrameSet( const String& row_height_list,  
    const String& column_width_list )  
Constructs an empty frameset object of the specified dimensions. Either row_height_list or column_width_list must be specified. Refer to the Rows() and Columns() methods for additional details about row_height_list and column_width_list.  
 
htmlFrameSet( const String& row_height_list,  
    const String& column_width_list,  
    const htmlFrame& frame )  
Constructs a frameset object of the specified dimensions, adding a copy of frame. Either row_height_list or column_width_list must be specified.  
 
htmlFrameSet( const htmlFrameSet& rhs )  
Copy constructor.  
 
Destructor
virtual ~htmlFrameSet()  
Destroys the object.  
 
Member Methods
<<      htmlGroup& operator<< ( const htmlFrame& frame )  
<<      htmlGroup& operator<< ( const htmlFrameSet& frameset )  
Adds the specified frame or frameset object to the frameset and returns a reference to the it.  
 
Add      htmlObject FAR * Add( const htmlFrame& frame )  
Add      htmlObject FAR * Add( const htmlFrameSet& frameset )  
Adds the specified frame or frameset object to the frameset and returns a pointer to the new object.  
 
Rows   htmlFrameSet& Rows( const String& row_height_list )  
Sets the height of each frame in the frameset to row_height_list, a comma-separated list of values giving the heigth of each frame, and returns a reference to the object. Each item in row_height_list can be one of the following:  
  • height of a frame in pixels
  • height of the frame as a percentage of the parent
  • an asterisk (*) meaning whatever remaining space is available, dividing it equally among all rows that have an asterisk.
 
Rows   String Rows() const  
Returns the row list setting for the frameset, or an empty string if not set.  
 
Columns   htmlFrameSet& Columns( const String& column_width_list )  
Sets the width of each frame in the frameset to column_width_list, a comma-separated list of values giving the width of each frame, and returns a reference to the object. Each item in column_width_list can be one of the following:  
  • width of a frame in pixels
  • width of the frame as a percentage of the parent
  • an asterisk (*) meaning whatever remaining space is available, dividing it equally among all columns that have an asterisk.
 
Columns   String Columns() const  
Returns the column list setting for the frameset, or an empty string if not set.  
 
BorderWidth   htmlFrameSet& BorderWidth( int pixels )  
Sets the thickness for all frame borders in an outermost frameset to pixels, and returns a reference to the object.  
 
BorderWidth   int BorderWidth() const  
Returns the border thickness for frames in the frameset in pixels, or zero if not set.  
 
BorderColor   htmlFrameSet& BorderColor( ColorType color )  
Sets the default color for all frame borders in an outermost frameset to color, and returns a reference to the object.  
 
BorderColor   ColorType BorderColor() const  
Returns the border color, or COLOR_DEFAULT if not set.  
 
EnableBorderhtmlFrameSet& EnableBorder( Boolean is_visible = TRUE )  
Sets the default frame border for all frames in the frameset. If is_visible is TRUE, the frames will have an outline 3D border unless the setting is overriden by an individual frame within the frameset. If is_visible is FALSE, the 3D border is suppressed. A reference to the object is returned.  
 
IsBorderEnabledBoolean IsBorderEnabled() const  
Returns TRUE if the default border setting for the frameset is visible, FALSE if not.  
 
NoFrames   htmlNoFrames& NoFrames()  
Returns a reference to the htmlNoFrames object for the frameset, which can be used to add content displayed by browsers that do not support frames. Browsers that can display frames ignore all htmlNoFrames content, unless a URL specified by a frame is missing or unreachable.  
 
Print      void Print( ostream& os ) const  
Outputs the object to os.  
 
Clone   htmlObject FAR * Clone() const  
Returns a base-class pointer to a deep copy of the object.  
 
Example
 
See the example in Tutorial : Frames : Framesets  
 


©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.