no form focus when made visible with SIZE event (OpenInsight 32-Bit)
At 12 OCT 2004 03:14:39PM Blair Massey wrote:
Gentlemen,
I've always used the code below to open all windows in our 16-bit application. Now, with OI32 bit, when a form is opened, there is no focus. It seems to be tied to setting the size property to make the form visible. All forms are created with VISIBLE set to false initially.
Here the code:
Utility('CURSOR','H')
if Assigned(parent) else
parent=Get_Property( @Window, 'PARENT' )end
* Get the size of the system (Resolution)
sysRes=Get_Property("SYSTEM" , "SIZE")
sysW=sysRes
sysH=sysRes
retval=Start_Window( window, parent,
) * If want Buyer to close all open windows * use this statement rather than above. Only * promblem is loose flexibility * retval=Start_Window( window, 'BUYER',
)* Get the size of the window to center
winSize=Get_Property(window , "SIZE" )
winWidth=winSize
winHeight=winSize
* Get the coordinates for the new window.
* The window should be first set to not visible
winOffsetFromTop=(sysH - winHeight) / 2
winOffsetFromLeft=(sysW - winWidth) / 2
* Set the size of the window which will also make the form visible
x=Set_Property( window , "SIZE" , winOffsetFromLeft:@FM:winOffsetFromTop:@FM:winWidth:@FM:winHeight)
Utility('CURSOR','A')
return
Anyway seen this behavior. The user can press F8 to set the focus, but this starts a fairly long chain of events.
Thanks,
Blair