|
htmlHorizontalRule
Horizontal rule class | [Previous] [Main] [Next] |
| htmlHorizontalRule encapsulates the <HR> tag. Horizontal rules are rendered as horizontal lines by web browsers, and are used to separate regions within document. Horizontal rules are preceded and followed by line breaks.
| |
|
| |
| The appearance of horizontal rules can be adjusted in several ways, and methods are provided to specify:
| |
|
|
| |
| Note that the thickness, width, alignment, and shading are Netscape extensions to HTML and may not be supported by all browsers.
| |
|
| |
| #include <dcmicro/htmlpp/horizrul.h>
| |
|
| |
| None.
| |
|
| |
| typedef enum {
| |
| shade_solid = 0,
| |
| shade_shaded,
| |
| } ShadeType ;
| |
|
| |
| typedef enum {
| |
| align_default = 0,
| |
| align_left,
| |
| align_center,
| |
| align_right,
| |
| align_justify
| |
| } Alignment ;
| |
|
| |
| htmlHorizontalRule()
| |
| Constructs a horizontal rule using the browser's default settings.
| |
|
| |
| htmlHorizontalRule( int pixel_size )
| |
| Constructs a horizontal rule using the specified pixel_size thickness.
| |
|
| |
| htmlHorizontalRule( Alignment align )
| |
| Constructs a horizontal rule using the specified alignment.
| |
|
| |
| htmlHorizontalRule( int pixel_size, String& width_percent )
| |
| Constructs a horizontal rule using the specified thickness pixel_size, and width as a percentage of the display.
| |
|
| |
| htmlHorizontalRule( int pixel_size, Alignment align )
| |
| Constructs a horizontal rule using the specified thickness pixel_size, and alignment.
| |
|
| |
| htmlHorizontalRule( int pixel_size, String& width_percent, Alignment align )
| |
| Constructs a horizontal rule using the specified thickness pixel_size, width as a percentage of the display, and alignment.
| |
|
| |
| htmlHorizontalRule( | int pixel_size,
| |
| String& width_percent,
| ||
| Alignment align,
| ||
| ShadeType shading )
| ||
| Constructs a horizontal rule using the specified thickness pixel_size, width as a percentage of the display, alignment, and shading.
| |
|
| |
| virtual ~htmlHorizontalRule()
| |
| Destroys the object.
| |
|
| |
| Align | htmlHorizontalRule& Align( Alignment align )
| |
| Sets the horizontal alignment to align and returns a reference to the object.
| |
|
| |
| Align | int Align() const
| |
| Returns the horizontal alignment for the object, or align_default if not set.
| |
|
| |
| Shade | htmlHorizontalRule& Shade( ShadeType shading )
| |
| Sets the method used by the browser to render the horizontal rule to shading (shade_solid or shade_shaded), and returns a reference to the object.
| |
|
| |
| Shade | ShadeType Shade() const
| |
| Returns the method specified for rendering the horizontal rule, shade_solid or shade_shaded.
| |
|
| |
| Width | htmlHorizontalRule& Width( const String& percentage )
| |
| Sets the horizontal width to as a percentage of the display size, then returns a reference to the object. The percentage argument can optionally include a percent (%) character.
| |
|
| |
| Width | htmlHorizontalRule& Width( int pixels )
| |
| Sets the horizontal width to pixels, then returns a reference to the object.
| |
|
| |
| Width | String Width() const
| |
| Returns the width of the horizontal rule as a string. If the width is a percentage (instead of pixel size) value, the string will include a trailing percent (%) character. Otherwise, the string will be the equivalent of the pixel size value as text.
| |
|
| |
| Size | htmlHorizontalRule& Size( int pixel_size )
| |
| Sets the thickness of the horizontal rule to pixel_size, then returns a reference to the object.
| |
|
| |
| Size | int Size() const
| |
| Returns the thickness setting, in pixels, for the horizontal rule.
| |
|
| |
| 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.
| |
|
| |
|
| |
| #include <stdio.h>
| |
| #include <stdlib.h>
| |
| #include <dcmicro/htmlpp/htmlpp.h>
| |
|
| |
| int main( void )
| |
| {
| |
| htmlCgi server ;
| |
| htmlPage page( "html++ example application" ) ;
| |
|
| |
| page << "Default rule" << htmlHorizontalRule() ;
| |
|
| |
| htmlHorizontalRule hr1 ;
| |
| hr1.Width( "50%" ).Size( 10 ) ;
| |
| page << "50% wide, 10 pixels thick" << hr1 ;
| |
|
| |
| htmlHorizontalRule hr2 ;
| |
| hr2.Width( 200 ).Shade( shade_shaded ) ;
| |
| page << "200 pixels wide, shaded" << hr2 ;
| |
|
| |
| htmlHorizontalRule hr3 ;
| |
| hr3.Shade( shade_solid ).Align( align_right ) ;
| |
| page << "Default width, solid, right-align" << hr3 ;
| |
|
| |
| server << page ;
| |
| return 0 ;
| |
| }
| |
|
| |
|
| |
| Content-Type: text/html
| |
| <HTML>
| |
| <HEAD>
| |
| <TITLE>html++ example application</TITLE>
| |
| </HEAD>
| |
| <BODY>
| |
| Default rule<HR>
| |
| 50% wide, 10 pixels thick<HR WIDTH="50%" SIZE="10">
| |
| 200 pixels wide, shaded<HR WIDTH="200">
| |
| Default width, solid, right-align<HR NOSHADE ALIGN="RIGHT">
| |
| </BODY>
| |
| </HTML>
| |
|
| |
| |
