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
Problem TScrollPanel e TBitmap
Re: Problem TScrollPanel e TBitmap
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.
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.
-
- Posts: 84
- Joined: Tue Mar 20, 2007 3:13 pm
Re: Problem TScrollPanel e TBitmap
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
*------------------------------------------------------------------------------*
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
*------------------------------------------------------------------------------*
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Problem TScrollPanel e TBitmap
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
//------------------------------------------------------//
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
-
- Posts: 84
- Joined: Tue Mar 20, 2007 3:13 pm
Re: Problem TScrollPanel e TBitmap
Hi Silvio, thank you worked the way you indicated.
Thank you Mr. Rao for your attention.
Att.
Oliveiros Junior
Thank you Mr. Rao for your attention.
Att.
Oliveiros Junior
- Marc Venken
- Posts: 727
- Joined: Tue Jun 14, 2016 7:51 am
Re: Problem TScrollPanel e TBitmap
Silvio,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
//------------------------------------------------------//
How did you make that color selector ? Have you a sample function ?
Marc
Marc Venken
Using: FWH 20.08 with Harbour
Using: FWH 20.08 with Harbour
Re: Problem TScrollPanel e TBitmap
Marc,
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
For a color-selector I'm using a xBrowse-array.For n= 1 to 100
here ...bitmaps or btnbmp
next
oPanel:SetRange()
Return oPanel
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
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Problem TScrollPanel e TBitmap
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..
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