1 / 12

Chapter 18

Chapter 18. Splitter Windows and Multiple Views. The Splitter Windows. An object of class CSplitterWnd represents the splitter window. As far as Windows is concerned, a CSplitterWnd object is an actual window that fully occupies the frame window (CFrameWnd or CMDIChildWnd) client area.

reilly
Download Presentation

Chapter 18

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 18 Splitter Windows and Multiple Views

  2. The Splitter Windows • An object of class CSplitterWnd represents the splitter window. • As far as Windows is concerned, a CSplitterWnd object is an actual window that fully occupies the frame window (CFrameWnd or CMDIChildWnd) client area. • Like RichText did

  3. View Options • SDI application with splitter window, single view class • SDI application with splitter window, multiple view classes • SDI application with no splitter windows, multiple view classes • MDI application with no splitter windows, single view class • MDI application with no splitter windows, multiple view classes • MDI application with splitter child windows

  4. Dynamic and Static Splitter Windows • The user can split the window at any time by choosing a menu command or by dragging a splitter box. • The panes are pre defined and can not be changed, However the user can move the split changing the size of them.

  5. Ex18a Example: A Single View Class SDI Dynamic Splitter • the user can dynamically split the view into four panes with four separate view objects, all managed by a single view class. • You create an SDI project and select Split Window on the User Interface Features page (That was hard  ) • MFC Application Wizard adds code to your CMainFrame class. You can also add this code to a current project.

  6. 18 A

  7. Ex18b Example: A Double View Class SDI Static Splitter • Defines a second view class and allowing a static splitter window to show the two views. • The splitter is initialized with two panes each with it’s own view class. (Hex and String code in text)

  8. 18 B

  9. Ex18c Example: Switching View Classes Without a Splitter • Ex18c is an SDI application that switches between the CStringView and CHexView with commands from the View menu. • Button / check menu handlers are needed to switch the views used. • E.G. GetActiveView()->IsKindOf(RUNTIME_CLASS(CStringView)));

  10. 18 C

  11. Ex18d Example: A Multiple View Class MDI Application • Ex18d, creates a multiple view class MDI application without a splitter window. • This example uses the CDocTemplate object and code hooks in both the application and main frame classes

  12. 18D

More Related