TaskPanel de Andrés Reyes + SPLITTER + xBrowse
xHB/FWH/
Si alguien quiere mejorar bienvenido
- Code: Select all Expand view
#include "fivewin.ch"
#include "xbrowse.ch"
#include "taskpanel.ch"
#include "Splitter.ch"
STATIC oTaskPanel, oBold, oBrw
FUNCTION Main()
WITH OBJECT ScTask()
:New()
END OBJECT
RETURN (NIL)
CLASS ScTask
DATA oWnd AS OBJECT
DATA oBar AS OBJECT
DATA oTaskPanel AS OBJECT
DATA oVSplit AS OBJECT
DATA oExBar AS OBJECT
METHOD New()
METHOD MakeWindow()
METHOD BuildBar()
METHOD BuildSplitterV()
METHOD SetSize( nType, nWidth, nHeight )
METHOD BuildTaskPanel()
METHOD BuildXbrowse()
ENDCLASS
METHOD New() CLASS ScTask
::MakeWindow()
RETURN (NIL)
METHOD MakeWindow() CLASS ScTask
LOCAL oBrush
LOCAL oMenu
LOCAL oSelf := Self
DEFINE BRUSH oBrush COLOR CLR_GRAY
DEFINE FONT oBold NAME "Segoe UI Semi Bold" SIZE 0,-24
MENU oMenu
ENDMENU
DEFINE WINDOW ::oWnd BRUSH oBrush Menu oMenu title "Window MDI, Taskpanel & Browse, "
DEFINE BUTTONBAR ::oBar OF ::oWnd SIZE 60,60 //2007
::oBar:SetColor( CLR_WHITE, rgb(255, 230, 230) )
::BuildBar()
::BuildTaskPanel()
::BuildXbrowse()
::BuildSplitterV()
SET MESSAGE OF ::oWnd TO "SysCtrl Software" KEYBOARD CLOCK DATE NOINSET
ACTIVATE WINDOW ::oWnd MAXIMIZED ;
ON RESIZE oSelf:SetSize( nSizeType, nWidth, nHeight ) ;
VALID ( oSelf:oWnd := Nil, .T. )
oBrush:End()
oBold:End()
RETURN (NIL)
METHOD SetSize( nType, nWidth, nHeight ) CLASS ScTask
if nWidth != nil
oBrw:Move( , , nWidth - ( oTaskPanel:nRight + 6 ), nHeight )
endif
Return nil
METHOD BuildBar() CLASS ScTask
LOCAL nRow := 3
LOCAL hWDskTop := GetDeskTopWindow()
LOCAL aResXY := GetClientRect( hWDskTop )
LOCAL nCol := aResXY[4]
LOCAL cLabel := "CATEGORIAS"
LOCAL oFontExit
LOCAL oSay
DEFINE FONT oFontExit NAME "TAHOMA" SIZE 0,-16 bold
@ nRow+20, 10 SAY oSay PROMPT "CATEGORIAS" ;
SIZE 200, 24 PIXEL OF ::oBar FONT oBold TRANSPARENT COLOR CLR_RED
@ nRow, nCol-100 BTNBMP oBtnBmp ;
PROMPT "Exit" ;
TOOLTIP "Cerrar el catálogo de categorias" ;
SIZE 70,55 PIXEL OF ::oBar FONT oFontExit ;
TOP ADJUST UPDATE //NOBORDER //FLAT TOP //NOBORDER
WITH OBJECT oBtnBmp
:Cargo := oBtnBmp
:bAction := { |oBtn| If( MsgYesNo( "Salir ?","Usuario" ), ::oWnd:End(), .t. ) }
:bPainted := { |hDC| FW_DrawImage( hDC, "SALIR2", { 2, 30, 34, 62 } ) }
:bClrGrad := { |l,oBtn| If( oBtn:lPressed, CLR_HRED, RGB( 207, 83, 0 ) ) }
END
RETURN (Self)
METHOD BuildSplitterV() CLASS ScTask
LOCAL oSelf := Self
LOCAL oBrush
LOCAL oParent := ::oWnd
DEFINE BRUSH oBrush FILE ".\BMPS\spiral.bmp"
//10,80
@ 60, oTaskPanel:nWidth + 2 SPLITTER oSelf:oVSplit ;
VERTICAL ;
PREVIOUS CONTROLS ::oBar, oTaskPanel ;
HINDS CONTROLS oBrw ;
LEFT MARGIN 10 ;
RIGHT MARGIN 80 ;
SIZE 12, ScreenHeight() - 1 - 23;
PIXEL ;
COLOR rgb(255, 165, 0) ;
OF oParent UPDATE
oSelf:oVSplit:SetBrush( oBrush )
Return nil
METHOD BuildXbrowse() CLASS ScTask
LOCAL aArray := {}
LOCAL hDC := GetDeskTopWindow()
LOCAL aRes := GetClientRect( hDC )
LOCAL nAlto := aRes[3]
LOCAL nAncho := aRes[4]
LOCAL aHeaders := {"Nombre","Direccion","Telefono"}
LOCAL aColSizes := {200,200,100}
LOCAL oSelf := Self
aAdd( aArray , { "Juan Domingo Lopez Aramburo", "Rio Panuco #454645", "6699843023"} )
aAdd( aArray , { "Mario Rosales Montevideo", "Rio Presidio #546564", "6699879788"} )
aAdd( aArray , { "Felipe de Jesus Ramirez Lopez", "Rio de la Loma #18795", "6695644556"} )
aAdd( aArray , { "Renesio Recto", "Rio Florido #56546", "6699565464"} )
@ 60, 255 xbrowse oBrw ;
DATASOURCE aArray ;
HEADERS aHeaders ;
AUTOCOLS;
COLSIZES aColSizes;
SIZE 260, 200 ; //
AUTOSORT PIXEL LINES OF ::oWnd FLAT
MyStileBrw( oBrw )
oBrw:CreateFromCode()
oBrw:SetFocus()
RETURN (NIL)
METHOD BuildTaskPanel() CLASS ScTask
DEFINE TASKPANEL oTaskPanel ANCHOR LEFT BUBBLE OF ::oWnd
TASKGROUP "Categorias" BITMAP "CATEGORIES" SPECIAL WATERMARK "WATERMARK"
TASKITEM "New" BITMAP "ADD16" ;
ACTION ( Msginfo("New") )
TASKITEM "Edit" BITMAP "EDIT" ;
ACTION ( MsgInfo("EDIT") )
TASKITEM "Deleted" BITMAP "DEL" ;
ACTION ( MsgInfo("Del") )
ENDTASKGROUP
TASKGROUP "Report" BITMAP "PRINTER" SPECIAL WATERMARK "WATERMARK"
TASKITEM "Pdf" BITMAP "PDF16" ;
ACTION ( Msginfo("PDF") )
TASKITEM "To Excel" BITMAP "XLS16" ;
ACTION ( MsgInfo("XLS") )
ENDTASKGROUP
ENDTASKPANEL
oTaskPanel:SetTheme( "XpGreen.dll" )
RETURN (NIL)
Saludos