Adhemar,
No est谩 terminado pero puedes ir prob谩ndolo. No tengo instalado OutLook 2010 aqui, por lo que te agradezco si pones unas capturas de la parte superior del control, gracias
outl2010.prg
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
#define COLOR_WINDOW 聽 聽 聽 聽 5
#define COLOR_BTNFACE 聽 聽 聽 15
#define TME_LEAVE 聽 聽 聽 聽 聽 聽2
#define WM_MOUSELEAVE 聽 聽 聽675
#define LIGHTBLUE 聽 聽nRGB( 聽89, 135, 214 )
#define DARKBLUE 聽 聽 nRGB( 聽 3, 聽56, 147 )
#define LIGHTORANGE1 nRGB( 250, 227, 143 )
#define DARKORANGE1 聽nRGB( 238, 152, 25 )
#define LIGHTCYAN 聽 聽nRGB( 203, 225, 252 )
#define DARKCYAN 聽 聽 nRGB( 125, 165, 224 )
#define LIGHTORANGE2 nRGB( 255, 255, 220 )
#define DARKORANGE2 聽nRGB( 247, 192, 91 )
CLASS TOutLook2010 FROM TControl
聽 聽DATA 聽oHeader
聽 聽DATA 聽aGroups, aDialogs
聽 聽DATA 聽oFontHeader
聽 聽DATA 聽oFontGroup
聽 聽DATA 聽nOver
聽 聽DATA 聽bChange
聽 聽DATA 聽nOption
聽 聽DATA 聽hBmpDots
聽 聽DATA 聽oPopup
聽 聽CLASSDATA lRegistered AS LOGICAL
聽 聽METHOD New( oWnd, aPrompts, aBmpNames, bChange )
聽 聽METHOD Redefine( nId, oWnd, aPrompts, aBmpNames, bChange, aDialogs )
聽 聽METHOD Paint()
聽 聽METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
聽 聽METHOD EraseBkGnd( hDC ) INLINE 1
聽 聽METHOD AddGroup( cPrompt, cBitmap )
聽 聽METHOD AtGroup( nRow, nCol )
聽 聽METHOD BuildPopup()
聽 聽METHOD Default()
聽 聽METHOD Initiate( hDlg )
聽 聽METHOD MouseMove( nRow, nCol, nFlags )
聽 聽METHOD LButtonDown( nRow, nCol, nFlags )
聽 聽METHOD Destroy()
聽 聽METHOD HandleEvent( nMsg, nWParam, nLParam )
聽 聽METHOD MouseLeave( nRow, nCol, nFlags )
聽 聽METHOD SetOption( nOption )
聽 聽METHOD AdjustDialogs( nWidth, nHeight )
聽 聽METHOD SetPopup( oPopup ) INLINE ::oPopup:End(), ::oPopup := oPopup
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( oWnd, aPrompts, aBmpNames, bChange )
聽 聽local n, oDlg
聽 聽DEFAULT oWnd := GetWndDefault()
聽 聽::nTop 聽 聽= 0
聽 聽::nLeft 聽 = 0
聽 聽::nBottom = oWnd:nBottom
聽 聽::nRight 聽= 190
聽 聽::oWnd 聽 聽= oWnd
聽 聽::nStyle 聽= nOr( WS_CHILD, WS_VISIBLE, WS_BORDER )
聽 聽::lDrag 聽 = .f.
聽 聽::nClrPane = nRGB( 220, 223, 228 )
聽 聽::aGroups = {}
聽 聽::bChange = bChange
聽 聽::aDialogs = {}
聽 聽::bResized = { | nType, nWidth, nHeight | ::AdjustDialogs( nWidth, nHeight ) }
聽 聽::nOption 聽= 1
聽 聽::hBmpDots = BmpOLDots()
聽 聽::oPopup 聽 = ::BuildPopup()
聽 聽::Register()
聽 聽if ! Empty( ::oWnd:hWnd )
聽 聽 聽 ::Create()
聽 聽 聽 ::oWnd:AddControl( Self )
聽 聽else
聽 聽 聽 ::oWnd:DefControl( Self )
聽 聽endif
聽 聽::oWnd:oLeft = Self
聽 聽DEFINE FONT ::oFontHeader NAME "Verdana" SIZE 0, -16 BOLD
聽 聽DEFINE FONT ::oFontGroup 聽NAME "Verdana" SIZE 0, -12 BOLD
聽 聽::oHeader = TOutLook2010Group():New( "", Self )
聽 聽if ! Empty( aPrompts )
聽 聽 聽 for n = 1 to Len( aPrompts )
聽 聽 聽 聽 聽if ! Empty( aBmpNames ) .and. n <= Len( aBmpNames )
聽 聽 聽 聽 聽 聽 ::AddGroup( aPrompts[ n ], aBmpNames[ n ] )
聽 聽 聽 聽 聽else
聽 聽 聽 聽 聽 聽 ::AddGroup( aPrompts[ n ] )
聽 聽 聽 聽 聽endif
聽 聽 聽 next
聽 聽endif
聽 聽for n = 1 to Len( ::aGroups )
聽 聽 聽 DEFINE DIALOG oDlg OF Self STYLE WS_CHILD 聽;
聽 聽 聽 聽 聽FROM 33, 0 TO ::nHeight - ( Len( ::aGroups ) * 32 ), ::nWidth() - 1 PIXEL ;
聽 聽 聽 聽 聽FONT Self:oFont
聽 聽 聽 AAdd( ::aDialogs, oDlg )
聽 聽next
聽 聽if ! Empty( oWnd:hWnd )
聽 聽 聽 ::Default()
聽 聽endif
return Self
//----------------------------------------------------------------------------//
METHOD Redefine( nId, oWnd, aPrompts, aBmpNames, bChange, aDialogs ) CLASS TOutLook2010
聽 聽local n, oDlg, oFont
聽 聽DEFAULT aDialogs := Array( Len( aPrompts ) ), oWnd := GetWndDefault(), aBmpNames := {}
聽 聽::nId 聽 聽 聽= nId
聽 聽::oWnd 聽 聽 = oWnd
聽 聽::aGroups 聽= {}
聽 聽::aDialogs = {}
聽 聽::bChange 聽= bChange
聽 聽::nClrPane = nRGB( 0, 45, 150 )
聽 聽::hBmpDots = BmpOLDots()
聽 聽::oPopup 聽 = ::BuildPopup()
聽 聽::Register()
聽 聽DEFINE FONT ::oFontHeader NAME "Verdana" SIZE 0, -16 BOLD
聽 聽DEFINE FONT ::oFontGroup 聽NAME "Verdana" SIZE 0, -12 BOLD
聽 聽::oHeader = TOutLook2010Group():New( "", Self )
聽 聽if ! Empty( aPrompts )
聽 聽 聽 for n = 1 to Len( aPrompts )
聽 聽 聽 聽 聽if ! Empty( aBmpNames ) .and. n <= Len( aBmpNames )
聽 聽 聽 聽 聽 聽 ::AddGroup( aPrompts[ n ], aBmpNames[ n ] )
聽 聽 聽 聽 聽else
聽 聽 聽 聽 聽 聽 ::AddGroup( aPrompts[ n ] )
聽 聽 聽 聽 聽endif
聽 聽 聽 next
聽 聽endif
聽 聽oFont = TFont():New( GetSysFont(), 0, -9 )
聽 聽for n = 1 to Len( aPrompts )
聽 聽 聽 DEFINE DIALOG oDlg OF Self RESOURCE aDialogs[ n ] FONT oFont
聽 聽 聽 AAdd( ::aDialogs, oDlg )
聽 聽next
聽 聽oWnd:DefControl( Self )
return Self
//----------------------------------------------------------------------------//
METHOD Default() CLASS TOutLook2010
聽 聽local oDlg, n
聽 聽::SetColor( ::nClrText, ::nClrPane )
聽 聽for n = 1 to Len( ::aDialogs )
聽 聽 聽 oDlg = ::aDialogs[ n ]
聽 聽 聽 ACTIVATE DIALOG oDlg NOWAIT ;
聽 聽 聽 聽 聽ON INIT oDlg:Move( 33, 0 ) ;
聽 聽 聽 聽 聽VALID .F. 聽 聽 聽 聽 聽 聽 聽 聽// to avoid exiting pressing Esc !!!
聽 聽 聽 if IsAppThemed()
聽 聽 聽 聽 聽if Empty( oDlg:oBrush:hBitmap )
聽 聽 聽 聽 聽 聽 // oDlg:bEraseBkGnd = { | hDC | DrawPBack( oDlg:hWnd, hDC ), 1 }
聽 聽 聽 聽 聽endif
聽 聽 聽 endif
聽 聽 聽 oDlg:Hide()
聽 聽next
聽 聽if Len( ::aDialogs ) > 0
聽 聽 聽 ::aDialogs[ 1 ]:Show()
聽 聽endif
return nil
//----------------------------------------------------------------------------//
METHOD Initiate( hDlg ) CLASS TOutLook2010
聽 聽Super:Initiate( hDlg )
聽 聽::Default()
聽 聽::AdjustDialogs()
return nil
//----------------------------------------------------------------------------//
METHOD AddGroup( cPrompt, cBitmap ) CLASS TOutLook2010
聽 AAdd( ::aGroups, TOutLook2010Group():New( cPrompt, Self, cBitmap ) )
聽 if Empty( ::oHeader:cPrompt )
聽 聽 聽::oHeader:cPrompt = cPrompt
聽 endif
return nil
//----------------------------------------------------------------------------//
METHOD BuildPopup() CLASS TOutLook2010
聽 聽local oPopup
聽 聽MENU oPopup POPUP 2007
聽 聽 聽 MENUITEM "Show &More Buttons"
聽 聽 聽 MENUITEM "Show &Fewer Buttons"
聽 聽 聽 MENUITEM "Na&vigation Pane Options..."
聽 聽 聽 SEPARATOR
聽 聽 聽 MENUITEM "&Add or Remove Buttons"
聽 聽ENDMENU
return oPopup
//----------------------------------------------------------------------------//
METHOD Paint() CLASS TOutLook2010
聽 聽local n, nTop
聽 聽local aInfo := ::DispBegin()
聽 聽FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
聽 聽::oHeader:Paint()
聽 聽// Grab bar
聽 聽nTop = ::nHeight - ( Len( ::aGroups ) * 32 ) - 7
聽 聽Gradient( ::hDC, { nTop, 0, nTop + 7, ::nWidth() }, DARKBLUE, LIGHTBLUE, .T. )
聽 聽DrawTransparent( ::hDC, ::hBmpDots, nTop + 2, ( ::nWidth() / 2 ) - ( nBmpWidth( ::hBmpDots ) / 2 ) )
聽 聽if Len( ::aGroups ) > 0
聽 聽 聽 for n = 1 to Len( ::aGroups )
聽 聽 聽 聽 聽::aGroups[ n ]:Paint()
聽 聽 聽 next
聽 聽endif
聽 聽::DispEnd( aInfo )
return nil
//----------------------------------------------------------------------------//
METHOD AtGroup( nRow, nCol ) CLASS TOutLook2010
聽 聽local nGroupsArea := ::nHeight - ( Len( ::aGroups ) * 32 )
聽 聽if nRow > nGroupsArea
聽 聽 聽 return Len( ::aGroups ) - Int( ( ::nHeight - nRow ) / 32 )
聽 聽endif
return nil
//----------------------------------------------------------------------------//
METHOD MouseMove( nRow, nCol, nFlags ) CLASS TOutLook2010
聽 聽local nGroup := ::AtGroup( nRow, nCol )
聽 聽if nGroup == nil
聽 聽 聽 CursorArrow()
聽 聽 聽 if ::nOver != nil
聽 聽 聽 聽 聽::aGroups[ ::nOver ]:Paint()
聽 聽 聽 聽 聽::nOver = nil
聽 聽 聽 endif
聽 聽endif
聽 聽if nGroup != nil .and. nGroup != ::nOver
聽 聽 聽 if ::nOver != nil
聽 聽 聽 聽 聽::aGroups[ ::nOver ]:Paint()
聽 聽 聽 endif
聽 聽 聽 ::aGroups[ nGroup ]:Paint( .T. )
聽 聽 聽 ::nOver = nGroup
聽 聽 聽 CursorHand()
聽 聽endif
聽 聽TrackMouseEvent( ::hWnd, TME_LEAVE )
return nil
//----------------------------------------------------------------------------//
METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TOutLook2010
聽 聽local nGroup := ::AtGroup( nRow, nCol )
聽 聽if nGroup != nil
聽 聽 聽 ::SetOption( nGroup )
聽 聽 聽 if nCol > ::nWidth - 30 .and. nCol < ::nWidth
聽 聽 聽 聽 聽if nGroup == Len( ::aGroups )
聽 聽 聽 聽 聽 聽 ::oPopup:Activate( ::nHeight, ::nWidth + 1, Self, .F., 32 )
聽 聽 聽 聽 聽endif
聽 聽 聽 endif
聽 聽endif
return nil
//----------------------------------------------------------------------------//
METHOD Destroy() CLASS TOutLook2010
聽 聽local n
聽 聽::oFontHeader:End()
聽 聽::oFontGroup:End()
聽 聽for n = 1 to Len( ::aDialogs )
聽 聽 聽 ::aDialogs[ n ]:bValid = nil
聽 聽 聽 ::aDialogs[ n ]:End()
聽 聽next
聽 聽DeleteObject( ::hBmpDots )
聽 聽for n = 1 to Len( ::aGroups )
聽 聽 聽 ::aGroups[ n ]:Destroy()
聽 聽next
聽 聽::oHeader:Destroy()
聽 聽::oPopup:End()
return Super:Destroy()
//----------------------------------------------------------------------------//
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TOutLook2010
聽 聽if nMsg == WM_MOUSELEAVE
聽 聽 聽 return ::MouseLeave( nHiWord( nLParam ), nLoWord( nLParam ), nWParam )
聽 聽endif
return Super:HandleEvent( nMsg, nWParam, nLParam )
//----------------------------------------------------------------------------//
METHOD MouseLeave( nRow, nCol, nFlags ) CLASS TOutLook2010
聽 聽if ::nOver != nil
聽 聽 聽 ::aGroups[ ::nOver ]:Paint()
聽 聽 聽 ::nOver = nil
聽 聽endif
return nil
//----------------------------------------------------------------------------//
METHOD SetOption( nOption ) CLASS TOutLook2010
聽 聽local nOldOption := AScan( ::aGroups, { | o | o:lSelected } )
聽 聽if nOption > 0 .and. nOption != nOldOption
聽 聽 聽 ::aGroups[ nOldOption ]:lSelected = .F.
聽 聽 聽 ::aGroups[ nOldOption ]:nClrStart = LIGHTCYAN
聽 聽 聽 ::aGroups[ nOldOption ]:nClrEnd 聽 = DARKCYAN
聽 聽 聽 ::aGroups[ nOldOption ]:Paint()
聽 聽 聽 ::aGroups[ nOption ]:lSelected = .T.
聽 聽 聽 ::aGroups[ nOption ]:nClrStart = LIGHTORANGE1
聽 聽 聽 ::aGroups[ nOption ]:nClrEnd 聽 = DARKORANGE1
聽 聽 聽 ::aGroups[ nOption ]:Paint( .T. )
聽 聽 聽 ::oHeader:cPrompt = ::aGroups[ nOption ]:cPrompt
聽 聽 聽 ::oHeader:Paint()
聽 聽 聽 if nOldOption <= Len( ::aDialogs ) .and. ::aDialogs[ nOldOption ] != nil
聽 聽 聽 聽 聽::aDialogs[ nOldOption ]:Hide()
聽 聽 聽 endif
聽 聽 聽 if nOption <= Len( ::aDialogs ) .and. ::aDialogs[ nOption ] != nil
聽 聽 聽 聽 聽::nOption = nOption
聽 聽 聽 聽 聽if ::bChange != nil
聽 聽 聽 聽 聽 聽 Eval( ::bChange, nOption, nOldOption )
聽 聽 聽 聽 聽endif
聽 聽 聽 聽 聽::aDialogs[ nOption ]:AEvalWhen()
聽 聽 聽 聽 聽::aDialogs[ nOption ]:Show()
聽 聽 聽 聽 聽::aDialogs[ nOption ]:SetFocus()
聽 聽 聽 endif
聽 聽endif
return nil
//----------------------------------------------------------------------------//
METHOD AdjustDialogs( nWidth, nHeight ) CLASS TOutLook2010
聽 聽local n
聽 聽DEFAULT nWidth := ::nWidth, nHeight := ::nHeight;
聽 聽nHeight := Max( 0, nHeight - 6 - ( ( Len( ::aGroups ) + 1 ) * 32 ) )
聽 聽for n = 1 to Len( ::aDialogs )
聽 聽 聽 ::aDialogs[ n ]:SetSize( nWidth, nHeight )
聽 聽next
return nil
//----------------------------------------------------------------------------//
CLASS TOutLook2010Group
聽 聽DATA 聽 cPrompt
聽 聽DATA 聽 hBmp, hBmpArrow
聽 聽DATA 聽 lSelected, lHeader
聽 聽DATA 聽 nClrStart, nClrEnd, nClrText
聽 聽DATA 聽 oContainer
聽 聽METHOD New( cPrompt, oContainer, cBitmap )
聽 聽METHOD Paint( lOver )
聽 聽METHOD Destroy()
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( cPrompt, oContainer, cBitmap ) CLASS TOutLook2010Group
聽 聽::cPrompt 聽 聽= cPrompt
聽 聽::oContainer = oContainer
聽 聽::lHeader 聽 聽= ( ::oContainer:oHeader == nil )
聽 聽::lSelected 聽= ! ::lHeader .and. Len( ::oContainer:aGroups ) == 0
聽 聽::nClrStart 聽= If( ::lHeader, LIGHTBLUE, If( ::lSelected, LIGHTORANGE1, LIGHTCYAN ) )
聽 聽::nClrEnd 聽 聽= If( ::lHeader, DARKBLUE, If( ::lSelected, DARKORANGE1, DARKCYAN ) )
聽 聽::nClrText 聽 = If( ::lHeader, CLR_WHITE, CLR_BLACK )
聽 聽::hBmpArrow 聽= BmpOLArrow()
聽 聽if File( cBitmap )
聽 聽 聽 ::hBmp = ReadBitmap( 0, cBitmap )
聽 聽else
聽 聽 聽 ::hBmp = LoadBitmap( GetResources(), cBitmap )
聽 聽endif
return Self
//----------------------------------------------------------------------------//
METHOD Paint( lOver ) CLASS TOutLook2010Group
聽 聽local nTop, hDC, oBmp, oCon := ::oContainer
聽 聽local hGrayPen, hOldPen
聽 聽DEFAULT lOver := .F.
聽 聽if ::lHeader
聽 聽 聽 nTop = 0
聽 聽else
聽 聽 聽 nTop = oCon:nHeight - ;
聽 聽 聽 聽 聽 聽 聽( ( Len( oCon:aGroups ) + 1 - AScan( oCon:aGroups, { | o | o == Self } ) ) * 32 )
聽 聽endif
聽 聽if ::lSelected
聽 聽 聽 GradientFill( hDC := oCon:GetDC(), nTop + 2, 2, nTop + 28, oCon:nWidth() - 2,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 { { 0.5, RGB( 222, 227, 233 ), RGB( 209, 213, 222 ) },;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 { 0.5, RGB( 209, 213, 222 ), RGB( 222, 227, 233 ) } } ) 聽
聽 聽else
聽 聽 聽 FillRect( hDC := oCon:GetDC(), { nTop, 0, nTop + 32, oCon:nWidth() }, oCon:oBrush:hBrush )
聽 聽endif
聽 聽 聽 聽 聽 聽 聽 聽
聽 聽if ! Empty( ::hBmp )
聽 聽 聽 DrawTransparent( hDC, ::hBmp, nTop + 5, 8 )
聽 聽endif
聽 聽oCon:Say( nTop + 8 - If( ::lHeader, 2, 0 ), 40 - If( ::lHeader, 30, 0 ),;
聽 聽 聽 聽 聽 聽 聽::cPrompt, If( ::lSelected, ::nClrText, RGB( 57, 75, 97 ) ),,;
聽 聽 聽 聽 聽 聽 聽If( ::lHeader, oCon:oFontHeader, oCon:oFontGroup ), .T., ::lSelected )
聽 聽if Self == ATail( oCon:aGroups )
聽 聽 聽 DrawTransparent( hDC, ::hBmpArrow, nTop + 10, oCon:nWidth() - nBmpWidth( ::hBmpArrow ) * 2 )
聽 聽endif
聽 聽if ::lSelected
聽 聽 聽 hGrayPen = CreatePen( PS_SOLID, 1, nRGB( 165, 168, 173 ) )
聽 聽 聽 WndBoxClr( hDC, nTop + 1, 3, nTop + 30, oCon:nWidth - 6, hGrayPen )
聽 聽 聽 DeleteObject( hGrayPen )
聽 聽endif 聽
聽 聽oCon:ReleaseDC()
return nil
//----------------------------------------------------------------------------//
METHOD Destroy CLASS TOutLook2010Group
聽 聽if ! Empty( ::hBmp )
聽 聽 聽 DeleteObject( ::hBmp )
聽 聽endif
聽 聽if ! Empty( ::hBmpArrow )
聽 聽 聽 DeleteObject( ::hBmpArrow )
聽 聽endif
return nil
//----------------------------------------------------------------------------//
test2010.prg
// FWH Class TOutLook2010
#include "FiveWin.ch"
#include "Splitter.ch"
#include "OutLook.ch"
static lExit := .F.
//----------------------------------------------------------------------------//
function Main()
聽 聽local oWnd, oOutLook2010, oStatusBar, oSplit, cCombo, oRad, nValue := 1
聽 聽local oFont, oExBar, oPanel1, oPanel2, bClick := { | o | MsgInfo( o:GetText() ) }
聽 聽DEFINE WINDOW oWnd TITLE "FWH new Class TOutLook2010" MDI // ;
聽 聽 聽 // MENU BuildMenu()
聽 聽DEFINE OUTLOOK2010 oOutLook2010 OF oWnd ;
聽 聽 聽 PROMPTS "Mail", "Calendar", "Contacts", "" ;
聽 聽 聽 BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp"
聽 聽 聽
聽 聽oWnd:oLeft = nil // Because the splitter is going to control the resize 聽
聽 聽@ 0, 0 EXPLORERBAR oExBar OF oOutLook2010:aDialogs[ 1 ] ;
聽 聽 聽 SIZE oOutLook2010:aDialogs[ 1 ]:nWidth, oOutLook2010:aDialogs[ 1 ]:nHeight
聽 聽oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
聽 聽oPanel1:lSpecial = .T.
聽 聽oPanel1:AddLink( "First item", bClick, "..\bitmaps\16x16\additem.bmp" )
聽 聽oPanel1:AddLink( "Second item", bClick, "..\bitmaps\16x16\copy.bmp" )
聽 聽 聽
聽 聽oPanel2 = oExBar:AddPanel( "Two", "..\bitmaps\32x32\case.bmp" )
聽 聽oPanel2:AddLink( "First item", bClick, "..\bitmaps\16x16\adddbf.bmp" )
聽 聽oPanel2:AddLink( "Second item", bClick, "..\bitmaps\16x16\delete0.bmp" )
聽 聽oPanel2:AddLink( "Third item", bClick, "..\bitmaps\16x16\envelope.bmp" )
聽 聽oPanel2:AddLink( "Fourth item", bClick, "..\bitmaps\16x16\copy.bmp" ) 聽 聽 聽
聽 聽 聽
聽 聽@ 1, 1 COMBOBOX cCombo ITEMS { "January", "February", "March", "April", "May" } ;
聽 聽 聽 OF oOutLook2010:aDialogs[ 2 ] SIZE 170, 100
聽 聽
聽 聽DEFINE FONT oFont NAME "Arial" SIZE 0, -10
聽 聽
聽 聽@ 12, 10 SAY Date() OF oOutLook2010:aDialogs[ 2 ] SIZE 80, 20 FONT oFont
聽 聽
聽 聽@ 3, 1 RADIO oRad VAR nValue OF oOutLook2010:aDialogs[ 2 ] ;
聽 聽 聽 ITEMS "&Day", "&Week", "&Month" SIZE 100, 20
聽 聽 聽
聽 聽oRad:SetFont( oFont ) 聽
聽 聽@ 1, 2 BUTTON "New" OF oOutLook2010:aDialogs[ 3 ] SIZE 80, 22 ACTION BuildDlg()
聽 聽@ 3, 2 BUTTON "Edit" OF oOutLook2010:aDialogs[ 3 ] SIZE 80, 22 ACTION MsgInfo( "Edit" ) 聽
聽 聽@ 5, 2 BUTTON "Search" OF oOutLook2010:aDialogs[ 3 ] SIZE 80, 22 ACTION MsgInfo( "Search" ) 聽
聽 聽DEFINE STATUSBAR oStatusBar PROMPT " 聽FWH Class TOutLook2010" OF oWnd
聽 聽SetParent( oOutLook2010:hWnd, oWnd:hWnd )
聽 聽
聽 聽oWnd:oClient = nil
聽 聽
聽 聽@ 0, 191 SPLITTER oSplit ;
聽 聽 聽 VERTICAL _3DLOOK ;
聽 聽 聽 PREVIOUS CONTROLS oOutLook2010 ;
聽 聽 聽 HINDS CONTROLS oWnd:oWndClient ;
聽 聽 聽 SIZE 4, oWnd:nHeight - 70 PIXEL ;
聽 聽 聽 OF oWnd
聽 聽SetParent( oSplit:hWnd, oWnd:hWnd )
聽 聽ACTIVATE WINDOW oWnd ;
聽 聽 聽 ON RESIZE ( oSplit:Adjust(),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 WndLeft( oWnd:oWndClient:hWnd, oSplit:nRight + 1 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 WndWidth( oWnd:oWndClient:hWnd, oWnd:nWidth - oOutLook2010:nWidth - 23 ) ) ; // + 80
聽 聽 聽 VALID lExit := .T.
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
聽 聽local oMenu
聽 聽
聽 聽MENU oMenu
聽 聽 聽 MENUITEM "&One"
聽 聽 聽 MENUITEM "&Two"
聽 聽 聽 MENUITEM "&Three"
聽 聽ENDMENU
聽 聽
return oMenu 聽
//----------------------------------------------------------------------------//
function BuildDlg()
聽 聽local oDlg, oOutL2010
聽 聽
聽 聽DEFINE DIALOG oDlg RESOURCE "Test"
聽 聽
聽 聽REDEFINE OUTLOOK2010 oOutL2010 ID 110 OF oDlg ;
聽 聽 聽 PROMPTS "One", "Two", "Three" ;
聽 聽 聽 BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp" ;
聽 聽 聽 DIALOGS "Page1", "Page2", "Page3"
聽 聽REDEFINE BUTTON ID 110 OF oOutL2010:aDialogs[ 1 ] ACTION MsgInfo( "Click" )
聽 聽 聽
聽 聽ACTIVATE DIALOG oDlg CENTERED
聽 聽
return nil 聽 聽 聽
//----------------------------------------------------------------------------//
function WinRun()
聽 聽while NoGPF()
聽 聽 聽 if lExit
聽 聽 聽 聽 聽PostQuitMessage( 0 )
聽 聽 聽 endif 聽
聽 聽end
聽 聽
return nil 聽 聽 聽 聽
聽 聽 聽 聽 聽 聽 聽 聽
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
BOOL SysRefresh( void );
HB_FUNC( NOGPF )
{
聽 聽__try
聽 聽{
聽 聽 聽 hb_retl( SysRefresh() );
聽 聽}
聽 聽__except ( ( hb_retl( TRUE ), TRUE ) )
聽 聽{}
}
#pragma ENDDUMP
En wndboxes.c
HB_FUNC( WNDBOXCLR ) // ( hDC, nTop, nLeft, nBottom, nRight, hPen )
{
聽 聽RECT rct;
聽 聽rct.top 聽 聽= hb_parni( 2 );
聽 聽rct.left 聽 = hb_parni( 3 );
聽 聽rct.bottom = hb_parni( 4 );
聽 聽rct.right 聽= hb_parni( 5 );
聽 聽WndDrawBox( ( HDC ) hb_parnl( 1 ), &rct,
聽 聽 聽 聽 聽 聽 聽 聽( HPEN ) hb_parnl( 6 ),
聽 聽 聽 聽 聽 聽 聽 聽( HPEN ) hb_parnl( 6 ) );
}
outlook.ch
#ifndef _OUTLOOK_CH
#define _OUTLOOK_CH
/*----------------------------------------------------------------------------//
!short: OUTLOOK */
#xcommand @ <nRow>, <nCol> OUTLOOK [<oOut>] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ STYLE <nStyle> ] ;
[ FONT <oFont> ] ;
[ <lPixel: PIXEL> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <help: HELP, HELPID> <nHelpId> ] ;
[ ON RIGHT CLICK <uRClicked> ] ;
=> ;
[<oOut> := ] TOutLook():New( <nRow>, <nCol>, ;
<nWidth>, <nHeight>, ;
<nClrFore>, <nClrBack>, <nStyle>, <oFont>, ;
<.lPixel.>, <oWnd>, <nHelpId>, ;
[{|nRow,nCol,nFlags|<uRClicked>}] )
#xcommand DEFINE GROUP OF OUTLOOK <oOut> ;
[ PROMPT <cPrompt> ] ;
[ WHEN <bWhen> ] ;
[ MESSAGE <cMsg> ] ;
[ FONT <oFont> ] ;
=> ;
<oOut>:AddGroup( <cPrompt>, ;
[{|Self|<bWhen>}], <cMsg>, <oFont> )
#xcommand DEFINE BITMAP OF OUTLOOK <oOut> ;
[ GROUP <nGroup> ] ;
[ PROMPT <cPrompt> ] ;
[ <action: ACTION, ON CLICK> <uAction> ] ;
[ ON RIGHT CLICK <uRClicked> ] ;
[ BITMAP <cBmp> ] ;
[ RESOURCE <cResBmp> ] ;
[ WHEN <bWhen> ] ;
[ MESSAGE <cMsg> ] ;
[ FONT <oFont> ] ;
[ <lAdjust: ADJUST> ] ;
[ <lBorder: BORDER> ] ;
[ TOOLTIP <cToolTip> ] ;
=> ;
<oOut>:AddItem( <cPrompt>, <cBmp>, <cResBmp>, ;
[{|Self, oBmp, oSay|<uAction>}], <nGroup>, ;
[{|Self|<bWhen>}], <cMsg>, ;
[{|nRow,nCol,nFlags|<uRClicked>}], <oFont>, ;
<.lAdjust.>, <.lBorder.>, <cToolTip>, .f. )
// OutLook 2003
#xcommand DEFINE OUTLOOK2003 <oOut> ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <bmp: BITMAPS, IMAGES> <cBmpName,...> ] ;
[ ON CHANGE <uChange> ] ;
=> ;
[ <oOut> := ] TOutLook2003():New( [<oWnd>], [\{<cPrompt>\}],;
[\{<cBmpName>\}], [{|nOption,nOldOption| <uChange>}] )
#xcommand REDEFINE OUTLOOK2003 <oOut> ;
[ ID <nId> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <bmp: BITMAPS, IMAGES> <cBmpName,...> ] ;
[ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgName,...> ] ;
[ ON CHANGE <uChange> ] ;
=> ;
[ <oOut> := ] TOutLook2003():Redefine( [<nId>], [<oWnd>], [\{<cPrompt>\}],;
[\{<cBmpName>\}], [{|nOption,nOldOption| <uChange>}], [\{<cDlgName>\}], )
// OutLook 2010
#xcommand DEFINE OUTLOOK2010 <oOut> ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <bmp: BITMAPS, IMAGES> <cBmpName,...> ] ;
[ ON CHANGE <uChange> ] ;
=> ;
[ <oOut> := ] TOutLook2010():New( [<oWnd>], [\{<cPrompt>\}],;
[\{<cBmpName>\}], [{|nOption,nOldOption| <uChange>}] )
#xcommand REDEFINE OUTLOOK2010 <oOut> ;
[ ID <nId> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <bmp: BITMAPS, IMAGES> <cBmpName,...> ] ;
[ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgName,...> ] ;
[ ON CHANGE <uChange> ] ;
=> ;
[ <oOut> := ] TOutLook2010():Redefine( [<nId>], [<oWnd>], [\{<cPrompt>\}],;
[\{<cBmpName>\}], [{|nOption,nOldOption| <uChange>}], [\{<cDlgName>\}], )
#endif // _OUTLOOK_CH
//--------------------------------------------------------------------------//
De FiveWin.ch eliminamos OUTLOOK2003
