Browse headers

This forum is for eXpress++ general support.
Message
Author
Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Browse headers

#1 Post 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
Attachments
Picture.png
Picture.png (19.91 KiB) Viewed 14502 times

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Browse headers

#2 Post by Wolfgang Ciriack »

Which version of XBase++ ? With 2.0.832 there was this problem, solved with the latest updates (840/853).
_______________________
Best Regards
Wolfgang

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Browse headers

#3 Post 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

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Browse headers

#4 Post 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 14476 times
Picture wo.png
Picture wo.png (10.49 KiB) Viewed 14476 times
Roger, maybe you have an idea?

Thanks and kind regards
JAnko

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Browse headers

#5 Post by rdonnay »

Can you see the headers when you run the \exp20\samples\browse\generic.exe program?
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Browse headers

#6 Post 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

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Browse headers

#7 Post by rdonnay »

If you give me some code that I can compile and run then I can help you.
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Browse headers

#8 Post 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

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Browse headers

#9 Post 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
Attachments
CALENDAR.zip
(422.01 KiB) Downloaded 735 times

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Browse headers

#10 Post 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.
The eXpress train is coming - and it has more cars.

Post Reply