FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem TScrollPanel e TBitmap
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM

Problem TScrollPanel e TBitmap

Posted: Fri Apr 05, 2019 06:36 PM

Hello good afternoon,

I would like to know if anyone has already passed this problem and would know to solve:

In a dialog, I create a TScrollPanel and inside it I put a photo with TBitmap. In the first access everything happens right, however in the second access the following error occurs: Method HBRUSH does not exist.

Thank you for your help.

Att.,

Oliveiros Junior

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM

Re: Problem TScrollPanel e TBitmap

Posted: Fri Apr 05, 2019 07:16 PM

Do not you have a small self-contained example that shows us the problem?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM

Re: Problem TScrollPanel e TBitmap

Posted: Fri Apr 05, 2019 09:46 PM
Olá,

Static Function Editar_Aluno( lAppend )
Local oDialog, aGet[46], aBtn[4], oTitle, oPanel
Local cEscola, nIdade, cFotografia, aAlteracao

cFotografia := oSistema():cLocal_Sistema + "temp\F" + cTempFile() + ".jpg"

DEFINE DIALOG oDialog SIZE 800,600 PIXEL TRUEPIXEL

WITH OBJECT oDialog
:lHelpIcon := .F.
:cTitle := oSistema():cNome_Reduzido_Sistema
:-)Font := oSistema():oFonte2
END

// Título
*----------------------------------------------------------------------------*
@ 0,0 TITLE oTitle SIZE 800, 60 TRUEPIXEL OF oDialog ;
SHADOW NOSHADOW ;
COLORBOX nRGB( 107, 141, 184 ), nRGB( 107, 141, 184 ) ;
GRADIENT { nRGB( 107, 141, 184 ), nRGB( 107, 141, 184 ) }

@ 10, 10 TITLETEXT OF oTitle TEXT ".::Aluno" ;
FONT oSistema():oFonte2

@ 30, 10 TITLETEXT OF oTitle TEXT If( lAppend, "Inclusão", "Alteração" ) ;
FONT oSistema():oFonte5

// Paniel
*----------------------------------------------------------------------------*
oPanel := TScrollPanel():New( 70, 0, 550, 800, oDialog, .T. )
oPanel:SetFont( oDialog:oFont )


// Botões
*----------------------------------------------------------------------------*
@ 570,570 BUTTON "&Salvar" SIZE 100, 24 PIXEL OF oDialog ;
ACTION If( Verificar_Aluno( lAppend, aGet, cFotografia, aAlteracao ), ;
oDialog:End(), )

@ 570,680 BUTTON "&Cancelar" SIZE 100, 24 PIXEL OF oDialog ;
ACTION oDialog:End() ;
CANCEL

ACTIVATE DIALOG oDialog CENTERED ;
ON INIT ( Colocar_Controles_Aluno( oPanel, aGet, aBtn, lAppend, cFotografia ), ;
Verificar_Fotografia( lAppend, matricula_aluno, cFotografia, aGet[3] ) )

FErase( cFotografia )
Return NIL
*------------------------------------------------------------------------------*
Static Function Colocar_Controles_Aluno( oPanel, aGet, aBtn, lAppend, cFotografia )
Local nLinha

nLinha := 10

@ nLinha, 580 BITMAP aGet[3] SIZE 120,140 PIXEL OF oPanel FILENAME cFotografia ;
ADJUST

oPanel:SetRange()

Return NIL
*------------------------------------------------------------------------------*
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Problem TScrollPanel e TBitmap

Posted: Sat Apr 06, 2019 06:32 AM
a test with TpanelScroll




you must insert


ACTIVATE DIALOG....
ON INIT (oPanel:= CreatePanelScroll(oDlg), oPanel:checkresize() )

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

Function CreatePanelScroll(oWnd)
Local oPanel
oPanel:= TScrollPanel():New(1,1,oWnd:nbottom-10,oWnd:nWidth-10,oWnd, .t.)
oPanel:nRightMargin := 10
oPanel:nBottomMargin := 335

* the gradient not run good when I use scrollbar
* oPanel:Gradient( aGrad )
* oPanel:bResized := { || oPanel:Gradient( aGrad ) }

// oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }
oPanel:WinStyle(WS_BORDER, .t.)





For n= 1 to 100
here ...bitmaps or btnbmp
next
oPanel:SetRange()
Return oPanel

//------------------------------------------------------//
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM

Re: Problem TScrollPanel e TBitmap

Posted: Tue Apr 09, 2019 01:50 AM

Hi Silvio, thank you worked the way you indicated.

Thank you Mr. Rao for your attention.

Att.

Oliveiros Junior

Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: Problem TScrollPanel e TBitmap

Posted: Tue Apr 09, 2019 03:31 PM
Silvio.Falconi wrote:a test with TpanelScroll




you must insert


ACTIVATE DIALOG....
ON INIT (oPanel:= CreatePanelScroll(oDlg), oPanel:checkresize() )

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

Function CreatePanelScroll(oWnd)
Local oPanel
oPanel:= TScrollPanel():New(1,1,oWnd:nbottom-10,oWnd:nWidth-10,oWnd, .t.)
oPanel:nRightMargin := 10
oPanel:nBottomMargin := 335

* the gradient not run good when I use scrollbar
* oPanel:Gradient( aGrad )
* oPanel:bResized := { || oPanel:Gradient( aGrad ) }

// oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }
oPanel:WinStyle(WS_BORDER, .t.)





For n= 1 to 100
here ...bitmaps or btnbmp
next
oPanel:SetRange()
Return oPanel

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


Silvio,

How did you make that color selector ? Have you a sample function ?

Marc
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: Problem TScrollPanel e TBitmap

Posted: Wed Apr 10, 2019 07:10 AM
Marc,

For n= 1 to 100
here ...bitmaps or btnbmp
next
oPanel:SetRange()
Return oPanel


For a color-selector I'm using a xBrowse-array.
because NO buttons or images are needed.
You can define any colors You need ( different sets )



I will provide a sample as soon I'm finished
with TGDIPLUS.

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Problem TScrollPanel e TBitmap

Posted: Wed Apr 10, 2019 07:22 AM

I made a my function selector with particular colors set Like office colors no windows colors
for the function I use tscrollpanel and bitmap
I not use fwh color function
Sorry, for now I cannot pubblish..

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion