Page 1 of 1

Dear Antonio : ERROR graphics on xbrowse header

Posted: Wed Mar 05, 2008 11:52 am
by Silvio
I have another error
look the image


Image

why It create a black background ?

Posted: Wed Mar 05, 2008 12:17 pm
by Silvio
found !!!!!!!!!

I made this command
oApp():oGrid:nRecSelColor := {|| { CLR_WHITE, RGB(24, 116, 205) } }
it make now also the recsel ( on the left) with black background

Dear Antonio,

is there a bug sure !

Posted: Wed Mar 05, 2008 12:43 pm
by Silvio
there is another bug :

I made
oApp():oGrid:bClrHeader := { || { DARKORANGE2 , DARKBLUE} }

where
#define DARKORANGE2 nRGB( 247, 192, 91 )
#define DARKBLUE nRGB( 3, 56, 147 )


all is ok

but when I use a bitmap on xbrowse header it change the background color of this bitmap
see it please





Image


whit the command oApp():oGrid:bClrHeader := { || { DARKORANGE2 , DARKBLUE} }



Image

Posted: Wed Mar 05, 2008 12:56 pm
by Silvio
Another :

How I can make to erase the marron line at the init of header ?

please see the picture sample :
Image

Posted: Thu Mar 06, 2008 12:37 pm
by Antonio Linares
Silvio,

Lets go one by one :-)

In the first one, is there a column there ? or is it the right empty space ?

Are you able to reproduce it on a small sample ? Thanks

Posted: Thu Mar 06, 2008 5:34 pm
by Silvio
ok first sample :

Code: Select all

#include "FiveWin.ch"
#include "xbrowse.ch"

#define LIGHTBLUE    nRGB(  89, 135, 214 )
#define DARKBLUE     nRGB(   3,  56, 147 )
#define LIGHTORANGE1 nRGB( 250, 227, 143 )
#define DARKORANGE1  nRGB( 238, 152, 25 )
#define LIGHTCYAN    nRGB( 203, 225, 252 )
#define DARKCYAN     nRGB( 125, 165, 224 )
#define LIGHTORANGE2 nRGB( 255, 255, 220 )
#define DARKORANGE2  nRGB( 247, 192, 91 )



function Main()
   local oWnd
   USE CUSTOMER NEW

   INDEX ON field->first to "name"
   SET INDEX TO "name"

   ORDSETFOCUS( "name" )

   GO TOP


   DEFINE WINDOW oWnd TITLE "New TXBrowse class (only for FWH)" ;
     MENU BuildMenu( oWnd ) MDI ;
      MENUINFO 3


   DEFINE BITMAP oBmp RESOURCE "Background"

   SET MESSAGE OF oWnd TO FWVERSION + ", " + FWCOPYRIGHT CENTERED TIME DATE



   ACTIVATE WINDOW oWnd

   return nil

 function BuildMenu( oWnd )

   local oMenu
   local cFile

   cFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "readme.txt"

   MENU oMenu
      MENUITEM "sample xbrowse"
      MENU
         MENUITEM "sample  browse" ;
            ACTION mybrowse( oWnd )
          ENDMENU
         ENDMENU
return oMenu








STATIC FUNCTION mybrowse( oWnd )

   local oChild, oBrw

   DEFINE WINDOW oChild TITLE "MultiSelect browse" MDICHILD OF oWnd

   oBrw := TXBrowse():New( oWnd )


     oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLROWMS
     oBrw:nColDividerStyle    := LINESTYLE_FORECOLOR
     oBrw:lColDividerComplete := .t.
     oBrw:lRecordSelector := .T.

      oBrw:nRecSelColor  := {|| {  LIGHTCYAN , LIGHTBLUE } }









   oBrw:SetRDD()
   oBrw:CreateFromCode()

   oChild:oClient := oBrw

   ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()

RETURN NIL



there are not column there !!!
and Now you can see also black the selector

Posted: Thu Mar 06, 2008 5:45 pm
by Silvio
SECOND STEP

Code: Select all


#include "FiveWin.ch"
#include "xbrowse.ch"

#define LIGHTBLUE    nRGB(  89, 135, 214 )
#define DARKBLUE     nRGB(   3,  56, 147 )
#define LIGHTORANGE1 nRGB( 250, 227, 143 )
#define DARKORANGE1  nRGB( 238, 152, 25 )
#define LIGHTCYAN    nRGB( 203, 225, 252 )
#define DARKCYAN     nRGB( 125, 165, 224 )
#define LIGHTORANGE2 nRGB( 255, 255, 220 )
#define DARKORANGE2  nRGB( 247, 192, 91 )



