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 

Some suggestions for future enhancements to Clearwin+
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
LitusSaxonicum



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

PostPosted: Fri Aug 09, 2013 7:34 pm    Post subject: Reply with quote

Hi Dan,

In a manner of speaking, the alignment of some controls is at their bottom, because the coordinates are measured down from the top, so the top is really the bottom !

This coordinate system drives me mad, especially in graphics.

May I commend to you the %rp and %`rp format codes (together with %ap and %`ap, if you have to)? It is always worth working out what the Windows average character size is by displaying the grid with %gd. You can count the pixels by doing a screen grab, and pasting into the Paint application, then zooming. An alternative is to invest in "Ruler by George" which gives you an onscreen pixel-calibrated ruler for measuring such things. This is usable as freeware, but to nag you to buy it the markings gradually fade away. (You can refresh them, but they stay visible if you spend the $17).

I can't help with the crashes, sorry.

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



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Fri Aug 09, 2013 8:37 pm    Post subject: Reply with quote

Eddie,
Tried your stretchy box application and have made a few mods to allow any backgound colour and used "RGB_COLOURS" option in the %GR.
Ian

Code:
      WINAPP
      OPTIONS (INTL, DREAL)
      PROGRAM WILFRIED
C     ----------------
      COMMON /BOXCORNERS/ iX1, iX2, iY1, iY2, NCURS
      COMMON /PICKUP/ MOVING, NODE
      common /draw_mode/iback_colour,idraw_colour,idraw_xor,iwid,ihgt
      INCLUDE <WINDOWS.INS>
      INTEGER, EXTERNAL :: KALLBACK
      INTEGER, EXTERNAL :: iBOXPLOT
      INTEGER, EXTERNAL :: klear_screen
      iX1 = 100;  iX2 = 300;  iY1 = 100;  iY2 = 300
      NCURS  = 1
      MOVING = 0;  NODE = 0
      iback_colour = rgb@(255,200,200)
      idraw_colour = rgb@(  0,  0,255)
      idraw_xor    = xor(iback_colour,idraw_colour)
      iwid = 400 ; ihgt = 380
      IA=WINIO@('%ca[Test for stretchy box]&')
      IA=WINIO@('%sc&', '+', klear_screen, iBOXPLOT)
      IA=WINIO@('%5cu[arrow][updown][leftright][diag1][diag2]&', NCURS)
      IA=WINIO@('%`^gr[WHITE, full_mouse_input, rgb_colours]',
     &           iwid, ihgt, iHANDLE,
     &           KALLBACK)
      STOP;   END
      INTEGER FUNCTION KALLBACK()
