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

Name

HScrollBar - scroll an interactor horizontally

Synopsis

#include <ivplus/scrollbar.h>

Description

HScrollBar is an interactor that manipulates the perspective of another interactor. It contains an hscroller, a leftmover and a rightmover (left arrow and right arrow). The position and size of the hscroller’s bar reflect the current origin and size in the interactor’s perspective. See ScrollBar(3X) for a further description.

Class Hierarchy

HScrollBar->ScrollBar->MonoScene->Scene->Interactor

Constructors

HScrollBar(Interactor*, int size = scrollbarWidth)

HScrollBar(const char* instanceName, Interactor*, int size = scrollbarWidth)

Create an HScrollBar object with a height 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 HScroller’s Interpret() operation with the given action string. See the "DEFAULT KEYBOARD TRANSLATIONS" section below for the actions defined for this interactor.

virtual void Reconfig()

Arranges the components of the hscrollbar (slider, leftmover and rightmover) inside a frame which is inside of a focusframe.

Protected Data

HScroller* hscroller

Pointer to the hscroller which implements the horizontal trough and sliding bar.

Protected Operations

None.

X Resources

scrollbarWidth:int

Specifies the height of the scrollbar in coordinates.

Default Keyboard Translations

Key Binding
Ctrl<Key>osfLeft
Ctrl<Key>osfRight
<Key>osfLeft
<Key>osfRight
<Key>osfPageLeft
Ctrl<Key>osfPageLeft
<Key>osfPageRight
Ctrl<Key>osfPageRight
<Key>osfBeginLine
<Key>osfEndLine



Examples

//                          HScrollBar 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 HScrollBar a perspective.
   strcpy(buf, "Hello  World");
   TextBuffer* tbuf= new TextBuffer(buf, strlen(buf),BuffSize);
   // Create a multi-line text editor with 20 rows, 80 cols, and TabSize
of 8.
   MLTextEditor* tedit = new MLTextEditor(20, 80,8);
   tedit->Edit(tbuf);
   // Create a horizontal scroll bar of width = 15 and attach it with the
   // text editor just created.
   HScrollBar* hsb = new HScrollBar(tedit, 15);
   // Compose a vbox with this text editor, glue, and the scroll bar.
   VBox* box = new VBox(tedit, new VGlue(4, 0,0), hsb);
   // 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) , Interactor(3X) , HScroller(3X) , MonoScene(3X) , Mover(3X) , Perspective(3X) , Scene(3X) , ScrollBar(3X) , Scroller(3X) , VScrollBar(3X) .


Table of Contents