 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Sun Apr 19, 2009 1:49 pm Post subject: Menu in Child window? |
|
|
Is it possible to have menus in a %aw child window residing in a MDI parent frame?
Using the attach window %aw example from the Help files with an additional line for a menu item doesn't work. Anyone any ideas? Thanks.
Best regards
Albert
Code: | WINAPP
INTEGER ctrl,winio@
EXTERNAL open_func
CHARACTER*128 fname
COMMON ctrl
fname='*.f95'
i=winio@('%ww[no_border]&')
i=winio@('%mn[&File[&Open]]&', 'FILE_OPENR[Open]',fname,'+',open_func,'EDIT_FILE',fname)
i=winio@('%mn[[E&xit]]&','EXIT')
i=winio@('%pv%fr&',400L,300L)
i=winio@('%lw',ctrl)
END
INTEGER FUNCTION open_func()
COMMON ctrl
INTEGER ctrl,winio@
i=winio@('%pv%aw&',ctrl)
i=winio@('%mn[Exit]&', 'EXIT') ! Menu item in child window
i=winio@('%20.8eb[no_border]','*',0L)
open_func=1
END |
|
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Mon Apr 20, 2009 10:52 am Post subject: |
|
|
Albert,
I think that the Windows standard is not to have menus in child windows. There is nothing to stop you launching other windows (not child windows) that do have menus.
The norm for child windows is for the menus in the parent window to act on the contents of the child window that has focus. (The same goes for any "toolbars"). If the child windows have different characteristics (e.g. one is a spreadsheet, another is a graph) then you may need to do some quick work adjusting the grey state of the items in the menus in the parent window, or even altering those menus dynamically (add_menu_item@ and remove_menu_item@ - or enhanced menus).
This strikes me as an application for "add_focus_monitor@" .
Eddie |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Apr 20, 2009 11:04 am Post subject: |
|
|
%mn is not implemented in the mdi child window.
In theory it ought to modify the main menu in the frame but this does not happen. The problem is that the child can be maximised and then the child menu would not be visible.
I guess that given time and a lot of effort, ClearWin+ could be improved in this respect but I would suggest using either %pm to get a context menu in the child window or %sm to modify the system menu (hopefully in the child window). |
|
Back to top |
|
 |
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Mon Apr 20, 2009 11:36 am Post subject: |
|
|
Thank you Eddie and Paul.
I didn't realise that it's not standard to have menus in child windows, I'll look into the suggestions you both gave.
I'm rewriting parts of my application which has at the moment an analysis section including graphics region, a spreadsheet section and an animation section on three seperate property sheets. But because I can't work out how to make propertysheets resizable when they include a graphics region, I'm considering using child windows instead of propertysheets for the different sections of the application. Although propertysheets are very appealing and good for the work flow when using the application.
Best regards
Albert |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Wed Apr 22, 2009 5:02 pm Post subject: |
|
|
Albert,
"Multiple documents" can mean (for example) several documents of the same type (as in Word), or what you are doing, (and what I do) which is to have several windows of different types but all related to the same problem. Can I suggest putting your scalable graphics in the main window, and when the graphics are updated, minimise your other windows using SHOWWINDOW (below)?
Code: | INCLUDE <WINDOWS.INS>
LOGICAL Q
Q=SHOWWINDOW (IHWND, SW_MINIMIZE) |
(IHWND is the handle to the window you want to minimise)
This works very well for me. If you put this in the callback to the %gr window, then resizing also shuffles the "data input" window and the "numerical results" window (as I call them in my program) out of the way (but doesn't close them).
Eddie |
|
Back to top |
|
 |
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Thu Apr 23, 2009 8:55 am Post subject: |
|
|
Eddie,
Thank you for the suggestion, it sounds a very good idea. I'll have a play with that tonight and see if I can get an example working.
Best regards
Albert |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|