replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - %PL - some issues/questions
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
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8217
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: 818
Location: 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
Kenneth_Smith



Joined: 18 May 2012
Posts: 818
Location: 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
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8217
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: 818
Location: 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
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8217
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: 818
Location: 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
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
Martin_K



Joined: 09 Apr 2020
Posts: 227

PostPosted: Tue Jun 16, 2020 1:10 pm    Post subject: Reply with quote

something went wrong with my latest post - here is the missing part:

.. which are wanted to be changed from the others which should remain unchanged.

Most important question is:
Is it not possible to call with %PL command contained in one integer function more than one call-back? I saw this as a way how to separate the influence
of changes in font/colour/size on X/Y captions from the others and if it is possible, where am I wrong?

As an assessment from a common user (occasional programmer) - by far - the easiest way would be to ADD new options for the %PL command such as:
[x_axis_font=], [x_axis_colour=], [x_axis_fontsize=] (the same for Y axis) and maybe a few more options along with good help (documentation).

So If you would have some ideas/comments/recommendations whick trick(s) could overcome current status of the %PL , I would be thankful.

Martin
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 818
Location: Lanarkshire, Scotland.

PostPosted: Tue Jun 16, 2020 8:58 pm    Post subject: Reply with quote

Martin,

I am not surprised that your first attempt failed. The code it trying to produce two pl regions.

The function to draw the text should be called in the main pl call back within the if �plot adjust� logical test. Do this before you call COPY_GRAPHICS_REGION@ to copy the %pl to the �back up� internal graphics region.

After a call to rotate_font@(XX), it�s always a good idea to call rotate_font@(0.d0) immediately after you have completed the drawing operation with the text at an angle of XX.

Yes the characters in the yellow box will change. It�s drawn on the same graphics area as the %pl and prior to the call to draw the title text this would be at some default value probably defined by %fn before immediately before the %pl call � if I understand the user�s guide.

Generally I only use a single font and simply scale or rotate it where necessary.

You could open another window to display the internal %gr region. Then by adding a number of calls to SLEEP1@ at strategic points in the code, you can follow the progress of the various call back functions as they operate on each of the graphics areas.

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



Joined: 09 Apr 2020
Posts: 227

PostPosted: Wed Jun 17, 2020 12:54 pm    Post subject: Reply with quote

Thanks Ken!

Now, I can zoom in/out/to extents as many times as I want and the X,Y captions retain always all their properties as I programmed it for them (picture below)!



I also incorporated switch on/off option for the bubble help (picture below)!



One question more (your answer will avoid my thinking in wrong direction):

I also have a raster image (.bmp) of the grid with SK borders which can
be seen under one menu option (there is also scale on the picture which corresponds to the reality).

I would also like to add a possibility in the menu option to zoom in/out/to extents using %SL (slider) in connection with mouse wheel. It means, as the wheel would spin, the raster picture would zoom in/out). Is this idea with the %SL command in connection with mouse wheel feasible or is there a more appropriate % command to use for such purpose?

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


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

PostPosted: Wed Jun 17, 2020 4:34 pm    Post subject: Reply with quote

See item number 351 in cwplus.ehn.
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, 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