forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

QT-Designer ... A Good Solution for GUI PRE-Design ?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Dec 05, 2015 8:48 pm    Post subject: QT-Designer ... A Good Solution for GUI PRE-Design ? Reply with quote

I was wondering if anyone has any experience in using QT-Designer as a tool for planning a GUI implementation .

I'm about to try to 'up my game' in my quest to update and integrate under one umbrella a number of old programs I've had hanging around doing nothing for a while and that means I need some kind of 'organisation' and logical documentation of what I'm doing.

Having discovered it, QT has 'jumped out' at me (well, aroused my curiosity at least) as something which might be a reasonable (and free) tool to use even though no doubt it has some limitations.

I understand of course that it's just a GUI pre-production visualisation tool, but I get the impression that it could be useful for noything other than the simplest of GUI's.

It does however imply learning yet another program, which my somewhat limited time resources may or may not allow.

Can anyone recommend it ?

Is it an easily picked-up program for the planning aspects of the GUI structure (with subsequent implementation via ClearWin+) or am I wasting my time even thinking about it ?

How does its widgets library compare with that of Clearwin+ ? (e.g. am I likely to find myself with aspects of a design impossible to be reproduced with clearWin+ ?)

... and Are there maybe even better alternatives (I'm an optimist Smile ) out there in the deep dark danky depths of the www ?
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Dec 08, 2015 10:15 pm    Post subject: Reply with quote

John,

There's no substitute for having a good idea what your program main window will look like - and you can produce that with a pencil and a pad of squared paper!

I have written several applications using Clearwin+ and nothing else, including apps developed from scratch, and others that are little more than a graphics interface and integrator that acts as a front-end to one or more Fortran programs of some antiquity. All of my efforts have a menu bar and one or more toolbars, with the rest of the client area taken up by a large %gr graphics window. This experience has convinced me that a good starting point is a main routine that calls separate subroutines for caption bar, menu bar, toolbar(s) and graphics region. There's also a subroutine to set all the window styles, fonts, etc., and another routine simply to handle startup and close down. The WINIO@ calls continue from subroutine to subroutine. So the contents of a main program routine looks like this:

Code:
      CALL CAPTION_AND_MAIN_WINDOW
      CALL START_ROUTINE
      CALL MENU_ROUTINE
      CALL BUTTON_BAR_ROUTINE
      CALL GRAPHICS_ROUTINE
      CALL SERVICE_COMMAND_LINE_ROUTINE
      CALL FINISH_ROUTINE
      IA = WINIO@('%sf')


Because I can only handle debugging a small amount of new code at any one time, when I start, some of these subroutines have very little content! As the Windows User Experience guidelines suggest no more than 11 top level menu items, but I always know what the first and last are: 'File' and 'Help'. Remember you can write callback functions that do nothing (except set the return code!) and evolve the program accordingly.

It isn't difficult to do basic layout with Clearwin+, and I doubt that any other system is much easier (if any easier) as the work is in the callbacks, not in designing the interface.

For what it's worth, my experience is not to put to much in any one WINIO@ call, and that simplifies moving things around and re-ordering them. Of course this means menu items in the menu subroutine, toolbar items in the toolbar routine and so on. Moving them around in this way doesn't introduce errors like rewriting does.

When you are producing a Windows interface for an antique program, you will almost certainly already have a routine for reading in a datafile, and this should be easy to modify into a callback for 'File| Open', and it should be easy to produce a variant of it as 'File | Save'. Along with the 'About...' Window that comes up as an item of the Help menu these give you the sense that you have made progress!

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Dec 10, 2015 9:19 am    Post subject: Reply with quote

That QT-designer works exactly how i thought Visual Clearwin is working. Never made VC to run though Sad
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Dec 10, 2015 10:04 am    Post subject: Reply with quote

For those who may not know, "Visual ClearWin" is for .NET only and uses the Microsoft Visual Studio resource editor. At the moment there is nothing like this design approach available for ClearWin+.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Thu Dec 10, 2015 11:27 am    Post subject: Reply with quote

Agreed, Paul, that there's nothing like a visual layout tool to make a layout - except my pencil and paper. The real work is fleshing out what the callbacks do, and the layout tool has nothing to offer there: that's straightforward coding in traditional (or not so traditional) style.

When you are laying out a dialog box, there isn't much to it once you've read the UX guide. Layout tools still let you make the mistakes that drive users crazy, like the wrong button being the default.

The design features that Clearwin+ lacks are various things like horizontal and vertical lines across dialog boxes (although they can be faked with %bx and %gr) and the 'ribbon' feature that appeared in MS applications some years ago. Apart from that, it's almost all there already. However, there's little doubt that the %ib button looks old-fashioned in Windows 10, whereas %tb is infinitely adjustable to suit different styles.

Eddie
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Dec 10, 2015 9:32 pm    Post subject: Reply with quote

Well, I didn't even know there was such a thing as 'Visual Clearwin' !!!
but as I've no intention of delving into .NET then that's by-the-by.

Eddie thanks for your valuable informed mutterings on the process, I appreciate once again your experience-sharing and pointing down the obvious logical path to take.
I guess what you're saying is you can do the UI programming first and then flesh it out with the 'hurdy-gurdy' code afterwards, which is surely true when you have the experience you have but for less immersed folk it's still a daunting task, the major difficulty as I see it being the anticipation of changes maybe needed in the future ! (to avoid, or at least minimise, mass re-write of GUI code).
I'm still struggling to memorise the fundamentals and pluck 'em out of the air when needed ! Smile

I tend to work visually and while the 'pencil n graph paper method is for me already an integral part of the process (the first one, and indeed extends to multiple sheets of graph paper !), I think QT might be useful and I might dip into it before ploughing on.

I guess the full 'ideal' (if there is one) procedure is simple enough :-

1. Indispensable - Pencil & Graph Paper (get a pad of it and a lever arch file !)

2a). QT (or VCwin , or other) tool for initial visualisation of a GUI concept
(everything of course depends on how quick/esy it is to use in practice for the correction of the inevitable errors, as Eddie you touched upon above)

AND/OR

2b)Initial coding of GUI with ClearWin+

3. Number-crunching code in Callbacks

4. On-going housekeeping of a certain level of documentation for all th above, hence future-proffing (to some extent) the updating in the future


Of course, there is inevitably some degree of parallelisation within steps 2 + 3 of that process.


I guess I'm being too cautious in trying to plot my route in too much detail at the beginning but once being of the type who used to rush in and then had to re-write and fudge code in the quickest possible fashion (bad habits like just duplicating code with small changes instead of creating specific functions/subroutines - usually due to the pressure of producing a resulot within schedule and with no consideration of future ease of use of the code) I'm trying to avoìd that in my old age !

Apart from the visualisation of the GUI, I'm also struggling with how best to record the logic of all GUI routines/number crunching routines interaction in a visual way, and documentation of it for future use ! My Direct-Access Memory Nodule (DAMN Smile ) i.e. the brain cell, isn't what it once was.
Basically, recording the spaghetti junction of logic which will emanate from the fundamental core program steps you list above Eddie.

A 'flowchart type' prog is the ideal of course but in my experience these are time-consuming to familiarise with/create/update.
I once searched around for an auto-flowchart generator for FORTRAN code but was unsuccessful in finding anything of practical use).

My intuition says do it in that old devil called EXCEL, mainly because I'm familiar with it , and it's 'easy' , but I just know there'll be lots of cutting and pasting once things start rolling and I'll let it slip and everything will descend into chaos as far as traceability is concerned.
I consider Excel to be a devil in disguise for all matters and indeed young users should be banned from using it for at least 2 years when they start work !), give 'em the graph paper and pencil I say Wink. The problem being a) it's fundamentally undocumentable (in a rigorous way) b) any idiot can delve into it and make changes and no-one is none the wiser !
When was the last time you saw a (physical paper) file which followed through the calculations in a spreadsheet BY HAND as a verification it produces the correct results !?
And they can't deal easily with large amounts of data either.
And don't get me onto documentation of what's in there.
These are facts ime. It's one fundamental reason why I want to re-juvenate my old FORTRAN programs to a large extent, a
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Dec 13, 2015 10:16 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
For those who may not know, "Visual ClearWin" is for .NET only and uses the Microsoft Visual Studio resource editor. At the moment there is nothing like this design approach available for ClearWin+.


