Hi Guys,
Thanks for all the input, some very sound advice here I am learning a lot. I think the biggest problem is as people have said, design patterns are more of a guideline, and there are no concrete 'correct' ways that can cover all the different combinations of data processing that may be undertaken.
Find a Gui toolkit for your programming language, and do the tutorial, make a button, print 'hello' when you push it, draw lines at the canvas, that sort of things. It should give you enough ideas of how to scale up to a more complete gui.
If you use C++ and don't know what Gui library to use, I'd recommend Qt. They have great tutorials and good documentation.
I am using MATLAB and quite comfortable with it and programming a GUI using OOP with it. I find reading about patterns like MVC is all well and good but without a proper example or implementation I really have no idea how to apply them to my own problems. I will give an example of the kind of things I am stuck with though. I attach a screenshot of my GUI as it stands now:
So the first thing the user does is press 'Add raw data', this opens a window where they can chose 1 or multiple data files. For the purposes of this example, each data file could be an .asc file, where each .asc file has a series of x and y data points. The file names are populated in the tab 'Raw Data', and the selected file name is plotted in the graph tab 'View 1'.
The user can select 1 or multiple files in the 'Raw Data' tab and click 'Double data values' to double the y values of the data points. The files that were doubled go into the tab 'Doubled Data', and when they are clicked on, will be displayed in 'View 1'.
The purpose of the View tabs could be different ways to show the data, such as line plot, scatter plot, bar chart...
My questions:
What exactly is the MVC setup for this?
Should 'Views' depend on the List boxes, or should the List boxes depends on the 'Views'. What I mean by this is when a data set is clicked on in 'Raw Data' should it check the View tabs with a switch statement to see which to display? And if I then click on a different 'View' should it query the List Box to see which file is highlighted, and then display that? But it would need to query both the 'Raw Data' and 'Doubled Data' List boxes, to first see which is 'Active' and then select the right file...? Basically there are so many combinations of things that I am struggling to see how best to have them communicate, and this is a tiny basic GUI...
Or am I linking the GUI elements with the data too tightly?
I have more people I need to quote and ask things but do not have time for now. I will get back to it. Thanks everyone for your input.