I have a CDialogBar with two CStatic that act as place holders for
two CDialogs.
On one of these dialogs I have a bunch of CStatics that act as holders
for pictures.
The idea behind this is that the user can drag and drop a pix from Dialog
A to Dialog B and this
picture gets drawn on the way through.
In my CDialogBar based class I'm catching a event when the user drags
this image from dlg A.
The last position (CRect) of this pix should get invalidated
and then this picture should be drawed onto the new location.
Unfortunately, when I do that the picture gets drawn but the dialog is
drawn on top of that.
I'm thinking that the paint() on CDialogBar is calling paint() on CDialog
afterwards.
The parent is calling the paint() for his children.
I would like the opposite. Paint the child first (CDialog) for the last
CRect,
then on top of that, paint this picture on the new CRect on the parent
(CDialogBar).
Is this possible? Is there any way to achieve this?
TIA
fade
--
fade
email: fade(*AT*)forward(*dot*)to
Key in dialogs is that you (a) must not draw on the dialog itself (b) must mark the dialog
with WS_CLICHILDREN and WS_CLIPSIBLINGS options.
In the case of using CStatics, you have avoided (a), but (b) might be the source of the
problem. Also note that up to but not including Vista, the DC for a control has a
clipping region equal to the clipping reigon of the parent (this has never made sense as
far as I can tell, and I'm always having to work around it; after only 20 years or so,
Microsoft has figured this out also and fixed it in Vista)..
When dragging images like this, one of the tricks is to create a window that has the same
image, create it as a popup, and the dragging operation drags this window. When you drop
it, you destroy the drag-image window. This solves a lot of refresh problems because the
window logic in the kernel handles most of the refresh problems.
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
you've said that the trick is to create a
window that has the same image and create it as a popup...
Is it possible to do that dynamically without going through the resource
routine? (Add a new resource, draw the popup, set a ID for it, create a
CWnd based on this ID...)
I did the following...
m_pMovingWnd = new CWnd();
m_pMovingWnd->Create( _T("STATIC"), _T("STATIC WINDOW"), WS_VISIBLE |
WS_CHILD, movingWndRect, this, 0);
This created a static wnd as a child of the CDialogBar.
How do I create a popup this way?
I've tried
m_pMovingWnd->Create( _T("STATIC"), _T("STATIC WINDOW"), WS_VISIBLE |
WS_POPUP, movingWndRect, this, 0);
but it crashes.
The following crashes also...
m_pMovingWnd->Create( _T("STATIC"), _T("STATIC WINDOW"), WS_VISIBLE |
WS_CHILD, movingWndRect, (CWnd*)&wndTopMost, 0);
How do I create the popup you said in runtime?
TIA
fade
Joseph M. Newcomer <newc...@flounder.com> wrote in
news:acae03psnbmugtaqh...@4ax.com:
--
fade
email: fade(*AT*)forward(*dot*)to