Alaska Software Inc. - xbpcolumn heading
Username: Password:
AuthorTopic: xbpcolumn heading
Paul Chongxbpcolumn heading
on Fri, 01 Jun 2018 04:00:57 +0800
Hi all,

I like to know if a xbpcolumn heading can use both text & ico? I wanted to
add a triangle ico to show that xbpcolumn is the control index after the
user click on the heading.

Thanks
Jonathan LeemingRe: xbpcolumn heading
on Thu, 31 May 2018 14:14:57 -0600
On 5/31/2018 2:00 PM, Paul Chong wrote:
> Hi all,
> 
> I like to know if a xbpcolumn heading can use both text & ico? I wanted to
> add a triangle ico to show that xbpcolumn is the control index after the
> user click on the heading.
> 
> Thanks
> 
Hi Paul,

In looking at the 2.0.951 help file the xbpColumn object has an instance 
variable heading that references the the xbpCellGroup object with the 
documentation stating...

"Objects of this class (xbpCellGroup) are used by the XbpColumn() class 
for displaying the heading, footing and data area of a single column 
within an XbpBrowse() object."

It appears that the xbpCellGroup object can have different types with 
text simply being the default. As per the documentation...

"An XbpCellGroup object can display data in textual or graphic form, 
such as bitmaps or icons. The instance variable :type defines how data 
should be displayed."

Hope this helps and now that I know I may give it a try too!

Cheers... Jonathan

jonathan.leeming@the-family-centre.com
Edmonton, Alberta, Canada
Jonathan LeemingRe: xbpcolumn heading
on Thu, 31 May 2018 14:16:34 -0600
On 5/31/2018 2:14 PM, Jonathan Leeming wrote:
> On 5/31/2018 2:00 PM, Paul Chong wrote:
>> Hi all,
>>
>> I like to know if a xbpcolumn heading can use both text & ico? I 
>> wanted to
>> add a triangle ico to show that xbpcolumn is the control index after the
>> user click on the heading.
>>
>> Thanks
>>
> Hi Paul,
> 
> In looking at the 2.0.951 help file the xbpColumn object has an instance 
> variable heading that references the the xbpCellGroup object with the 
> documentation stating...
> 
> "Objects of this class (xbpCellGroup) are used by the XbpColumn() class 
> for displaying the heading, footing and data area of a single column 
> within an XbpBrowse() object."
> 
> It appears that the xbpCellGroup object can have different types with 
> text simply being the default. As per the documentation...
> 
> "An XbpCellGroup object can display data in textual or graphic form, 
> such as bitmaps or icons. The instance variable :type defines how data 
> should be displayed."
> 
> Hope this helps and now that I know I may give it a try too!
> 
> Cheers... Jonathan
> 
FYI... I just looked at the 1.9 documentation and this capability 
appears to have existed in 1.9 too.

jonathan.leeming@the-family-centre.com
Edmonton, Alberta, Canada
Paul ChongRe: xbpcolumn heading
on Fri, 01 Jun 2018 04:39:30 +0800
On Thu, 31 May 2018 14:16:34 -0600, Jonathan Leeming wrote:

> On 5/31/2018 2:14 PM, Jonathan Leeming wrote:
>> On 5/31/2018 2:00 PM, Paul Chong wrote:
>>> Hi all,
>>>
>>> I like to know if a xbpcolumn heading can use both text & ico? I 
>>> wanted to
>>> add a triangle ico to show that xbpcolumn is the control index after the
>>> user click on the heading.
>>>
>>> Thanks
>>>
>> Hi Paul,
>> 
>> In looking at the 2.0.951 help file the xbpColumn object has an instance 
>> variable heading that references the the xbpCellGroup object with the 
>> documentation stating...
>> 
>> "Objects of this class (xbpCellGroup) are used by the XbpColumn() class 
>> for displaying the heading, footing and data area of a single column 
>> within an XbpBrowse() object."
>> 
>> It appears that the xbpCellGroup object can have different types with 
>> text simply being the default. As per the documentation...
>> 
>> "An XbpCellGroup object can display data in textual or graphic form, 
>> such as bitmaps or icons. The instance variable :type defines how data 
>> should be displayed."
>> 
>> Hope this helps and now that I know I may give it a try too!
>> 
>> Cheers... Jonathan
>> 
> FYI... I just looked at the 1.9 documentation and this capability 
> appears to have existed in 1.9 too.

Hi Johathan

Thank you for the headup. However, the help file stated the object can only
display data in textual OR graphic form. But i wanted to display BOTH the
text & graphic.

Here's some sample code
Text
:setCell(1, "Name",,.T.)

Icon
:setCell(1,Icon-ArrowDn,XBPCOL_TYPE_ICON,.T.)

Regards
Peter AlderliestenRe: xbpcolumn heading
on Fri, 01 Jun 2018 13:38:32 +0200
Paul,

> Thank you for the headup. However, the help file stated the object can only
> display data in textual OR graphic form. But i wanted to display BOTH the
> text & graphic.

That is true, but only for the standard drawing mode.
If you switch to custom drawing you can place whatever you want on your
header, footer and cells. See screen print attached.

