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 

%PL - some issues/questions
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Sat Jun 13, 2020 2:33 pm    Post subject: Reply with quote

Thanks Ken!

I had totally false imagination about it and this was also the reason why I did not initially find my problem when I changed your original code with my F values.

So, put in another words: to have exactly the same length in the array constructor, all characters put between a pair of apostrophes '' must be counted (including commas and parenthesis) and when this does not fit, it is possible to adjust the required length with blank spaces.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Jun 14, 2020 10:52 am    Post subject: Reply with quote

Exactly.

If you don’t like having to include spaces in the strings an alternative form is:

Code:
character(len=19) :: fmt(1:2)
data (fmt(i),i=1,2) /'(SP,F10.2,1A,F11.2)','(SP,2X,A3,1X,F5.2)'/


But you loose the protection provided by the PARAMETER declaration in the earlier version.

Ken
Back to top
View user's profile Send private message Visit poster's website
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Sun Jun 14, 2020 11:41 am    Post subject: Reply with quote

Thanks Ken!

As I see, you have an unlimited flexibility! Each of your posts is for me a teaching class, thanks again!

I still would like to know, as I already mentioned earlier and recently, more or less the same question was also put by John Silver:

Is there (when using %PL command) any feasible possibility to influence where the captions for the (X,Y) axes appear (including change of their fonts and their colour)?

I found nothing in the on-line help. Namely, at present stage, as I mentioned yesterday, the captions practically touch the numbers and have the same font and colour (they blend with the graphics) and this is not good for illustrations.

Another question: I found in the on-line help the following options (for the %PL command):
[box_selection],
[line_selection],
[free_selection]

Unfortunately, there are absolutely no comments/description how to use them and what can be achieved when using them.

Do you have some descriptions about the above mentioned options?

Next question: Is there already a fix available (a new dll) for SYMBOL=12 and SYMBOL=13 options? They behave unpredictably when zooming in/out the graphics and mostly change their original graphical look to another symbol. If there is/are new DLL(s), where could I download it/them?

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


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

PostPosted: Sun Jun 14, 2020 12:10 pm    Post subject: Reply with quote

Here is a quick response to some of these questions.

1) Adjustments can be made to the positions of the title and captions by adding an @ with brackets and offsets as illustrated here...

Code:
CALL winop@("%pl[y_axis=Amplitude@(-4,0)]")


2) The latest DLLs (including new %pl symbols) are available from here... https://www.dropbox.com/s/mlrd848w3ixnlp3/newDLLs47.zip?dl=0

3) Box selection etc. are inherited from %gr and information can be found under %gr.

There is a plan to release more information about %pl within the next few days.
Back to top
View user's profile Send private message AIM Address
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Sun Jun 14, 2020 12:38 pm    Post subject: Reply with quote

Thanks Paul!

I will apply the adjustment and post it how it looks when applying it.
Back to top
View user's profile Send private message
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Sun Jun 14, 2020 2:29 pm    Post subject: Reply with quote

Paul,

thanks - the captions for X,Y axes can be moved as I wished!

I used the code:

Code:

...
...
 CALL winop@('%pl[x_axis="Y_S-JTSK [m]@(0,20)"]')
 CALL winop@('%pl[y_axis="X_S-JTSK [m]@(-20,0)"]')
...
...


and the result can be seen below (now, I am satisfied with their placement!)

[url]

[/url]

But I still need your advise. I want to have the caption text (Y_S-JTSK [m] and X_S-JTSK [m]) for both axes in different font (verdana and bold for exmple) and colour (as blue, for example and maybe also graph title in blue).

I tried to use the following code:

Code:

     iw = winio@('%fn[Verdana]%bf%gf%tc[blue]&',cval)
     CALL WINOP_CLR@('%pl[x_axis=]', cval) !for colours
     CALL WINOP_CLR@('%pl[y_axis=]', cval) !for colours


but it does not work (I tried some combinations and in one instance I achieved that the whole numbers/captions/graph title, all were blue). Could you tell me how to achieve it?

Thanks in advance!

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


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

PostPosted: Sun Jun 14, 2020 2:38 pm    Post subject: Reply with quote

All the text has the same font except that you can change the font for the title and keep the other fonts the same.

The general font is set using %fn before %pl.

To change the font for the title see item 406 in cwplus.enh...

Quote:
integer(7) hTitleFont
...
iw = winio@("%fn[Verdana]%ts[1.2]%it%gf%sf&",hTitleFont)
CALL winop_hdl@("%pl[title_hfont]",hTitleFont)
Back to top
View user's profile Send private message AIM Address
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Sun Jun 14, 2020 3:36 pm    Post subject: Reply with quote

Thanks for the info. I already changed the font for the title earlier. Maybe it could be worth to add these possibilities (changing the fonts/colours for the axis captions) in some next releases.

Again - thanks for your advises!
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Jun 14, 2020 5:07 pm    Post subject: Reply with quote

