Page 1 of 2

Browse headers

Posted: Wed Nov 22, 2017 1:47 pm
by Janko
When using SUBCLASS 'DC_XbpOwnerDrawBrowseGeneric()' with OWNERDRAW I do not succede to make browser to show headers.
I copied browse sample 'generic' without succes. Here are excerpts from my code:

Code: Select all

   aPres := ;
         { { XBP_PP_COL_HA_FGCLR, GRA_CLR_WHITE },            /* Header FG Color  */  ;
			  { XBP_PP_COL_HA_BGCLR, GRA_CLR_DARKGRAY },         /* Header BG Color  */  ;
		     { XBP_PP_COL_DA_ROWHEIGHT, 60 }, ;  // rows are 50 pixels high
           { XBP_PP_COL_DA_CELLHEIGHT, 60 } ,;
           { XBP_PP_COL_DA_HILITE_BGCLR, GRA_CLR_PALEGRAY },;   // Hilite BG color
           { XBP_PP_COL_DA_CELLFRAMELAYOUT, XBPFRAME_BOX } ,;
           { XBP_PP_COL_DA_FRAMELAYOUT,     XBPFRAME_NONE} ,;
           { XBP_PP_COL_DA_ROWSEPARATOR, XBPCOL_SEP_LINE },  /* Row Sep  */     ;
           { XBP_PP_COL_DA_COLSEPARATOR, XBPCOL_SEP_LINE } },  /* Col Sep  */  


and browse command:

Code: Select all

 
@ 0.9,1 DCBROWSE oBrowImenik ALIAS 'IMENIK' SIZE 121,24 PRESENTATION aPres  PARENT oTabPage2 NOSOFTTRACK FIT  ;
                  ITEMMARKED ({||Dc_GetRefresh(oStaticoP1), DC_GetRefresh(oStaticoT1), ;
                  if(partnerjiImenik,(PartMati->(dbseek(Imenik->partner)),oBrowPartnerji:refreshAll()),)     }) ;
				      EVAL {|o|oBrowImenik:ItemRbDown := { |x,y,z| oMenuImenik:PopUp ( z, x, 2 ,  XBPMENU_PU_DEFAULT + XBPMENU_PU_MOUSE_RBDOWN  ) },oBrowImenik:lOwnerDraw := .t.,oBrowImenik:InvalidateRect()  } ;
                  SUBCLASS 'DC_XbpOwnerDrawBrowseGeneric()' USEVISUALSTYLE NOHSCROLL ;
      PREEVAL {|o|o:stdFontCompoundName := '10.Tahoma', ;
                  o:boldFontCompoundName := '10.Tahoma '+FONTBOLD, ;
                  o:boldItalicFontCompoundName := '12.Tahoma '+FONTBOLD+' '+FONTITALIC}

browse column:

Code: Select all

DCBROWSECOL DATA {||CellArray(3)} ;
                    HEADER 'Name;Address'  WIDTH 20 PARENT oBrowImenik ;
                    COLOR {||{IF(imenik->oznaka[nGroupO]='*',GraMakeRGBColor( { 253, 120,41 } ),GRA_CLR_DARKGREEN),oBrowImenik:rowColor()[2]}} ;
                    OWNERDRAW

and cell data:

Code: Select all

ELSEIF nCol == 3
  @ 5,1 DCADDCELLITEM cpy(imenik->oseba) FONT'10.Tahoma Bold' SELFONT '12.Tahoma Bold Italic'  TO aCell
  @ 18,1 DCADDCELLITEM imenik->telefon                                                         TO aCell
  @ 31,1 DCADDCELLITEM imenik->fax                                                             TO aCell
  @ 44,1 DCADDCELLITEM imenik->email3                                                          TO aCell


I'd appreciate any hint.

Kind regards
JAnko

Re: Browse headers

Posted: Wed Nov 22, 2017 11:54 pm
by Wolfgang Ciriack
Which version of XBase++ ? With 2.0.832 there was this problem, solved with the latest updates (840/853).

Re: Browse headers

Posted: Thu Nov 23, 2017 12:26 am
by Janko
Thank you Wolfgang, I'll check.

I did not emphasise that when oBrowImenik:lOwnerDraw := is set to .f., headers are shown as expected.
I think this anomaly apeared when 'Generic' was moved to DLL.

Any hint appreciated!!
Kind regards
Janko

Re: Browse headers

Posted: Thu Nov 23, 2017 7:36 am
by Janko
The xBase version is not an issue, I use 853, so the latest.

I am attaching two screen shots, one with lOwnerDraw set to .t., and the second lOwnerDraw set to .f.
Picture w.png
Picture w.png (24.94 KiB) Viewed 16724 times
Picture wo.png
Picture wo.png (10.49 KiB) Viewed 16724 times
Roger, maybe you have an idea?

Thanks and kind regards
JAnko

Re: Browse headers

Posted: Sat Nov 25, 2017 3:34 pm
by rdonnay
Can you see the headers when you run the \exp20\samples\browse\generic.exe program?

Re: Browse headers

Posted: Sun Nov 26, 2017 4:25 am
by Janko
Roger,

yes, they are visiable.
But I can't discover what I am doing differently. Without OWNERDRAVING they are also visiable.

BR Janko

Re: Browse headers

Posted: Sun Nov 26, 2017 11:15 am
by rdonnay
If you give me some code that I can compile and run then I can help you.

Re: Browse headers

Posted: Mon Nov 27, 2017 12:52 am
by Janko
Roger,
it will take some time to exctract piece of code for demonstration. But I'll certianly do it.

Thank you for your goodwill.

Janko

Re: Browse headers

Posted: Mon Nov 27, 2017 8:57 am
by Janko
Roger,

here is my sample of calendar (modified) showing no headers.
I would appreciate very much if you could define, what I am doing wrong.

Thank you
JAnko

Re: Browse headers

Posted: Sat Dec 02, 2017 12:54 pm
by rdonnay
It looks like the problem was caused by the USEVISUALSTYLE clause in your DCBROWSE command.

The problem shows up on your example because you are linking EXPRESS.ARC to your .EXE.
EXPRESS.ARC has manifest declarations which cause the USEVISUALSTYLE to be enabled.
In the sample program in .\exp20\samples\browse folder, the EXPRESS.ARC is not in the project file.
When I add it to the project file, I get the same result as you.

It appears that I never tested with USEVISUALSTYLE enabled.
This will require some major code changes to the eXpress++ library to fix this and I do not have a quick fix for you.
Therefore, I am suggesting that you either remove the EXPRESS.ARC reference in your project file or remove the USEVISUALSTYLE clause from your code.