【问题标题】:Jaspersoft iReports designer 5.6.0; how to fix size of expression editor windowJaspersoft iReport 设计器 5.6.0;如何修复表达式编辑器窗口的大小
【发布时间】:2018-09-02 03:20:51
【问题描述】:

由于我主要在 iReport 设计器中处理大型表达式,因此我想将 iReport 设计器的表达式编辑器的窗口大小固定为与默认值相比更大的大小。

每次我在 iReport 设计器中打开表达式编辑器时,它默认为一个相对较小的窗口,然后我总是需要重新排列它。由于双击标题栏没有任何作用,所以当我每天必须完成 100 分之一的时间时,这会占用大量时间。

有没有办法设置 iReport 设计器 5.6.0 的位置、宽度和高度(我不使用 Jaspersoft Studio,因为它的文件保存行为更耗时)以便下次打开表达式编辑器会使用这个位置、宽度和高度吗?

(我已经搜索过互联网,也在这里搜索过——但似乎没有人有这个问题)

【问题讨论】:

    标签: ireport


    【解决方案1】:

    由于我无处可寻,因此我迅速开发了 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 脚本,欢迎进行优化 :-)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多