My understanding is that VC though was written under NET makes the code for usual Clearwin+ since there is no specific Clearwin+ for NET. I'd use it. Generally i do not care if VC is just an executable made under NET or even some program written on Pascal or Visual Basic unless it is built using this Fortran compiler and we have source code of it to expand and modify. So...would be great to make VC using this compiler and slowly expand and add design elements to its library like a lego blocks. That eventuially will be like a higher level GUI programming tool to majke you fully ready to use prototype. You then just add the source code and expand id using regular text editors.

But what i'd think also is why Silverfrost not collaborate with this author and ask him to add this Fortran as an option (but do not forget to own its source code). That will be the Visual Clearwin+. Eventually this will go to the network with all the GUI elements directly callable from anywhere in the world.


Last edited by DanRRight on Sun Dec 13, 2015 11:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sun Dec 13, 2015 10:53 pm    Post subject: Reply with quote

Dan
I am confused by your comment. Visual Clearwin uses the existing Visual Studio .NET resource editor. The task of doing something similar for Win32/64 Clearwin+ is fundamentally more challenging.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Dec 13, 2015 11:27 pm    Post subject: Reply with quote

Paul,
Well, as i said, i was not able to make VC to work to see it despite few attempts during years and I do not know what this resource editor is specifically doing and how successful VC was at its tasks compared to any other GUI builders. I see though that the author of the tool we are discussing managed to succeed to make it for 4 different compilers and environments. Did he use this resource editor?
And again, let it uses anything, the point is to produce the Clrearwin+ source code visually using the mouse. I suppose that making an option in VC not to use specific NET extensions for the output code would be not as difficult. Actually other examples for NET work and you can easily take Clearwin code part out of them - that is what we want - we need just a visual GUI builder. We do not need VC to write the entire code which is doing the simulation using just the mouse, and that will not be possible more 30-50 years until the library of mathematical objects will be created doing most of humanly possible things automatically. But let's return to our sheeps. Let's take your examples demonstrating the NET. One of them, "Multithreading" example, uses just the LOCK/UNLOCK NET extension, but Clearwin part can be extracted and used for regular code without NET. I think i even published that here years ago
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Dec 14, 2015 11:11 am    Post subject: Reply with quote

Dan

I wrote Visual ClearWin and part of ClearWin+ so you can rest assured that to produce a visual ClearWin+ would be a significant task. In fact I made a start on this but had to put it on the back burner because of more urgent demands.

The immediate focus is on 64 bit FTN95. I know that many things seem easy from the outside but the reality can be quite different.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Dec 15, 2015 6:22 pm    Post subject: Reply with quote

I had a look at the statistics for the source code in two of my large applications to see where (if anywhere) a visual forms designer would be of use. On average about 10% of my programming is devoted to the main window, although less in a big program and more in a small one. One of my programs that is 31,000 lines long divided over 11 source code files, spends a huge amount of the total source code in just the graphics callback arena, roughly equivalent to actually doing the calculations or to reading and writing data files. About the same amount of code is dedicated to hardcopy and the remainder to lots and lots of small dialog boxes are one form or another. In the program with the graphics input, the subroutines that you could call forms (including everything to do with help) amount to about 35% of the source code, and in the program where the input is basically through data forms only, this is nearly 60%. I was slightly horrified by those two last figures, although when I investigated, the amount of Clearwin+ code is nothing like these percentages would imply.

I was able to count the number of dialog boxes because I arrange for all of them to pop up in the same place that they were last closed, and there are about 80. Most of them have less than a dozen WINIO@ function calls although the most complex one I could find had 40. I ran through both programs as one would do if using them in earnest, just to see which of the dialogue boxes were complex enough to merit using a layout program (if I had one) and there were few enough for me to feel that I had not been unfair in saying that hand coding was probably better.

I came to the conclusion that with my style of programming, explicitly writing the clearwin+ code is rarely my difficulty. The larger program has over 400 bitmaps and icons, and drawing those has been a major effort.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Wed Dec 16, 2015 3:23 am    Post subject: Reply with quote

Eddie,
I understand that and probably share your experience. But still there exist few dialogs i would prefer to be made by the VC like property sheet for example. Or the ability to change the styles for all windows in one click. Or move controls 1/4 line up or 20 pixels right. Or having specific designs for specific topics (i have the topic "Tools" for example, which consists of few dozen of windows all of different style as i was experimenting with Clearwin for almost two decades). Or numerous warning dialogs (like your POPs). There must be a used made library for them so that next time you want to create them you just chose your favorite design quickly list through existing ones visually. Currently i have such library but it is just the source codes, colorless & tasteless ASCII symbols in editor. You quickly forget where for example these or these 10 designs of the same thing differ with...

