123456789101112131415161718192021222324 |
- $PBExportHeader$f_wcenter.srf
- $PBExportComments$把窗口移到主窗口的中间--函数
- global type f_wcenter from function_object
- end type
- forward prototypes
- global subroutine f_wcenter (window f_win)
- end prototypes
- global subroutine f_wcenter (window f_win);//把窗口移到主窗口的中间
- int lx=640,ly=480
- environment env
- if GetEnvironment(env)=1 then
- lx=env.ScreenWidth
- ly=env.ScreenHeight
- end if
- lx=PixelsToUnits(lx,XPixelsToUnits!)
- ly=PixelsToUnits(ly,YPixelsToUnits!)
- lx=(lx -f_win.Width)/2
- ly=(ly -f_win.Height)/2
- f_win.Move(lx,ly)
- end subroutine
|