Article View: comp.windows.interviews
Article #1146Adding VHScroller to a StringBrowser
From: Jan Chang
Date: Tue, 14 May 1991 17:07
Date: Tue, 14 May 1991 17:07
88 lines
3082 bytes
3082 bytes
Environment:
IV2.6 on HP800 running C++ 2.1
I am trying to add both vertical and horizontal scroller bars to
a stringbrowser (Option A). It appears OK but the horizontal
scroller bars does not work. If I insert the stringbrowser into a
viewport (Option B) and AddVHScroller(viewport), then the viewport
only displays number of rows (NUM_ROWS) specified in the stringbrowser
constructor, even though I have more NUM_ROWS to be displayed.
Can someone tell me what is my problem?
Thanks,
Jan
******************************************************************
* This is my function to add both vertical and horizontal scroller
********************************************************************
//
// Add both horizontal and vertical scroll bar
// INPUTS:
// i: Any kind of interactors.
//
// RETURN:
// an Interactor.
Interactor* GenMonoScene::AddVHScroller(Interactor* i)
{
HBox *_hbox;
_hbox = new HBox
(
new MarginFrame(i, 2),
new VBorder,
new VBox
(
new UpMover(i, 1),
new HBorder,
new VScroller(i),
new HBorder,
new DownMover(i, 1)
)
);
return new VBox
(
_hbox,
new HBorder,
new HBox
(
new LeftMover(i, 1),
new VBorder,
new HScroller(i),
new VBorder,
new RightMover(i, 1)
)
);
}
******************************************************************
*Option A:
* Add VHScroller to the stringbrowser
********************************************************************
_strbr = new StringBrowser(_strbr_bs, 20, 60, false);
// Put the stringbrowser into a HBox
strbr_hbox = new HBox(
new HGlue(round(0.3*inch),0),
new Frame(AddVHScroller(_strbr),
new HGlue
);
********************************************************************
*Option B:
* Add VHScroller to a viewport
********************************************************************
_strbr = new StringBrowser(_strbr_bs, 20, 60, false);
// Add stringbrowser to viewport
_viewport = new Viewport(_strbr,Top);
// Put the stringbrowser into a HBox
strbr_hbox = new HBox(
new HGlue(round(0.3*inch),0),
new Frame(AddVHScroller(_viewport),
new HGlue
);
********************************************************************
Technical Details
Message-ID:
<9105141707.AA12489@hplds3.sid.hp.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!riacs!stanford.edu!HPLDS3.SID.HP.COM!jancShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!riacs!stanford.edu!HPLDS3.SID.HP.COM!janc From: janc@HPLDS3.SID.HP.COM (Jan Chang) Newsgroups: comp.windows.interviews Subject: Adding VHScroller to a StringBrowser Message-ID: <9105141707.AA12489@hplds3.sid.hp.com> Date: 14 May 91 17:07:52 GMT Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Lines: 88