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

Name

Panner - interactor that provides scrolling and zooming

Remarks:

This interactor does not comply with the OSF/Motif Certification Checklist. It is provided for compatibility with existing InterViews programs, however it may not behave as expected when used with InterViews Plus.

Synopsis

#include <ivplus/panner.h>

Description

Panner is an interactor that manipulates the perspective of another interactor to provide 2D scrolling and zooming. A panner is composed of a slider and several adjusters, including two zoomers and four movers. The slider’s position and size reflect the current origin, size, and aspect ratio in the interactor’s perspective. Dragging the slider around with the mouse changes the perspective’s curx and cury member variables. Panner is a composite interactor with the ability to manipulate the perspective provided in the slider and adjuster components.

Class Hierarchy

Panner->MonoScene->Scene->Interactor

Constructors

Panner(Interactor*, int size = 0)

Panner(const char* instanceName, Interactor*, int size = 0)

Create a panner for the given interactor, optionally with the given width. If the size is 0, a reasonable default size is used. The panner’s aspect ratio reflects that of the perspective.

Public Operations

None.

Protected Operations

virtual void Reconfig()

Calls MonoScene::Reconfig(), then calculates the size of the adjusters and zoomers.

X Resources

None.

Examples


//                          Panner Example
#include <ivplus/bitmap.h>
#include <ivplus/border.h>
#include <ivplus/box.h>
#include <ivplus/glue.h>
#include <ivplus/frame.h>
#include <ivplus/message.h>
#include <ivplus/panner.h>
#include <ivplus/viewport.h>
#include <ivplus/world.h>
#include <string.h>
#include "./bitmaps/escherknot"
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 bitmap from the  escherknot bitmap.
   Bitmap* bm = new Bitmap(escherknot_bits, escherknot_width,
                           escherknot_height);
   // Use this bitmap in a message.
   Message* msg = new Message(bm);
   // Create a viewport and display a bitmap inside the viewport.
   // Place the message component at the center of the viewport.
   Viewport* viewport = new Viewport(msg, Center);
  
   // Create a panner of width = 0 (default for reasonable size) and
   // attach it with the viewport just created.
   Panner* panner = new Panner(viewport);
    
   // Compose interior with boxes, using viewport, glue, and the panner.
   VBox* vbox = new VBox(new VGlue(4, vfil, vfil), 
                          panner, new VGlue(4, vfil, vfil));
   // Since the Slider portion of the Panner resizes it’s self by calling
   // Change() when the viewport’s perspective changes, set propagate false
   // on the box containing the panner to prevent the application from
begin
   // resized.
   vbox->Propagate(false);
   HBox* box = new HBox(viewport, new VBorder(), new HGlue(4, hfil, hfil),

                        vbox, new HGlue(4, hfil, hfil));
   // Map the window.
   world->InsertApplication(new Frame(box, 1, BevelOut));
   // Enter the event loop.
   world->Run();
   return 0;
}

Files


panner.h
panner.C

See Also

Adjuster(3X) , Interactor(3X) , MonoScene(3X) , Mover(3X) , Perspective(3X) , Scene(3X) , Slider(3X) .


Table of Contents