Embedding windows in windows

89 views
Skip to first unread message

Peter Horsbøll Møller

unread,
Sep 24, 2007, 9:41:58 AM9/24/07
to mapi...@googlegroups.com

Just thought I would share this with the list.

The questions about the graph window in a Info window style made me think about something that I had been trying to investigate before, but I just never found the time for this.

I was curious to see if it was possible to embed any window in a map window.
The short answer is "Yes, that is possible".

What I did was this:

1. Open a map window
2. Thru the MapBasic window run this command:
        Set Next Document Parent WindowInfo(FrontWindow(), 12) Style 1
3. Now open any new window, a browser, map, graph etc.
4. Now it looks as if your mapper also holds the new window.
5. Now run this command to change the size of the new window:
        Set window WindowID(2) width 8 units "cm" Height 8 units "cm"
6. Now you should be able to see the original map behind the window you embedded in the map.

I'm pretty sure you also can move the embedded window, but I haven't played with that yet.

So in this way it is possible to embed a graph in your map.
You can now see both the graph and the mapper at the same time.

Cool ?

Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  p...@cowi.dk
http://www.cowi.dk/gis

"Syn for sagen" er temaet for dette års MapInfo konference 2007.
Se programmet for konferencen her: http://www.cowi.dk/mapinfokonference

esrispy

unread,
Sep 24, 2007, 10:23:13 AM9/24/07
to MapInfo-L
excelent! that did the trick :-)
http://re3.mm-a2.yimg.com/image/2445412603

Bill Thoen

unread,
Sep 24, 2007, 11:32:38 AM9/24/07
to mapi...@googlegroups.com
The technique Peter suggests works perfectly, and you can also move,
rescale or do anything else that you can do in a window even if it's an
embedded one. For example, if your next document happens to be a map
window, these commands also work:

set map window WindowID(2) center (-96, 39) zoom 3500 units "mi"
set window WindowID(2) position (5,0) units "in"

You can also open and control multiple windows in the first window,
which is a slick way to avoid the problem of a maximized window hiding
the ones behind it. The downside is that the user doesn't have as much
direct control over the child windows, so you might have to do some
extra programming to mange it all.

- Bill Thoen

Peter Horsbøll Møller

unread,
Sep 24, 2007, 12:43:02 PM9/24/07
to mapi...@googlegroups.com
If you want to move and rescale the window, you should use this command when inserting the window:
 
Set Next Document Parent WindowInfo(FrontWindow(), 12) Style 2
or
 
Set Next Document Parent WindowInfo(FrontWindow(), 12) Style 3
In that way the window will have a small titlebar, you can hold the window with
 
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
5260 Odense S.
Denmark
 
Dir   +45 6311 4908


From: mapi...@googlegroups.com on behalf of Bill Thoen
Sent: Mon 24-Sep-07 17:32
To: mapi...@googlegroups.com
Subject: [MI-L] Re: Embedding windows in windows

Reply all
Reply to author
Forward
0 new messages