GUI nach Gui, show vergrößern Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

effel
Posts: 546
Joined: 16 Jan 2018, 13:34

GUI nach Gui, show vergrößern

13 Mar 2024, 07:15

Hallo,

mit GuiControl, 1: MoveDraw, thisTab3, % thisH(45.0) kann ich das Tab3 nachträglich vergrößern, die GUI zieht aber leider nicht mit.

Kann ich nachdem sie erstellt wurde, die GUI irgendwie nachträglich vergrößern?

ich meine nicht mit der Maus ziehend


EDIT:

ich habe es. Mit nochmal Gui, Show gehts...
if ! test#635
{
sleep, 2000
GuiControl, 1: MoveDraw, thisTab3, % thisH(45.0)
Gui, 1: Show,x100 h545,% "Batch OCR & Translate " strReplace((substr(a_scriptname,-10)),".ahk")
}
fredchf
Posts: 54
Joined: 30 Sep 2013, 14:55

Re: GUI nach Gui, show vergrößern  Topic is solved

13 Mar 2024, 15:42

Hallo!
AutoSize: Passt die Fenstergröße automatisch an die Größe und Position aller sichtbaren Steuerelemente im Fenster an. Diese Option ist besonders nützlich, wenn neue Steuerelemente hinzugefügt werden, oder wenn bereits vorhandene Steuerelemente größer/kleiner, sichtbar oder unsichtbar gemacht werden. Zum Beispiel: Gui, Show, AutoSize Center.
https://ahkde.github.io/docs/v1/lib/Gui.htm
effel
Posts: 546
Joined: 16 Jan 2018, 13:34

Re: GUI nach Gui, show vergrößern

23 Mar 2024, 18:01

Hallo @fredchf,
das war genau der richtige Hinweis für mein Problem, Danke!

Es ist zwar nicht genau getroffen, aber so kann es sich schon mal sehen lassen. Wenn der Loop nur bis 50 zählt, habe ich am unteren Rand zwar noch ein paar Millimeter `Stauraum`, die stören aber nicht so wie mein altes Ergebnis.

Code: Select all

	SendMode Input  ; Aufgrund seiner überlegenen Geschwindigkeit und Zuverlässigkeit für neue Skripte empfohlen.
	#SingleInstance force
	Critical Off 
	;#NoTrayIcon
	#NoEnv
	#Persistent
	FileEncoding, UTF-8
	SetBatchLines, -1
	SetTitleMatchMode, 2
	SetKeyDelay 20
	SetWorkingDir, %A_ScriptDir%
	
	settimer, UPDATEDSCRIPT, 200
	
	zoomfactor:=((A_ScreenWidth/1920)*(96/A_ScreenDPI))
	wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
	
	Gui, 1: -dpiscale hwndHthisGui +Resize 
;---------------------------------
	Gui, 1: Add, Tab3, x10 y0.5 Buttons vthisTab3 hwndHthisTab3 gTab3Control
			 , OCR && Translate|History|ISOLanguageCodes|json|settings
	Gui, 1: 	Font, 					% thisZoomFactorFontVerdanaPro(11) 
	GuiControl, 1:  Font, 			thisTab3
	GuiControl, 1:  show, 			thisTab3
 	GuiControl, 1:  MoveDraw, 		thisTab3, 	% thisX(0.5) thisY(0.5) thisH(34.0) ;  default
;---------------------------------
	Gui, 1: Add, ListView, vDebugListview hwndHDebugListview r15 grid, #|hwnd|x|y|w|h|TabSize()|Dif|RowCount|ItemHeight
	Gui, 1: 	Font, 				% thisZoomFactorFontVerdanaPro(11) ; 
	GuiControl, 1:  Font, 			DebugListview
 	GuiControl, 1:  MoveDraw, 		DebugListview, 	% thisX(.5) thisY(0.5) thisW(60.9) ; thisH(34.0) ;  default
	GuiControl, 1: 	+cBlack, 		DebugListview
	GuiControl, 1: ,  			DebugListview, 	%a_Space% vDebugListview %Space% 
	GuiControl, 1:  show, 			DebugListview
	gui, 1: show,x100 y200 AutoSize, test
