Bring Database Windows to Front

I often have several databases going at the same time, each with several of their own windows open. I thought it would be a good idea to have a way to bring all the windows of a selected database to the front when I’m focusing on that particular file. The Window menu has “Bring All to Front” with command-7 as the shortcut. Not exactly what i needed so I wrote a custom Hotkey using command-8 to do the job.

This Hotkey will pop up a list of open databases (including any secret ones) from which to choose. If no choice is made nothing happens. If a visible database is selected then all the associated open windows for that database will be brought forward including forms, procedures and the data sheet. If a secret file is selected it will open the data sheet for that file and make it active (this alone makes it very handy).

definehotkeys "Global", "COMMAND-8", |||let _targetDB=""
popupatmouse  info("files"),"",_targetDB
if _targetDB=""   // no file selected
let _dbWindowNames= listwindows(_targetDB)
If _dbWindowNames = ""    // this is a secret file
    setactivedatabase _targetDB
looparray _dbWindowNames,cr(),element,index
    window element

You can place this code in the .Initialize procedure of a file that always opens with Panorama or in your custom Library file - if you have one. This Hotkey will trigger even if you have a procedure window front-most. It would be nice to have this in the Window menu instead of as a Hotkey…

Knowing my track record, Jim might already have a feature like this embedded somewhere I’m not aware of and I’m just reinventing the wheel.


Very nice.

What I have been dreaming about is the same concept but for my ‘file sets’. Bring forward a group of databases (or tables more precisely) that are used together. I often have several projects or sets of databases that I would like to bring forward. I do miss sets.

I don’t think I realized that popupatmouse could be used to bring up a popup menu from a hotkey like that. There could be all sorts of cool stuff that could be done with that!