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

Name

VScrollBar - scroll an interactor vertically

Synopsis

#include <ivplus/scrollbar.h>

Description

VscrollBar is an interactor that manipulates the perspective of another interactor. It contains a vscroller, an upmover and a downmover (up arrow and down arrow). The position and size of the vscroller’s bar reflect the current origin and size in the interactor’s perspective. See ScrollBar(3X) for a further description.

Class Hierarchy

VScrollBar->ScrollBar->MonoScene->Scene->Interactor

Constructors

VScrollBar(Interactor*, int size = ScrollBarWidth)

VScrollBar(const char* instanceName, Interactor*, size = ScrollBarWidth)

Create a vscrollbar object with a width of size and associate it with the given interactor.

Public Data

static const int ScrollBarWidth = 16;

Default scrollbar width.

Public Operations

virtual boolean Interpret(const char* action)

Calls vscroller’s Interpret() with the given string. See the "DEFAULT KEYBOARD TRANSLATIONS" section below for the actions defined for this interactor.

virtual void Reconfig()

Arranges the components of the VScrollBar (vscroller, upmover and downmover) inside a frame which is inside of a focusframe.

Protected Data

VScroller* vscroller

Pointer to the vscroller which implements the vertical trough and sliding bar.

Protected Operations

None.

X Resources

None.

Default Keyboard Translations

Default Keyboard Translations
Key BindingAction String
Ctrl<Key>osfUp
Ctrl<Key>osfDown
<Key>osfUp
<Key>osfDown
<Key>osfPageUp
Ctrl<Key>osfPageUp
<Key>osfPageDown
Ctrl<Key>osfPageDown
<Key>osfBeginLine
<Key>osfEndLine


Examples

//                          VScrollBar Example
#include <ivplus/box.h>
#include <ivplus/frame.h>
#include <ivplus/glue.h>
#include <ivplus/scrollbar.h>
#include <ivplus/textbuffer.h>
#include <ivplus/mltexteditor.h>
#include <ivplus/world.h>
#include <string.h>
int main(int argc, char **argv)
{
   const int BuffSize = 512;
   char* buf = new char[BuffSize];
   // Create the world to get the connection with the display.
   World* world = new World("MyApp", argc, argv);
   // Create a text editor to give vertical scroll bar a perspective 
   // to manipulate.
   strcpy(buf, "HelloWorld");
   TextBuffer* tbuf= new TextBuffer(buf, strlen(buf),BuffSize);
   // Create a text editor with 20 rows and 80 cols.
   MLTextEditor* tedit = new MLTextEditor(20, 80, 8);
   tedit->Edit(tbuf);
   // Create a vertical scroll bar of width = 15 and attach it to the
   // text editor just created.
   VScrollBar* vsb = new VScrollBar(tedit, 15);
   // Compose an hbox with this text editor, glue, and the scroll bar.
   HBox* box = new HBox(tedit, new HGlue(4, 0,0), vsb);
   // Map the window.
   world->InsertApplication(new Frame(box, 1, BevelOut));
   // Enter the event loop.
   world->Run();
   return 0;
}

Files


scrollbar.h 
scrollbar.C 

See Also

FocusFrame(3X) , HScrollBar(3X) , HScroller(3X) , Interactor(3X) , MonoScene(3X) , Perspective(3X) , Scene(3X) , ScrollBar(3X) , Scroller(3X) , VScroller(3X) .


Table of Contents