htmlFrame
Frame window class
[Previous] [Main] [Next]


Description
htmlFrame encapsulates the <FRAME></FRAME> tags, used for creating frames and frame sets. A frame is a window winthin another window, used for displaying a different document. The main browser window can contain multiple frames, each one displaying a distinct URL.  
 
You can control whether a frame has a border or margins, and whether it can be resized or scrolled by the user.  
 
A frame references another document URL instead of containing HTML content on it's own. Therefore, htmlFrame objects cannot contain other html++ objects. htmlFrame objects are added to htmlFrameSet objects using the htmlFrameSet::Add() or htmlFrameSet::<< operator.  
 
Declaration
#include <dcmicro/htmlpp/frame.h>  
 
Hierarchy
htmlframe.gif  

See Also
htmlFrameSet  
 
Related Constants/Definitions
#define NOT_RESIZEABLE   FALSE  
#define IS_RESIZEABLE      TRUE  
 
typedef enum {  
   auto_scroll = 0,  
   disable_scroll,  
   enable_scroll  
} ScrollType ;  
 
Constructors
htmlFrame()  
Constructs an empty frame object.  
 
htmlFrame(const String& name,  
   const String& source_url,  
   ScrollType scroll_type = auto_scroll,  
   Boolean is_resizeable = IS_RESIZEABLE )  
Constructs a frame object of the specified name, displaying the document at source_url. Scrollbars are controlled by the scroll_type option, and is_resizeable specifies whether or not users can resize the frame. name must begin with an alphanumeric character.  
 
htmlFrame( const htmlFrame& rhs )  
Copy constructor.  
 
Destructor
virtual ~htmlFrame()  
Destroys the object.  
 
Member Methods
Name   htmlFrame& Name( const String& name )  
Sets the frame name to name, and returns a reference to the object. name must begin with an alphanumeric character.  
 
Name   String Name() const  
Returns the frame name as a string, or an empty string if not set.  
 
URL      htmlFrame& URL( const String& source_url )  
Sets the source document URL for the frame to source_url, and returns a reference to the object. This attribute is required.  
 
URL      String URL() const  
Returns the source document URL as a string, or an empty string if not set.  
 
Scroll   htmlFrame& Scroll( ScrollType scroll_type )  
Sets the type of scroll bars available on the frame, if any, to scroll_type, and returns a reference to the object.  
 
  • auto_scroll The browser will automatically determine whether or not scrollbars are displayed based on the document being displayed. This is the default setting.
  • disable_scrol Scrollbars are not displayed.
  • enable_scroll Scollbars are always displayed.
 
Scroll   ScrollType Scroll() const  
Returns the type of scrollbars specified for the frame, or auto_scroll if not specified.  
 
Resize   htmlFrame& Resize( Boolean is_resizeable = IS_RESIZEABLE )  
If is_resizeable is TRUE, the user will be allowed to resize the frame. A reference to the object is returned.  
 
IsResizeable   Boolean IsResizeable() const  
Returns TRUE if the frame is set to be resizable, or FALSE if it set to disable resizing.  
 
MarginWidth   htmlFrame& MarginWidth( int pixels )  
Sets the margin width between the left and right edges of the frame and it's content to pixels, and returns a reference to the object. If pixels is a negative value, the browser default will be used.  
 
MarginWidth   int MarginWidth() const  
Returns the margin width in pixels for the frame, or zero if not set.  
 
MarginHeight   htmlFrame& MarginHeight( int pixels )  
Sets the margin height between the top and bottom edges of the frame and it's content to pixels, and returns a reference to the object. If pixels is a negative value, the browser default will be used.  
 
MarginHeight   int MarginHeight() const  
Returns the margin height in pixels for the frame, or zero if not set.  
 
EnableBorderhtmlFrame& EnableBorder( Boolean is_visible = TRUE )  
Controls whether or not the frame has visibe borders, and returns a reference to the object. The default setting is to enable visible borders.  
 
IsBorderEnabledBoolean IsBorderEnabled() const  
Returns TRUE if the border for the frame is visible, FALSE if not.  
 
BorderColor   htmlFrame& BorderColor( ColorType border_color )  
Sets the border color to border_color, and returns a reference to the object.  
 
BorderColor   ColorType BorderColor() const  
Returns the border color, or COLOR_DEFAULT if not set.  
 
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 Use
 
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.