[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Banner(3X) manual page Table of Contents

Name

Banner - one-line title bar

Remarks:

There is no corresponding Motif widget for this interactor. It may not be suitable for Motif user interface design.

Synopsis

#include <ivplus/banner.h>

Description

Banner draws a one line title bar with optional left-justified, centered, and right-justified headings. The member variable highlight can be set to cause the drawing to display with the foreground and background colors reversed. The natural size of a banner depends on the size of its headings. Banners are infinitely stretchable horizontally, but fixed size vertically.

Class Hierarchy

Banner -> Interactor

Constructors

Banner(char* lt, char* mid, char* rt)

Banner(const char* instanceName, char* lt, char* mid, char* rt)

The left string will be left-justified, the middle string centered, and right string right-justified in the banner. Any of the header strings can be omitted by passing a nil string.

Public Data

char* left;

char* middle;

char* right;

boolean highlight;

Public Operations

void Update()

Updates the banner’s header strings. The strings can be set through the left, middle, and right member variables. The Update() operation should be called after one or more of the strings is changed.

Protected Operations

void Init(char*, char*, char*)

This operation sets the member variables left, middle and right to the respective char* passed in to the operation. It sets the highlight member variable to false and the inverse member variable to nil.

void Interactor::Reconfig()

Performs any configuration specific to a particular interactor.

void Interactor::Redraw(IntCoord left, IntCoord bottom, IntCoord right, IntCoord top)

Called when some portion of the interactor needs to be redrawn.

void Interactor::Resize()

Notifies an interactor that its canvas has been created or modified.

X Resources

None.

Examples


//                          Banner Example
#include <ivplus/box.h>
#include <ivplus/banner.h>
#include <ivplus/frame.h>
#include <ivplus/glue.h>
#include <ivplus/world.h>
int main(int argc, char **argv)
{
   // Create the world to get the connection with the display.
   World* world = new World("MyApp", argc, argv);
 
   // Create a banner with only the center header string.
   Banner* title1 = new Banner(nil, "Window Mail Program", nil);   
   // Create a banner with three header strings: left, center, right.
   Banner* title2 = new Banner("Ver1.0", "On Line Doc Viewer", " Page 1");
   // Set highlight to cause foreground & background colors to be reversed.
   title2->highlight = true;
   // Change banner’s header string to new string and tell banner to update.
   title2->right = "Page 2";
   title2->Update();
   // Insert the banner just created into a vbox.
   VBox* mainbox = new VBox(title1, new VGlue, title2);
 
   // Map the window.
   world->InsertApplication(new Frame(mainbox, 1, BevelOut));
   // Enter the event loop.
   world->Run();
   return 0;
}

Files


banner.h

See Also

Interactor(3X) .


Table of Contents