In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Browser question

Xailer professional forum in English
Responder
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Browser question

Mensaje por Giuseppe Bogetti »

Hi,
I would like to have the text in a column to be drawn in bold based on
a certain condition.
I've tried in the OnDrawCellEvent to set the oFont:lBold to true or false
based on the condition but I've come up with bold caption an all columns of
the browser e nothing in the cell.
The browser is inherited from TDBBrowse
The OnGetData is as follows
METHOD BrowseDataGetData( oSender, cText, nImage ) CLASS TDbManager
// Get data
WITH OBJECT oSender:oDataField
SWITCH :cType
CASE "M"
cText := Iif( ( :Value == "" ), "memo", "MEMO" )
EXIT
....
END SWITCH
END WITH
RETURN Nil
The DrawCell is as follows
METHOD BrowseDataDrawCell( oSender, cText, nClrText, nClrPane, lHighLite,
hDC, aRect ) CLASS TDbManager
WITH OBJECT oSender:oDataField
oSender:oFont:lBold := FALSE
SWITCH :cType
CASE "M"
oSender:oFont:lBold := ( cText == "MEMO" )
EXIT
....
END SWITCH
END WITH
RETURN Nil
What am I doing wrong ?
Do I have to draw the text myself in the OnDrawCellEvent ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9254
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Browser question

Mensaje por ignacio »

Giuseppe,
Instead of changing its property lBold is preferible that you create a
second font for bold printing. Be aware that every time that you change that
property the font is destroyed and created a new one.
The trick is to set directly the font to use with the basic API function
SelectObject() on the TBrwColumn:OnDrawCell event:
SelectObject( hDC, oFontBold:Handle )
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:vbetb6182llc$.yek6r8bbllep$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> Hi,
>
> I would like to have the text in a column to be drawn in bold based on
> a certain condition.
>
> I've tried in the OnDrawCellEvent to set the oFont:lBold to true or false
> based on the condition but I've come up with bold caption an all columns
> of
> the browser e nothing in the cell.
>
> The browser is inherited from TDBBrowse
>
> The OnGetData is as follows
> METHOD BrowseDataGetData( oSender, cText, nImage ) CLASS TDbManager
>
> // Get data
> WITH OBJECT oSender:oDataField
> SWITCH :cType
> CASE "M"
> cText := Iif( ( :Value == "" ), "memo", "MEMO" )
> EXIT
> ....
> END SWITCH
> END WITH
>
> RETURN Nil
>
> The DrawCell is as follows
> METHOD BrowseDataDrawCell( oSender, cText, nClrText, nClrPane, lHighLite,
> hDC, aRect ) CLASS TDbManager
>
> WITH OBJECT oSender:oDataField
> oSender:oFont:lBold := FALSE
> SWITCH :cType
> CASE "M"
> oSender:oFont:lBold := ( cText == "MEMO" )
> EXIT
> ....
> END SWITCH
> END WITH
>
> RETURN Nil
>
> What am I doing wrong ?
>
> Do I have to draw the text myself in the OnDrawCellEvent ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Browser question

Mensaje por NoName »

Giuseppe,
Instead of changing its property lBold is preferible that you create a
second font for bold printing. Be aware that every time that you change that
property the font is destroyed and created a new one.
The trick is to set directly the font to use with the basic API function
SelectObject() on the TBrwColumn:OnDrawCell event:
SelectObject( hDC, oFontBold:Handle )
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:vbetb6182llc$.yek6r8bbllep$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> Hi,
>
> I would like to have the text in a column to be drawn in bold based on
> a certain condition.
>
> I've tried in the OnDrawCellEvent to set the oFont:lBold to true or false
> based on the condition but I've come up with bold caption an all columns
> of
> the browser e nothing in the cell.
>
> The browser is inherited from TDBBrowse
>
> The OnGetData is as follows
> METHOD BrowseDataGetData( oSender, cText, nImage ) CLASS TDbManager
>
> // Get data
> WITH OBJECT oSender:oDataField
> SWITCH :cType
> CASE "M"
> cText := Iif( ( :Value == "" ), "memo", "MEMO" )
> EXIT
> ....
> END SWITCH
> END WITH
>
> RETURN Nil
>
> The DrawCell is as follows
> METHOD BrowseDataDrawCell( oSender, cText, nClrText, nClrPane, lHighLite,
> hDC, aRect ) CLASS TDbManager
>
> WITH OBJECT oSender:oDataField
> oSender:oFont:lBold := FALSE
> SWITCH :cType
> CASE "M"
> oSender:oFont:lBold := ( cText == "MEMO" )
> EXIT
> ....
> END SWITCH
> END WITH
>
> RETURN Nil
>
> What am I doing wrong ?
>
> Do I have to draw the text myself in the OnDrawCellEvent ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Browser question

