Tooltip is DCBROWSECOL

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 116
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Tooltip is DCBROWSECOL

#1 Post by jdsoft »

Hello,

I do not get tooltips in DCBROWSECOL.
What is my mistake?

Regards,
Jack Duijf

Code: Select all

#include "dcdialog.ch"
#pragma Library("dclipx.lib")

PROCEDURE MAIN

LOCAL GetList        := {}
LOCAL aData          := {}
LOCAL GetOptions     := {}
LOCAL oBrowse        := nil
LOCAL oBox           := oBox
LOCAL n              := 0
LOCAL nType          := 1

Aadd(aData,{1,"Item 1","Type 1",1})
Aadd(aData,{2,"Item 2","Type 2",2})
Aadd(aData,{3,"Item 3","Type 1",1})
Aadd(aData,{4,"Item 4","Type 2",2})
Aadd(aData,{5,"Item 5","Type 1",1})
Aadd(aData,{6,"Item 6","Type 2",2})
Aadd(aData,{7,"Item 7","Type 1",1})
Aadd(aData,{8,"Item 8","Type 2",2})
Aadd(aData,{9,"Item 9","Type 1",1})

@ 0,0    DCGROUP oBox SIZE 30,3 CAPTION "Show"
@ 1,1    DCRADIOBUTTON nType  PROMPT "Type 1" VALUE 1  PARENT oBox ACTION {||oBrowse:GoTop(),oBrowse:Refresh()}
@ 1,15   DCRADIOBUTTON nType  PROMPT "Type 2" VALUE 2  PARENT oBox ACTION {||oBrowse:GoTop(),oBrowse:Refresh()}
DCSETPARENT TO

@ 4,2    DCBROWSE oBrowse DATA aData SIZE 100,15  NOHSCROLL  ;
         PRESENTATION DC_BrowPres() ;
         ITEMSELECTED {||MsgBox(aData[n,2] + " selected.")} ;
         FIT POINTER n ;

DCBROWSECOL ELEMENT 1 HEADER "Id"    WIDTH  3 PARENT oBrowse   TOOLTIP "Id"
DCBROWSECOL ELEMENT 2 HEADER "Name"  WIDTH 15 PARENT oBrowse   TOOLTIP "Name"
DCBROWSECOL ELEMENT 3 HEADER "Type"  WIDTH 15 PARENT oBrowse ;
         COLOR {||iif(n = 5,{GRA_CLR_YELLOW,GRA_CLR_RED},{GRA_CLR_RED,GRA_CLR_YELLOW}) }


DCGETOPTIONS AUTORESIZE

DCREAD GUI FIT ADDBUTTONS MODAL ;
     OPTIONS GetOptions ;
     TITLE 'How to filter elements in a array?'
Return

Regards,
Jack Duijf

skiman
Posts: 1195
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tooltip is DCBROWSECOL

#2 Post by skiman »

Hi Jack,

You need to use the DATATOOLTIP and TIPBLOCK.

DCBROWSECOL ELEMENT 1 HEADER "Id" WIDTH 3 PARENT oBrowse DATATOOLTIP {|| .T. } TIPBLOCK {|| "Id" }
Best regards,

Chris.
www.aboservice.be

User avatar
jdsoft
Posts: 116
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Tooltip is DCBROWSECOL

#3 Post by jdsoft »

Hello Chris,

Thanks, changed now to:

DATATOOLTIP {||TRUE} TIPBLOCK {|nRow|Show_Tooltip(oBrowse,nRow,nCol}

Al works as expected now.

Jack
Regards,
Jack Duijf

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

Re: Tooltip is DCBROWSECOL

#4 Post by Tom »

If using DATATOOLTIPs when browsing databases - be careful. The datatooltip mechanism moves database pointers. Open the table twice if you need tooltips on the data level in this situation.
Best regards,
Tom

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

Post Reply