FoxPro Programming
Open source alternatives to windows dialogs that VFP uses
Gravatar is a globally recognized avatar based on your email address. Open source alternatives to windows dialogs that VFP uses
  Alejandro A Sosa
  All
  Jun 9, 2019 @ 07:59pm

Hi,

I am looking for open source alternatives to windows dialogs that VFP calls, such as file open/save, messagebox etc

TIA,

Alex

Gravatar is a globally recognized avatar based on your email address. re: Open source alternatives to windows dialogs that VFP uses
  Tore Bleken
  Alejandro A Sosa
  Jun 9, 2019 @ 10:54pm

Hi Alex,

since you want alternatives, may I ask why?

Gravatar is a globally recognized avatar based on your email address. re: Open source alternatives to windows dialogs that VFP uses
  Rick Strahl
  Alejandro A Sosa
  Jun 10, 2019 @ 12:29am

No such thing AFAIK.

In the latest release of Web Connection I added a few new functions to use Windows dialogs from .NET. The main reason is to use the modern dialogs and more importantly in order to capture proper case filenames.

Unfortunately the GetDir() dialog - which is terrible - is no better in .NET unless you use a helper open source library. The 'cleaner' interface basically use the file selection dialog with options to select folders which is much more flexible than the terrible default Windows folder selection dialog.

This library provides access to many of the modern (Windows 7+) Windows Desktop dialogs and Windows support features:

I'm using this in several of my .NET applications but you can probably call these with wwDotnetBridge or create a .NET Wrapper for specific ones you need to use and expose those as .NET functions in a helper library. That's probably what I would use. The dialogs may not be much different (except the folder dialog), but there are many more options available such as customizing labels and titles, getting multiple files, checking for valid filenames, customized file filters etc.

Tore - the FoxPro dialogs capture file names in upper case. In fact all the directory functions in FoxPro all list and capture files in UPPER case only which sucks if you need to create proper cased file names (pretty much any time you create files).

There are new functions for GetFullPath(), GetRelativePath() which return the path in proper case unlike the FoxPro counterparts.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Open source alternatives to windows dialogs that VFP uses
  Alejandro A Sosa
  Rick Strahl
  Jun 10, 2019 @ 06:31am

Thank you very much Rick.

Alex

Gravatar is a globally recognized avatar based on your email address. re: Open source alternatives to windows dialogs that VFP uses
  Alejandro A Sosa
  Rick Strahl
  Jun 10, 2019 @ 03:39pm

Rick,

Along the same lines, what .NET MessageBox function can be called with wwDotNetBridge?

Thanks a lot.

Alex

Gravatar is a globally recognized avatar based on your email address. re: Open source alternatives to windows dialogs that VFP uses
  Rick Strahl
  Alejandro A Sosa
  Jun 10, 2019 @ 03:45pm

Not sure what you're asking?

You can call the .NET Message box controls no problem. But they are no different than the standard message box you use with FoxPro.

If you want to use the enhanced dialogs (ie. Win7+ rich dialogs) then you need to use that library that I mentioned previously. I would surely wrap these dialogs into a helper because setting them up to be called requires a bit more effort than standard dialogs as there are a lot more options available on them.

What exactly are you trying to do?

If you need truly custom behavior you can build your own dialogs in .NET using whatever controls you need and modally call those from FoxPro. Modal .NET windows can be easily accessed from FoxPro. Non-modal works too but it takes more code, and has threading issues. Modal though works fine. I do this in Markdown Monster for a few dialogs which fixes a few nasty focus issues that FoxPro has.

+++ Rick ---

© 1996-2024