Holá, Algun ejemplo práctico? como en este ejemplo?
http://fivewin.com.br/index.php?/topic/38005-dashboard-metropanel/
Gracias.
Regards, saludos.
sysctrl2 wrote:ok Joao lo hago y te lo comparto,
saludos.
#include <FiveWin.ch>
#include <XBrowse.ch>
*--------------------------------------
*TEST.PRG
* Windows MDI + Windows Child + Dialog + xBrowse
* 21/09/2023
*--------------------------------------
STATIC oWnd
STATIC oBrw
STATIC oWndChild
STATIC oDlg
STATIC lSalir := .f.
FUNCTION Main()
DEFINE WINDOW oWnd MDI
ACTIVATE WINDOW oWnd MAXIMIZED ON INIT Win_Child() VALID lSalir
RETURN NIL
STATIC FUNCTION Win_Child()
LOCAL oBrush
LOCAL hWDskTop := GetDeskTopWindow()
LOCAL aResXY := GetClientRect( hWDskTop )
LOCAL oSay
LOCAL oFont
DEFINE BRUSH oBrush color RGB(239,118,10)
DEFINE FONT oFont NAME "Times New Roman" BOLD SIZE 35, 35
DEFINE WINDOW oWndChild MDICHILD OF oWnd ;
STYLE nOr( WS_CAPTION, WS_VISIBLE, WS_SYSMENU ) ;
COLOR "N/W" TITLE "Windows Child"
DEFINE DIALOG oDlg size aResXY[4], aResXY[3] ;
STYLE WS_CHILD OF oWndChild BRUSH oBrush
@ 20, 65 SAY oSay PROMPT "32 H A B I T A C I O N E S" ;
OF oDlg size 500, 24 pixel font oFont COLOR CLR_BLUE, nrgb(239,118,10 )
MakeBar()
MakeBrw()
oDlg:lhelpicon := .F.
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT oDlg:Move( 0, 0 )
SET MSGBAR OF oWndChild TO "SysCtrl Software 2023" 2010
ACTIVATE WINDOW oWndChild ;
ON INIT oWndChild:SetSize( oDlg:nWidth, oDlg:nHeight ) valid lSalir
RETURN (.T.)
STATIC FUNCTION MakeBar()
LOCAL nRow := 5
LOCAL nCol := 10
LOCAL nAncho := 45 //50
LOCAL nAlto := 35 //40
LOCAL oBtn := array(10)
LOCAL oFont := TFont():New("Arial",0,-14,.F.,.F.,0,0,0,.F. )
@ nRow, nCol BTNBMP oBtn[1] OF oDlg ;
SIZE nAncho, nAlto PIXEL 2007 ;
NOBORDER ;
PROMPT " " + "EXIT"+CRLF+"" ;
FILENAME "C:\FWH16.08\bitmaps\32x32\EXIT.BMP" ;
ACTION ( iif( Salir_hotel(), ( oWnd:END(), Cerrar_Todo() ), NIL ) ) ;
FONT oFont ;
TOP
RETURN NIL
STATIC FUNCTION MakeBrw()
LOCAL aRooms := { {101,102,103,104,105,106,107,108}, ;
{109,110,111,112,113,114,115,116}, ;
{117,118,119,120,121,122,123,124}, ;
{125,126,127,128,129,130,131,132} }
LOCAL oFont
LOCAL nCol
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-24 BOLD
@ 48,10 XBROWSE oBrw ;
SIZE 510,250 PIXEL OF oDlg ;
AUTOCOLS ;
ARRAY aRooms ;
LINES CELL NOBORDER FONT oFont
for nCol := 1 to Len( oBrw:aCols )
WITH OBJECT oBrw:aCols[ nCol ]
:nWidth := 120
:oDataFont := oFont
:nDataBmpAlign := AL_CENTER
END
next
SetupBrw()
RETURN (NIL)
STATIC FUNCTION SetupBrw()
LOCAL aGradBarSel:= { { 1, RGB(252,232,171), RGB(248,195, 34) } }
LOCAL aGradRowSel:= { { 1, RGB(108,125,184), RGB(241,222,088) } }
LOCAL nRowPos, nColPos
WITH OBJECT oBrw
:lHeader := .f.
:lFooter := .f.
:nHeaderHeight := 0
:nFooterHeight := 0
:nStretchCol := STRETCHCOL_LAST
:nRowHeight := 110
//para barra de linea selecc cuando el control no tiene el foco
:bClrSel := {|| { nRGB( 0, 0, 0), aGradRowSel } }
//para barra de linea selecc cuando el control tiene el foco
:bClrSelFocus := { || { CLR_BLACK, aGradBarSel } }
:bLClicked := { || ( nRowPos := oBrw:KeyNo(), ;
nColPos := oBrw:SelectedCol():nCreationOrder, ;
CLICK_ACTION( oBrw, nRowPos, nColPos ), oBrw:Refresh(), oBrw:SetFocus() ) }
:CreateFromCode()
END
RETURN (.T.)
STATIC FUNCTION CLICK_ACTION( oBrw, nRow, nCol )
LOCAL cRoom := oBrw:aCols[nCol]:Value()
MsgInfo("Habitación No. " + str(cRoom), "User")
RETURN (.T.)
STATIC FUNCTION Salir_Hotel()
local oQry, cQry, cApertura, cCierre
local nSeek := 0
if MsgYesNo("Cerrar sistema ?", "Usuario ..." )
lSalir := .t.
else
lSalir := .f.
endif
return lSalir
STATIC FUNCTION Cerrar_Todo()
SysRefresh() // Importante !!
FreeResources()
RELEASE All
Hb_GCAll( .T. )
CLEAR MEMORY
CLOSE DATABASES
PostQuitMessage(0)
__Quit()
RETURN NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 50 guests