簡體   English   中英

Jaspersoft iReports設計器5.6.0; 如何確定表達式編輯器窗口的大小

[英]Jaspersoft iReports designer 5.6.0; how to fix size of expression editor window

由於我主要在iReport設計器中處理大型表達式,因此我希望將iReport設計器的表達式編輯器的窗口大小與默認值相比更大。

每次我在iReport設計器中打開表達式編輯器時,它默認使用一個相對較小的窗口,然后我總是必須重新安排它。 由於雙擊標題欄不會執行任何操作,因此當我每天必須執行100次此操作時,這將花費大量時間。

有沒有一種方法可以設置iReport設計器5.6.0的位置,寬度和高度(我不使用Jaspersoft Studio,因為它更加耗時的文件保存行為),因此下次我打開表達式編輯器時,它將使用這個位置,寬度和高度?

(我已經在互聯網上搜索過互聯網,也可以在此處搜索-但似乎沒有人遇到這個問題)

由於找不到答案,因此我迅速使用AutoIt開發了一種解決方法。

;這里是AutoIt代碼:

; *** Variables ***
$FrameInPercent = 10

do

   $hWindow = WinWaitActive("[CLASS:SunAwtDialog;TITLE:Expression editor]", "") ; *** Wait here until the Expression editor window is opened ***
   WinActivate($hWindow)

   ; *** Calculate distance from screen edge for Expression editor window ***
   $DeskSize = _GetWorkingArea()
   $WindowWidth = $DeskSize[2]-($DeskSize[2]*(0.01*2*$FrameInPercent))
   $WindowHeight = $DeskSize[3]-($DeskSize[3]*(0.01*2*$FrameInPercent))
   $windowStartLeft = ($DeskSize[2]*(0.01*$FrameInPercent))
   $windowStartTop = ($DeskSize[3]*(0.01*$FrameInPercent))

   WinMove($hWindow, "",$windowStartLeft, $windowStartTop, $WindowWidth, $WindowHeight)

   ;WinMove($hWindow, "",71, 116, 1815, 863)

   Do
      Sleep(1000) ; calmly idle around as long as the Expression editor window is    open
   until NOT(WinExists($hWindow))

until False ; *** Loop forever ***

;===============================================================================
;
; Credits for this function goes to: https://www.autoitscript.com/forum/topic/53788-getting-windows-desktop-size/
; Function Name:    _GetWorkingArea()
; Description:    Returns the coordinates of desktop working area rectangle
; Parameter(s):  None
; Return Value(s):  On Success - Array containing coordinates:
;                       $a[0] = left
;                       $a[1] = top
;                       $a[2] = right
;                       $a[3] = bottom
;                  On Failure - 0
;
;===============================================================================
Func _GetWorkingArea()
#cs
BOOL WINAPI SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
uiAction SPI_GETWORKAREA = 48
#ce
    Local $dRECT = DllStructCreate("long; long; long; long")
    Local $spiRet = DllCall("User32.dll", "int", "SystemParametersInfo", _
                        "uint", 48, "uint", 0, "ptr", DllStructGetPtr($dRECT), "uint", 0)
    If @error Then Return 0
    If $spiRet[0] = 0 Then Return 0
    Local $aRet[4] = [DllStructGetData($dRECT, 1), DllStructGetData($dRECT, 2), DllStructGetData($dRECT, 3), DllStructGetData($dRECT, 4)]
    Return $aRet
EndFunc

為了使用此功能,您必須安裝AutoIt: https : //www.autoitscript.com/site/autoit/downloads/

然后運行此腳本(雙擊它)。 該腳本將永久運行,但不會占用太多CPU資源,因為它是事件驅動的,它等待表達式編輯器出現,並且在表達式編輯器打開時,如果此窗口仍處於打開狀態,則僅每1秒鍾掃描一次。

希望這對某人有幫助。

由於這是我的第一個AutoIt腳本,因此歡迎進行優化:-)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM