<< Click to Display Table of Contents >> Navigation: 1. Starting Guides > 1. Starting Guide |
Starting Guide
"Client" and "Non-Client" Area
Whats it, and what's it good for?
What is the "Client Area" of a window and why do we need it?
To answer this question best, think a moment like a developer of a windows-application.
Building a windows-application a developer can place controls, statics and pictures inside a window. But not really anywhere in the window, but only in the so called "Client Area".
That is the area, where a Software developer can place its controls.
The "Non Client Area" is the common part, that is equal to all windows. The parts that are drawn from the OS, to some degree independent from the Software in the "Client Area".
Lets take a look on the window below and see the difference between the "Client-Area" (yellow) and the "Non-Client Area" (orange color).
As you can see, the following parts of a window belong to the "Non-Client Area":
- Complete Window Border
- Sizing, Foreground, Help, Close and Minimize Gadgets
- System Menu
- Real" Top-Menus, means Menus which belong directly to the Top-Window
The rest of the window is under the control of the software developer and is as such called "Client Area".
Here comes the "input focus" ...
- When taking a Screenshot from a window, we must know if want the complete window or (as most often) just the "Client Area" of the window.
When using IRA. or WRA. we should work with the Client Area only.
Otherwise simply giving the windows the "Input focus" would change the color of the "Non-client area. You can see this below.
The window below on the left side has the "Input focus". Please note the blinking cursor inside the textbox. The picture on the right side shows the same window without the input focus. As you can see the "non client area" has a completely different Color.
Note that also a blinking cursor like the one in the left picture may cause IRA. /WRA. and such, to notify "a change" in the client area.
Coordinate Systems
Coordinate Systems in our sense are 2-dimensional. They describe a location on the screen using an
X - value (Horizontal position)
Y - value (Vertical position)
Our Coordinate systems generally have their zero (0,0)-Point in the upper, left corner.
We have three coordinate systems in use with windows.
1. Screen-Coordinates
Screen-Coordinates have their zero (0,0)-Point in the upper, left corner of the desktop.
The total and maximum resolution is the Screen-Resolution.
If you have multiple Screens (Dual Screen), then the coordinate system goes over all available Screens.
The Screen-Coordinate where the mouse currently is, is displayed in the Windows-Inspector behind the "Screen:", see here:
Screen coordinates have some disadvantages.
For example, if you have the coordinates of a button, and you move the window around, the screen coordinates are not more accurate.
Therefore we have a second coordinate system:
2. Window-relative coordinates:
These coordinates have their origin (0,0-Point) in the upper left corner of the "non-Client-Area" of the window. Therefore if you move the window, they will move with the window.
Window coordinates have the advantage that you can reach any part of a window, whether in the client- or in the Non-Client-Area. That's the reason why we use them most often. And their main-advantage is that they move with the window.
You can see the window coordinates right of each child- or Top-window in the windows-inspector. See the numbers on the right side. They show you first the current Mouse-Position in window-coordinates. And right of that you see the dimensions of the child-window.
But as anything, windows-coordinates have a small disadvantage when it comes to different Window-OS'es.
Imagine that the Title-bar would have another size on another window-OS.
In this case the Window coordinates will not be accurate anymore. This way, they may not work on another windows-system.
We have a third coordinate system that overcomes this problem:
3. Client-Coordinates
These coordinates have their origin (0,0-Point) in the upper left corner of the "Client-Area" of the window.
Therefore if you move the window, they will move with the window like window-coordinates. And they do not depend on the styles of the windows-outline. Because they only contain the "Client-Area".
The disadvantage of Client Coordinates is, that you can not easily get to any point outside the client Area. In fact you could do that by using negative coordinates.
Currently we do not use Client Coordinates, they are however implemented in the CST.-command so you can use them your self if you want.