Con este codigo esta casi listo, pero el xbrowse aparace muy lejos del margen derecho de la ventana hija.
Code: Select all
FUNCTION MantCentCosto( oVentana, oMenuItem, cCod )
LOCAL oWChild, oBar, oBrw, oFont, oCursor, oIcon
LOCAL lSalir := .F., oBrush
local oOutLook2003, oStatusBar, oSplit, cCombo, oRad, nValue := 1
cAliUsu := AbreDbf( "CKUSUARI" )
( cAliUsu )->( DBSetOrder( "CODIGO" ) )
IF ( cAliUsu )->( DBSeek( cCod ) )
IF !( cAliUsu )->USEM16
__StopMsg("Usuario no tiene permiso para ingresar a este M¢dulo ...")
CierraDbf( "CKUSUARI", cAliUsu )
RETURN( .T. )
ENDIF
ELSE
CierraDbf( "CKUSUARI", cAliUsu )
RETURN( .T. )
ENDIF
CierraDbf( "CKUSUARI", cAliUsu )
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -05
DEFINE ICON oIcon RESOURCE "FWCIBCONT"
DEFINE CURSOR oCursor RESOURCE "Mano"
DEFINE BRUSH oBrush NAME "GRADIEN"
CursorWait()
cAliCos := AbreDbf( "T10REF09" )
( cAliCos )->( DBSetOrder( "CODIGO" ) )
( cAliCoS )->( DBGoTop() )
oMenuItem:Disable()
DEFINE WINDOW oWChild;
TITLE OToA( "Gesti¢n de Centros de Costo" );
MDICHILD;
ICON oIcon;
OF oVentana
SET FONT OF oWChild TO oFont
DEFINE OUTLOOK2003 oOutLook2003 OF oWChild;
PROMPTS "Centros de Costo", "Calendario", "Otros";
BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp"
oWChild:oLeft = NIL
@ 1, 2 BUTTON "Nuevo Costo" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION ( MCLICK(), AMCosto( oBrw, .T., cAliCos ), oBrw:Refresh() )
@ 3, 2 BUTTON "Edita Costo" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION ( MCLICK(), AMCosto( oBrw, .F., cAliCos ), oBrw:Refresh() )
@ 5, 2 BUTTON "Borra Costo" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION ( MCLICK(), BorrCosto( "este Centro de Costo" ), oBrw:Refresh() )
@ 7, 2 BUTTON "Salir" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION ( MCLICK(), oMenuItem:Enable(), lSalir := .T., oWChild:End() )
oBrw := TXBrowse():New( oWChild )
WITH OBJECT oBrw
:bKeyDown := { | nKey, nFlags | ;
IIF( nKey == 13,; // [Enter]
( MCLICK(), AMCosto( oBrw, .F., cAliCos ) ),;
IIF( nKey == 46,; // [DEL]
( MCLICK(), BorrCosto( "este Centro de Costo " ) ),;
IIF( nKey == ASC("N") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+N]
( MCLICK(), AMCosto( oBrw, .T., cAliCos ) ),;
IIF( nKey == ASC("M") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+M]
( MCLICK(), AMCosto( oBrw, .F., cAliCos ) ),;
IIF( nKey == ASC("P") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+P]
( MCLICK(), PrintCCos() ),;
IIF( nKey == ASC("S") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+S]
( MCLICK(), oMenuItem:Enable(), lSalir := .T., oWChild:End() ), ) ) ) ) ) ) }
END
WITH OBJECT oBrw
:cAlias := cAliCos
:bClrHeader := { || { 65535, 0 } }
:nHeaderHeight := 35
:SetRdd()
:SetBackGround( oBrush )
:lRecordSelector := .F.
:nStretchCol := STRETCHCOL_LAST
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:CreateFromCode()
END
SetParent( oOutLook2003:hWnd, oWChild:hWnd )
oWChild:oClient = NIL
@ 0, 191 SPLITTER oSplit ;
VERTICAL _3DLOOK ;
PREVIOUS CONTROLS oOutLook2003 ;
HINDS CONTROLS oWChild:oWndClient, oBrw ;
SIZE 4, oWChild:nHeight - 70 PIXEL ;
OF oWChild
SetParent( oSplit:hWnd, oWChild:hWnd )
oSplit:lStatic := .T. // PARA QUE ES SPLITER NO SE MUEVA POR EL USUARIO
oBrw:SetFocus()
ACTIVATE WINDOW oWChild;
ON RESIZE ( oOutLook2003:AdjLeft(), oSplit:AdjClient(), oBrw:AdjRight() );
VALID( CierraDbf( "T10REF09", cAliCos ), lSalir:= .T. )
RELEASE FONT oFont
RETURN( .T. )
Aqui una muestra de lo que digo...
[img]
http://img838.imageshack.us/img838/5854/outlook2003.jpg
[/img]
Salu2