Problem TScrollPanel e TBitmap

Problem TScrollPanel e TBitmap

Postby oliveiros junior » Fri Apr 05, 2019 6: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
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Problem TScrollPanel e TBitmap

Postby cnavarro » Fri Apr 05, 2019 7: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem TScrollPanel e TBitmap

Postby oliveiros junior » Fri Apr 05, 2019 9: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
: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
*------------------------------------------------------------------------------*
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Problem TScrollPanel e TBitmap

Postby Silvio.Falconi » Sat Apr 06, 2019 6: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

//------------------------------------------------------//
Last edited by Silvio.Falconi on Wed Apr 10, 2019 7:56 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem TScrollPanel e TBitmap

Postby oliveiros junior » Tue Apr 09, 2019 1:50 am

Hi Silvio, thank you worked the way you indicated.

Thank you Mr. Rao for your attention.

Att.

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Problem TScrollPanel e TBitmap

Postby Marc Venken » Tue Apr 09, 2019 3:31 pm

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 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Problem TScrollPanel e TBitmap

Postby ukoenig » Wed Apr 10, 2019 7: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 )

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Problem TScrollPanel e TBitmap

Postby Silvio.Falconi » Wed Apr 10, 2019 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wilsongamboa and 51 guests