"Q"
Classes
     
Subsystem
list
     
Top
level


DragMouse2

This method is being obsoleted. Do not use it for new work. Instead, use the built-in 4Test method DragMouse.

This method of QChildWin and QAnyWin presses the mouse button at a given location, moves the mouse (with the button held down) to another given location, and releases the mouse button.

Declaration

void DragMouse (integer iFromX, integer iFromY, integer iToX, integer iToY, integer iSteps optional)

Inputs

iFromX, iFromY
The location at which to depress the mouse button.
iToX, iToY
The location at which to release the mouse button.
iSteps
If specified, this is how many discrete mouse movements to perform. This is useful for slowing down mouse movement. If not specified, there are no intermediate steps between the press and release positions.

Outputs

(none)


GetDeclaredParent

This method is implemented for all of the "Q" classes. It performs the same function as the built-in 4Test routine WindowParent (not to be confused with the WindowParent method), which returns the window inside which a given window is declared. Because of a QA Partner bug, the built-in WindowParent crashes QAP when used on a dynamically instantiated window. Therefore, you should always use this method instead.

Declaration

window GetDeclaredParent ()

Inputs

(none)

Outputs

Returns
The window inside which this window was declared.


GetMainPaneID

Returns the pane ID of the main pane for the window, or an empty string if the window has no main pane.

Declaration

string GetMainPaneID ()

Inputs

(none)

Outputs

Returns
The pane ID of the main pane.


GetMoveableWindow

This method is implemented for all of the "Q" classes. If the window belongs to the class MoveableWin, (includes MoveableWin, ChildWin, and DialogBox), then this method returns the window itself. Otherwise, this method returns the nearest ancestor (parent or enclosing) window that belongs to the class MoveableWin.

This method is useful when you have a window variable that refers to a control or gadget, and you want to do something like make it the current active window (SetActive). Since you can't call that method on the control or gadget itself, you must obtain its enclosing MoveableWin window.

Declaration

window GetMoveableWindow ()

Inputs

(none)

Outputs

Returns
The nearest enclosing MoveableWindow (counting the window itself).

Example of Usage

// This routine copies the contents of one text field
// to another text field.  Note that the two text fields
// may be in different parent windows.
void CopyTextContents (window wFrom, window wTo)
{
    wFrom.GetMoveableWindow.SetActive();
    string s = wFrom.GetText();
    wTo.GetMoveableWindow.SetActive();
    wTo.SetText(s);
}


GetNameForLog

This method is implemented for all of the "Q" classes. It returns a name for the window that is reasonably human-readable, for the purpose of printing in the results file. It is mainly intended for use with CUlogGuiAction.

Declaration

window GetDeclaredParent ()

Inputs

(none)
Note: the optional x and y parameters are obsolete, and should not be used.

Outputs

Returns
A human-readable string that describes the window.


GetUIshellClass

This method is implemented for QChildWin, QCustomWin and QDialogBox. It returns the application's internal C++ UI Shell class name for the window.

Declaration

string GetUIshellClass ()

Inputs

(none)

Outputs

Returns
The UI Shell C++ class name for the window.


QChildWin::GlobalToLocal

Converts a point in global (screen-relative) coordinates to a point in local (window-relative) coordinates.

Note that QA Partner always uses local coordinates. Global coordinates are generally only useful as intermediate values when converting a point from the coordinate system of one window to the coordinate system of another window (see example).

Declaration

void GlobalToLocal (integer iGlobalX, integer iGlobalY, out integer iLocalX, out integer iLocalY)

Inputs

iGlobalX, iGlobalY
The location in global (screen) coordinates.

Outputs

iLocalX, iLocalY
The location in local (window) coordinates.

Example of Usage

// convert a point to a different window's coordinate system
integer iX, iY;
window w1, w2;

w1.GetSomeRandomPoint(iX, iY);
w1.LocalToGlobal(iX, iY, iX, iY);
w2.GlobalToLocal(iX, iY, iX, iY);


QChildWin::Invoke

In addition to invoking the window by calling the inherited Invoke method (from ChildWin), this method calls the window's Init and MoveToMakeVisible methods. These steps help ensure that the window will actually be usable after calling Invoke.

Declaration

void Invoke ()

Inputs

None.

Outputs

None.


QChildWin::IsPointVisible

This routine tells whether a particular point is visible, or if it's obscured by some other window.

If you are writing scripts for PRODUCT and related products, you may also want to see Window Management for more related methods.

Declaration

boolean IsPointVisible (integer iX, integer iY, out string sWhatsInTheWay optional);

Inputs

iX, iY
The point to be tested.

Outputs

Returns
TRUE if the point is visible, FALSE if the point is obscured by some other window.
sWhatsInTheWay
If the point is obscured, this is the name of the window that is obscuring it. This information is intended only for error reporting.


QChildWin::LocalToGlobal

Converts a point in local (window-relative) coordinates to a point in global (screen-relative) coordinates.

Note that QA Partner always uses local coordinates. Global coordinates are generally only useful as intermediate values when converting a point from the coordinate system of one window to the coordinate system of another window (see example).

Declaration

void LocalToGlobal (integer iLocalX, integer iLocalY, out integer iGlobalX, out integer iGlobalY)

Inputs

iLocalX, iLocalY
The location in local (window) coordinates.

Outputs

iGlobalX, iGlobalY
The location in global (screen) coordinates.

Example of Usage

// convert a point to a different window's coordinate system
integer iX, iY;
window w1, w2;

w1.GetSomeRandomPoint(iX, iY);
w1.LocalToGlobal(iX, iY, iX, iY);
w2.GlobalToLocal(iX, iY, iX, iY);


QChildWin::MoveProportionate

Moves and optionally resizes the window, relative to the size of the enclosing main window (or optional RECT).
Also see: SizeProportionate.

If you are writing scripts for PRODUCT and related products, you may also want to see Window Management for more related methods.

Declaration

void MoveProportionate (real rXpos, real rYpos, real rXsize optional NULL, real rYsize optional NULL, RECT rSpace optional);

Inputs

rXpos, rYpos
The position of the window, specified as a fraction of the given RECT. For example, to move the upper left corner of the window (this) to the center of the given RECT, specify 0.5 for both rXpos and rYpos.
rXsize, rYsize
The size of the window (optional), specified as a fraction of the size of the given RECT. For example, to make the window (this) one quarter the size of its enclosing RECT, specify 0.25 for both rXsize and rYsize.
rSpace
The RECT to use when calculating position and proportions. The default RECT is the Main Window (client area on NT).

A problem that can occur when using the default RECT is that the proportions and placement of the windows will be different depending on the number of physical monitors on the computer. This can result in 'stretched' windows on two-monitor systems and also doesn't account for the differing amounts of available space on the different configurations.

Note: If you are passing a RECT but are not doing any sizing, each size parameter must be passed with a value of 'NULL'.

Outputs

none

Examples of Usage

wWindow.MoveProportionate(.65, .3);		//Move proportionate to Main Window/Client Area (no sizing).
wWindow.MoveProportionate(.65, .3, .3, .2);	//Move and Size proportionate to Main Window/Client Area.

RECT rRect = GetMyNeededRect();

wWindow.MoveProportionate(.65, .3, NULL, NULL, rRect);	//Move proportionate to supplied RECT (no sizing).
wWindow.MoveProportionate(.65, .3, .3, .2, rRect);	//Move and Size proportionate to supplied RECT.


QChildWin::MoveToMakeVisible

This method checks to see if the window is completely visible on the screen (for MacIntosh) or within its parent main window (for NT). If it is, this method returns TRUE and takes no other action.

If the window is not completely visible, this method attempts to move the window to make it completely visible. If it succeeds, it returns TRUE.

If the window is too large to be made completely visible without resizing, this method moves the window to the upper left corner of the screen (Mac) or its main window (NT), and returns FALSE. This method does not attempt to resize the window.

Note: this method does not take into account any floating (always on top) windows that may be partly or completely obscuring the window that is being made visible.

Declaration

void MoveToMakeVisible ()

Inputs

None.

Outputs

Returns
TRUE if the window is now completely visible; FALSE if it's too big.


QChildWin::SizeProportionate

Resizes the window, relative to the size of the enclosing main window (or optional RECT).
Also see: MoveProportionate.

If you are writing scripts for PRODUCT and related products, you may also want to see Window Management for more related methods.

Declaration

void SizeProportionate (real rXsize, real rYsize, RECT rSpace optional);

Inputs

rXsize, rYsize
The size of the window, specified as a fraction of the size of the given RECT. For example, to make the window (this) one quarter the size of its enclosing RECT, specify 0.25 for both rXsize and rYsize.
rSpace
The RECT to use when calculating proportions. The default RECT is the Main Window (client area on NT).

A problem that can occur when using the default RECT is that the proportions and placement of the windows will be different depending on the number of physical monitors on the computer. This can result in 'stretched' windows on two-monitor systems and also doesn't account for the differing amounts of available space on the different configurations.

Outputs

none

Examples of Usage

wWindow.SizeProportionate(.3, .2);			//Size proportionate to Main Window/Client Area.

RECT rRect = GetMyNeededRect();

wWindow.SizeProportionate(.3, .2, rRect);		//Size proportionate to supplied RECT.


QChildWin::VerifyPointVisible

This routine verifies that a point is visible, and not obscured by some other window. If the point is not visible, and exception is raised.

If you are writing scripts for PRODUCT and related products, you may also want to see Window Management for more related methods.

Declaration

void VerifyPointVisible (integer iX, integer iY);

Inputs

iX, iY
The point to be tested.

Outputs

none


QMainWin::WaitForIdle

This method waits for the application to become idle. You should use this rather than the built-in Sleep function to wait for an operation to complete.

Declaration

real WaitForIdle (number nMinSeconds, number nMaxSeconds, string sWaitingFor);

Inputs

nMinSeconds
The minimum number of seconds to wait.
nMaxSeconds
The maximum number of seconds to wait, after which an exception will be raised.
sWaitingFor
A brief description of what operation you're waiting for. This will only be used for error reporting.

Outputs

Returns
The number of seconds actually waited.


This page is maintained by (REMOVED)
Last updated 8 February 2000.