Re: Dialog centering


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Grant Foraker on May 22, 2014 at 10:59:15:

In Reply to: Re: Dialog centering posted by Barbara Brazil on May 21, 2014 at 08:23:50:

Found these other methods (B-D), but yours seems to work with one tweak. cosState can be 0 and 1-4. 0 is center and 1-4 are the four screen quadrants. Hurray for nil! Soccer fan talk. NOT :)

!-------------------- method A ---------------------------------------------
gosub COS.GetFrameWnd
cosDlghDlg$ = cosCWnd$
cosCWnd$ = "@00000000@"
cosState = 0 ! center dialog in screen
gosub COS.SetWindowPos ! move the window

!-------------------- method B ---------------------------------------------
! Position the dialog centered within the inner "View" area of the window
Gosub COS.GetViewWnd ! Get handle to window we're centering on
cosState = 0 ! Center dialog in window
Gosub COS.SetWindowPos ! Move the window

!-------------------- method C ---------------------------------------------
! Position the dialog centered within the outer "Frame" area of the window
Gosub COS.GetFrameWnd ! Get handle to window we're centering on
cosState = 0 ! Center dialog in window
Gosub COS.SetWindowPos ! Move the window

!-------------------- method D ---------------------------------------------
! Position the dialog
Gosub COS.GetViewWnd
Gosub COS.GetWindowRect
cosDlgFlags = SWP.NOSIZE + SWP.SHOWWINDOW + SWP.NOZORDER
cosCol = cosRight - 325
cosRow = cosTop + 5
cosItemId = 0
cosCWnd$ = cosDlghDlg$
Gosub COS.SetWindowPosEx

Method C looked like it would be like A but it wasn't.

Found D a long time back. Can't remember where. But it seems to only move the dialog around inside the "View" window.

The info on COS.SetWindowPos and COS.SetWindowPosEx documentation is a mite confusing.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]