Post by effel » 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 (252.28 KiB) Viewed 279 times
[quote=fredchf post_id=562968 time=1710362553 user_id=104]
[url]https://ahkde.github.io/docs/v1/lib/Gui.htm[/url]
[/quote]
Hallo [mention]fredchf[/mention],
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 [c]Loop[/c] 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] 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
}
}[/code]
[attachment=0]38f40708.jpg[/attachment]