Modify

#1667 closed Bug (Fixed)

WinMove, Child-Window, Default.

Reported by: mvg Owned by: Jon
Milestone: 3.3.9.13 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: winmove child default Cc:

Description

Not sure about this, (child of child of child ... headache?)
but when using WinMove() on a child Gui-window while using the Default keyword the result is kinda unexpected.
The argument here is that with the use of the Default keyword it is implied that no changes are made to that aspect of the element.
With Child-windows this is unfornately not the case.

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#include <Debug.au3>
Enum $_logwin_ = 1, $_console_, $_msgbox_, $_file_
_DebugSetup(Default, False, $_console_, 'DebugOut.log')
;~ _DebugOut('msg')
;~ _DebugReportVar('msg', 'var/data')

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <StaticConstants.au3>

_Main()

Func _Main()
	Local $hGUI, $h_cGUI
	Local $res

	$hGUI = GUICreate("Main Gui", 200, 200, 10, 10, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
	GUISetBkColor(0x88AABB)
	$res = WinGetPos($hGUI) ;; returns absolute (destop relative) coordinates.
	_DebugReportVar('[1] WinGetPos($hGUI)', $res) ;### Debug DebugOut.

	$h_cGUI = GUICreate("Child GUI", 100, 100, 10, 10, $WS_CHILD, -1, $hGUI)
	GUISetBkColor(0X006400)
	$res = WinGetPos($h_cGUI) ;; returns absolute (destop relative) coordinates.
	_DebugReportVar('[1] WinGetPos($h_cGUI)', $res) ;### Debug DebugOut.

	GUISetState(@SW_SHOW, $h_cGUI)
	GUISwitch($hGUI)
	GUICtrlCreateLabel('', 10, 10, 100, 100, $SS_WHITEFRAME)
	GUISetState(@SW_SHOW, $hGUI)

	Sleep(1000 * 0.5)

	$res = WinMove($h_cGUI, '', Default, Default) ;; moves to relative position inside parrent GUI, using absolute child-window coordinates.
	_DebugReportVar('[2] WinMove()', $res) ;### Debug DebugOut.

	$res = WinGetPos($h_cGUI)
	_DebugReportVar('[3] WinGetPos()', $res) ;### Debug DebugOut.

	Do ;; gui wait.
	Until GUIGetMsg() = $GUI_EVENT_CLOSE ;; Or Not WinActive($hGUI)

EndFunc

Attachments (0)

Change History (5)

comment:1 by Jpm, on Jun 20, 2010 at 1:35:03 PM

Milestone: 3.3.7.0
Owner: set to Jpm
Resolution: Fixed
Status: newclosed

Fixed by revision [5890] in version: 3.3.7.0

comment:2 by Jpm, on Jun 10, 2011 at 9:36:15 PM

Resolution: Fixed
Status: closedreopened

comment:3 by TicketCleanup, on Jun 11, 2011 at 12:00:01 AM

Milestone: 3.3.7.0

Automatic ticket cleanup.

comment:4 by Jon, on Jul 21, 2013 at 11:31:57 PM

Resolution: Rejected
Status: reopenedclosed

comment:5 by Jon, on Jul 26, 2013 at 11:58:31 PM

Milestone: 3.3.9.13
Owner: changed from Jpm to Jon
Resolution: RejectedFixed

Fixed by revision [8179] in version: 3.3.9.13

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.