Enabling the Navigation Services default behavior in its dialogs

Q: Drag and dropping a file or folder in my Navigation Services dialog does not change the location but this action works in other application. How can I make this working in my application as well?

A: What you need is a non-NULL eventProc when you call any of the Navigation Services dialogs creation or execution. Even an eventProc which does nothing is fine. That way, the Navigation Services code has a chance to add its default behavior event processing to yours (which does nothing), else, if your eventProc is NULL, the Navigation Services does not try to add his default behavior, assuming you don't want any behavior at all. And the default behavior event processing is, of course, the one which handles the drag and drop to change the location.

You can use the following eventProc shown in Listing 1:

Listing 1: An empty event Proc.

pascal void myDoNothingEventProc(NavEventCallbackMessage callBackSelector,
      NavCBRecPtr callBackParms, void * callBackUD)
    {
    }

And you can specify this eventProc with the following Listing 2:

Listing 2: Using the empty event Proc.

NavEventUPP myDoNothingEventProcUPP = NewNavEventUPP(myDoNothingEventProc);

err = NavCreatePutFileDialog(
      &navOptions,
      kmyApplicationSignature,
      kmyFileType,
      myDoNothingEventProcUPP,
      clientData,
      &navDialog
      );

DisposeNavEventUPP(myDoNothingEventProcUPP);

In the previous Listing 2, any of the other Navigation Services APIs such as NavPutFile, NavGetFile, NavCreateChooseFileDialog, etc could have been used as well.

Document Revision History

DateNotes
2004-10-15Explains how to enable the default behavior of the Navigation Services dialogs.

Posted: 2004-10-15


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.