Thread: Development question

Development question

From
Leon Miller-Out
Date:
Hi. I'm well on my way to making a working Window menu (which I guess
is only necessary in OS X, but might be nice in other OSes as well).
The Window menu will list all of the open windows and allow the user to
switch between them. I was given a good head start by the existence of
the windowList "frames" in frmMain. I'm now at the point of needing
some communication between the various other types of pgFrames and
frmMain, and I'm not sure how to best set that up. Here are my specific
questions:

Since the frames list is in frmMain, I either need to A) make the
contents of the frames list available to the other various pgFrames so
they can build their Window menus, or B) build the Window menu in
frmMain and make it available to the pgFrames to add to their menu
bars. I'm leaning towards B (and any input is appreciated), but in
either case the pgFrames need to be able to call a function in frmMain.
Hence, they'll need a reference to frmMain. It looks like the pgFrames
get a reference as part of their constructor:

     pgFrame(wxFrame *parent, const wxString &title, const wxPoint&
pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long
flags=wxDEFAULT_FRAME_STYLE)
         : wxFrame(parent, -1, title, pos, size, flags) { changed=false;
recentFileMenu=0; windowMenu=0; }

How can I take the *parent reference and save it for future use?

Thanks! I apologize for being such a n00b. :-)  If anyone can help me
out off-list, maybe we can do this without bothering everyone else.

Leon


Re: Development question

From
Andreas Pflug
Date:
Leon Miller-Out wrote:
> Hi. I'm well on my way to making a working Window menu (which I guess is
> only necessary in OS X, but might be nice in other OSes as well).

Does this mean you're running pgAdmin3 successfully under OSX? No more
problems? If so, please report your setup (OSX/wx version, configure
options).

> The
> Window menu will list all of the open windows and allow the user to
> switch between them.

This sounds like MDI's window menu, but we're SDI. If there's some
window/topFrame registration/setup missing to allow the desktop to
switch between frames, then wxWidgets should do the stuff; it can't be
up to pgAdmin to manage the windows.

Regards,
Andreas

Re: Development question

From
leon-pg@comvision.com
Date:
Andreas, I understand where you're coming from. The issue arises
because of a fundamental difference in Mac OS vs Windows/Linux window
management. All Mac OS applications are a hybrid of MDI and SDI. I'll
try to explain:

SDI Features
- There's generally no parent window enclosing the document windows

MDI Features
- Every app has a Window menu listing all of the app's open windows.
This, along with the Cmd-` keyboard shortcut, are the two methods for
accessing other windows of your app without clicking directly on them.
- There's only one Dock icon per application, regardless of how many
windows are open

Since pgAdmin is not a wxWidgets MDI app, I don't think that wxWidgets
is going to provide us with the Window menu.
(http://www.wxwidgets.org/manuals/2.5.3/wx_wxmdiparentframe.html) I'm
not familiar enough with wxWidgets to know if it can be made to provide
a Window menu for SDI apps.

pgAdmin seems like it's part of the way towards fitting the OS X model
nicely. As I mentioned before, the work of tracking open frames was
already done for me. A search of the source for "frames" reveals this
code. Building a Window menu based on the frame list shouldn't be hard.
The other related issue is full Cmd-` support.
I am able to Cmd-` from the main window to a query window, but when I
try to Cmd-` back to the main window, I just get a ` in the SQL text
area.


Since there's currently no way to get to completely-covered pgAdmin3
windows without dragging other windows around to uncover them, I'm
using Mac OS X's Expose feature as a workaround. Using the single-app
mode of Expose, I can see all of my open pgAdmin3 windows in a sort of
tiled view. (See the screenshot above F10 at
http://www.apple.com/macosx/features/expose/ if you're not familiar
with this).

Leon


On Feb 14, 2005, at 5:54 AM, Andreas Pflug wrote:

> Leon Miller-Out wrote:
>
>> The Window menu will list all of the open windows and allow the user
>> to switch between them.
>
> This sounds like MDI's window menu, but we're SDI. If there's some
> window/topFrame registration/setup missing to allow the desktop to
> switch between frames, then wxWidgets should do the stuff; it can't be
> up to pgAdmin to manage the windows.
>
> Regards,
> Andreas


Re: Development question

From
Andreas Pflug
Date:
leon-pg@comvision.com wrote:
> Andreas, I understand where you're coming from. The issue arises because
> of a fundamental difference in Mac OS vs Windows/Linux window
> management. All Mac OS applications are a hybrid of MDI and SDI. I'll
> try to explain:
>
> SDI Features
> - There's generally no parent window enclosing the document windows
>
> MDI Features
> - Every app has a Window menu listing all of the app's open windows.
> This, along with the Cmd-` keyboard shortcut, are the two methods for
> accessing other windows of your app without clicking directly on them.
> - There's only one Dock icon per application, regardless of how many
> windows are open
>
> Since pgAdmin is not a wxWidgets MDI app, I don't think that wxWidgets
> is going to provide us with the Window menu.
> (http://www.wxwidgets.org/manuals/2.5.3/wx_wxmdiparentframe.html) I'm
> not familiar enough with wxWidgets to know if it can be made to provide
> a Window menu for SDI apps.
>
> pgAdmin seems like it's part of the way towards fitting the OS X model
> nicely. As I mentioned before, the work of tracking open frames was
> already done for me. A search of the source for "frames" reveals this
> code. Building a Window menu based on the frame list shouldn't be hard.
> The other related issue is full Cmd-` support.
> I am able to Cmd-` from the main window to a query window, but when I
> try to Cmd-` back to the main window, I just get a ` in the SQL text area.

Ok, so MAC obviously needs a hint which frames are there, still I'd
guess that there's already a mac specific function wx function for that
(like that wxApp::s_macAboutMenuId in frmMain). I'd expect a wxMAC
function to be called in every frame to register it in the window list
(IMHO this should happen in wxTopLevelWindow automatically). Please try
a multi-windowed sample in wx, and post your results to wx. Finally,
that'll probably more helpful.

Regards,
Andreas