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

Name

Frame - place a Motif bevelled frame around an interactor

Synopsis

#include <ivplus/frame.h>

Description

Frame outlines another interactor with a bevelled border of a given style. The most common styles are: bevelled in, bevelled out, etched in, and etched out. Two more styles are also supported for special purposes: a BevelType of BevelHighlight is used by Control(Menu) classes; and a BevelType of BevelNone will draw a frame with the current background color. A frame is used to provide a decorative border or to visually group components for the user.

Class Hierarchy

Frame->IVFrame->MonoScene->Scene->Interactor

Constructors

Frame (Interactor* = nil, int width = 0, BevelType = BevelIn);

Frame (const char* instanceName, Interactor* = nil, int width = 0, BevelType = BevelIn);

Construct a bevelled frame. If the given interactor is not nil, it is inserted as the frame’s component. The frame extends width pixels outside of the interactor. If width is 0, the actual width will be the value of the shadowThickness X resource, which defaults to 2.

Public Data

enum Beveller::BevelType {BevelIn, BevelOut, BevelHighlight, BevelEtchedIn, BevelEtchedOut, BevelNone}

Public Operations

virtual void Highlight(boolean)

This call is only valid when the frame has a BevelType of BevelHighlight. If it does, passing true will cause the frame to be drawn bevelled out. Passing false will cause the frame to be drawn with the current background color.

virtual void Scene::Insert(Interactor*)

Inserts an interactor into the frame.

void SetBevel(BevelType)

Sets the bevel type of the frame to BevelType.

Protected Data

BevelType bevel

Stores the style of the bevel.

boolean highlighted

Used to determine whether or not the frame should be drawn as highlighted.

int frameWidth

Stores the width in pixels.

Protected Operations

virtual void Reconfig()

Calls IVFrame::Reconfig() and recalculates the shape of the frame.

virtual void Redraw(IntCoord left, IntCoord bottom, IntCoord right, IntCoord top)

Draws the frame based on the indicated BevelType.

X Resources

None.

Examples


//                          Frame Example
#include <ivplus/box.h>
#include <ivplus/frame.h>
#include <ivplus/glue.h>
#include <ivplus/message.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);
  
   Message* msg = new Message("This is a Framed \n Message");
   // Outline the message with two frames of width = 2 pixels
   // (inner one BevelIn, the outer one BevelOut).
   Frame* fin = new Frame(msg, 2, BevelIn);
   Frame* fout = new Frame(fin, 2, BevelOut);
   // Enclose the framed msg in a box with glues around it.
   VBox* mainbox = new VBox(new VGlue(10), new HBox(new HGlue(10), fout,

                                                    new HGlue(10)), 
                            new VGlue(10));
   // Map the window.
   world->InsertApplication(new Frame(mainbox, 1, BevelOut));
   // Enter the event loop.
   world->Run();
   return 0;
}

Files


frame.h
frame.C

See Also

BorderFrame(3X) , Event(3X) , IVFrame(3X) , Interactor(3X) , MarginFrame(3X) , MonoScene(3X) , Scene(3X) , ShadowFrame(3X) , ShowFrame(3X) , TitleFrame(3X) .


Table of Contents