Solved

Dragging Gray Region over multiple windows

Posted on 1999-01-11
2
264 Views
Last Modified: 2013-12-26
I have a "parent" index window which contains three "child" windows: a left pane, a right pane, and a divider pane.  I want the user to be able to mouse-click on the divider pane, drag a gray region of the divider pane anywhere over all three of the "child" windows, release the mouse button, and then have all "child" windows reposition themselves.  I have everything working except for dragging the Gray region over multiple windows.  How can this be done?  DragGrayRgn() does not seem to suffice as it only drags within one window.  I am dragging in the content area of the "parent" window which is covered up by the "child" windows.  How can I see the Dragged region while at the same time showing my "child" windows?  Please Help!
0
Comment
Question by:osibrian
2 Comments
 
LVL 2

Accepted Solution

by:
roov earned 100 total points
ID: 1291704
The easiest way would probably be to track the dragging your self (using StillDown() ).

This code is the skeleton, let me know if you need more...
Point mouseLoc, lastMouseLoc = {-1,-1};
while (::StillDown()) {
      ::GetMouse(&mouseLoc);
      if ((mouseLoc.h != lastMouseLoc.h) ||
            (mouseLoc.v != lastMouseLoc.v))
      {
            // we moved...
            lastMouseLoc = mouseLoc;
            
            // undraw previous region (using xor mode...)
            
            // draw new region, using xor mode...                  
      }
}

0
 

Author Comment

by:osibrian
ID: 1291705
The better solution I found was to Create a Graphics Port (not a Window) the same size as the Entire Desktop under the menu bar. (See GetGrayRgn()). Then I copy some of the info from GetGrayRgn() into my new Graphics Port.  Once this is done, I can use DragGrayRgn() to accomplish the task of dragging my Gray Region over any number of windows at once.  The effect is just what I wanted.  If any of you would like the same code for doing this, send me an E-mail.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now