replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Menu in Child window?
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Menu in Child window?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
acp693



Joined: 04 Sep 2006
Posts: 56

PostPosted: Sun Apr 19, 2009 1:49 pm    Post subject: Menu in Child window? Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Mon Apr 20, 2009 10:52 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Mon Apr 20, 2009 11:04 am    Post subject: Reply with quote

%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
View user's profile Send private message AIM Address
acp693



Joined: 04 Sep 2006
Posts: 56

PostPosted: Mon Apr 20, 2009 11:36 am    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Wed Apr 22, 2009 5:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
acp693



Joined: 04 Sep 2006
Posts: 56

PostPosted: Thu Apr 23, 2009 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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