Mensaje por Giuseppe Bogetti »

Il Wed, 31 May 2006 08:54:46 +0200, Ignacio Ortiz de Zúñiga ha scritto:
Ignacio,
> Giuseppe,
>
> Instead of changing its property lBold is preferible that you create a
> second font for bold printing. Be aware that every time that you change that
> property the font is destroyed and created a new one.
>
> The trick is to set directly the font to use with the basic API function
> SelectObject() on the TBrwColumn:OnDrawCell event:
>
> SelectObject( hDC, oFontBold:Handle )
>
That solved everything, thanks.
I'd like to trap the right click event on the column header.
I'd like to override the automatic menu to select colomns to be shown with
a dialog that enables the user to select all the column to show/hide at
once.
I tried to used the OnContextMenu event but the menu is executed first.
Is it possible ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Browser question

Mensaje por Giuseppe Bogetti »

Il Wed, 31 May 2006 08:54:46 +0200, Ignacio Ortiz de Zúñiga ha scritto:
Ignacio,
> Giuseppe,
>
> Instead of changing its property lBold is preferible that you create a
> second font for bold printing. Be aware that every time that you change that
> property the font is destroyed and created a new one.
>
> The trick is to set directly the font to use with the basic API function
> SelectObject() on the TBrwColumn:OnDrawCell event:
>
> SelectObject( hDC, oFontBold:Handle )
>
That solved everything, thanks.
I'd like to trap the right click event on the column header.
I'd like to override the automatic menu to select colomns to be shown with
a dialog that enables the user to select all the column to show/hide at
once.
I tried to used the OnContextMenu event but the menu is executed first.
Is it possible ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9254
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Browser question

Mensaje por ignacio »

Guisseppe,
> I tried to used the OnContextMenu event but the menu is executed first.
Use the TBrwColumn:OnHeaderRClick event
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:1x60ovudk1o8m.1jwa4qv57hiq4$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> Il Wed, 31 May 2006 08:54:46 +0200, Ignacio Ortiz de Zúñiga ha scritto:
>
> Ignacio,
>
>> Giuseppe,
>>
>> Instead of changing its property lBold is preferible that you create a
>> second font for bold printing. Be aware that every time that you change
>> that
>> property the font is destroyed and created a new one.
>>
>> The trick is to set directly the font to use with the basic API function
>> SelectObject() on the TBrwColumn:OnDrawCell event:
>>
>> SelectObject( hDC, oFontBold:Handle )
>>
>
> That solved everything, thanks.
>
> I'd like to trap the right click event on the column header.
> I'd like to override the automatic menu to select colomns to be shown with
> a dialog that enables the user to select all the column to show/hide at
> once.
>
> I tried to used the OnContextMenu event but the menu is executed first.
>
> Is it possible ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Browser question

Mensaje por NoName »

Guisseppe,
> I tried to used the OnContextMenu event but the menu is executed first.
Use the TBrwColumn:OnHeaderRClick event
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:1x60ovudk1o8m.1jwa4qv57hiq4$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> Il Wed, 31 May 2006 08:54:46 +0200, Ignacio Ortiz de Zúñiga ha scritto:
>
> Ignacio,
>
>> Giuseppe,
>>
>> Instead of changing its property lBold is preferible that you create a
>> second font for bold printing. Be aware that every time that you change
>> that
>> property the font is destroyed and created a new one.
>>
>> The trick is to set directly the font to use with the basic API function
>> SelectObject() on the TBrwColumn:OnDrawCell event:
>>
>> SelectObject( hDC, oFontBold:Handle )
>>
>
> That solved everything, thanks.
>
> I'd like to trap the right click event on the column header.
> I'd like to override the automatic menu to select colomns to be shown with
> a dialog that enables the user to select all the column to show/hide at
> once.
>
> I tried to used the OnContextMenu event but the menu is executed first.
>
> Is it possible ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Browser question

Mensaje por Giuseppe Bogetti »

Il Wed, 31 May 2006 18:58:56 +0200, Ignacio Ortiz de Zúñiga ha scritto:
> Guisseppe,
>
>> I tried to used the OnContextMenu event but the menu is executed first.
>
> Use the TBrwColumn:OnHeaderRClick event
It works thanks.
Sorry but I have another question:
I want to trap the DoubleClick on a tree view item but using that code the
item is never found.
//---------------------------------------------------------- --------------------
// Double click on main treeview
//
METHOD FormMainTreeDblClick( oSender, nPosX, nPosY ) CLASS TDbMate
LOCAL oItem AS OBJECT
WITH OBJECT oSender
oItem := :HitTest( nPosX, nPosY )
IF !( oItem == Nil )
LogDebug( "Item found using image index " + ndASTR(oItem:nImage) )
......
ELSE
LogDebug( "Item NOT found" )
ENDIF
END WITH
RETURN Nil
Can you please explain me what I'm doing wrong ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Browser question

Mensaje por Giuseppe Bogetti »

Il Wed, 31 May 2006 18:58:56 +0200, Ignacio Ortiz de Zúñiga ha scritto:
> Guisseppe,
>
>> I tried to used the OnContextMenu event but the menu is executed first.
>
> Use the TBrwColumn:OnHeaderRClick event
It works thanks.
Sorry but I have another question:
I want to trap the DoubleClick on a tree view item but using that code the
item is never found.
//---------------------------------------------------------- --------------------
// Double click on main treeview
//
METHOD FormMainTreeDblClick( oSender, nPosX, nPosY ) CLASS TDbMate
LOCAL oItem AS OBJECT
WITH OBJECT oSender
oItem := :HitTest( nPosX, nPosY )
IF !( oItem == Nil )
LogDebug( "Item found using image index " + ndASTR(oItem:nImage) )
......
ELSE
LogDebug( "Item NOT found" )
ENDIF
END WITH
RETURN Nil
Can you please explain me what I'm doing wrong ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9254
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Browser question

Mensaje por ignacio »

Giussupe,
There is a bug on the Event prototype, just change:
> METHOD FormMainTreeDblClick( oSender, nPosX, nPosY ) CLASS TDbMate
With:
> METHOD FormMainTreeDblClick( oSender, nKeyFlags, nPosX, nPosY ) CLASS
> TDbMate
Be aware that with this modification when you double-click on the envent
from the Ojbect Inspector window it will not jump to the method and it will
create the new method again. So be cautious to NOT doble-click on that event
until next release.
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:[email=1vqs1bimt0ctz.1o104et8w2247.dlg@40tude.net...]1vqs1bimt0ctz.1o104et8w2247.dlg@40tude.net...[/email]
> Il Wed, 31 May 2006 18:58:56 +0200, Ignacio Ortiz de Zúñiga ha scritto:
>
>> Guisseppe,
>>
>>> I tried to used the OnContextMenu event but the menu is executed first.
>>
>> Use the TBrwColumn:OnHeaderRClick event
>
> It works thanks.
>
> Sorry but I have another question:
>
> I want to trap the DoubleClick on a tree view item but using that code the
> item is never found.
>
> //---------------------------------------------------------- --------------------
> // Double click on main treeview
> //
> METHOD FormMainTreeDblClick( oSender, nPosX, nPosY ) CLASS TDbMate
> LOCAL oItem AS OBJECT
>
> WITH OBJECT oSender
> oItem := :HitTest( nPosX, nPosY )
> IF !( oItem == Nil )
> LogDebug( "Item found using image index " + ndASTR(oItem:nImage) )
> ......
> ELSE
> LogDebug( "Item NOT found" )
> ENDIF
> END WITH
>
> RETURN Nil
>
> Can you please explain me what I'm doing wrong ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Browser question

Mensaje por NoName »

Giussupe,
There is a bug on the Event prototype, just change:
> METHOD FormMainTreeDblClick( oSender, nPosX, nPosY ) CLASS TDbMate
With:
> METHOD FormMainTreeDblClick( oSender, nKeyFlags, nPosX, nPosY ) CLASS
> TDbMate
Be aware that with this modification when you double-click on the envent
from the Ojbect Inspector window it will not jump to the method and it will
create the new method again. So be cautious to NOT doble-click on that event
until next release.
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:[email=1vqs1bimt0ctz.1o104et8w2247.dlg@40tude.net...]1vqs1bimt0ctz.1o104et8w2247.dlg@40tude.net...[/email]
> Il Wed, 31 May 2006 18:58:56 +0200, Ignacio Ortiz de Zúñiga ha scritto:
>
>> Guisseppe,
>>
>>> I tried to used the OnContextMenu event but the menu is executed first.
>>
>> Use the TBrwColumn:OnHeaderRClick event
>
> It works thanks.
>
> Sorry but I have another question:
>
> I want to trap the DoubleClick on a tree view item but using that code the
> item is never found.
>
> //---------------------------------------------------------- --------------------
> // Double click on main treeview
> //
> METHOD FormMainTreeDblClick( oSender, nPosX, nPosY ) CLASS TDbMate
> LOCAL oItem AS OBJECT
>
> WITH OBJECT oSender
> oItem := :HitTest( nPosX, nPosY )
> IF !( oItem == Nil )
> LogDebug( "Item found using image index " + ndASTR(oItem:nImage) )
> ......
> ELSE
> LogDebug( "Item NOT found" )
> ENDIF
> END WITH
>
> RETURN Nil
>
> Can you please explain me what I'm doing wrong ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Responder