HOW TO GET BROWSE COLUMN HEADING AT RUNTIME ?

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

HOW TO GET BROWSE COLUMN HEADING AT RUNTIME ?

#1 Post by unixkd »

#include "dcdialog.ch"

FUNCTION MyBrowse()

LOCAL GetList[0], GetOptions, oBrowse
LOCAL aDir := Directory()

@ 0, 0 DCBROWSE oBrowse DATA aDir SIZE 20,10 FIT

DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 10 PARENT oBrowse
DCBROWSECOL ELEMENT 2 HEADER 'File Size' WIDTH 11 PARENT oBrowse
DCBROWSECOL ELEMENT 3 HEADER 'File Date' WIDTH 12 PARENT oBrowse
DCBROWSECOL ELEMENT 4 HEADER 'File Time' WIDTH 13 PARENT oBrowse

DCREAD GUI FIT TITLE 'Zebra Colors on Browse'

RETURN nil
*
In the sample program above:

1. How can I retrieve the Column Headers i.e. 'File Name', 'File Size' from the oBrowse object at runtime ?
2. How can I retrieve the Column Width i.e. 10, 11, 12, 13 from the oBrowse object at runtime ?

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: HOW TO GET BROWSE COLUMN HEADING AT RUNTIME ?

#2 Post by Tom »

oBrowse:GetColumn(nColNo):Heading:GetCell(1) -> Column header

oBrowse:GetColumn(nColNo):CurrentSize()[1] -> Column width (in pixel)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: HOW TO GET BROWSE COLUMN HEADING AT RUNTIME ?

#3 Post by unixkd »

Thanks tom

Now concerning the column with that returns PIXEL, which function can I use to convert PIXEL to DECIMAL ?

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: HOW TO GET BROWSE COLUMN HEADING AT RUNTIME ?

#4 Post by Tom »

Multiplication. 8-)

By default, a "column" has 7 pixel, a "line" has 20 - in eXpress++. As long as you didn't change this in your app.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply