Menu

Windows 10 style for DocView windows

Thien Egi
2016-10-25
2017-06-21
  • Thien Egi

    Thien Egi - 2016-10-25

    Hello,
    in my project all windows have the new look of Windows 10 except those created by GetDocManager()->CreateDoc(..). Theese have still the blue bar on the top and the thick borders. How can i change the style or should this be done by the OWLNExt libraries?
    Another issue is the open/save dialog. If I use such a dialog as TOpenSaveDialog, I can add the value OFN_ENABLESIZING (0x00800000) to the flag for making the open/save dialog resizeable. The same dialog provided by the DocManager is not resizeable and I don't know where to change the flag for it.
    Maybe someone can help here.
    Thanks,
    Thien

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2016-10-25

    dialog provided by the DocManager is not resizeable

    See TDocManager::SetAdditionalFileDialogFlags. This function was added by Jogy in 6.20 [r47].

    auto m = new TDocManager{dmMDI, this};
    m->SetAdditionalFileDialogFlags(OFN_EXPLORER | OFN_ENABLESIZING);
    SetDocManager(m);
    
     

    Related

    Commit: [r47]

    • Ivan Stepanov

      Ivan Stepanov - 2017-06-21

      Hi Vidar,

      Currently I use OWLNext 6.36 and VS 2015.
      Could you please advise how to force the TDocManager::CreateAnyDoc(0,0) to open the Open/Save dialog in Explorer-style (for example, when choose File->Open menu item).
      Using of the SetAdditionalFileDialogFlags(OFN_EXPLORER | OFN_ENABLESIZING) before :CreateAnyDoc(0,0) doesn't help. It only changes the old-style dialog box to resizeble.

      Thanks.
      Ivan Stepanov

       
      • Vidar Hasfjord

        Vidar Hasfjord - 2017-06-21

        Hi Ivan, sorry, not sure how to help. I use the code as shown above, and it works for me. Note that I set the additional flags at the point of creating the document manager.

         
        • Ivan Stepanov

          Ivan Stepanov - 2017-06-23

          Hi Vidar,
          thanks for your response.

          I was wrong, TDocManager::CreateAnyDoc(0,0) opens Explorer-style dialog always. SetAdditionalFileDialogFlags(OFN_EXPLORER | OFN_ENABLESIZING) makes it resizeble ( top picture in the attached file). While Win API function GetOpenFileName(&ofn) opens another kind of this dialog, which led me astray (bottom picture).

          By the way, TDocTemplate :: SetDefaultExt (char const) is declared in doctpl.h, but does not exist ( OWLNext 6.36).
          error LNK2019: unresolved external symbol "declspec(dllimport) public: void thiscall owl::TDocTemplate::SetDefaultExt(char const *)"

          Thanks,
          Ivan Stepanov

           
          • Vidar Hasfjord

            Vidar Hasfjord - 2017-06-24

            TDocManager::CreateAnyDoc calls SelectDocPath, which uses TDvFileOpenDialog, which in turn uses the Windows API function GetOpenFileName under the hood. The dialog style depends on how the OPENFILENAME structure is initialised. OWLNext always provides a custom hook (to let TFileOpenDialog subclass the dialog), and I guess that is what gives us the original Explorer look, rather than the latest modern look.

            However, note that you can get a slightly more modern style by enabling Common Controls version 6 in your application (needs a manifest). See FAQ.

            By the way, TDocTemplate :: SetDefaultExt (char const) is declared in doctpl.h, but does not exist

            Good catch! Looks like this is also the case for SetFileFilter and SetDescription. Please report this issue in the bug tracker.

             
            • Ivan Stepanov

              Ivan Stepanov - 2017-06-26

              Thanks Vidar,

              I've sent report.

               
  • Thien Egi

    Thien Egi - 2016-10-26

    Hi Vidar,
    that works. Thank-you. Because there are many different doc-view in my project, I added the line
    GetDocManager()->SetAdditionalFileDialogFlags(OFN_EXPLORER | OFN_ENABLESIZING);
    into the InitMainWidow() function and it seems to set that flag for resizeable now global.

    Do you have any idea about the issue about the different window border look unter Windows 10?

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2016-10-26

    different window border look [for MDI Child Windows]

    This is a known issue. Microsoft has deprecated MDI, and the look of the MDI Child Window has not been updated since the classic theme in Vista.

    E.g. see this post at ClarionHub:

    MDI Child Window vs Non MDI Child Windows 10 appearance

    However, you can write your own skinning code, painting the non-client area of the window.

    Tip: In my own MDI-based software, I allow the user to toggle off the painting of the title area altogether (WS_CAPTION), thus getting neater tiling and better use of screen space.

    In the long term, consider rewriting your code to use better workspace management.

    See UI design for multiple views in the Knowledge Base.

     

    Related

    Wiki: Knowledge_Base
    Wiki: UI_design_for_multiple_views

Anonymous
Anonymous

Add attachments
Cancel