Probando TGSAY.prg y su potencia:
https://imgur.com/2Bie5qu
Fantástico!! Estoy empezando a entender. jajajaja
Regards, saludos.
METHOD Redefine( nId, oWnd, bText, cPict, oFont, oCursor, bLClicked , ;
cHAlign, cVAlign, nClrText, nClrPane, nClrOTxt, nClrOBck , ;
nClrSmbr, nClrLin, cModo, lTransp, lUpdate ) CLASS TGSAY
LOCAL cValue
DEFAULT oWnd := GetWndDefault(), oFont := oWnd:oFont, ;
nClrText := IF( Upper(oWnd:Classname()) = "TWINDOW", GetSysColor(COLOR_WINDOWTEXT),oWnd:nClrText ), ;
nClrPane := IF( Upper(oWnd:Classname()) = "TWINDOW", GetSysColor(COLOR_BTNFACE),oWnd:nClrPane ) , ;
cModo := "", cHAlign := "LEFT", cVAlign := "CENTER", lTransp := .F., lUpdate := .F. , ;
nClrLin := 0
::bGet := bText
::bSetGet := bText
::cPict := cPict
::bLClicked := bLClicked
::nId := nId
::oWnd := oWnd
::oFont := oFont
::oCursor := oCursor
cValue := EVAL( bText ) // que esta errado aqui? Line 253. ERROR AQUI!
IF bText # NIL
::cCaption := If( Empty(cPict) .OR. Empty(cValue) , cValToChar( cValue ), Transform( cValue, cPict ) )
ELSE
::cCaption = GetWindowText( ::hWnd )
ENDIF
::cCaption := ALLTRIM(::cCaption)
::nEstado := NINGUNO // ------------------------- 250
::lDrag := .F.
::lCaptured := .F.
::lUpdate := lUpdate
::nAlign := ::SetAlign(cHAlign,cVAlign)
::nModo := ::SetModo(cModo)
::hObj := {0,0,NIL,NIL}
::lTransp := lTransp
::SetColor( ::C_LETRA, IF( ::lTransp .OR. ::nModo = MD_ROUND,, nClrPane ) )
::C_LETRA := nClrText
::C_FONDO := nClrPane
::C_LOVER := nClrOTxt
::C_FOVER := nClrOBck
::C_SOMBRA := nClrSmbr
::C_LINEA := IF(cModo == "SQUARE" .OR. cModo == "ROUNDED", nClrLin, RGB(128,128,128))
::C_DISABLE := RGB(128,128,128)
::lValidating:= .F.
::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
IF oWnd # NIL
::oWnd:DefControl( Self )
ENDIF
::nAngle := Min(Max((Min(::nWidth,::nHeight))/1.5,6),25)
SysRefresh()
RETURN Self
if hb_IsBlock( bText )
cValue := EVAL( bText )
else
if ValType( bText ) == "C"
cValue = bText
endif
endif
REDEFINE GSAY oGST[ 01 ] VAR aTits[ 01 ] ID 401 OF oDlg ;
COLOR RGB( 255, 180, 020 ) TRANSPARENTE FONT oFont COLORSOMBRA 0
METHOD Redefine( nId, oWnd, bText, cPict, oFont, oCursor, bLClicked , ;
cHAlign, cVAlign, nClrText, nClrPane, nClrOTxt, nClrOBck , ;
nClrSmbr, nClrLin, cModo, lTransp, lUpdate ) CLASS TGSAY
LOCAL cValue
DEFAULT oWnd := GetWndDefault(), oFont := oWnd:oFont, ;
nClrText := IF( Upper(oWnd:Classname()) = "TWINDOW", GetSysColor(COLOR_WINDOWTEXT),oWnd:nClrText ), ;
nClrPane := IF( Upper(oWnd:Classname()) = "TWINDOW", GetSysColor(COLOR_BTNFACE),oWnd:nClrPane ) , ;
cModo := "", cHAlign := "LEFT", cVAlign := "CENTER", lTransp := .F., lUpdate := .F. , ;
nClrLin := 0
::bGet := bText
::bSetGet := bText
::cPict := cPict
::bLClicked := bLClicked
::nId := nId
::oWnd := oWnd
::oFont := oFont
::oCursor := oCursor
// cValue := EVAL( bText ) // que esta errado aqui?
// Master Antonio Linares en: 07/05/2024 - Joao.
IF HB_ISBLOCK( bText )
cValue := Eval( bText )
ELSE
IF ValType( bText ) == "C"
cValue = bText
ENDIF
ENDIF
IF bText # NIL
::cCaption := If( Empty(cPict) .OR. Empty(cValue) , cValToChar( cValue ), Transform( cValue, cPict ) )
ELSE
::cCaption = GetWindowText( ::hWnd )
ENDIF
::cCaption := ALLTRIM(::cCaption)
::nEstado := NINGUNO // ------------------------- 250
::lDrag := .F.
::lCaptured := .F.
::lUpdate := lUpdate
::nAlign := ::SetAlign(cHAlign,cVAlign)
::nModo := ::SetModo(cModo)
::hObj := {0,0,NIL,NIL}
::lTransp := lTransp
::SetColor( ::C_LETRA, IF( ::lTransp .OR. ::nModo = MD_ROUND,, nClrPane ) )
::C_LETRA := nClrText
::C_FONDO := nClrPane
::C_LOVER := nClrOTxt
::C_FOVER := nClrOBck
::C_SOMBRA := nClrSmbr
::C_LINEA := IF(cModo == "SQUARE" .OR. cModo == "ROUNDED", nClrLin, RGB(128,128,128))
::C_DISABLE := RGB(128,128,128)
::lValidating:= .F.
::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
IF oWnd # NIL
::oWnd:DefControl( Self )
ENDIF
::nAngle := Min(Max((Min(::nWidth,::nHeight))/1.5,6),25)
SysRefresh()
RETURN Self
::nAngle := Min(Max((Min(::nWidth,::nHeight))/1.5,6),25)
Application
===========
Path and name: c:\TGSAY\TESTGSAY.exe (32 bits)
Size: 3,498,496 bytes
Compiler version: xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914)
FiveWin version: FWH 19.05
C compiler version: Borland/Embarcadero C++ 7.6 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 08/05/2024, 10:06:36
Error description: Error BASE/1082 Argument error: -
Args:
[ 1] = N 0
[ 2] = U
Stack Calls
===========
Called from: .\source\classes\WINDOW.PRG => TGSAY:NWIDTH( 1593 )
Called from: TGSay.prg => TGSAY:REDEFINE( 305 )
Called from: TESTGSAY.prg => USANDO_RESOURCE_WORKSHOP( 440 )
Called from: TESTGSAY.prg => (b)MAIN( 337 )
Called from: .\source\classes\BUTTON.PRG => TBUTTONBMP:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1755 )
Called from: .\source\classes\BUTTONB.PRG => TBUTTONBMP:HANDLEEVENT( 261 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 433 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1136 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: TESTGSAY.prg => MAIN( 351 )
METHOD Redefine( nId, oWnd, bText, cPict, oFont, oCursor, bLClicked , ;
cHAlign, cVAlign, nClrText, nClrPane, nClrOTxt, nClrOBck , ;
nClrSmbr, nClrLin, cModo, lTransp, lUpdate ) CLASS TGSAY
LOCAL cValue
DEFAULT oWnd := GetWndDefault(), oFont := oWnd:oFont, ;
nClrText := IF( Upper(oWnd:Classname()) = "TWINDOW", GetSysColor(COLOR_WINDOWTEXT),oWnd:nClrText ), ;
nClrPane := IF( Upper(oWnd:Classname()) = "TWINDOW", GetSysColor(COLOR_BTNFACE),oWnd:nClrPane ) , ;
cModo := "", cHAlign := "LEFT", cVAlign := "CENTER", lTransp := .F., lUpdate := .F. , ;
nClrLin := 0
::bGet := bText
::bSetGet := bText
::cPict := cPict
::bLClicked := bLClicked
::nId := nId
::oWnd := oWnd
::oFont := oFont
::oCursor := oCursor
// cValue := EVAL( bText ) // que esta errado aqui?
// viewtopic.php?f=6&t=44493&sid=a0d68b2457180019e7e6ed82ed2b3212#p269968
// Master Antonio Linares en: 07/05/2024 - Joao.
IF HB_ISBLOCK( bText )
cValue := Eval( bText )
ELSE
IF ValType( bText ) == "C"
cValue = bText
ENDIF
ENDIF
IF bText # NIL
::cCaption := If( Empty(cPict) .OR. Empty(cValue) , cValToChar( cValue ), Transform( cValue, cPict ) )
ELSE
::cCaption = GetWindowText( ::hWnd )
ENDIF
::cCaption := ALLTRIM(::cCaption)
::nEstado := NINGUNO // ------------------------- 250
::lDrag := .F.
::lCaptured := .F.
::lUpdate := lUpdate
::nAlign := ::SetAlign(cHAlign,cVAlign)
::nModo := ::SetModo(cModo)
::hObj := {0,0,NIL,NIL}
::lTransp := lTransp
::SetColor( ::C_LETRA, IF( ::lTransp .OR. ::nModo = MD_ROUND,, nClrPane ) )
::C_LETRA := nClrText
::C_FONDO := nClrPane
::C_LOVER := nClrOTxt
::C_FOVER := nClrOBck
::C_SOMBRA := nClrSmbr
::C_LINEA := IF(cModo == "SQUARE" .OR. cModo == "ROUNDED", nClrLin, RGB(128,128,128))
::C_DISABLE := RGB(128,128,128)
::lValidating:= .F.
::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
IF oWnd # NIL
::oWnd:DefControl( Self )
ENDIF
// ::nAngle := Min(Max((Min(::nWidth,::nHeight))/1.5,6),25)
SysRefresh()
RETURN Self
METHOD Initiate( hDlg ) CLASS TGSAY
Super:Initiate( hDlg )
::nAngle := Min(Max((Min(::nWidth,::nHeight))/1.5,6),25)
::lTabs := ( lAnd(GetWindowLong(::hWnd,GWL_STYLE),WS_TABSTOP) .AND. (::nModo = MD_3DBOX .OR. ::nModo = MD_ROUND) )
IF ::lTransp .OR. ::nModo = MD_ROUND
SetWindowLong( ::hWnd, GWL_EXSTYLE, nOr( GetWindowLong( ::hWnd, GWL_EXSTYLE ), WS_EX_TRANSPARENT ) )
ENDIF
IF ::oFont # NIL
::SetFont( ::oFont )
ELSE
::GetFont()
ENDIF
IF ::oCursor # NIL
::nCursor := ::oCursor:hCursor
ENDIF
::nWPen := IF(::nModo = MD_SQUARE .OR. ::nModo = MD_ROUND,::nWPen,1)
::hObj[1] := CreatePen( 0, ::nWPen, ::C_LINEA )
::hObj[2] := CreatePen( 0, 1, ::C_DISABLE )
IF ::C_FONDO # NIL .AND. !::lTransp
::hObj[3] := CreateSolidBrush(::C_FONDO)
ENDIF
IF ::C_FOVER # NIL
::hObj[4] := CreateSolidBrush(::C_FOVER)
ENDIF
::Default()
RETURN NIL
Application
===========
Path and name: c:\TGSAY\TESTGSAY.exe (32 bits)
Size: 3,498,496 bytes
Compiler version: xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914)
FiveWin version: FWH 19.05
C compiler version: Borland/Embarcadero C++ 7.6 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 08/05/2024, 10:31:25
Error description: Error BASE/1066 Argument error: conditional
Args:
[ 1] = U
Stack Calls
===========
Called from: TGSay.prg => TGSAY:PINTAR( 486 )
Called from: TGSay.prg => TGSAY:PAINT( 424 )
Called from: TGSay.prg => TGSAY:REPINTAR( 566 )
Called from: TGSay.prg => TGSAY:REFRESH( 589 )
Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW:TWINDOW( 629 )
Called from: => TGSAY:SETBRUSH( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:INITIATE( 456 )
Called from: TGSay.prg => TGSAY:INITIATE( 313 )
Called from: => __OBJSENDMSG( 0 )
Called from: => HB_EXECFROMARRAY( 0 )
Called from: .\source\function\HARBOUR.PRG => OSEND( 300 )
Called from: => HB_EXECFROMARRAY( 0 )
Called from: .\source\function\HARBOUR.PRG => ASEND( 278 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 805 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1120 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: TESTGSAY.prg => USANDO_RESOURCE_WORKSHOP( 448 )
Called from: TESTGSAY.prg => (b)MAIN( 337 )
Called from: .\source\classes\BUTTON.PRG => TBUTTONBMP:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1755 )
Called from: .\source\classes\BUTTONB.PRG => TBUTTONBMP:HANDLEEVENT( 261 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 433 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1136 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: TESTGSAY.prg => MAIN( 351 )
METHOD Pintar( nClrLetra, hBrush ) CLASS TGSAY // PINTA RECUADRO, FONDO Y LETRA (CON O SIN FOCO)
LOCAL hOFnt,nBkMd,nTxCl
LOCAL nOldP := SelectObject(::hDc,::hObj[1])
LOCAL nOldB := SelectObject(::hDc,IF(::lTransp .AND. hBrush = NIL,GetStockObject(5),hBrush))
LOCAL nSmbr := IF(::oFont:lBold,2,1)
*
IF !::lActive .AND. ::nModo > 0 .AND. ::nModo < 6
SelectObject(::hDc,::hObj[2])
Rectangle(::hDc,0,0,::nHeight,::nWidth)
ELSEIF ::nModo = MD_SHADED
Rectangle(::hDc,0,0,::nHeight,::nWidth)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
MoveTo(::hDc,0,::nHeight-1)
LineTo(::hDc,::nWidth-1,::nHeight-1)
LineTo(::hDc,::nWidth-1,0)
ELSEIF ::nModo = MD_RAISED
Rectangle(::hDc,0,0,::nHeight,::nWidth)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
MoveTo(::hDc,0,::nHeight-1)
LineTo(::hDc,0,0)
LineTo(::hDc,::nWidth-1,0)
ELSEIF ::nModo = MD_BOX
Rectangle(::hDc,1,1,::nHeight,::nWidth)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
SelectObject(::hDc,GetStockObject(5)) // Object(5) => SIN BRUSH
Rectangle(::hDc,0,0,::nHeight-1,::nWidth-1)
ELSEIF ::nModo = MD_3DBOX
SelectObject(::hDc,GetStockObject(7)) // Object(7) => LAPIZ NEGRO
Rectangle(::hDc,0,0,::nHeight,::nWidth)
SelectObject(::hDc,::hObj[1])
Rectangle(::hDc,1,1,::nHeight-1,::nWidth-1)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
MoveTo(::hDc,1,::nHeight-2)
LineTo(::hDc,1,1)
LineTo(::hDc,::nWidth-2,1)
ELSEIF ::nModo = MD_SQUARE
Rectangle(::hDc,0,0,::nHeight,::nWidth)
ELSEIF ::nModo = MD_ROUND
IF !::lActive
SelectObject(::hDc,::hObj[2])
ENDIF
RoundRect(::hDc,0,0,::nWidth,::nHeight,::nAngle,::nAngle)
ELSE
SelectObject(::hDc,GetStockObject(8)) // Object(8) => SIN PEN
Rectangle(::hDc,0,0,::nHeight+1,::nWidth+1)
ENDIF
*
nBkMd := SetBkMode( ::hDc, F_TRANSP )
hOFnt := SelectObject(::hDc,::oFont:hFont)
IF !::lActive
nTxCl := SetTextColor( ::hDc, IF(::lTransp,RGB(220,220,220),ACLARO(::C_FONDO,80)) )
DrawText( ::hDc, ::cCaption, {4,4,::nHeight-2,::nWidth-2}, ::nAlign )
SetTextColor( ::hDc, IF(::lTransp,RGB(128,128,128),OSCURO(::C_FONDO,64)) )
DrawText( ::hDc, ::cCaption, {3,3,::nHeight-3,::nWidth-3}, ::nAlign )
ELSE
nTxCl := SetTextColor( ::hDc, nClrLetra )
IF ::lSombra // MASTER: linea 486 AQUI
SetTextColor( ::hDc, ::C_SOMBRA)
DrawText( ::hDc, ::cCaption, {4,4+nSmbr,::nHeight-2,::nWidth-2+nSmbr}, ::nAlign )
SetTextColor( ::hDc, nClrLetra )
ENDIF
DrawText( ::hDc, ::cCaption, {3,3,::nHeight-3,::nWidth-3}, ::nAlign )
ENDIF
SetTextColor( ::hDC, nTxCl )
SetBkMode( ::hDc, nBkMd )
*
SelectObject(::hDc,hOFnt)
SelectObject(::hDc,nOldB)
SelectObject(::hDc,nOldP)
RETURN NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 22 guests