function Main()
   local oWnd
   USE CUSTOMER NEW

   INDEX ON field->first to "name"
   SET INDEX TO "name"

   ORDSETFOCUS( "name" )

   GO TOP


   DEFINE WINDOW oWnd TITLE "New TXBrowse class (only for FWH)" ;
     MENU BuildMenu( oWnd ) MDI ;
      MENUINFO 3


   DEFINE BITMAP oBmp RESOURCE "Background"

   SET MESSAGE OF oWnd TO FWVERSION + ", " + FWCOPYRIGHT CENTERED TIME DATE



   ACTIVATE WINDOW oWnd

   return nil

 function BuildMenu( oWnd )

   local oMenu
   local cFile

   cFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "readme.txt"

   MENU oMenu
      MENUITEM "sample xbrowse"
      MENU
         MENUITEM "sample  browse" ;
            ACTION mybrowse( oWnd )
          ENDMENU
         ENDMENU
return oMenu








STATIC FUNCTION mybrowse( oWnd )

   local oChild, oBrw

   DEFINE WINDOW oChild TITLE "MultiSelect browse" MDICHILD OF oWnd

   oBrw := TXBrowse():New( oWnd )


     oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLROWMS
     oBrw:nColDividerStyle    := LINESTYLE_FORECOLOR
     oBrw:lColDividerComplete := .t.
     oBrw:lRecordSelector := .T.
     oBrw:nRowHeight  :=40

                                          oCol:=oBrw:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:nHeadBmpNo    := 1
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bStrData := { ||     field->first }
                                          oCol:cHeader  :=  i18n('first')
                                          oCol:nWidth   :=80

                                          oCol:= oBrw:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:nHeadBmpNo    := 1
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bStrData := { ||     field->last }
                                          oCol:cHeader  :=  i18n('first')
                                          oCol:nWidth   :=80










      oBrw:nRecSelColor  := {|| {  LIGHTCYAN , LIGHTBLUE } }

     oBrw:bClrHeader := { || { DARKORANGE2 , DARKBLUE} }








   oBrw:SetRDD()
   oBrw:CreateFromCode()

   oChild:oClient := oBrw

   ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()

RETURN NIL


TEST.RC

Code: Select all

SORT1 BITMAP LOADONCALL MOVEABLE DISCARDABLE 
{
 '42 4D 36 03 00 00 00 00 00 00 36 00 00 00 28 00'
 '00 00 10 00 00 00 10 00 00 00 01 00 18 00 00 00'
 '00 00 00 03 00 00 C2 1E 00 00 C2 1E 00 00 00 00'
 '00 00 00 00 00 00 FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF 00 00 00 00 00'
 '00 FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF 00 00 00 9C FF FF 31 FF'
 'FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 00 00 00 9C FF FF 31 FF FF 00 D6'
 'FF 31 FF FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF 00 00 00 9C FF FF 31 FF FF 9C FF FF 00 D6'
 'FF 00 D6 FF 31 FF FF 00 00 00 FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF 42'
 '42 42 9C FF FF 9C FF FF 9C FF FF 31 FF FF 00 D6'
 'FF 00 D6 FF 00 D6 FF 31 FF FF 00 00 00 FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF 42'
 '42 42 42 42 42 42 42 42 9C FF FF 9C FF FF 00 D6'
 'FF 00 D6 FF 00 00 00 00 00 00 00 00 00 FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 42 42 42 9C FF FF 31 FF FF 00 D6'
 'FF 00 D6 FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 42 42 42 9C FF FF 9C FF FF 00 D6'
 'FF 00 D6 FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 42 42 39 9C FF FF 29 FF FF 00 D6'
 'FF 00 D6 FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 42 42 42 9C FF FF 9C FF FF 00 D6'
 'FF 00 D6 FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 42 42 42 9C FF FF 9C FF FF 31 FF'
 'FF 31 FF FF 00 00 00 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 42 42 42 42 42 42 42 42 42 42 42'
 '42 42 42 42 42 42 42 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF'
}


SORT2 BITMAP LOADONCALL MOVEABLE DISCARDABLE 
{
 '42 4D 36 03 00 00 00 00 00 00 36 00 00 00 28 00'
 '00 00 10 00 00 00 10 00 00 00 01 00 18 00 00 00'
 '00 00 00 03 00 00 C2 1E 00 00 C2 1E 00 00 00 00'
 '00 00 00 00 00 00 FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF 40 40 40 40 40'
 '40 FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF 40 40 40 FF 00 FF FF 00'
 'FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF 80'
 '80 80 FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF 40 40 40 FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF 80'
 '80 80 80 80 80 80 80 80 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 40 40 40 40 40 40 FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 80 80 80 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 80 80 80 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 80 80 80 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 80 80 80 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 80 80 80 FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF 40 40 40 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF 80 80 80 80 80 80 80 80 80 80 80'
 '80 80 80 80 80 80 80 FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF'
 '00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00'
 'FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF'
 'FF 00 FF FF 00 FF'
}


