将4GL窗口放置在中心 [英] Positioning a 4GL window in center
问题描述
我在整个4gl程序中有多个窗口,必须将它们定位在屏幕中央。例如:
I'm having multiple windows throughout my 4gl program where I have to position to the center of the screen. For example:
OPEN WINDOW w_yesno AT 10, 10
WITH 4 ROWS, 56 COLUMNS
ATTRIBUTE (BORDER, MESSAGE LINE FIRST+1,
PROMPT LINE FIRST+2)
是否有我可以使用关键字自动在中心打开它吗?像这样的东西:
Is there any keyword I can use to automatically open it in the center? Something like:
OPEN WINDOW w_yesno AT CENTER
推荐答案
不,没有针对中心窗口的关键字解决方案。您可以将变量用于位置并进行计算,也可以先验计算并使用硬编码的位置,如图所示。如果您的窗口尺寸不是24x80,则计算可能会更好。
No, there isn't a keyword solution to centring windows. You can use variables for the positions and do the calculation, or you can do the calculation a priori and use hard-coded positions as you've shown. If your window size is not 24x80, calculation is perhaps better.
在遥远的过去,我编写了一些代码,其中屏幕下方的窗口数量可变,其中一些带有2行,有些带有3行,有些带有4行;那么您必须通过计算来定位它们。
In the dim distant past, I wrote some code where there were a variable number of windows down the screen, some of them with 2 lines, some with 3, some with 4 lines; then you have to position them all with calculations.
这篇关于将4GL窗口放置在中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!