GUI adapter for old DOS application - user-interface

I have an old DOS application which accepts some files as input, does some calculations and saves results into file system. This app uses terminal as sort of GUI, where you can choose input files, types of calculations to perform and choose where to save the result. I don't know the logics behind calculations and am not able to reuse them in a new project.
The problem is that the users of this app want a modern looking GUI which will be easier to work with.
That is why, I have an idea to create an adapter which will translate button clicks into commands in DOS and grab text output to show in modern GUI.
Is it possible and where should I start from?

It is possible. How to start from depends on your programming Tools. If you use a RAD tool like Delphi or Lazarus or Visual Besic or ... then make your GUI design first and define Events after. For a Button click it is ButtonXClick(); In the RAD tool you will find a object inspector with properties and ther values and Events and their values. Go to Events page there, look for onClick-event. Double click there in the value line and you will get an empty Event handler, wehre you can write your Code for your application.
If you dont have or use such RAD tool, take a GUI Framework for DOS. Create your frontend and write your Code which is to call in Dependance of your button clicks.

Related

Fortran GUI: Can Dislin be used to create an event handling GUI?

I have been searching for the easiest way to integrate a GUI into my Fortran programs. So far Dislin has been the simplest to implement but it seems like it can only take some input and then pass those values to the rest of the code after the GUI closes. I cannot figure out how to get a button to call a function. Is this even possible with Dislin?
The idea is to have the user select a file or two, add some input and run the code. I specifically want a button to open a file chooser window, the dwgfil subroutine in Dislin.

Handle GUI window changes

I'm doing an automation script for installation wizards using AutoIt. I'm trying to handle window changes in some way.
Can some one explain how these GUI's work?
When I click on the Next button it looks just like the components in the GUI is beeing changed. Is this tha case? Or is a new window created and the old destroyed?
I've noticed that the process ID is the same for all windows.
I'm sure there is some way to know which "state" the GUI is in, or which step?
By the way. All the windows has the same title.
Thanks
/Anders
This will be dependant on the program you are automating.
The easiest approach would be to look at what changes in the GUI between stages, likely candidates are if there is a label that is giving instructions for that step, or a button that has text changing (e.g. if the button says "Finish" then you know your at the end).
Most installer programs have child windows for grouping the controls of each stage. These are typically implemented as dialog resources (as can be seen when using something like reshacker on them). So although the window remains the same, the panels are being created/destroyed as appropriate. This is a very neat method of doing it, for the obvious reason that you don't need to have to code to create/destroy a lot of controls. Resource created dialogs don't have nice class names like windows sometimes do though, so this may not be a reliable way to check the state.

Is there a way to parent a standard Windows dialog inside another form?

I know it's possible to take a dialog that you built yourself and parent it on another form. But is it possible to parent a standard Windows system dialog on a form that you designed?
Specifically, I'm trying to set up a form with multiple tabs that provide different ways to obtain a reference to data used by the program. One of those tabs should represent the file system, and the ideal way to do this would be with the standard Open dialog that can be instantiated with the COM identifier CLSID_FileOpenDialog.
Is there any way to take a system dialog and cause it to appear parented on another window, without the border, title bar, etc?
There are ways to use a hook, either via SetWindowsHookEx() or SetWinEventHook(), to grab a system dialog's HWND, then you can do whatever you want with it, such as call SetParent(). But just because you CAN does not mean you SHOULD. System dialogs are designed to run as their own windows, not embedded in someone else's window. A better solution might be to use the same Shell display components that are used by Windows Explorer (and system dialogs) via IShellFolder::CreateViewObject() or SHCreateShellFolderView(), or find a third-party solution that does the hard work of interacting with the Shell for you.

GUI frontend for R script

We have a set of R scripts, which process some data and produce some results. We want to make these scripts available to basic users, which are not used to commandline of R - we want to provide them some nice GUI, which would allow to:
import/export data from MS Excel/Access easily (also supporting Copy/Paste if possible)
allow user to change settings/parameters of the process
should be running in MS Windows.
Is there any simple, scripting environment which would allow to develop such nice GUI for our R scripts as fast as possible? Need not necessarily be in R language.
There is the RExcel tool that incorporates R as an Excel plugin so the main interface is Excel with R doing the computations in the background. You could set up a sheet so that the user enters their data, then highlights a box and then chooses a menu item or clicks a button and the results are placed in another cell (or set of cells). Note however, that RExcel and the comunication program it user are not free.
Another option is to create your own gui function in R, then have that gui run automatically when you start R (see ?STARTUP) and set this up on the users machine. I have done this for clients before that did not know anything about R, they just double clicked on the icon on the desktop (windows), minimized the main R window when it opened, interacted with the gui that I had programmed to run (I used tcltk, but there are others) and saw the output provided.
You can get data copied from Excel by having the user select the data and click on copy, then in your program run newdata <- read.delim('clipboard') and the data will be in the data frame called 'newdata', you can use write.table(outdata, file='clipboard', delim='\t') to put the data from data frame 'outdata' onto the clipboard and the user can then paste it into Excel (or other programs).
There is also the Rcmdr package which provides a general GUI for R (basic tools) but also has a mechanism where you can create your own menus and dialog boxes for use with the GUI.
You didn't say it had to be a desktop program. So Jeroen Ooms' hilarious openCPU project might be worth a look. He basically calls it statistical computing in the cloud. The guys has been really active recently (now that I checked the website again, I realized it's new again).
Also, his earlier work stockplot or ggplot demo is very interesting. Especially a brief look at stockplot gives you an impression quickly of his approach.
Afaik, RApache is used and the nice frontend GUI is created with EXTJS .
I think the documentation can explain the approach much better than I do.
I think R on a webserver – particularly for intranet use is a good solution (depending on the size of your company), because:
it's platform independent, clients can use their favorite browsers
local development and deployment of script and even whole R pakacges is easy
Reporting / Publishing is big strength of R and can be facilitated using a web based architecture (see packages like knitr or sweave
In this question I just come around R shiny:
http://www.rstudio.com/shiny/

Creating quick GUI front ends

I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.

Resources