TOutLook

Source: source/classes/outlook.prg

Inherits from: TControl

TOutLook implements an Outlook-style navigation bar with collapsible groups containing icon-and-text navigation items. It is commonly used as a sidebar panel in MDI or SDI applications to organize navigation destinations into logical categories, similar to Microsoft Outlook's folder pane.

Key DATA Members

DATATypeDescription
aGroupArrayArray of group objects containing items
nActualNumericIndex of the currently selected item

Methods

MethodDescription
New( nTop, nLeft, nW, nH, nClrF, nClrB, nStyle, oFont, lPixel, oWnd )Create a new TOutLook control
AddGroup( cPrompt )Add a new collapsible group with the given caption
AddItem( cPrompt, cBmp, cRes, bAction, nGroup )Add an item to the specified group
Set( nGroup )Expand a specific group by its index
DeleteItem( oItem )Remove an item from its group
MoveToGroup( xItem, nGroup )Move an item (by index or object reference) to a different group
SaveOrder()Return the current group/item order as a serialized string
RestoreOrder( cOrder )Restore a previously saved group/item order

Example: Two Groups with Items

#include "FiveWin.ch"

function Main()

   local oWnd, oOutLook

   DEFINE WINDOW oWnd TITLE "Outlook Bar" SIZE 300, 500

   @ 10, 10 OUTLOOK oOutLook ;
      SIZE 280, 460 OF oWnd

   oOutLook:AddGroup( "Mail" )
   oOutLook:AddItem( "Inbox",    "mail1.ico", , {|| MsgInfo( "Inbox" ) }, 1 )
   oOutLook:AddItem( "Sent",     "mail2.ico", , {|| MsgInfo( "Sent" ) }, 1 )
   oOutLook:AddItem( "Drafts",   "mail3.ico", , {|| MsgInfo( "Drafts" ) }, 1 )

   oOutLook:AddGroup( "Calendar" )
   oOutLook:AddItem( "Today",    "cal1.ico",  , {|| MsgInfo( "Today" ) }, 2 )
   oOutLook:AddItem( "Week",     "cal2.ico",  , {|| MsgInfo( "Week" ) }, 2 )
   oOutLook:AddItem( "Month",    "cal3.ico",  , {|| MsgInfo( "Month" ) }, 2 )

   oOutLook:Set( 1 )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

See Also