If you prevent %pl from drawing the axis labels via

%pl [x-axis=@,y-axis=@]

You can then add your title and axis captions using any font/size/colour by using the %gr routines within the %pl callback.

SELECT_FONT@, ROTATE_FONT@ and DRAW_CHARACTERS@

Defining the margins of the %pl region and GET_TEXT_SIZE@ helps with the positioning.
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Jun 14, 2020 6:49 pm    Post subject: Reply with quote

Paul, The new DLLs work fine for WIn32 - I can see that the bug with symbol 12 has been fixed.

But with x64 there seems to be a problem. This example fails.

Code:
i = winio@('%ws','Here')
print*, i
end


Can somebody else confirm this? Or maybe I have I messed up my installation?

Note

Same issue with my back up machine - so both are now back to the previous set of DLLs.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Jun 15, 2020 7:41 am    Post subject: Reply with quote

It works OK for me. I what way does it fail?
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Mon Jun 15, 2020 9:38 am    Post subject: Reply with quote

Console opens, no Clearwin window created, no data printed to console, then terminates itself.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Jun 15, 2020 10:39 am    Post subject: Reply with quote

I plan to upload new DLLs within the next few days and hopefully this problem will prove to be resolved.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Mon Jun 15, 2020 11:30 am    Post subject: Reply with quote

Fingers crossed Paul.

There's been a large number of intermediate releases (debugers, FTN, Plato etc) since the last official release and I am just wondering if I have perhaps missed something critical?
Back to top
View user's profile Send private message Visit poster's website
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Tue Jun 16, 2020 12:56 pm    Post subject: Reply with quote

Ken,

I tried to change the font/colour/size of X/Y captions in the graphics. Couple of observations (better said problems) related to this:

1) First, I thought that I could call within %PL more than one call-back, so I defined a separate function in my module as follows (because I wanted that
any effect in changing font/colour/font size would relate to ONLY X/Y axis captions):

Code:

INTEGER FUNCTION nazvy_osi ()

          CALL select_font@('arial') ! font selection
          CALL bold_font@(1) ! bold setup
          CALL size_in_pixels@(15,15) ! dimensions in pixels
 !         CALL size_in_points@(15,15) ! dimensions in points
          CALL draw_characters@('Y_S-JTSK [m]',600,630,RGB@(255,0,255))
          CALL rotate_font@(90.0d0) ! for vertical axis caption
          CALL draw_characters@('X_S-JTSK [m]',70,350,RGB@(255,0,255))   
     nazvy_osi = 2

END FUNCTION nazvy_osi



Then - in the plot graph function I had the following:

Code:

...
...
iw=winio@('%^pl&',nazvy_osi)
     iw=winio@('%`^pl[full_mouse_input]&',gw,gh,npoints,y_hr,x_hr,y,x,handle_pl,pl_cb)
...
...


During compiling, I got (sometimes, sometimes not) a message saying about memory access violation, but at the end (regardless whether this message appeared or not) compilation was done. When I build the executable, as soon as I accessed graphics menu, program crashed (run time error saying that in the 2nd WINIO continuation (command: iw=winio@('%^pl&',nazvy_osi) integer argument was expected or something similar.

So, I abandoned this %PL call-back.

2. I integrated the commands contained in the integer function above to the
main %PL call-back which draws full graphics (called pl_cb in the command:
iw=winio@('%`^pl[full_mouse_input]&',gw,gh,npoints,y_hr,x_hr,y,x,handle_pl,pl_cb) at the end of this pl_cb call-back.

After this, I had to leave out the command ROTATE_FONT@(90.0d0), since it caused that NOT ONLY vertical axis caption was rotated (this was required), but ALSO all values in the yellow rectangle were perpendicular to horizontal axis (unwished effect). When I commented out this function, initially, graphics looked promising (see picture below):



By the way, I also had to enlarge the yellow rectangle, since it was too small when I defined also bold type and dimensions in pixels/points. The reason is that also these values (in the yellow rectangle) are drawn as characters using DRAW_CHARACTERS@ function and UNFORTUNATELY, any change in font/colour/font size has effect NOT ONLY on X/Y captions (as I thought and wanted), but also on ALL characters appearing in the graphics (except the title graph, which I drew by another way).

Next, I zoomed in the graphics and the result can be seen below:



Clearly, the Y,X coordinate values (at the bottom and to the left) and the X/Y captions are in disarray.

Then, I used zoom to extents function (result is demonstrated below):



While X/Y captions seems to be OK, the X/Y values on the axes remain in disarray.

So, basic knowledge is (at the current level of my knowledges which are quit low with respect to this and to the way how I tried to realise it) that ALL characters drawn in a graphics (when using %PL command) are influenced by change of font/colour/size and I did not find the way how to isolate/separate the characters which are wanted to 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 -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 8 of 9

 
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