15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


To keep dialog boxes/property pages inside mainframe

Akshay_Patel@pcmailgw.ml.com
Monday, July 01, 1996

     MFC 2.5/VC++1.52C; Windows 3.1
     
     I am working with an application development which uses many dialog 
     boxes and property pages. Users should be able to open any dialog box 
     and/or property sheet from menu. Users should be allow to open many 
     dialog boxes and/or property sheets simultaneously and all of them 
     should stay inside mainframe window of an application.
     
     Is any one know how to solve this problem, I appreciate your help.
     
     Thanks.
     
     Akshay Patel




Rkumar_at_CalSoft-ElNet@mail.cswl.com
Monday, July 08, 1996

[Mini-digest: 4 responses]

     to open many dialogs simultaneously you could use Modeless dialogs 
     boxes.
     
-----From: "Grant Shirreffs (Great Elk)" 


Also known as an MDI application?  Lots of simultaneous windows means   
they must be modeless? Lots of modeless windows, all of which are   
restricted to within the main window, sounds very like MDI to me.

Grant Shirreffs
grant.s@greatelk.co.nz

-----From: jimt1@voicenet.com (Jim Tannenbaum)

        Try modeless dialog boxes (See Inside Visual C++ by Kruglinsky for
the technical low down).  You can set the size of the dialog boxes (and
their placement) in the OnInitDialog call.  One word of caution.  Modeless
dialog boxes send focus back to the frame, not the last dialog box open.
You will have to manage the focus by yourself if you want a different behavior.


-----From: Vilas Patil 


Hi Akshay

Going by the way u described your application I suggest you should go for 
following scheme:
     - Create as many dlg templates u want
     - Style of the templates should be ws_child and NO border
     - Whenever u want to show dialog, place these templates in a child 
window (u should create child window of your main window before this oper.)
     - Handle notification messages.  All you got to do is reflect these msg 
to the respective parent.

Good luck

Vilas
vilasp@inf.com



David.Lowndes@bj.co.uk
Friday, July 05, 1996

[Mini-digest: 3 responses]

>     MFC 2.5/VC++1.52C; Windows 3.1
>     
>     I am working with an application development which uses many dialog 
>     boxes and property pages. Users should be able to open any dialog box 
>     and/or property sheet from menu. Users should be allow to open many 
>     dialog boxes and/or property sheets simultaneously and all of them 
>     should stay inside mainframe window of an application.
>

I'm not aware of any way to constrain dialogs (modal or modeless) to the
boundaries of their application's window. You would get this effect if you used
child windows, so you should be able to get the same results using
CFormView instead.

If you have to use modeless dialogs then you would need to implement this
facility yourself, possibly by checking when the user has moved the dialog,
and re-positioning it within the frame's boundary.

Dave Lowndes
-----From: Roger Onslow/Newcastle/Computer Systems Australia/AU 

Not trying to tell you what to do, but...

Dialogs and property sheets are *supposed* to be separate windows (not 
constrained to the main application).  This is the way most (if not all) 
Windows applications work and (from memory) is the recommendation from the 
Win95 guidelines.

Have you considered an MDI application, where the views a CFormViews?  In that 
case the windows (ie dialogs) *are* supposed to be constrained to the parent 
windows.

Of course you can set flags for windows to behave in the manner you require, 
but I don't have time right now to research this for you.  I will try to send 
further info if you wish at a later date.

           /|\        Roger Onslow
      ____|_|.\       ============
    _/.........\Senior Software Engineer
   /CCC.SSS..A..\
  /CC..SS...A.A..\   Computer
 /.CC...SS..AAA...\       Systems
/\.CC....SSAA.AA../            Australia
\ \.CCCSSS.AA.AA_/
 \ \...........//      Ph: +61 49 577155
  \ \...._____//      Fax: +61 49 675554
   \ \__|_/\_//    RogerO@compsys.com.au
    \/_/  \//


-----From: Vilas Patil 
     
     
Hi Akshay
     
Going by the way u described your application I suggest you should go for 
following scheme:
     - Create as many dlg templates u want
     - Style of the templates should be ws_child and NO border
     - Whenever u want to show dialog, place these templates in a child 
window (u should create child window of your main window before this oper.)
     - Handle notification messages.  All you got to do is reflect these msg 
to the respective parent.
     
Good luck
     
Vilas
vilasp@inf.com





| Вернуться в корень Архива |