Что нового

Перемещение Graphic при Resize дочернего окна

Vint91

Новичок
Сообщения
9
Репутация
0
Все привет, не судите строго я чайник. Почему "убегает" вниз кружок при изменении размера дочернего окна $h_GUItree (сперва прокрутите скролл, шарик внизу)?
Ссылка на проект(я не могу оставлять ссылки так что только так):
//yadi.sk/d/kyDaQUpEILTzhg

Код:
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#Include <GuiMenu.au3>
#include <WinAPIShellEx.au3>
#include "GUIScrollbars_Ex.au3"
#include <Array.au3>
#include <File.au3>

$projpath="d:\Projects\MZAL\Sim072"
$g_namemydir=".myarc"
$sourcedir = '!source'
ProjForm(@ScriptDir)

Func ProjForm($proj)
	local $ParentWidth = 800
	Global $ProjectForm = GUICreate("ProjectForm",$ParentWidth,465,-1,-1,$WS_OVERLAPPEDWINDOW,-1)
	GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $ProjectForm)
	GUISetState(@SW_SHOW,$ProjectForm)
	ChildGuiTree($ParentWidth-50, $proj)

EndFunc

Func ChildGuiTree($childwidth, $projpath)

	local $height = 200, $heightscroll = 0, $diamcirc = 11
	$h_GUItree = GUICreate("Child GUI", $childwidth, $height, 10, 10, $WS_CHILD+$WS_OVERLAPPED+$WS_THICKFRAME, $WS_EX_CLIENTEDGE, $ProjectForm)
	GUISetBkColor(0xFFFFFF)
	$hell=GUICtrlCreateGraphic(20, 20, 400, 100)
	;GUICtrlSetBkColor(-1, 0xffffff)
	;GUICtrlSetColor(-1, 0)
	Local $A_amountbranch = _FileListToArray($projpath & '\' & $g_namemydir,"*", 2)
	Local $First_element =  $A_amountbranch[1]
	_ArrayDelete($A_amountbranch,1)

	Dim  $A_branch
	Dim $A_AmountRow[]=[0]
	;Определение максимального количества элементов в ветви
	;~ _ArrayDisplay($A_AmountRow)
		For  $i = 1 to $A_amountbranch[0]-1 step 1
			$A_branch = _FileListToArray($projpath & '\' & $g_namemydir & '\' & $A_amountbranch[$i],"*", 2)
			_ArrayAdd($A_AmountRow,$A_branch[0])
		Next
	Local $MaxElement =_ArrayMax($A_AmountRow)
	Local $A_branchcontent[$MaxElement][$A_amountbranch[0]-1]

	;Создание многомерного массива с назаваниями элементов ветвей
	If $A_amountbranch[0]>1 Then
		For  $i = 1 to $A_amountbranch[0]-1 step 1
			$A_branch = _FileListToArray($projpath & '\' & $g_namemydir & '\' & $A_amountbranch[$i],"*", 2)
			if @error <> 0 then Return
			For  $j = 1 to $A_branch[0] step 1
				$A_branchcontent[$j-1][$i-1] = $A_branch[$j]
			Next
		Next
	EndIf
	ConsoleWrite($First_element & "///" & $MaxElement &  "...." & @CR)
	IF $MaxElement <=  5 Then
		IF $First_element = $sourcedir Then
			GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xc0c0ff)
			GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 5, $height + $heightscroll -50, $diamcirc, $diamcirc)
		EndIf
	Else
		IF $First_element = $sourcedir Then
			$heightscroll = $MaxElement * 15
			GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xc0c0ff)
			GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 5, $height + $heightscroll -20, $diamcirc, $diamcirc)
			GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKBOTTOM)
		EndIf
	EndIf


	GUISetState(@SW_SHOW)
	_GUIScrollbars_Generate($h_GUItree, 0,$height +  $heightscroll)
EndFunc

Func _Exit()
	Exit
EndFunc

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
 
Верх