Posted: Thu Mar 06, 2008 5:54 pm
by Silvio
third and last step

Code: Select all


#include "FiveWin.ch"
#include "xbrowse.ch"

#define LIGHTBLUE    nRGB(  89, 135, 214 )
#define DARKBLUE     nRGB(   3,  56, 147 )
#define LIGHTORANGE1 nRGB( 250, 227, 143 )
#define DARKORANGE1  nRGB( 238, 152, 25 )
#define LIGHTCYAN    nRGB( 203, 225, 252 )
#define DARKCYAN     nRGB( 125, 165, 224 )
#define LIGHTORANGE2 nRGB( 255, 255, 220 )
#define DARKORANGE2  nRGB( 247, 192, 91 )



function Main()
   local oWnd
   USE CUSTOMER NEW

   INDEX ON field->first to "name"
   SET INDEX TO "name"

   ORDSETFOCUS( "name" )

   GO TOP


   DEFINE WINDOW oWnd TITLE "New TXBrowse class (only for FWH)" ;
     MENU BuildMenu( oWnd ) MDI ;
      MENUINFO 3


   DEFINE BITMAP oBmp RESOURCE "Background"

   SET MESSAGE OF oWnd TO FWVERSION + ", " + FWCOPYRIGHT CENTERED TIME DATE



   ACTIVATE WINDOW oWnd

   return nil

 function BuildMenu( oWnd )

   local oMenu
   local cFile

   cFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "readme.txt"

   MENU oMenu
      MENUITEM "sample xbrowse"
      MENU
         MENUITEM "sample  browse" ;
            ACTION mybrowse( oWnd )
          MENUITEM "sample DIALOG" ;
             ACTION NewDialog( oWnd )
          ENDMENU
         ENDMENU
return oMenu








STATIC FUNCTION mybrowse( oWnd )

   local oChild, oBrw

   DEFINE WINDOW oChild TITLE "MultiSelect browse" MDICHILD OF oWnd

   oBrw := TXBrowse():New( oWnd )


     oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLROWMS
     oBrw:nColDividerStyle    := LINESTYLE_FORECOLOR
     oBrw:lColDividerComplete := .t.
     oBrw:lRecordSelector := .T.
     oBrw:nRowHeight  :=40

                                          oCol:=oBrw:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:nHeadBmpNo    := 1
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bStrData := { ||     field->first }
                                          oCol:cHeader  :=  i18n('first')
                                          oCol:nWidth   :=80

                                          oCol:= oBrw:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:nHeadBmpNo    := 1
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bStrData := { ||     field->last }
                                          oCol:cHeader  :=  i18n('last')
                                          oCol:nWidth   :=80










      oBrw:nRecSelColor  := {|| {  LIGHTCYAN , LIGHTBLUE } }

     oBrw:bClrHeader := { || { DARKORANGE2 , DARKBLUE} }








   oBrw:SetRDD()
   oBrw:CreateFromCode()

   oChild:oClient := oBrw

   ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()

   RETURN NIL





   STATIC FUNCTION NewDialog( oWnd )

   local oDlg, oBrw, nSplit:=10

   DEFINE DIALOG oDlg FROM 10,24 TO 30,80 OF oWnd

   oDlg:SetColor(0,RGB(143,172,230))

    oBrw := TXBrowse():New(oDlg )
    oBrw:nTop    := 10
    oBrw:nLeft   := nSplit+2
    oBrw:nBottom :=  oDlg:nBOTTOM
    oBrw:nRight  := oDlg:nRight






                                          oCol:=oBrw:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:nHeadBmpNo    := 1
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bStrData := { ||     field->first }
                                          oCol:cHeader  :=  i18n('first')
                                          oCol:nWidth   :=80

                                          oCol:= oBrw:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:nHeadBmpNo    := 1
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bStrData := { ||     field->last }
                                          oCol:cHeader  :=  i18n('last')
                                          oCol:nWidth   :=80








             oBrw:SetRDD()
   oBrw:CreateFromCode()









   ACTIVATE DIALOG oDlg ;


RETURN NIL

















see Newdialog func
do you see a marron line ?

Posted: Fri Mar 07, 2008 3:18 pm
by Silvio
Dear Antonio,
you try my samples ?