View description difficulty

Forum for discussion about the documentation project.
Post Reply
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

View description difficulty

Post by Tourist Trap »

Hello again,

Here is the description at VIEW (graphics) page:
The first statement sets the viewport to encompass the entire screen, which is the default viewport for a new graphics screen.

The second and third statements both allow a new viewport to be defined. The corners of the viewport are specified by the x1, y1, x2 and y2 parameters. fill_color and border_color are both in the format accepted by Color. The indicated effects for each parameter only occur if that parameter is specified.

The second statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport.

The third statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the screen.
Here is what all of that describes:
Syntax
View
View ( x1, y1 )-( x2, y2 ) [ [, fill_color ] [, border_color ] ]
View Screen ( x1, y1 )-( x2, y2 ) [ [, fill_color ] [, border_color ] ]
So, what I find difficult here, is two things. What are "first", "second", and "third" statement exactly is a little difficult to remember when you really meet the keyword for the first time (or very rarely as I do). The second point is that this is not linear, things about the colors are in the middle of the things about coordinates. This all makes the reading difficult.

As a matter of suggestion, what about something like, reducing difficulty in my opinion and adding some details (rectangular region, no scaling effect):
The first statement (View) sets the viewport to encompass the entire screen . This is the default viewport for a [just created] graphics screen.

The two others statements takes a rectangular region as argument. The corners of the region are specified in the application screen coordinates by the x1, y1, x2 and y2 parameters. Once specified, this region will be the new active viewport area. A viewport can also have some colors defined: fill_color and border_color are then to be specified in a format like what is used for the Color (<--link) keyword.

About coordinates change:
  • The second statement (View "region") modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport rectangular region.
  • The third statement (View Screen "region") modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures remains relative to the top-left corner of the screen.

    Remark: in both cases no new scale factor is applied (see WINDOW (<---link) for that).
Second point, the VIEW PRINT page seems to be a mere copy of the VIEW (console) page. But where VIEW (console) mentions that VIEW PRINT concerns also graphics, VIEW PRINT seems to omit this point... I'm not exact, I mean it mentions it but just as an illustration. This was the right approach in VIEW (console), but at VIEW PRINT page, it all about this, so maybe it should be more visible?

Last point, again about VIEW (graphics), just a question I have right now. Are all the procedures and anything, compatible with VIEW? Or do some commands ignore it?

Thanks!
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: View description difficulty

Post by fxm »

Only graphics instructions take into account the viewport.
Does not work for example for Locate / Print but works for Draw String.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: View description difficulty

Post by Tourist Trap »

fxm wrote:Only graphics instructions take into account the viewport.
Does not work for example for Locate / Print but works for Draw String.
Ok, this is what I believed. But see:
The second statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport.
The documentation is keeping rather vague here. It would be nice to give some hint of what to be heard by "drawing statements and procedures". Draw string, is about text just as Print is. Seems obvious maybe that Draw string is drawing but that Print is not drawing, it's more confusing.
Maybe the approach would be to tell at start that View in graphical context, VIEW (graphics) has a set of command that will ignore it. Those are typically Print, Locate, maybe Input and so on.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: View description difficulty

Post by fxm »

In fact, there is one single page (KeyPgViewtext) which is addressed by 'View Print' from the alphabetical keyword list, and by 'View (Console)' from the functional keyword list (to differentiate with 'View (Graphics)').
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: View description difficulty

Post by fxm »

KeyPgViewgraphics → fxm [Rewording / Formatting]
KeyPgViewtext → fxm [Rewording]
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: View description difficulty

Post by Tourist Trap »

fxm wrote:KeyPgViewgraphics → fxm [Rewording / Formatting]
KeyPgViewtext → fxm [Rewording]
It's better with list bullets, you are right.

Thanks again.
Post Reply