os_frame
|
 |
Characteristics of a frame within
a frameset.
An os_frame
is a single frame within an os_frameset , and
specifies a URL for the source or contents of the frame. The source is rendered
in a view area within the os_frameset . Typically,
the source URL refers to another Web page and is specified either in the
constructor or through the source() member
function.
An os_frame
can be constructed without specifying a source URL. This generates a frame that
is initially blank. The location and size of the os_frame
within the browser is determined by the containing os_frameset
.
An os_frame
can be named through either a constructor or the name()
member function. Naming an os_frame allows it to be
specified as an os_hyperlink target. When the
hyperlink is accessed, its destination is rendered inside the specified frame.
Several member functions are
provided to specify aspects of frame rendering and behavior of the frame.
marginwidth()
and marginheight() -Specify the amount of blank
space between the contents of the frame and its border.
size()
-Specifies frame size.
scroll()
-Specifies scrolling behavior.
Declaration
#include <ospace/web/frame.h>
class os_frame : public os_element
Enums
enum os_frame::scrolling
{
automatic, // Allows the frame to have scrollbars automaticallly when necessary.
always, // Always places scrollbars on the frame.
never // Never places scrollbars on the frame.
};
enum os_frame::sizing
{
resize, // Allows the frame to be resized.
no_resize // Prevents the frame from being resized.
};
Interface
Constructor
os_frame()
Constructs a frame that is
initially blank.
Constructor
os_frame(
const string& source )
Constructs a frame with
initial contents at the URL source .
Constructor
os_frame(
const string& source ,
const string& name )
Constructs a frame with
initial contents at the URL source and name name
.
Constructor
os_frame(
const string& source ,
const string& name ,
sizing size ,
scrolling scroll )
Constructs a frame with
initial contents at the URL source , name name
, resizing size , and scrolling scroll
.
Constructor
os_frame(
const string& source ,
const string& name ,
int marginwidth ,
int marginheight ,
sizing size ,
scrolling scroll )
Constructs a frame with
initial contents at the URL source , name name
, margin width marginwidth pixels, margin height marginheight
pixels, resizing size , and scrolling scroll
.
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the frame.
marginheight
int
marginheight() const
Returns the margin height
in pixels, or 0 if not set.
marginheight
os_frame&
marginheight( int marginheight )
Sets the margin height to marginheight
pixels and returns a reference to the frame.
marginwidth
os_frame&
marginwidth( int marginwidth )
Sets the margin width to marginwidth
pixels and returns a reference to the frame.
marginwidth
int
marginwidth() const
Returns the margin width
in pixels, or 0 if not set.
name
os_frame&
name( const string& name )
Sets the name to name
and returns a reference to the frame.
name
string
name() const
Returns the name, or the
empty string if not set.
print
/*
virtual */ void print( ostream& os )
const
Prints the frame to os
.
scroll
os_frame&
scroll( scrolling scroll )
Sets the scrolling to
scroll and returns a reference to the frame.
scroll
int
scroll() const
Returns the scrolling, or os_element::use_default
if not set.
size
os_frame&
size( sizing size )
Sets the resizing to size
and returns a reference to the frame.
size
int
size() const
Returns the resizing, or os_frame::resize
if not set.
source
string
source() const
Returns the initial
content URL, or the empty string if not set.
source
os_frame&
source( const string& source )
Sets the initial content
URL to source and returns a reference to the
frame.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved