Thread: Transforming dialogs to MDI

  1. #1
    Registered User
    Join Date
    Nov 2004
    Location
    Slovenia, Europe
    Posts
    115

    Transforming dialogs to MDI

    It's possible to convert dialogs into MDI Child Windows without loosing everything I've done with resources ?
    [C++]
    IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
    2nd compiler: g++ (GCC 3.4.3/4.0.0)
    3rd compiler: Borland 5.5
    [C#]
    IDE: Microsoft Visual C# Express 2005
    2nd IDE: SharpDevelop
    2nd compiler: csc in Command Prompt
    .NET Framework: 2.0
    [PHP]
    Core: 5.1.0 beta 3
    IDE: PHPEdit
    2nd IDE: Notepad
    Favourite extensions: exif,gd2,mysql
    Favourite PEAR packages: DB, XML_RSS, ID3
    Favourite databases: SQLite, MySQL

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    One option would be to create a custom window class based on the dialog class (see Custom Dialog Boxes); this window class, once modified would become an mdi child window class. Another option is to just glue your dialog (borderless) onto the client area of an mdi child window(ie. make the dialog a child of the mdi child window), which would probably be much simpler, particularly if you're not familiar with custom dialogs.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Location
    Slovenia, Europe
    Posts
    115
    Thanks, but how can I glue dialog to MDI Child Window ?
    [C++]
    IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
    2nd compiler: g++ (GCC 3.4.3/4.0.0)
    3rd compiler: Borland 5.5
    [C#]
    IDE: Microsoft Visual C# Express 2005
    2nd IDE: SharpDevelop
    2nd compiler: csc in Command Prompt
    .NET Framework: 2.0
    [PHP]
    Core: 5.1.0 beta 3
    IDE: PHPEdit
    2nd IDE: Notepad
    Favourite extensions: exif,gd2,mysql
    Favourite PEAR packages: DB, XML_RSS, ID3
    Favourite databases: SQLite, MySQL

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    If the dialog is a child window just make its dimensions relative to the parent (mdi child) window's client area. Failing that, just SetWindowPos in the dialog's WM_INITDIALOG handler.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    Registered User
    Join Date
    Nov 2004
    Location
    Slovenia, Europe
    Posts
    115
    Can you give me an example?
    [C++]
    IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
    2nd compiler: g++ (GCC 3.4.3/4.0.0)
    3rd compiler: Borland 5.5
    [C#]
    IDE: Microsoft Visual C# Express 2005
    2nd IDE: SharpDevelop
    2nd compiler: csc in Command Prompt
    .NET Framework: 2.0
    [PHP]
    Core: 5.1.0 beta 3
    IDE: PHPEdit
    2nd IDE: Notepad
    Favourite extensions: exif,gd2,mysql
    Favourite PEAR packages: DB, XML_RSS, ID3
    Favourite databases: SQLite, MySQL

  6. #6
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Oops, forgot about this - example attached (drop the .txt from script.rc.txt; cprog doesn't currently permit upload of *.rc files).
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Editor design: Traditional MDI versus Tabbed MDI
    By psychopath in forum Game Programming
    Replies: 7
    Last Post: 01-22-2007, 07:48 AM
  2. Inserting text into MDI program
    By Rutabega in forum Windows Programming
    Replies: 0
    Last Post: 12-23-2005, 11:25 AM
  3. MDI Problem
    By Rare177 in forum Windows Programming
    Replies: 3
    Last Post: 04-12-2005, 01:29 PM
  4. mdi workspace
    By Elyubarov in forum Windows Programming
    Replies: 10
    Last Post: 04-03-2005, 03:40 PM
  5. Modeless Dialogs in Multiple threads
    By MrGrieves in forum Windows Programming
    Replies: 0
    Last Post: 06-22-2004, 01:33 PM