Page 1 of 5

A Generic ownerdraw system for DCBROWSE

Posted: Tue Jun 02, 2015 7:06 am
by rdonnay
This is a GENERIC owner drawing system for DC_XbpBrowse. Each browse cell can draw text, icons or bitmaps anywhere within the cell by declaring each within a multi-dimensional array

[1] = <ocData>
[2] = <nCol>
[3] = <nRow>
[4] = <nWidth>
[5] = <nHeight>
[6] = <font>
[7] = <selectedFont>
[8] = <fgColor>
[9] = <bgColor>
[10] = <nAlign>

OWNERGEN.PRG can be used with any browse configuration.

CALENDAR.PRG uses the XbpOwnerDrawBrowseGeneric class to paint a calendar that is loaded into an array from CALENDAR.DBF.

GENERIC.PRG uses the XbpOwnerDrawBrowseGeneric class to paint a database browse of customers.

This is the first draft. It will evolve. Your suggestions are welcome.
calendar.jpg
calendar.jpg (112.54 KiB) Viewed 16729 times

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 12:32 am
by c-tec
Hello Roger,
great ! this fills a big gap in xBase++. I need such browsers many often
regards
Rudolf

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 1:16 am
by Eugene Lutsenko
Thank you, Roger!

This greatly expands the scope of the browser. This is very cool, I would say that is amazing. It can also be used to display the output of complex shapes.

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 5:10 am
by skiman
Hi Roger,

I'm getting a browse as this. Maybe I'm missing something.
ownerdraw.png
ownerdraw.png (7.61 KiB) Viewed 16687 times

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 5:20 am
by rdonnay
Click on "Use Owner Drawing" check box.

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 5:44 am
by Tom
Please don't use the two or three icon files in the sample in applications which are to be delivered. Those are some I bought for my company, and I just placed them in the ownerdrawing sample for the DevCon attendees.

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 6:02 am
by skiman
Ho Roger,

I have done that, but it doesn't make any difference. Also the calendar sample shows the array.

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 6:26 am
by Tom
You need Xbase++ 1.9 SL1 for this, Chris.

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 6:37 am
by rdonnay
Please don't use the two or three icon files in the sample in applications which are to be delivered.
Oops. I forgot about that. Sorry, I'll write a new sample.

Re: A Generic ownerdraw system for DCBROWSE

Posted: Wed Jun 03, 2015 6:40 am
by rdonnay
You need Xbase++ 1.9 SL1 for this, Chris.
It also works with Xbase++ 2.0, but NOT 1.9 build 331.