C     ---------------------------
      COMMON /BOXCORNERS/ iX1, iX2, iY1, iY2, NCURS
      COMMON /PICKUP/ MOVING, NODE
      KALLBACK = 1
      iSENSITIVE = 8

      iXA = (iX1+iX2)/2
      iYA = (iY1+iY2)/2
      CALL GET_MOUSE_INFO@ (jX, jY, jFLAGS)
      IF (NODE .NE. 0 .AND. MOVING .EQ. 1) GO TO 100
      NODE = 0
      IF (ABS(iX1-jX) .LE. iSENSITIVE) THEN
          IF(ABS(iY1-jY) .LE. iSENSITIVE) THEN
             NCURS = 4
             NODE  = 1
             MOVING = 1
          ELSE IF(ABS(iY2-jY) .LE. iSENSITIVE) THEN
             NCURS = 5
             NODE  = 7
             MOVING = 1
          ELSE IF(ABS(iYA-jY) .LE. iSENSITIVE) THEN
             NCURS = 3
             NODE  = 8
             MOVING = 1
          ENDIF
      ELSE IF (ABS(iX2-jX) .LE. iSENSITIVE) THEN
          IF(ABS(iY1-jY) .LE. iSENSITIVE) THEN
             NCURS = 5
             NODE  = 3
             MOVING = 1
          ELSE IF(ABS(iY2-jY) .LE. iSENSITIVE) THEN
             NCURS = 4
             NODE  = 5
             MOVING = 1
          ELSE IF(ABS(iYA-jY) .LE. iSENSITIVE) THEN
             NCURS = 3
             NODE  = 4
             MOVING = 1
          ENDIF
      ELSE IF (ABS(iXA-jX) .LE. iSENSITIVE) THEN
          IF(ABS(iY1-jY) .LE. iSENSITIVE) THEN
             NCURS = 2
             NODE  = 2
             MOVING = 1
          ELSE IF(ABS(iY2-jY) .LE. iSENSITIVE) THEN
             NCURS = 2
             NODE  = 6
             MOVING = 1
          ENDIF
      ELSE
          NCURS = 1
          MOVING = 0
      ENDIF

      IF (NODE .EQ. 0) RETURN

  100 CONTINUE
      IF (jFLAGS .EQ. 1) THEN
         IK = iBOXPLOT()
         IF (NODE .GE. 1 .AND. NODE .LE. 3) THEN
             iY1 = jY
         ELSE IF (NODE .GE. 5 .AND. NODE .LE. 7) THEN
             iY2 = jY
         ENDIF
         IF (NODE .GE. 3 .AND. NODE .LE. 5) THEN
             iX2 = jX
         ELSE IF (NODE .EQ. 1 .OR. NODE .GE. 7) THEN
             iX1 = jX
         ENDIF
         IK = iBOXPLOT()
         ELSE
         MOVING = 0       
         ENDIF     
      RETURN;  END
continued
Back to top
View user's profile Send private message Send e-mail
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Fri Aug 09, 2013 8:39 pm    Post subject: Reply with quote

Code:

      INTEGER FUNCTION iBOXPLOT()
C     ---------------------------
      COMMON /BOXCORNERS/ iX1, iX2, iY1, iY2, NCURS
      common /draw_mode/iback_colour,idraw_colour,idraw_xor,iwid,ihgt
      INCLUDE <WINDOWS.INS>
      iBOXPLOT = 1
      CALL GRAPHICS_WRITE_MODE@ (3)
      iXA = (iX1+iX2)/2
      iYA = (iY1+iY2)/2
      CALL DRAW_RECTANGLE@ (iX1, iY1, iX2, iY2, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iX1, iY1, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iX1, iY2, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iX2, iY1, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iX2, iY2, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iXA, iY1, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iXA, iY2, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iX1, iYA, 4, 4, idraw_xor)
      CALL DRAW_FILLED_ELLIPSE@(iX2, iYA, 4, 4, idraw_xor)
      RETURN
      END
      integer function klear_screen()
      common /draw_mode/iback_colour,idraw_colour,idraw_xor,iwid,ihgt
      INCLUDE <WINDOWS.INS>
c clear screen to chosen background colour
      call DRAW_FILLED_RECTANGLE@(0,0,iwid-1,ihgt-1,iback_colour)
      klear_screen = 1
      end

      RESOURCES
      1 24 default.manifest
      arrow       CURSOR    "SmoothArrow.cur"
      updown      CURSOR    "SmoothVerticalSize.cur"   
      leftright   CURSOR    "SmoothHorizontalSize.cur"
      diag1       CURSOR    "SmoothDiagonal1.cur"
      diag2       CURSOR    "SmoothDiagonal2.cur"
     
Back to top
View user's profile Send private message Send e-mail
LitusSaxonicum



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

PostPosted: Fri Aug 09, 2013 9:04 pm    Post subject: Reply with quote

Hi Ian,

I saw that you were on the forum. Let's hope that Wilfried takes something away from this: being able to do things in a %gr or %dw workspace is sometimes a matter of knowing a single trick. I hadn't mastered XOR in colour - it always worked on my Apricot with Green on Black without too much thinking about, and I hadn't used it since. I forgot to USE_RGB_COLOURS. Thanks for your input.

