METHOD Destroy() CLASS TWindow
if ( ::hWnd == nil .or. ::hWnd == 0 ) .and. ;
( ::nResult == nil .or. ( ValType( ::nResult ) == "N" .and. ::nResult == 0 ) )
return nil
endif
...
METHOD KeyChar( nKey, nFlags ) CLASS TDialog
if nKey == VK_ESCAPE
if ::oWnd != nil .and. ( ::oWnd:IsKindOf( "TMDICHILD" ) .or. ;
::oWnd:IsKindOf( "TDIALOG" ) .or. ::oWnd:IsKindOf( "TMDIFRAME" ) )
if SetDialogEsc()
::End()
endif
endif
return nil // este!
endif
return Super:KeyChar( nKey, nFlags )
case nMsg == WM_PASTE
if GetFocus() == ::hWnd
CallWindowProc( ::nOldProc, ::hWnd, WM_PASTE, 0, 0 )
SetWindowText( ::hWnd, SubStr( GetWindowText( ::hWnd ), 1, Len( ::oGet:Original ) ) ) // Nuevo !!!
::oGet:Buffer = GetWindowText( ::hWnd )
::oGet:Pos = GetCaretPos()[ 2 ]
::oGet:Assign()
if ::bChange != nil
Eval( ::bChange,,, Self )
endif
endif
return 0
1.- Dibujo de pantalla
Sigue apareciendo la pantalla de recurso antes de redefinirse.
#include "FiveWin.ch"
#include "xBrowse.ch"
function Main()
local oWnd
Define Window oWnd Title "Principal" Mdi Menu ps_Menu(oWnd)
Activate Window oWnd MAXIMIZED Valid MsgYesNo('Desea salir')
return nil
static func ps_Menu(oWnd)
local oMenu
Menu oMenu
MenuItem "Child" Action ps_Child(oWnd)
EndMenu
return oMenu
static proc ps_Child( oWnd )
local oChild
Define Window oChild MdiChild Title 'Child' of oWnd
Activate Window oChild On Init ps_Dialog(oChild)
return
static proc ps_Dialog( oChild )
local oDlg, oBrush, aGet[8], aVar[8]
local oFld, oDlg2, oBrw
USE EJEMPLO1
oBrush := tbrush():New(, nRgb(224, 236, 255) )
DEFINE DIALOG oDlg Resource "Dialogo" OF oChild TRANSPARENT Brush oBrush
aVar[1] := space(2)
Redefine Get aGet[1] Var aVar[1] Id 102 Update Message 'Indique el código del usuario' Of oDlg
aVar[2] := space(50)
Redefine Get aGet[2] Var aVar[2] Id 103 Update Message 'Indique el nombre del usuario' Of oDlg
aVar[3] := space(50)
Redefine Get aGet[3] Var aVar[3] Id 104 Update Message 'Indique el código de la empresa' Of oDlg
aVar[4] := space(50)
Redefine Get aGet[4] Var aVar[4] Id 105 Update Message 'Indique el nombre de la empresa' Of oDlg
Redefine Folder oFld ID 106 OF oDlg;
Prompts '&Notas', 'Notas1', 'Notas2', 'Notas3' ;
Dialogs 'Notas', 'Notas', 'Notas', 'Notas'
DEFINE DIALOG oDlg2 OF oFld STYLE WS_CHILD FROM 0, 0 TO 5, 5 PIXEL
aIns( oFld:aDialogs, 1, oDlg2, .T. )
aIns( oFld:aPrompts, 1, "Lineas", .T. )
aIns( oFld:aEnable, 1, .t., .T. )
@ 0, 0 XBROWSE oBrw OF oDlg2 ALIAS 'EJEMPLO1' AUTOCOLS
oBrw:CreateFromCode()
oDlg2:oClient := oBrw
Redefine Get aGet[5] Var aVar[5] Id 102 Of oFld:aDialogs[2] MEMO
Redefine Get aGet[6] Var aVar[6] Id 102 Of oFld:aDialogs[3] MEMO
Redefine Get aGet[7] Var aVar[7] Id 102 Of oFld:aDialogs[4] MEMO
Redefine Get aGet[8] Var aVar[8] Id 102 Of oFld:aDialogs[5] MEMO
ACTIVATE DIALOG oDlg NoWait On Init ps_Incrus( oChild, oDlg ) Valid .F.
return
static proc ps_Incrus(oChild, oDlg)
local nWidth, nHeight
oDlg:Move(0, 0,,, .T.)
nWidth := oDlg:nWidth + 7
nHeight := oDlg:nHeight + 33
oChild:SetSize(nWidth, nHeight, .T.)
oChild:Center()
return
DIALOGO DIALOG DISCARDABLE 0, 0, 519, 264
STYLE WS_CHILD|WS_VISIBLE
FONT 8, "MS Sans Serif"
{
CONTROL "123", 102, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 44, 7, 39, 12
CONTROL "123456", 103, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 91, 7, 146, 12
CONTROL "12", 104, "Edit", WS_BORDER|WS_TABSTOP, 288, 7, 32, 12
CONTROL "1", 105, "Edit", WS_BORDER|WS_TABSTOP, 335, 7, 105, 12
CONTROL "", 106, "SysTabControl32", 0x00000000, 0, 26, 519, 238
CONTROL "Usuario:", -1, "Static", SS_CENTERIMAGE|WS_GROUP, 5, 9, 31, 12
CONTROL "Empresa:", -1, "Static", SS_CENTERIMAGE|WS_GROUP, 249, 9, 31, 12
}
NOTAS DIALOG DISCARDABLE 6, 18, 519, 222
STYLE WS_CHILD|WS_VISIBLE
FONT 8, "MS Sans Serif", 0, 0, 1
{
CONTROL "Edit", 102, "Edit", ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|ES_WANTRETURN|WS_HSCROLL|WS_VSCROLL|WS_BORDER|WS_TABSTOP, 0, 0, 519, 222
}
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot], lubin and 93 guests