FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bitmap in xBrowse
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Bitmap in xBrowse
Posted: Mon Feb 02, 2009 10:01 AM
Hi all,

i have a xBrowse column where i put a bitmap beside the data to show that there is something special with that data.
Unfortunately this bitmap gets badly visible when the row gets selected.
I know it's not a xBrowse error but bad color from my side.



Is there a way just to highlite only colums 2 and 3 so that my bitmaps stays visible?

Regards,
Detlef
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Bitmap in xBrowe
Posted: Mon Feb 02, 2009 10:29 AM

there is another topic for this problem
We are working ( daniel, Uwe and me) to resolve the problem

viewtopic.php?f=3t=14347

&

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Bitmap in xBrowe
Posted: Mon Feb 02, 2009 10:43 PM

Hello Detlef,

can You add these two lines to Your xBrowser, to see, if there is a change ?
In my tests, the BMP is visible.

// for < oBrw > use Your browse-object
// -------------------------------------------
aClrCol := { { 0, 15724527 }, { 0, 14671839 } } // Alternated Colors
oBrw:bClrStd := { || aClrCol[ oBrw:KeyNo % 2 + 1 ] }

Regards

Uwe :lol:

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.
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Re: Bitmap in xBrowe
Posted: Tue Feb 03, 2009 08:30 AM

Hi Silvio and Uwe,

i think i made a bad description of my problem.
The bitmap is not hidden.
Its just too dark and a dark lightbar makes it hard to see.
I now made the lightbar with a very bright color.
But i would prefer a lightbar with the original blue color which covers only my columns 2, 3 and not column 1.
Someone how how to do this?

Thanks for your advices.
Regards,
Detlef

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 10:23 AM

Detlef,

Try to set this DATA of your first column object:

   oCol1:bClrSelFocus = { || { CLR_BLACK, CLR_WHITE } }

Here you have a working example:

#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oWnd, oBrw, oCol

   USE Customer

   DEFINE WINDOW oWnd
   

   @ 0, 0 XBROWSE oBrw OF oWnd ALIAS "Customer"
   

   oCol = oBrw:AddCol() 
   oCol:bStrData = { || Customer->First } 
   oCol:cHeader = "First"
   oCol:bClrSelFocus = { || { CLR_BLACK, CLR_WHITE } }  

   oCol = oBrw:AddCol() 
   oCol:bStrData = { || Customer->Last } 
   oCol:cHeader = "Last"

   oCol = oBrw:AddCol() 
   oCol:bStrData = { || Customer->Street } 
   oCol:cHeader = "Street"
   

   oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW
   

   oBrw:CreateFromCode()
   

   oWnd:oClient = oBrw

   ACTIVATE WINDOW oWnd

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 10:35 AM

Hello Detlef,

You can use Antonio's solution or change the color of the focused row with any
of the blue-color-values ( +, ++ ( lighter ) :

// 0 = Black
// 16777215 = White
// 8388608 = DarkBlue
// 15365376 = Blue +
// 16757606 = Blue ++
// 16764831 = Blue +++
// 16767411 = Blue ++++

// Selected Row-color on Focus ( Text / Background )
// ------------------------------------------------------------
oLbx:bClrSelFocus = { || { 0, 16757606 } }  

// Selected Row-color on change Focus ( Text / Background )
// -----------------------------------------------------------------
oLbx:bClrSel = { || { 0, 16757606 } }

Regards

Uwe :lol:

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.
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 10:48 AM

Antonio,

many thanks for your help.
Its working fine now.

Also thanks to Uwe for your color tip.

Regards,
Detlef

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 11:01 AM
Hello Detlef,

A screenshot :



Regards
Uwe :-)
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.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 12:01 PM

why on my application I cannot see the bitmaps ???????

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 02:56 PM
Hello Silvio,

I hope I get it ready, to put a early release of the tools tomorrow in this place.
It is easy for You, to check all possible combinations to see what's wrong.
There are 9 different backgrounds together for Windows and Dialog = 18 Test.
These tests in combination with Marquestyles ( 7 ) are together 126 Tests.
Maybe with all the tests, we can find out, what's wrong.
Some combinations are working ( 80 % :-) ), some not.

Test Selection



Selection Result ( xBrowse-Test in Windows and Dialog together )



Regards
Uwe :-)
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.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 03:21 PM

I use a special dialog ( nOR( WS_CHILD, 4 ))
and I put xbrowse into
Now I use this :

   App():oDlg:NewGrid( nSplit )
   oApp():oGrid:nColDividerStyle    := LINESTYLE_BLACK
   oApp():oGrid:nRowDividerStyle    := LINESTYLE_FORECOLOR
   oApp():oGrid:nMarqueeStyle       :=MARQSTYLE_HIGHLCELL




   oApp():oGrid:lColDividerComplete := .T.
   oApp():oGrid:lRecordSelector := .F.



oCol:= oApp():oGrid:AddCol()
oCol:AddResource("sort1")
oCol:AddResource("sort2")
oCol:bStrData := { ||  (oDCli)->NUMCLI}
oCol:cHeader  := "Codice"
oCol:nWidth   := 80
oCol:nHeadBmpNo    := 1
oCol:nHeadBmpAlign := AL_RIGHT
oCol:bLClickHeader :={ ||(Sel_Index(1,oDCli), oApp():oTab:nOption:=1,oApp():oTab:refresh())  }


   //PER LA SELEZIONE

oCol:= oApp():oGrid:AddCol()
oCol:AddResource("C_Pal")
oCol:AddResource("STATO3")
oCol:bBmpData  := { || Ds_Mar(1,2)}
oCol:cHeader  := ""
oCol:nWidth   := 25




 oCol:= oApp():oGrid:AddCol()
 oCol:AddResource("sort1")
 oCol:AddResource("sort2")
 oCol:bStrData := { ||  (oDCli)->NOMEINTERO}
 oCol:cHeader  := "Cognome Nome"
 oCol:nWidth   := 250
 oCol:nHeadBmpNo    := 2
 oCol:nHeadBmpAlign := AL_RIGHT
 oCol:bLClickHeader :={ ||(Sel_Index(2,oDCli), oApp():oTab:nOption:=2,oApp():oTab:refresh())  }


 oCol:= oApp():oGrid:AddCol()
                                     oCol:AddResource("sort1")
                                     oCol:AddResource("sort2")
                                     oCol:AddResource("UOMO")
                                     oCol:AddResource("DONNA")
                                   *   oCol:bStrData := { ||   (oDCli)->SESSO}
                                       oCol:bBmpData   := { || IF( ALLTRIM(UPPER("UOMO")) $ ALLTRIM(UPPER((oDCli)->SESSO)),3,4)}
                                      oCol:cHeader  := "Sesso"
                                      oCol:nWidth   :=40
                                      oCol:nHeadBmpNo    := 2
                                      oCol:nHeadBmpAlign := AL_RIGHT
                                      oCol:bLClickHeader :={ ||(Sel_Index(3,oDCli) , oApp():oTab:nOption:=3,oApp():oTab:refresh()) }



                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:AddResource("FONDATORE")
                                      oCol:AddResource("ORDINARIO")
                                      oCol:AddResource("SOSTENITORE")
                                      oCol:AddResource("ALTRO")
                                      *oCol:bStrData := { || (oDCli)->TIPO}
                                      oCol:cHeader  := "Adesione"
                                   *   oCol:bEditValue := { || (oDCli)->TIPO }
                                      oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
                                      oCol:bBmpData := { || (oDCli)->TIPO}
                                       oCol:nWidth   := 30






  oCol:= oApp():oGrid:AddCol()
                                      oCol:AddResource("sort1")
                                      oCol:AddResource("sort2")
                                      oCol:AddResource("ATTIVO")
                                      oCol:AddResource("NOATTIVO")
                                       *oCol:bStrData := { || (oDCli)->STATO}
                                      oCol:cHeader  := "Status"
                                      oCol:nHeadBmpNo    := 2
                                      oCol:nHeadBmpAlign := AL_RIGHT
                                      oCol:bBmpData   := { || iif( (oDCli)->STATO, 3, 4) }
                                      oCol:bLClickHeader :={ ||(Sel_Index(5,oDCli) , oApp():oTab:nOption:=5,oApp():oTab:refresh()) }





                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:AddResource("sort1")
                                      oCol:AddResource("sort2")
                                      oCol:nHeadBmpNo    := if( (oDCli)->( ORDNUMBER() ) == 6, 1, 2)
                                      oCol:nHeadBmpAlign := AL_RIGHT
                                      oCol:bLClickHeader :={ ||(Sel_Index(7,oDCli) , oApp():oTab:nOption:=7,oApp():oTab:refresh()) }
                                      oCol:AddBmpFile(".\BITMAPS\MENU\GRADI\GIOVANE.BMP")
                                      oCol:AddBmpFile(".\BITMAPS\MENU\GRADI\PENSIONATO.BMP")
                                      oCol:AddBmpFile(".\BITMAPS\MENU\GRADI\STUDENTE.BMP")
                                      oCol:AddBmpFile(".\BITMAPS\MENU\GRADI\ESPERTO.BMP")
                                      oCol:AddBmpFile(".\BITMAPS\MENU\GRADI\OBIETTORE.BMP")
                                      oCol:AddBmpFile(".\BITMAPS\MENU\GRADI\REGIONALE.BMP")
                                      oCol:bStrData := { || (oDCli)->ATTIVITA}
                                      oCol:cHeader  := "Tipo"
                                      oCol:bEditValue := { || (oDCli)->ATTIVITA }
                                      oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)

                                      oCol:bBmpData := { || (oDCli)->attivita + 2}
                                      oCol:nWidth   :=40




                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:AddResource("sort1")
                                      oCol:AddResource("sort2")
                                      oCol:cHeader  := "Grado"
                                      oCol:nHeadBmpNo    := if( (oDCli)->( ORDNUMBER() ) == 7, 1, 2)
                                      oCol:nHeadBmpAlign := AL_RIGHT
                                      oCol:bLClickHeader :={ ||(Sel_Index(6,oDCli) , oApp():oTab:nOption:=6,oApp():oTab:refresh()) }
                                      oCol:AddResource("GRADO1")
                                      oCol:AddResource("GRADO2")
                                      oCol:AddResource("GRADO3")
                                      oCol:AddResource("GRADO4")
                                      oCol:AddResource("GRADO5")
                                      oCol:AddResource("GRADO6")
                                      oCol:AddResource("GRADO7")
                                      oCol:AddResource("GRADO8")
                                      oCol:AddResource("GRADO0")
                                      oCol:bStrData := { || (oDCli)->GRADO}
                                      oCol:bBmpData := { || (oDCli)->GRADO + 2}
                                      oCol:nWidth   :=40




                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:bStrData := { ||   CF((oDCli)->NASCITA)}
                                      oCol:cHeader  := "Data di nascita"
                                      oCol:nWidth   := 90


                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:bStrData := { ||   (oDCli)->LUO_NASC }
                                      oCol:cHeader  := "Luogo di Nascita"
                                      oCol:nWidth   := 150


                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:bStrData := { ||  (oDCli)->INDIRIZZO }
                                      oCol:cHeader  := "Indirizzo"
                                      oCol:nWidth   := 200

                                      oCol:= oApp():oGrid:AddCol()
                                      oCol:AddResource("sort1")
                                      oCol:AddResource("sort2")
                                      oCol:bStrData := { ||   (oDCli)->LOCALITA }
                                      oCol:cHeader  := "Località"
                                      oCol:nWidth   := 100
                                      oCol:bLClickHeader :={ ||(Sel_Index(4,oDCli), oApp():oTab:nOption:=4,oApp():oTab:refresh())  }






   oApp():oGrid:nFreeze :=3
   oApp():oGrid:SetRDD()
  * oApp():oGrid:bClrStd := { || Colores(oDCli) }
   * oApp():oGrid:bClrStd := {|| {CLR_WHITE, CLR_BLACK} }
   *  oApp():oGrid:cBmpAdjBrush :=".\bitmaps\pclogog.BMP"


   oApp():oGrid:bClrStd := { || Colores(oDCli) }


   oApp():oGrid:SetBackGround( ".\bitmaps\pclogog.BMP" )
   oApp():oGrid:CreateFromCode()
   oApp():oGrid:bChange    :={ || (RefreshCont(oCont,oDCli)) }
   oApp():oGrid:bRClicked := {|nRow,nCol| Disp_Men(oApp():oDlg,nRow,nCol,oDCli) }
   oApp():oGrid:bKeyDown   :={|nKey| Val_nKey(nKey,oApp():oDlg)

I can see the bitmaps but the bar is on each cell and not on each row as U can see here :

I cannot use the backgroud because in this mode it not is usefull...

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 07:28 PM

Hello Silvio,

during preparing the download, I tested colors.
Because of a mistake, the rowselection of the dialog was white. Suddenly I could see the bitmap.
Slowly I am a little bit perplexed.

oBrw:nMarqueeStyle :=  MARQSTYLE_HIGHLROW
oBrw:nRecSelColor = 15512898 

 // Selected Row Black on White
oBrw:bClrSelFocus = { || { 0, 16777215 } }  
  

// LostFocus Black on White
oBrw:bClrSel = { || { 0, 16777215 } }

The same Test with a brush :

Regards
Uwe :cry:

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.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 11:26 PM

Now run but now I have a white bar
I wish have a bar with a light color
how I can modify it ?

Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Bitmap in xBrowse
Posted: Tue Feb 03, 2009 11:34 PM

found !!!
I insert the darkorange color office 2007 style ...now I see bitmaps

oApp():oGrid:nColDividerStyle := LINESTYLE_BLACK
oApp():oGrid:nRowDividerStyle := LINESTYLE_FORECOLOR

oApp():oGrid:nMarqueeStyle := MARQSTYLE_HIGHLROW

oApp():oGrid:nRecSelColor = 15512898

// Selected Row Black on White
oApp():oGrid:bClrSelFocus = { || { 0, nRGB( 238, 152, 25 ) } }

// LostFocus Black on White
oApp():oGrid:bClrSel ={ || { 0, nRGB( 238, 152, 25 ) } }

Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Bitmap in xBrowse
Posted: Wed Feb 04, 2009 11:09 AM
#define DARKCYAN nRGB( 125, 165, 224 )

oApp():nRecSelColor = 15512898
// Selected Row Black on White
oApp():bClrSelFocus = { || { 0, DARKCYAN } }

// LostFocus Black on White
oApp():bClrSel ={ || { 0, DARKCYAN } }


Best Regards, Saludos



Falconi Silvio

Continue the discussion