Silverfrost Forums

Welcome to our forums

Hello ClearWin+

6 Jan 2011 10:11 #7401

I did not answer your question about 'handle' clearly, as I don't fully understand this well myself. As a comment I find the use of 'Handle' is a bit vauge in clearwin+, as in some cases you provide a value for handle, defining the handle value, but in others you must inquire for the value of the handle then use it as a reference.

For a window handle, the best way may be to use %hw. I think you use this as you are creating the window, as 'call winio@(‘%hw&’, handle)'. It provides the handle for the current window, so hopefully the window being defined using winio@ is the current window. %lc is another winio@ option, although I'm a bit lost on the difference between %lc (last control) and %hw (current window). I think I am right in saying, get the window handle as you create the window and you can then use this handle to reference or select this window.

Cases where you provide, rather than receive a handle include 'create_graphics_region@'

I hope this helps

John

7 Jan 2011 12:15 #7403

John,

%hw gives us back the handle for an entire window. We often need this to do such things as close the window from 'outside', or to move or position it. Sizing it is another use.

%`gr also gives us a handle - to a single graphics region - that we often need to select that graphics area if we have more than one active.

%lc gives us the handle to a specific control (e.g. a button) rather than a whole window. According to FTN95.CHM, one use is to grey a button that does not have a grey control (that didn't seem all that sensible to me, as it is more complicated than having a grey control), another use is to change the text on a button.

I looked fruitlessly through several programs to see what I had used %lc for - I was sure I had used it. Eventually I discovered it in a superceded code. I had used it to change the text on a button (once). Eventually, I decided that it was unconventional and non-intuitive, and I did the same job another way.

Presumably you have to have the control before you can find its handle, and that is why the %lc comes after the format code that created it. (A guess!).

MOVE_WINDOW@ and related routines operate on controls as well as whole windows, and if you are determined, all sorts of unconventional things are possible!

Eddie

7 Jan 2011 10:08 #7407

Thanks for the very useful tipps!

I think that it might be appropriate at this stage to motivate my interest in ClearWin+. Working a lot with FEA (and the poor commercial products) one needs to prepare input files, move and convert large amounts of data and finaly evaluate the results. For this a bit of programming skills is very helpful. Since most of our numerical code is in Fortran we use several other languages for the GUI's, i.e. Fortran is a must. Now what makes Silverfrost FTN95 so attractive? With one product one gets the following:

1.) Fortran (and C/C++) compiler;

2.) Resource compiler;

3.) ClearWin+; and

4.) an IDE (Plato). Now if that is not enough - this is an excellent combination when one think about it! One product to get everthing done.

The preceding paragraph migt be theory from my side. However, the following software uses ClearWin+ and shows the capabilities, i.e. enough to prove that choosing ClearWin+ is perhaps not that wrong (there are several other sites which I am 80% sure that use ClearWin+).

a.) ROSHAZ

b.) NetDraw

I would guess that many other engineers are in a similar situation. If one could reduce the learning curve for ClearWin+ Perhaps Silverfrost can comment on this 😄

7 Jan 2011 2:52 #7411

I guess that you have seen the Introduction, Getting Started and ClearWin+ Tutorial in the help file FTN95.chm.

See Win32 Platform->ClearWin+.

There are more examples in Documents\FTN95 Examples\clearwin.

I plan to do some work on the help file but it will not be dramatic in the short term.

7 Jan 2011 5:33 #7414

Hi Paul

Thanks for your post!

The help has quite good and helpful examples, i.e. the explanation focus on a specific command.. However, it is only bits and pieces scattered in the whole help file - at least that is my experience.

What I would like to have (or my suggestion): The bits and pieces is actually good assumed one has mastered ClearWin+ to some extend. If one could expand the factoriser to include components like:

1.) resources;

2.) proper exit (incl. the %cc);

3.) simple menu and tool bar;

4.) save and load a file;

5.) print the input;

6.) etc. one has quite the basics of a real application.

I think that the effort for an experienced ClearWin+ programmer to give factoriser such a 'face-lift' will be straightforward. This will definitely speed up the learning curve for a beginner. Which such a basis it is much easier to look up the functions in the help.

Regards Jacques

8 Jan 2011 11:53 #7419

I'm using the products from Salford / Silverfrost since about 20 years, starting with FTN77 plus DBOS under DOS. My experience is that you should invest time and energy to learn step by step the various possibilities of this really powerful environment. Many solutions I simply found via 'learning by doing' or 'trial and error', and many others by discussions with and help of colleagues (or here in the forum).

I think that examples are the best way for beginners, and it might be a good idea if users could upload examples somewhere here.

Our software has the Windows 'look and feel' with all of the graphics elements like icons, buttons and so on, with several kinds of graphics (raster and vector), mouse interaction and more. All of them was realised with Clearwin+, but, of course, in some cases it was a long way until the result was as it should be. About 98% of our code is written in Fortran, the rest in C using the SCC compiler.

This is a good opportunity to thank the Salford / Silverfrost team for their excellent work during decades!

Regards - Wilfried

10 Jan 2011 4:20 #7438

I was not sure about LISA being developed with ClearWin+ - another prove that the Silverfrost developing tools (incl. ClearWin+) is very powerful.

The examples in the FTN95 directory (incl. those where fparam.exe is required) are all very useful. However, aspects like: 1.) a graceful exit; 2.) handles; and 3.) a proper installation on a client, to name only a few, are not addressed. When these things are not done properly then it will be the first (bad) experience by the end-user. No matter how good the 'actual code' might be, it has failed the important user-test.

I would not mind to prepare a small 'Getting started with Clearwin+' (from a user side) under the following conditions (I collect/test the bits and pieces provided by other users): 1.) We use the good old factoriser example; 2.) expand the menu bar to load and save user data (input); 3.) add a toolbar 4.) take care that a exit is done properly; and 5.) installation on a client using e.g. Inno Setup or NSIS

Deadline: 31.01.2011 😄

10 Jan 2011 6:28 #7442

You are welcome to do this. If you would like my comments on the finished product then please let me know.

Paul

10 Jan 2011 9:27 #7445

Jacques,

You have mentioned my software and few others as examples using ftn95 and clearwin+, so it is only fair that the list gets extended to include Lozzer's Digital Terrain Modelling software at www.dtmsoftware.com.

John

11 Jan 2011 6:04 #7455

I was not 100% sure about DTM Software but glad that the list is growing! We also use FTN95 of course, but we do not produce a (software) product - only for the number crunching in the design our products (machines). However, I would really like to introduce ClearWin+ to my colleagues. It is crazy but true - it is 'allowed' to spend hours doing something in Excel but not in Fortran!

11 Jan 2011 6:27 #7464

I finally succeeded in getting something done in ClearWin+ 😄 Using our existing numerical code it was quick in setting up this window - (getting to this is another story). The example reads a huge amount of data and then do a two-dimensional interpolation to find the parameters at the given operating point.

The coding is much easier than Matlab and by far easier to get it to run on a client machine (should it be necessary). However, beating the graphics from Matlab will be difficult (I think).

This example might be very simple. It saves time and it is brilliant to have a single tool to convert/read and evaluate the data! Some of my colleagues wil get a stroke if I tell them this is all Fortran 😃

[URL=http://img42.imageshack.us/i/bchreader.png/]http://img42.imageshack.us/img42/5866/bchreader.png[/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

11 Jan 2011 10:49 #7467

Jacques,

'However, beating the graphics from Matlab will be difficult (I think).'

with ftn95 and clearwin+you can create graphics to match any other product using GDI (%gr) or OpenGL (%og). Yes the programming may become involved but it can be achieved.

John

12 Jan 2011 8:31 #7469

Quoted from jjgermis Some of my colleagues wil get a stroke if I tell them this is all Fortran 😃

Oooh, don't tell them that, cos it's not true. And you wouldn't want to compromise your newly-acquired reputation as a user interface architect by misleading your colleagues about the nature of the tool you used, now would you? ClearWin+is tightly integrated with one particular FORTRAN compiler, but it isn't FORTRAN, and it doesn't work with other FORTRAN compilers.

But you knew that ...

12 Jan 2011 2:13 #7472

Come on, tell us how you got a printer icon along with the other 3 on the top right of the caption bar ....

Better still, add the mystical invocation:

1 24 default.manifest

to your resources, and it will look like 21st century (XP or post XP, that is the question) Windows!

Sparge: As far as the code actually written by jjgermis is concerned, isn't it all standard-conforming Fortran, even all the Clearwin+ bits? What happens with libraries and interfaces can be in any language, and since the days of FTN77 which had large parts of itself allegedly written in Fortran, the libraries and compiler code aren't Fortran anyway. Or do you have a different definition?

Isn't it possible that since Clearwin+ is just a (sophisticated?) wrapper for calls to the Windows system, it could conceivably be converted to work with just about anybody's Fortran? Before anyone replies, I don't want it that way.

Eddie

12 Jan 2011 4:31 #7477

The printer icon comes from our Hardcopy program. The top-window then automatically gets the icon. This is useful to make a screenshot for documentation.

Perhaps I should express myself in another way: Using FTN95 and ClearWin+ I have a single development environment - GUI and numerics.

How do I implement the 1 24 default.manifest in Plato?

12 Jan 2011 4:44 #7478

If it is the only resource then you can put it after the main program thus

RESOURCES 1 24 default.manifest

Otherwise add this as a new line to your existing resource script.

13 Jan 2011 5:52 #7482

When I tried this I get the following error:

H:\FTN95\Femag\BCH\src\MAIN.F90(424) : error 699 - Invalid character '2' at start of line

13 Jan 2011 8:53 #7483

You will need a recent FTN95.

Alternatively you can put the line in a separate .rc file. This can be referenced on the WINAPP line or compiled separately using SRC.exe.

13 Jan 2011 12:18 #7485

Quoted from LitusSaxonicum Or do you have a different definition? (re: what is and isn't FORTRAN)

It seems so, yes. I suppose my definition of something that might or might not be FORTRAN code would be something like 'that which is compiled without error by all bug-free FORTRAN compilers'. That the *compilers *were or were not written in FORTRAN seems to me to be irrelevant. Otherwise, you would by analogy have to say for example that a baked product made from dough is only 'bread' if it is produced in an oven that is also made out of dough :?

Libraries and interfacing to them is another matter!

I have been under the impression that code including ClearWin+ code (I confess I had only winio@ specifically in mind) would only compile without error using FTN95. However, now I come to think about it a little harder, I realise I do not know whether or not this is true. And that even if it is true, that does not mean my definition is good. I do not understand the division of labour between compiler, linker and runtime library anything like well enough.

I think I shall retreat to a purist position and say that I would define a program written in FORTRAN to be one for which the source code consists only of statements that consist only of standard FORTRAN keywords, variables, and calls to subroutines and use of functions that are also written in such source code. By which definition, I imagine they are rare beasts indeed, these days 😄

17 Jan 2011 7:47 #7510

I got some excellent tipps in this thread to get my ClearWin+ enthusiasm going. Comparing to my (little) GUI experience from Matlab and VB the philosophy is slightly different - I would say. However, for my applications just the right thing. Reaching a level of willing to try things out I can live with the scattered bits and pieces in the documentation.

There is however a few things I cannot figure out: What is the best way to print the results. The manual way that I am used to is to write the results to a file; open it with Wordpad and print.

[URL=http://img191.imageshack.us/i/cdem.png/]http://img191.imageshack.us/img191/8404/cdem.png[/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

Please login to reply.