I think that my graphics callbacks are the longest and most complicated procedures I ever write.

An update to %lv - which is a matter of mutual interest - is still on my list.

Regards

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



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

PostPosted: Fri Aug 09, 2013 11:15 pm    Post subject: Reply with quote

I thought the problem of "dancing controls" is pretty obvious, i wrote many time about it.

Look at two first pics with GUI fragments again. First provided as is and in the second i placed red lines along to tops. Natural writing is aligned on the bottom as you can see from my words you read now.

Third pic shows misalignment of subscript and superscripts (guess, which subscripts are in the first black box? They were photoshopped below in the box - here is how they should look).

Two next ones marked in magenta show vertical spacing is different for radiobuttons versus %rd/rf making ugly congestions of lines with radiobuttons. All that were published here and is hidden somewhere in the forum messages

Magnify them to full screen. The controls alignment in the line on the common top and vertical spacing is very unnatural and sometimes looks really ugly, like a mess. What %ap %rp, that painful manual procedure is useful for correcting 1-2 controls, not each and every of them. If contols were visually mouse movable even then this would be a hell







Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Aug 10, 2013 7:31 am    Post subject: Reply with quote

Eddie

Something must have gone wrong with my build and upload so I have done it again.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Sat Aug 10, 2013 7:41 am    Post subject: Reply with quote

Dan

I will make an note of the problem with the superscript alignment.

As a general rule, it is very difficult to fix alignment problems because, any changes that we make will probably break some existing code.

Sometimes one thinks that it might be easier to start again but we haven't got there yet!
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Sat Aug 10, 2013 12:40 pm    Post subject: Reply with quote

Dan,

Every time I read one of your posts I learn something.

I am very aware of the problem of superscripts and subscripts, as these even catch me out in graphics programs like CorelDraw, Powerpoint and even MS Word, so I expect that Paul will struggle to improve things greatly in Clearwin+.

As far as positioning is concerned, you may find %rp and %ap (and I forgot %dy) to be horrible to use, but that is what they are there for. Some of the spacing issues may well be due to choices made at Salford/Silverfrost, but some are surely embedded in the design of Windows itself.

When I look at your examples, I am immediately struck by the complexity of the layouts that you have designed. I usually try to design things to work on a tiny netbook with an 800x600 screen, but equally, they have to work on monsters with 1920x1080 or bigger. If your default is bigger, you can space your controls out more, and this reduces the visual alignment problem. Sometimes you could solve the problem even with Clearwin's layout arrangements. For example, your image containing the text "Set # of CPUs to use" etc. You have imposed the spacing of the %rd box containing 8 on the spacing of the %rb buttons. Apart from the fact that these are not ganged, and therefore the check box %`rb is preferred in the Windows UX guidelines, you could have taken this radio button out of the list and put it in an invisible box perhaps over on the right with the "Set #..." text and selector.

