TReBar

Fuente: source/classes/rebar.prg

Inherits from: TControl

TReBar wraps the Windows rebar / coolbar common control to create a container that hosts multiple child windows in resizable bands. Each band can contain a toolbar, a combobox, or any other control, and can be rearranged or resized by the user at runtime via a gripper bar at the left edge of each band.

Key DATA Members

DATATypeDescription
aBandsArrayArray of band definitions (controls and text)

Methods

MethodDescription
New( oWnd )Create a new TReBar control attached to a window
InsertBand( oControl, cText )Insert a new band containing oControl with optional caption text

Example: Rebar with Two Toolbar Bands

#include "FiveWin.ch"

function Main()

   local oWnd, oReBar, oBar1, oBar2

   DEFINE WINDOW oWnd TITLE "ReBar Demo" SIZE 600, 400

   oReBar := TReBar():New( oWnd )

   DEFINE BUTTONBAR oBar1 _3D OF oWnd SIZE 30, 30
   DEFINE BUTTON OF oBar1 RESOURCE "new.bmp"   ACTION MsgInfo( "New" )
   DEFINE BUTTON OF oBar1 RESOURCE "open.bmp"  ACTION MsgInfo( "Open" )
   DEFINE BUTTON OF oBar1 RESOURCE "save.bmp"  ACTION MsgInfo( "Save" )

   DEFINE BUTTONBAR oBar2 _3D OF oWnd SIZE 30, 30
   DEFINE BUTTON OF oBar2 RESOURCE "cut.bmp"   ACTION MsgInfo( "Cut" )
   DEFINE BUTTON OF oBar2 RESOURCE "copy.bmp"  ACTION MsgInfo( "Copy" )
   DEFINE BUTTON OF oBar2 RESOURCE "paste.bmp" ACTION MsgInfo( "Paste" )

   oReBar:InsertBand( oBar1, "File" )
   oReBar:InsertBand( oBar2, "Edit" )

   oWnd:oClient := oReBar

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

Ver También