Problem TScrollPanel e TBitmap

Post Reply
oliveiros junior
Posts: 84
Joined: Tue Mar 20, 2007 3:13 pm

Problem TScrollPanel e TBitmap

Post by oliveiros junior »

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
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem TScrollPanel e TBitmap

Post by cnavarro »

Do not you have a small self-contained example that shows us the problem?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
oliveiros junior
Posts: 84
Joined: Tue Mar 20, 2007 3:13 pm

Re: Problem TScrollPanel e TBitmap

Post by oliveiros junior »

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
:oFont := 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
*------------------------------------------------------------------------------*
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem TScrollPanel e TBitmap

Post by Silvio.Falconi »

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

//------------------------------------------------------//
Last edited by Silvio.Falconi on Wed Apr 10, 2019 7:56 am, edited 1 time in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
oliveiros junior
Posts: 84
Joined: Tue Mar 20, 2007 3:13 pm

Re: Problem TScrollPanel e TBitmap

Post by oliveiros junior »

Hi Silvio, thank you worked the way you indicated.

Thank you Mr. Rao for your attention.

Att.

Oliveiros Junior
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: Problem TScrollPanel e TBitmap

Post by Marc Venken »

Silvio.Falconi wrote:a test with TpanelScroll

Image


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 20.08 with Harbour
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Problem TScrollPanel e TBitmap

Post by ukoenig »

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 )

Image

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

regards
Uwe :D
Last edited by ukoenig on Wed Apr 10, 2019 7:28 am, edited 2 times in total.
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.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem TScrollPanel e TBitmap

Post by Silvio.Falconi »

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..
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply