How to move/resize a FlexTitleWindow in Silk4J

How to move/resize a FlexTitleWindow in Silk4J

If you view the Silk4J API for the FlexTitleWindow (com.borland.silktest.jtf.flex.FlexTitleWindow) it shows a series of dragXXXX options that appear to be inherited from the parent FlexContainer (com.borland.silktest.jtf.flex.FlexContainer). Unfortunately these drag actions have no defining to/from co-ordinates and actually do not work  - this is a shortcoming of Flex rather than Silk4J. You can achieve the same effect by using pressMouse(), mouseMove() and releaseMouse() in sequence. The following code example shows how to drag the FlexTitleWindow:


// Grab a point on the title bar
desktop.<SparkTitleWindow>find(".//SparkTitleWindow[@caption='Title Window']").pressMouse(1,new Point (1,1));
// Move the mouse to the new position
desktop.<SparkTitleWindow>find(".//SparkTitleWindow[@caption='Title Window']").mouseMove(new Point (-200,50));
// Release the mouse at the new position
desktop.<SparkTitleWindow>find(".//SparkTitleWindow[@caption='Title Window']").releaseMouse(1,new Point (0,0));

Note that you need the Point in the releaseMouse call. For resizing the FlexTitleWindow you will need the following approach:

mouseMove to the resize handle position
pressMouse to grab the handle
mouseMove to the resize position
releaseMouse to complete the action.

See also

http://microfocus.telligenthosting.net/borland_staging/silk_test/w/knowledge_base/22207.getting-offsets-for-low-level-events-when-testing-custom-controls.aspx

for any easy method of getting the required co-ordinates.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-10-08 17:58
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.