Peter


screen.png
Andreas Gehrs-Pahl
Re: xbpcolumn heading
on Fri, 01 Jun 2018 07:48:32 -0400
Paul,

You could create derived classes from XbpColumn as well as XbpCellGroup, 
add an additional instance variable for the second (Icon) caption and use 
Owner-Drawing to display both captions (text and icon) on the :Heading 
(XbpCellGroup).

There might be some examples for this floating around on these newsgroups, 
and if so, they are probably from J.A. Diego Kerejeta.

Hope that helps,

BTW: I'm available for software development as well as tutoring/coaching, 
if you need additional help.

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC
Jim LeeRe: xbpcolumn heading
on Fri, 01 Jun 2018 19:16:19 +0200
>  wanted to add a triangle ico to show that xbpcolumn is the control index 
> after the user click on the heading.

this Icon is visual Style and used e.g. to show sort order.
Alaska use "Explorer" as Style ... but Explorer like Desktop is Listview so 
try Listview Style.

---

other Way is to use Ownerdraw ( Alaska Customdraw ) to paint Icon & Text in 
Header/Data/Footer
Jim LeeRe: xbpcolumn heading
on Sat, 02 Jun 2018 06:34:26 +0200
i have to correct myself about visual Style which is not "Explorer", it is 
"Header" for xbpcolumn heading
neverless just change visual Style to e.g. styleClass := "COMBOBOX" work but 
Arror can not adjust left/right 

---

this is how Windows Listvie work

METHOD DXE_ListView:ShowIconSort()
LOCAL nRet := 0
LOCAL columnHeader := ::lv_GetHeader()
LOCAL oHDITEM  := HDITEM():New()

   oHDITEM:mask := HDI_FORMAT
   @User32:SendMessageA(columnHeader, HDM_GETITEM, ::nSubScript-1, oHDITEM )
   oHDITEM:fmt := nor(oHDITEM:fmt,HDF_LEFT ,HDF_BITMAP_ON_RIGHT )
   IF ::SortOrder == LVS_SORTASCENDING
      oHDITEM:fmt := nor(oHDITEM,HDF_SORTUP)
      oHDITEM:hbm := ::aHeaderIcon[1]
   ELSE
      oHDITEM:fmt := nor(oHDITEM,HDF_SORTDOWN)
      oHDITEM:hbm := ::aHeaderIcon[2]
   ENDIF
   @User32:SendMessageA(columnHeader, HDM_SETITEM, ::nSubScript-1, oHDITEM )

RETURN NIL

---

in Xbase++

METHOD XbpBrowseT:customDrawCell( oPs, aInfo )

    Header-, Data-, Footer-Area
   
   oArea := aInfo[ XBP_DRAWINFO_AREA   ]

    v1.9.355 NEED Hotfix >= 22 "XppUi1.dll"
   
   IF BAND( aInfo[ XBP_DRAWINFO_ACTION ], XBP_DRAWACTION_DRAWFRAME ) != 0

       only for  XBP_DRAW_OWNERADVANCED
      
      IF oArea:styleClass = "Header"
         RETURN .T.                  .T. mean System control paint
      ELSE
      ENDIF
   ENDIF

    this will Draw visual Style or Background Color
   
   IF BAND( aInfo[ XBP_DRAWINFO_ACTION ], XBP_DRAWACTION_DRAWBG    ) != 0

       only for  XBP_DRAW_OWNERADVANCED
      
      IF oArea:styleClass = "Header"
          draw visual Style with GraBackground()
         
         GraBackground( oPS, { nXDest, nYDest }, { nWidth, nHeight } )
         RETURN .F.
      ELSE
      ENDIF
   ENDIF

    Cell Text Forground Color
   
   IF BAND( aInfo[ XBP_DRAWINFO_ACTION ], XBP_DRAWACTION_DRAWFG    ) != 0

       also for XBP_DRAW_OWNER
      
      IF oArea:styleClass = "Header"
      ELSE
      ENDIF
   ENDIF

    check column State
   
   IF BAND( aInfo[ XBP_DRAWINFO_STATE ], XBP_DRAWSTATE_SELECTED ) != 0
      IF oArea:styleClass = "Header"
        ::oMarkOn:draw( oPS, { nXDest, nYDest, nWidth, nHeight} )
      ELSE
      ENDIF
   ELSE
      IF oArea:styleClass = "Header"
        ::oMarkOff:draw( oPS, { nXDest, nYDest, nWidth, nHeight} )
      ELSE
      ENDIF
   ENDIF

RETURN .F.
Paul ChongRe: xbpcolumn heading
on Mon, 04 Jun 2018 18:05:48 +0800
Thank you guys for all your suggestion. I am not a ownerdraw guru but i am 
getting help from Diego now.


On Fri, 1 Jun 2018 04:00:57 +0800, Paul Chong wrote:

> Hi all,
> 
> I like to know if a xbpcolumn heading can use both text & ico? I wanted to
> add a triangle ico to show that xbpcolumn is the control index after the
> user click on the heading.
> 
> Thanks