I might have written it like this:
Code:
write(NUMBER, '(I1)') Number_of_CPUs
IA=WINIO@('# of CPUs to use out of '//NUMBER//' total&')


There is nothing to stop you changing the font size before using the %rd box, as that also affects alignment, and change it back afterwards.

For the more complex things like Greek and math symbols, sometimes it is better to draw them as a bitmap, and incorporate that.

If you let your radio buttons take their text after the symbol, the irregular spacing as in your lower example is very much less obvious. In this example, you could make great use of named boxes to divide things up, and you have space to put the radio buttons in a column on the left with the numeric values in a column on the right e.g.

Code:
      WINAPP
      OPTIONS (INTL, DREAL)
      PROGRAM DAN_DEMO
      INCLUDE <WINDOWS.INS>
      iCentred = 0;  iDebug = 0; 
      iPhone = 1;    i911 = 0;
      iGeom1 = 1;    iGeom2 = 0;   iGeom3 = 0;
      Geom_Factor1 = 0.0
      Geom_Factor2 = 0.0
      Geom_Factor3 = 0.0

      IA=WINIO@('%ca[End of Universe calculation?]&')
      IA=WINIO@('%ob[named_l][One line]%nl&')
      IA=WINIO@('%ob[invisible]%`rb[Slice centred]%2nl%`rb[Debug?]&',
     &           iCentred, iDebug)
      IA=WINIO@('%2ga&', iPhone, i911)
      IA=WINIO@('%3nl%rb[Phone Dan]%2nl%rb[Phone 911]&',
     &           iPhone, i911)
      IA=WINIO@('%cb%ta%ob[invisible]&')
      IA=WINIO@('%`rb[Use Geom Factor 1:]    Geom Factor value 1 &',
     &           iGeom1)
      IA=WINIO@('%~rf[initially_blank]&', Geom_Factor, iGeom)
      IA=WINIO@('%2nl%`rb[Use Geom Factor 2:]    Geom Factor value 2 &',
     &           iGeom2)
      IA=WINIO@('%~rf[initially_blank]&', Geom_Factor, iGeom)
      IA=WINIO@('%2nl%`rb[Use Geom Factor 3:]    Geom Factor value 3 &',
     &           iGeom3)
      IA=WINIO@('%~rf[initially_blank]&', Geom_Factor, iGeom)
      IA=WINIO@('%cb%ff%nl%rj%6`tt[Apply]%tt[Cancel]%cb')
      STOP;  END
      RESOURCES
      1  24  default.manifest


It only matters that the vertical spacing is regular. Named boxes allow you to avoid putting the same text (
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Sat Aug 10, 2013 12:56 pm    Post subject: Reply with quote

Eddie,

thank you very much! Just now I saw your code. I'll test and play with it next week, and will try to integrate this in my code.

Best regards - Wilfried
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sat Aug 10, 2013 1:02 pm    Post subject: Reply with quote

Dan,

I fell foul of the length problem!

Named boxes allow you to avoid putting the same text ("One line" in this case).

If you forget about alignment in the whole window (dialog), but divide the controls into boxes, and enforce spacing and alignment only in the boxes, it works better. The more spacing you have, the less the vertical alignment matters.

I hope this is some help.

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



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

PostPosted: Sat Aug 10, 2013 1:20 pm    Post subject: Reply with quote

Hi Wilfried,

The callback to any %gr or %dw area is likely to become huge. Mine tend to be divided up into subroutines. The first thing I do is to get the callback reason and the mouse position. Then I decide what to do. For some things (like a resize) I can forget the mouse position and just get on with resizing the window.

I also have a set of flags (F1) for each possible action in the region, and a set of flags (F0) for actions that have a beginning and end. The flags are set via the buttons in a toolbar/toolbox.

If an F0 flag is set, then I look to see if I am completing or continuing a particular action or cancelling it. I go through the F0 flags in the order from most likely to least likely. If it isn't one of those things, I do the same with F1 flags, again in the most likely to least likely order - to see if something is being started or if something can be done in response to a particular mouse event. The %gr callback routine only decides what to do: actually doing it is in a different subroutine for each action so that my brain can keep track.

My stretchy box example omitted the code for creating the rectangle in the first instance. Although I am very wary of full_mouse_interrupts (FMI) you probably can't do such activities without them.

It wouldn't take much more effort to make the stretchy box a "bounding box" to some other figure, like an ellipse, and to stretch that at the same time. The final event would then be to hide the bounding box - which is just a matter of redrawing it one last time in XOR mode.

I am afraid that my code is rather "pedestrian" by the standards of real computer scientists ....

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



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

PostPosted: Sat Aug 10, 2013 2:36 pm    Post subject: Reply with quote

Paul,

Ever since I read "The Monkey's Paw", I have been cautious about what I wished for. I knew that rounded corners for Clearwin+ boxes would be troublesome, and sure enough, there are lots of traps in this!

In the example I showed, there were 3 named boxes. As square-cornered, they work with %sy[3D_thin], but when [rounded] they do not (for obvious reasons, clearly stated in the ENH file). However, the numerals for degrees, minutes, seconds in the second named box (“Results”) are placed in %`rd boxes, and when %sy[3D_thin] is removed, the outline round the %`rd boxes goes with it, causing a vertical “Dan alignment” problem that I had not foreseen. I could not get the boxes back even with %co[data_border]. However, vertical alignment of whole lines is a simple enough problem to deal with , but what I could find no way of dealing with was that the numbers for degrees, minutes and seconds were left-aligned within those now invisible %`rd data boxes, and so the relevance of the degrees, minutes and seconds symbols was lost: it appeared like this:

Code:
0      °0  ‘0   “  instead of   0°  0’  0”


The latter would have been clearer even with data boxes, but I was unable to right-justify the numbers, and it does matter more when the data boxes aren’t there. Once again, the problem isn’t insuperable, and knowing that it exists, I could convert the whole sequence to a string and output that – but it was an unexpected consequence.

The third named box (“Criticism”) is actually placed within an invisible box, in order to secure the proper alignment for the credits. As [rounded] operates on the outermost box (even when specified as applying to the inner, named, box), it obligingly gave me four visible rounded corners for the invisible box, but left the named box with square corners!

Curioser and curioser, when the program was minimised to the taskbar and then restored (Windows 7 64-bit), all trace of the rounded corners had gone – they were back to square, and the invisible box was completely invisible again!

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



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

PostPosted: Sun Aug 11, 2013 7:52 pm    Post subject: Reply with quote

Eddie,

Let me say something in general, i always say here ones in a while, this time may be in a bit different way. With CWP we all learn from each other much more intensively then from, say, general Fortran part of the forum or any other, because we all have the same goal and subject while there we have very many ones not crossing our experience or not giving us large benefits. Due to that doubling amount of users will super-linearly intensity of interest. Hence CWP could be great catalyst of using of this compiler in the manner resembling the chain reaction, the more users -> the more WOW feedbacks -> the more users, or kind of exponentially. It just needs initial seed, the active promotion of it BY US, USERS, in all related sites. Should i say how this will be beneficial for all of us? The number of advanced options, speed of development, improvement, bug fixes etc of this compiler will dramatically increase because developers' pay will increase exponentially (while with all other compilers linearly and there are no incentives in all other compilers to grow their users base).
CWP right now is just in its child's pants. Being further developed it has the potential to change Fortran and programming dramatically when we will not do coding but assemble code visually out of lego blocks of created libraries using often just the mouse.


Last edited by DanRRight on Mon Aug 12, 2013 11:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Aug 11, 2013 8:45 pm    Post subject: Reply with quote

Hi Dan,

You are spot on: Clearwin is a different trick from Fortran, as it contains aesthetics as well as programming. This section of the forum interests me most, partly because I don't care much for modern constructs - I'm an old dog, and they are new tricks - and often I simply don't understand what the person who posts is actually doing, or why they want to do it! I normally understand what people want to do in Clearwin - even if I don't know how to do it, and learn from others.

I always encourage folk to try the PE and to buy a licence. Without purchasers, FTN95 and Clearwin are dead in the water.

I know that you like skeuomorphic design, but the new paradigm in Windows 8 Metro has the potential to be a lot more suited to Clearwin+, and this may encourage some take-up. The problem is that most Fortran oldies haven't really understood the whole business of how Windows applications look and feel. I'm only just getting there, and I remember going to the launch of Clearwin back in 1992 (I think)!

I have a feeling that this thread is becoming overloaded with multiple sub-topics, don't you?

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Aug 12, 2013 1:08 pm    Post subject: Reply with quote

I have had another go at %ob[rounded].
Please test today's beta upload.

p.s. A box can now be both rounded and scored.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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