;-----------------------------------------------------------------------------------------------------------------------------

	Gui, 1: listview, -redwaw
;	startSize := (TabSize() - 2)
	startSize := (TabSize() - 0)
	WinGetPos, thisGui_X,   thisGui_Y,  thisGui_Width,  thisGui_Height,  ahk_id %HthisGui%
	GuiControl, 1:  MoveDraw, 		thisTab3, 	% "h" (thisGui_Height - ((startSize * 2) - 0))
	gui, 1: show, AutoSize hide

	loop, 250
	{
	GuiControl, 1:,thisTab3,% "File" a_index
	GuiControl, 1:  MoveDraw, 		thisTab3, 	% "h" ((thisGui_Height + TabSize()) - (startSize * 2) - 0)
	LV_Add("", a_index, HthisGui, thisGui_X, thisGui_Y, thisGui_Width, (thisGui_Height+TabSize()), TabSize(), ((thisGui_Height+TabSize()) - startSize), RowCount, ItemHeight)
	gui, 1: show, AutoSize hide
	}
	GuiControl, 1:  MoveDraw, 		thisTab3, 	% "h" ((thisGui_Height + TabSize()) - (startSize * 2) + 10)
	Loop % LV_GetCount("Column")
	LV_ModifyCol(A_Index, "AutoHdr")
	Gui, 1: listview, +redwaw

	gui, 1: show, AutoSize 




	return
;---------------------------------------

	TabSize() { ; https://www.autohotkey.com/boards/viewtopic.php?f=9&t=127631#p564249 by just me
	global
	VarSetCapacity(RECT, 16, 0)
	SendMessage, 0x130A, 0, &RECT, , ahk_id %HthisTab3%
	ItemHeight := NumGet(RECT, 12, "Int") - NumGet(RECT, 4, "Int") ; unten - oben
	SendMessage, 0x132C, 0, 0, , ahk_id %HthisTab3% 	; TCM_GETROWCOUNT (0x132C)
	RowCount := ErrorLevel
	return (RowCount * ItemHeight)
	}

Tab3Control:
GuiControl , Choose , systabcontrol321 , 1
return

;---------------------------------------

thisZoomFactorFontVerdanaPro_(factor) {
return (factor*((A_ScreenWidth/1920)*(96/A_ScreenDPI))) " , Verdana Pro"
}

thisZoomFactorBold(factor) {
global
return "s" (factor*zoomfactor) " , Comic Sans MS bold"
}

thisZoomFactorNormal(factor) {
global
;return "s" 10 " , Terminal " 
return "s" (factor*zoomfactor) " , Comic Sans MS" 
}

thisZoomFactorFontVerdanaPro(factor) { ; ab win 10
global
return "s" (factor*zoomfactor) " , Verdana Pro" 
}

thisX(factor) {
global
return	" x" (wa*factor)/xx
}

thisY(factor) {
global
return	" y" (ha*factor)/xx 
}

thisW(factor) {
global
return	" w" (wa*factor)/xx
}

thisH(factor) {
global
return	" h" (ha*factor)/xx 
}

UPDATEDSCRIPT(save := 1) {
	FileGetAttrib,attribs,%A_ScriptFullPath%
		IfInString,attribs,A
		{
		FileSetAttrib,-A,%A_ScriptFullPath%
		SplashTextOn,,,Updated script,
		Sleep,1500
			if save
			{
			If !FileExist(A_ScriptDir "\save\")
			FileCreateDir,% A_ScriptDir "\save\"
			FileCopy, % A_ScriptFullPath, % A_ScriptDir "\save\" A_ScriptName " save " A_Now " .ahk"
			}
		Reload
		}
	}
38f40708.jpg
38f40708.jpg (252.28 KiB) Viewed 104 times
Last edited by effel on 23 Mar 2024, 18:48, edited 1 time in total.
effel
Posts: 546
Joined: 16 Jan 2018, 13:34

Re: GUI nach Gui, show vergrößern

23 Mar 2024, 18:35

doppelt gepostet, kann gelöscht werden...

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 63 guests