DC_Dot suggestion

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

DC_Dot suggestion

#1 Post by Tom »

DC_Dot called via hotkey inside an app is extremely useful, especially for debugging. But whenever I want to access the objects on the dialog calling DC_Dot, I have to make at least one of those PRIVATE (in most cases the dialog itself - but I don't want to do this). Would it be possible to have the dialog object calling DC_Dot somewhere as a var or as the result of a function? All other objects can be accessed via the ChildList()-method, so having the dialog object itself would do the job.
Best regards,
Tom

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

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_Dot suggestion

#2 Post by rdonnay »

That is a reasonable request and a good idea.
This will be in build 255. Here's what you need to do to add this to your code.
There will be a new Get-Set function that will be used to store pointers to an array of information.
At the dot-prompt you will use the function DC_DotVar() to retrieve this info.

_DCGETBX.PRG (approx. line 4547), make the following change:

Code: Select all

    ELSEIF mp1 == DC_DotHotKey(,@bDotBlock)
      DC_ClearEvents()
      Eval(bDotBlock,{oParentDlg,aGetList,oGetList})  <<<<<< new parameters
_DCGETBX.PRG (add the following function)

Code: Select all

FUNCTION DC_DotVar( oDlg )

STATIC soDlg

IF PCount() == 1
  soDlg := oDlg
ENDIF

RETURN soDlg
_DCGETBX.PRG (change the following function)

Code: Select all

FUNCTION DC_DotHotKey( nKey, bBlock )

STATIC snHotKey := xbeK_ALT_D, ;
       sbBlock := {|oDlg,o|o := DC_WaitOn('Please wait while loading DCLIP1.DLL'), ;
                     DllLoad('DCLIP1.DLL'), ;
                     DC_Impl(o), ;
                     DC_DotVar(oDlg), ;  <<<<<<<<<<< new
                     &('DC_Dot(.t.)'), ;
                     DC_DotVar(nil)}  <<<<<<<<<<< new

LOCAL nOldHotKey := snHotKey

IF Valtype(nKey) = 'N'
   snHotKey := nKey
ENDIF

bBlock := sbBlock

RETURN nOldHotKey
The eXpress train is coming - and it has more cars.

Post Reply