Unix Technical Forum

Development question

This is a discussion on Development question within the pgsql Interfaces Pgadmin Hackers forums, part of the PostgreSQL category; --> Hi. I'm well on my way to making a working Window menu (which I guess is only necessary in ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:30 PM
Leon Miller-Out
 
Posts: n/a
Default Development question

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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 05:31 PM
leon-pg@comvision.com
 
Posts: n/a
Default Re: Development question

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...rentframe.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



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 05:31 PM
Andreas Pflug
 
Posts: n/a
Default Re: Development question

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...rentframe.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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 05:31 PM
Andreas Pflug
 
Posts: n/a
Default Re: Development question

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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:27 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com