3.6 Using Quadrant-Coordinates

<< Click to Display Table of Contents >>

Navigation:  2. Components > 3. System-Variable and Specialfolders >

3.6 Using Quadrant-Coordinates

Using Quadrant Coordinates

Previous Top Next


MiniRobotLanguage (MRL)

 

Quadrant-Coordinates

 

 

Intention

 

Normal Line or Rectangle (Rect-) Coordinates look like this:

 

x1,x2,y1,y2

 

Using these, you specify a (often) resolution dependent position on the screen.

Therefore they are generally screen-coordinates.

 

graphic

 

You can find out the screen coordinates where the mouse is, using the "windows Inspector". In this case it shows the values: 753,1096

Example using Screen-Coordinates.

 

ILC.753,1096,900,1500|!&HFFFFFF|0|3

 

You can also specify Rect-Coordinates relative to the upper, left corner of the last window that you had located. These coordinates are called "Window coordinates".

 

You see them on the right side of each child-window in the  "windows Inspector".

Example using "window coordinates":

 

ILC.w1,1,10,10|!&HFFFFFF|0|3

 

As an easier variant, you can use "Quadrants".

 

In short: Quadrant-Coordinates are screen- and window-size independent.

That is the advantage of using them. They are somehow similar numbered like the coordinates in a Spreadsheet.

Means that you may know the system already from your favorite Spreadsheet program.

It's the same system.

 

Using Quadrant- Coordinates, you specify the so called "Quadrant" that is

 

"A1" to "D4"

 

Here is a Window showing its 16 Quadrants:

 

Quadrant_New

 

Notice that the Quadrant for Top-Windows may or may not contains the so called "non-Client Area", that is the Title-Bar and the complete windows-border.

 

In case you will wait for a change in this window, in Quadrant {D4} you would write:

 

STW.ct|#32770|Basic-NAV Matrix 01

RRA.{D4}

WRA.

DBP.Change happened!

ENR.

 

Be aware that even the window becoming "Active" or losing the Input-Focus will change the color of the window border and thus influence/change all outer Quadrants  that are:

A1-A4,C1,C4, D1-D4.

Only B2,B3,C2 and C3 will not be changed if the window gets/loses Input Focus.

 

That is why you would normally locate a child-window or avoid using a Quadrant over the full window. More Details on this topic, see here:

 

1.8.1 The "Client" and the "Non-Client" Parts of a window

 

Here is an example:

 

STW.ct|Chrome_WidgetWin_1|- Brave

SWP.805,531|1076,1033|T

 

IRC.t{B2}{A4,D4}@|&H0|45%|3

  DMP.6

  $$XPO=$tos$

  $$YPO=$tos$

  MMV.s|$$XPO,$$YPO

 

EIF.

MBX.!

 

QFR.|{D1}{D1}|$$REC

GRM.$$REC|$$MID

MMV.$$MID

 

MBX.!

ENR.

 

 

As you can see the Quadrant is been calculated from the last located object, in this case from another Quadrant.

 

Quadrant coordinates are transformed to screen coordinates before they are used.

Therefore moving a window that is inspected by WRC., WRA. or such an command will make it be "changed".

 

 

 

Details

 

The regular Pixel-commands like RRA./WLC./WRC./WRA. etc. interpret Quadrants different from the "Analyze"-Command, that will be available in future versions.

 

If you give the RRA.-command this Parameter:

 

RRA.{A1,B2}

 

this will internally be calculated to a larger rectangle (-union) that will include all given rectangles in one large rectangle. In this case it will be an rectangle that includes A1,A2,B1 and B2.

This is done, as these commands can only work with a single rectangle at one time, but not with multiple rectangles.

 

This treatment of Quadrants is different from using the (future) Analyze Command.

In the Analyze command you do include the Quadrants into "()" brackets, not into "{}" brackets, which is the first difference.

 

More important, When using the ANA..-command, you can specify which types of controls should be included in the Quadrants-Mask for other commands.

 

When using a "Quadrant", all Controls or Buttons etc. can be:

  completely inside a Quadrant ( f - full)

  mostly inside a quadrant (middle-point is inside) ( m - middle point inside)

  partly inside a Quadrant means that the control is inside but with less then half of the area. (p - partly inside)

 

Therefore acting on all Controls in a Quadrant, you will need to specify which controls to include or exclude. For example:

 

 

STW.ct|#32770|Basic-NAV Matrix 01

ANA.PD:8,TL:40,FL:48,MS:(A1,A3,p)

ENR.

 

Will act on all controls which touch the A1 or the A3 Quadrant:

 

graphic

 

 

STW.ct|#32770|Basic-NAV Matrix 01

ANA.PD:8,TL:40,FL:48,MS:(A1,A3,f)

ENR.

 

Will act only on all controls which are completely inside the A1 or the A3 Quadrant:

As there are no such controls,  the result is this:

 

graphic

 

Here is a more complicated Example:

 

STW.ct|#32770|Basic-NAV Matrix 01

ANA.PD:8,TL:40,FL:48,MS:(C2,C3,D3,m)

ENR.

 

 

graphic

 

It will mark all controls that are more then half inside the given Quadrants.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    CCD. - Calculate Color Distance

    CCV. - Color Conversion

    WLC. - Wait for Line Color

    ILC. / NLC. - If Line Color

    IRC. / NRC, - If Rect Color

    WRC. - Wait Rect Color

    WRA. - Wait Rect-Area Altered

    IRA. / NRA. - If Rect altered