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

Name

MarginFrame - surround an interactor with glue (white space)

Synopsis

#include <ivplus/frame.h>

Description

MarginFrame constructs a margin of glue (white space) around an interactor.

Class Hierarchy

MarginFrame->IVFrame->MonoScene->Scene->Interactor

Constructors

MarginFrame(Interactor* = nil, int margin = 0)

MarginFrame(const char* instanceName, Interactor* = nil, int margin = 0)

Construct a MarginFrame for an interactor with margin pixels of fixed size glue around the interactor. If the interactor is not nil it is inserted as the marginframe’s component.

MarginFrame(Interactor*, int margin, int shrink, int stretch)

MarginFrame(const char* instanceName, Interactor*, int margin, int shrink, int stretch)

Construct a marginframe for an interactor with margin pixels of fixed size glue, shrink shrinkability and stretch stretchability. These values apply to both horizontal and vertical directions.

MarginFrame(Interactor*, int hmargin, int vmargin)

MarginFrame(const char* instanceName, Interactor*, int hmargin, int vmargin)

Construct a marginframe for an interactor with hmargin as the horizontal margin and vmargin as the vertical margin.

MarginFrame (Interactor*, int hmargin, int hshrink, int hstretch, int vmargin, int vshrink, int vstretch);

MarginFrame (const char* instanceName, Interactor*, int hmargin, int hshrink, int hstretch, int vmargin, int vshrink, int vstretch);

Construct a marginframe for an interactor with hmargin as the horizontal margin, hshrink as the horizontal shrinkability, hstretch as the horizontal stretchability, vmargin as the vertical margin, vshrink as the vertical shrinkability and vstretch as the vertical stretchability.

Public Operations

None.

Protected Operations

virtual void Reconfig()

Calls IVFrame::Reconfig(), then calculates the shape of the marginframe.

virtual void Resize()

Notifies the marginframe that its canvas has been created or modified. Calculates the new size of the canvas and places the interior interactor at new coordinates relative to the new size.

virtual void Redraw(IntCoord l, IntCoord b, IntCoord r, IntCoord t)

MarginFrame’s Redraw() operation does nothing. It is provided to circumvent the Redraw() operation of its superclass, IVFrame.

X Resources

None.

Examples


//                          MarginFrame 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* msg1 = new Message("This is a Framed \n Message1");
   // Outline the message with a margin frame (glue) of 4 pixels,
   // shrinkability of 10 and stretchability of 80 pixels.
   MarginFrame* mframe1 = new MarginFrame(msg1, 4, 10, 60);
   Message* msg2 = new Message("This is a Framed \n Message2");
   // Outline the message with a margin frame (glue) of 14 pixels
   // horizontal margin and 30 pixels vertical margin.
   // Remember that when desplayed, a ’Frame’ will not be drawn!.
   MarginFrame* mframe2 = new MarginFrame(msg2, 14, 30);
   
   // Enclose the mframe1, mframe2 in a frame.
   VBox* mainbox = new VBox(new VGlue, new Frame(mframe1), new VGlue, 
                            new Frame(mframe2), new VGlue);
   // 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

Glue(3X) , Frame(3X) , Interactor(3X) , IVFrame(3X) , MonoScene(3X) , Scene(3X) .


Table of Contents