splitterwindow.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: splitterwindow.h
  3. // Purpose: topic overview
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @page overview_splitterwindow wxSplitterWindow Overview
  9. @tableofcontents
  10. @see wxSplitterWindow
  11. @section overview_splitterwindow_appearance Appearance
  12. The following screenshot shows the appearance of a splitter window with a
  13. horizontal split.
  14. The style wxSP_3D has been used to show a 3D border and 3D sash.
  15. @image html overview_splitter_3d.png
  16. @section overview_splitterwindow_example Example
  17. The following fragment shows how to create a splitter window, creating two
  18. subwindows and hiding one of them.
  19. @code
  20. splitter = new wxSplitterWindow(this, -1, wxPoint(0, 0),
  21. wxSize(400, 400), wxSP_3D);
  22. leftWindow = new MyWindow(splitter);
  23. leftWindow->SetScrollbars(20, 20, 50, 50);
  24. rightWindow = new MyWindow(splitter);
  25. rightWindow->SetScrollbars(20, 20, 50, 50);
  26. rightWindow->Show(false);
  27. splitter->Initialize(leftWindow);
  28. // Set this to prevent unsplitting
  29. // splitter->SetMinimumPaneSize(20);
  30. @endcode
  31. The next fragment shows how the splitter window can be manipulated after
  32. creation.
  33. @code
  34. void MyFrame::OnSplitVertical(wxCommandEvent& event)
  35. {
  36. if ( splitter->IsSplit() )
  37. splitter->Unsplit();
  38. leftWindow->Show(true);
  39. rightWindow->Show(true);
  40. splitter->SplitVertically( leftWindow, rightWindow );
  41. }
  42. void MyFrame::OnSplitHorizontal(wxCommandEvent& event)
  43. {
  44. if ( splitter->IsSplit() )
  45. splitter->Unsplit();
  46. leftWindow->Show(true);
  47. rightWindow->Show(true);
  48. splitter->SplitHorizontally( leftWindow, rightWindow );
  49. }
  50. void MyFrame::OnUnsplit(wxCommandEvent& event)
  51. {
  52. if ( splitter->IsSplit() )
  53. splitter->Unsplit();
  54. }
  55. @endcode
  56. */