When i need quickly start new small project i want to prototype its look completely, and VC would help to make the Clearwin+ code in seconds specifically based on your previously purified designs where you just slightly modify something. Right now i really afraid to add anything new to the large code knowing that it will take days to purify Clearwin+ text and final look and feel, specifically with property sheets. All will take literally hundreds recompilations by moving buttons and radiobuttons, adjusting positions of pictures and backgrounds etc. Things are complicated by not perfect automatic positions of all controls and the text inside the lines and between the lines and these micro-movements up and down, left and right may make you literally swear and yell...

I speculate Visual Clearwin would drive new users to this compiler like no other tool.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Dec 16, 2015 9:45 am    Post subject: Reply with quote

Regarding the ease or otherwise of creating ClearWin+ dialogs, some users may find it helpful to import code fragments from the ClearWin+ clip library that is available in Plato. Go to the View menu and select "Clip library".
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Dec 16, 2015 2:59 pm    Post subject: Reply with quote

Dan, you may be right, but have you thought of having a testbed program to test out any one (or more) of your data input forms? You certainly don't have to try them out to see what they look like in a major application. As far as changing the entire style of every window in your application is concerned, I found this some years ago was best addressed by having the Clearwin+ code for styles and backgrounds and so on in a single subroutine that is called by every window. Mine is called "Set_fonts_and_styles". You can span WINIO@ calls across multiple subroutines, but you do need a return path so they need they need the SAVE attribute.
As for moving a control by a fractional line or individual pixels, then I suggest the %ap or %`ap or %rp or %`rp controls. Life is made much easier if you don't have too much going on in each WINIO@ text string, because you can just put in a positioning command with a WINIO@ call always in exactly the right position.You have to remember that Clearwin+ can layout its controls automatically for you because it works on the average character cell grid, that you can call up with %gd, and if you interfere with the automatic layout you do so at your own risk! You can find the average character cell dimensions quite easily and this is worth doing if you are contemplating manual layout.
I also found very quickly that the little 'For information' pop-up dialog boxes proliferated at an enormous rate, and I spent a bit of time writing a couple of prototypes of the form:
SUBROUTINE POP_OK (text_string)
SUBROUTINE POP_TWO_OK (text1, text2) – for two lines of text – and so on. When I actually wanted the user to make a serious considered response, I found that this boilerplating approach did not work very well, and the dialogues needed to be properly designed from the bottom up.
I never made the property sheet work for me, nor listview or branchview and these more complicated clearwin+ controls have for me an infinitely forgettable syntax.
Paul's clip library is rather basic, and just has templates for at most a single command, whereas if I understand you properly, you mean a user library of complete dialog windows.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Dec 17, 2015 7:47 am    Post subject: Reply with quote

Yea, Eddie... i remember how many times i recompiled one speciific window trying to center or position correctly by ~1/5 of the linewidth the text and controls using %ap and %rp...Hunderds. Every time something did not fit me. And every time i changed Windows things moved Smile. I gave up and killed it.

Now after two decades i know why it is not easy job to make perfect GUI. Clearwin+ still needs more users to polish it. It needs fine tuning and adjustments. Text inside the lines is positioned incorrectly (at the top of the line), buttons %tt aligned wring way too, radiobuttons %rb also positioned at the top of the line, numbers inside %rd immediately move down as soon as you use %dd in front of them, etcetcetc. Or try to do winio@('%1tl', 3) to to shift the text by 3 characters - it does not work. I have to use tricks to make the text not to jump up and down if i use many controls in the single line. And to use other tricks to make sure that the text and and controls if there in multilines are equidistant. And that hell needs million "try and see" recompilations. Still i see that this ir this window does not look good (spacing between some lines looks like 1, others 2 and in some 3 lines) and changing will take a lot of time i do not have...

That aligning work Visual Clearwin would simplified substantially i speculate (but probably not solve all the problems until internal alignment of all controls Clearwin itself - or WinAPI? - will be changed)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group