我的应用程序中有一个滚动窗口,我在其中创建了一个绘图区域小部件。在绘图区域中,我放置了多个图像。当用户在搜索框中输入有关图像的信息时,相应的图像会突出显示。
我的问题是如何让应用程序自动滚动到突出显示的图像框,而无需用户使用滚动条。滚动窗口应自动移动视图区域,以显示突出显示的图像所在的区域。
滚动窗口上使用的滚动策略是 XmAUTOMATIC。
任何指针将不胜感激。在此先感谢。
如果这不起作用,请尝试 XmScrollVisible(),那么您将需要:
1. Find out the size of the work area.
2. Find out the size and position of the clip window.
3. Find out the max/ min values for the horizontal scrollbar.
4. Use XmScrollBarGetValues() for the horizontal scrollbar to get its position within the max/min values.
5. Do some math magic to determine how much to move the horizontal scrollbar to get the work area to show through the clip window.
6. Call XmScrollBarSetValues() with Notify = True.
7. Repeat for the Vertical scrollbar.
高温高压