FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour como hago esto: window get say
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
como hago esto: window get say
Posted: Wed Aug 17, 2011 12:43 PM

Hola.

Necesito hacer un window y que este dividida en 2 partes la de arriba tiene que tener un say y un get y abajo un xbrowse

Intente con opanel pero no consigo lo del say y el get.
lo unico que me salio es poner un group arriba (oPanel:oTop= ogrupo) y abajo el xbrowse.

Alguna Ayuda?

gracias.

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: como hago esto: window get say
Posted: Wed Aug 17, 2011 09:28 PM

Hola Gosfancito, este pequeño codigo puede servirte de partida.
(Yo aun no uso la TPANEL)
//----------------------------//
Function Prueba()
local oChild, oBrw, oRect
local dFechemis := cTod(" / / "), oFechemis

DEFINE WINDOW oChild MDICHILD OF oWnd TITLE "Prueba"

oRect:=TPanel():New( 0, 0, 130, oChild:nWidth, oChild )

oRect:bPainted:={|| oRect:nWidth := oChild:nWidth ,;
oRect:Say( 1, 10, "Fecha de Emision:" ) }

@1, 40 GET oFechemis VAR dFechemis OF oRect SIZE 90,18

oBrw := TXBrowse():New( oChild )

oBrw:CreateFromCode()

ACTIVATE WINDOW oChild MAXIMIZED;
ON INIT ( oFechemis:SetFocus(),;
oBrw:nHeight := oChild:nHeight-163, oBrw:nWidth := oChild:nWidth-12, oBrw:nTop:=130 )

RETURN NIL

Saludos.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: como hago esto: window get say
Posted: Wed Aug 17, 2011 10:49 PM

y si no es con tpanel,
de que otra forma puedo realizarlo?

a ver los tpanel son como los contendores usados en gtk?

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: como hago esto: window get say
Posted: Thu Aug 18, 2011 02:23 AM

¿Algo asi, es lo que quieres hacer?

http://imageshack.us/photo/my-images/546/dibujofu.png/

Lo hice utilizando una pequeñisima classe, basada en TRect.
Saludos.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: como hago esto: window get say
Posted: Thu Aug 18, 2011 02:52 AM

exacto.

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: como hago esto: window get say
Posted: Thu Aug 18, 2011 04:33 AM

Goosfancito, aquí tienes un ejemplo probado: (Entorno MDI)

//----------------------------//
Function Prueba()
local oChild, oBrw, oFont1, oBotModi
local dFechemis := cTod(" / / "), oFechemis
Local oConceptG, cConceptG:="ESTO ES UNA PRUEBA"
LOCAL oRect, oRectClr1, oRectClr2, nRectClrTxt1,nRectClrTxt2

oRectClr1:= 12961221
oRectClr2:= 16777215
nRectClrTxt1:=0
nRectClrTxt2:=0

DEFINE FONT oFont1 NAME "LUCIDA SANS TYPEWRITER" SIZE 6, -13

DEFINE WINDOW oChild MDICHILD OF oWnd TITLE "Prueba"

oRect:=TRectang():New( 0, 0, 130, oChild:nWidth, oChild ,, oRectClr1,oRectClr2, )
oRect:bPainted:={|| oRect:nWidth := oChild:nWidth ,;
oRect:Say( 15, 48, "Fecha de Emision:", nRectClrTxt1, nRectClrTxt2, oRect:oWnd:oFont, .T., .T.,) ,;
oRect:Say( 40, 48, "Concepto General:", nRectClrTxt1, nRectClrTxt2, oRect:oWnd:oFont, .T., .T.,) }

@1.0, 28 GET oFechemis VAR dFechemis OF oRect SIZE 90,18 FONT oWnd:oFont
@2.7, 28 GET oConceptG VAR cConceptG OF oRect SIZE 550,68 MULTILINE NO VSCROL FONT oFont1

@70,30 BTNBMP oBotModi LEFT 2007 PROMPT "Modificar" SIZE 100,28 OF oRect ACTION MsgInfo("Hola")
oBotModi:cTooltip := "Modificar el documento"

oBrw := TXBrowse():New( oChild )

oBrw:CreateFromCode()

ACTIVATE WINDOW oChild MAXIMIZED;
ON INIT ( oFechemis:SetFocus(),;
oBrw:nHeight := oChild:nHeight-163, oBrw:nWidth := oChild:nWidth-12, oBrw:nTop:=130 )
oFont1:End()
RETURN NIL

Y ésta es la Classe:

include "FiveWin.ch"

define COLOR_BTNFACE 15

ifdef XPP

#define Super ::TControl

endif

// Francisco J. Alegría P., Sept 10/2008

//----------------------------------------------------------------------------//

CLASS TRectang FROM TControl

DATA l3D
DATA nRGB1, nRGB2

CLASSDATA lRegistered AS LOGICAL

METHOD New( nRow, nCol, nHeight, nWidth, oWnd, l3D, nRGB1, nRGB2, oFont ) CONSTRUCTOR

METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0

METHOD Paint()

ENDCLASS

//----------------------------------------------------------------------------//

METHOD New( nRow, nCol, nHeight, nWidth, oWnd, l3D, nRGB1, nRGB2, oFont ) CLASS TRectang

local oRect := oWnd:GetCliRect()

DEFAULT nWidth:=100, nHeight:=oWnd:nHeight, l3D := .f.,;
nRGB1:=NIL, nRGB2:=NIL, oFont:= NIL

::nStyle = nOR( WS_CHILD, WS_VISIBLE, WS_CLIPCHILDREN )
::oWnd = oWnd
::nTop = nRow
::nLeft = nCol
::nBottom = nHeight
::nRight = nWidth
::l3D = l3D
::nClrPane = If( l3D, GetSysColor( COLOR_BTNFACE ), CLR_GRAY )
::nRGB1 = nRGB1
::nRGB2 = nRGB2
::oFont = oFont

#ifdef XPP
DEFAULT ::lRegistered := .f.
#endif

::SetColor( ::nClrText, ::nClrPane )

::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
::Create()

return Self

//----------------------------------------------------------------------------//

METHOD Paint() CLASS TRectang

local aInfo := ::DispBegin(), oFont

   //colores personalizados degradados
       Gradient( ::hDC, { 0, 0, ::nHeight, ::nWidth },;
                 ::nRGB1, ::nRGB2, .T. )

  if ::oFont == nil 
     DEFINE FONT oFont NAME "Tahoma" SIZE 0, -12 BOLD
  endif   
  ::oWnd:SetFont( oFont )


  if ::bPainted != nil
     Eval( ::bPainted, ::hDC )
  endif

::oWnd:oFont:End()

::DispEnd( aInfo )

return nil

Espero sea de alguna utilidad.

Saludos

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: como hago esto: window get say
Posted: Thu Aug 18, 2011 10:09 AM

Gracias!

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/

Continue the discussion