Page 1 of 1

TOOLTIP - CAN IT BE A BROWSE DIALOG ?

Posted: Wed Apr 02, 2014 3:32 am
by unixkd
Hi All

I would like to make my Tooltip text to be a browse dialog ?

Joe

Re: TOOLTIP - CAN IT BE A BROWSE DIALOG ?

Posted: Wed Apr 02, 2014 7:16 am
by rdonnay
Is the browse a database or an array?

Re: TOOLTIP - CAN IT BE A BROWSE DIALOG ?

Posted: Wed Apr 02, 2014 8:07 am
by rdonnay
The tooltip system wasn't designed for this, but I threw together a little program to give you some ideas.
I don't guarantee that this will work the way you want it to.

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], cFileName := Space(30), oGet

@ 0,0 DCSAY 'Enter File Name' GET cFileName ;
      GETOBJECT oGet ;
      GETTOOLTIP {||ShowDialog(oGet,@cFileName,GetList)} ;
      SAYSIZE 0

DCREAD GUI FIT TITLE 'Drag Enter' SETAPPWINDOW

RETURN nil

PROC appsys ; return


STATIC FUNCTION ShowDialog(oGet,cFileName,aGetList)

LOCAL GetList[0], GetOptions, oBrowse, aDir, nPointer := 1

aDir := Directory()

@ 0,0 DCBROWSE oBrowse DATA aDir SIZE 20,10 FIT ;
      POINTER nPointer ;
      ITEMSELECTED {||cFileName := Pad(aDir[nPointer,1],30), ;
                      DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}

DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 20 PARENT oBrowse

DCGETOPTIONS ORIGIN XBPDLG_ORIGIN_MOUSE

DCREAD GUI FIT TITLE 'Directory' MODAL OPTIONS GetOptions

DC_GetRefresh(aGetList)

RETURN ''

Re: TOOLTIP - CAN IT BE A BROWSE DIALOG ?

Posted: Wed Apr 02, 2014 10:54 am
by unixkd
Many thanks Roger,

Your sample really gave me a direction towards what I want, I will spend some time modifying it to see how far I can go. One of the strength of Xbase++ is doing something near impossibility. I really want to anchor this tooltip to the TIPBLOCK of BROWSE

Once more Accept my many thanks.

Joe