Página 1 de 1

Browser question

Publicado: Mar May 30, 2006 2:14 pm
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

Browser question

Publicado: Mié May 31, 2006 8:54 am
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

Browser question

Publicado: Mié May 31, 2006 8:54 am
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

Browser question

Publicado: Mié May 31, 2006 12:31 pm
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

Browser question

Publicado: Mié May 31, 2006 12:31 pm
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

Browser question

Publicado: Mié May 31, 2006 6:58 pm
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

Browser question

Publicado: Mié May 31, 2006 6:58 pm
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

Browser question

Publicado: Mié May 31, 2006 8:00 pm
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

Browser question

Publicado: Mié May 31, 2006 8:00 pm
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

Browser question

Publicado: Mié May 31, 2006 9:00 pm
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

Browser question

Publicado: Mié May 31, 2006 9:00 pm
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