home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2240.zip / wxWindows-2.4.0 / src / generic / statline.cpp < prev    next >
C/C++ Source or Header  |  2002-07-29  |  2KB  |  78 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        generic/statline.cpp
  3. // Purpose:     a generic wxStaticLine class
  4. // Author:      Vadim Zeitlin
  5. // Created:     28.06.99
  6. // Version:     $Id: statline.cpp,v 1.7 2002/07/29 21:05:43 MBN Exp $
  7. // Copyright:   (c) 1998 Vadim Zeitlin
  8. // Licence:     wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10.  
  11. // ============================================================================
  12. // declarations
  13. // ============================================================================
  14.  
  15. // ----------------------------------------------------------------------------
  16. // headers
  17. // ----------------------------------------------------------------------------
  18.  
  19. #ifdef __GNUG__
  20.     #pragma implementation "statline.h"
  21. #endif
  22.  
  23. // For compilers that support precompilation, includes "wx.h".
  24. #include "wx/wxprec.h"
  25.  
  26. #ifdef __BORLANDC__
  27.     #pragma hdrstop
  28. #endif
  29.  
  30. #include "wx/statline.h"
  31. #include "wx/statbox.h"
  32.  
  33. // ============================================================================
  34. // implementation
  35. // ============================================================================
  36.  
  37. IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
  38.  
  39. // ----------------------------------------------------------------------------
  40. // wxStaticLine
  41. // ----------------------------------------------------------------------------
  42.  
  43. bool wxStaticLine::Create( wxWindow *parent,
  44.                            wxWindowID id,
  45.                            const wxPoint &pos,
  46.                            const wxSize &size,
  47.                            long style,
  48.                            const wxString &name)
  49. {
  50.     if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
  51.         return FALSE;
  52.  
  53.     // ok, this is ugly but it's better than nothing: use a thin static box to
  54.     // emulate static line
  55.  
  56.     wxSize sizeReal = AdjustSize(size);
  57.  
  58.     m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name);
  59.  
  60.     return TRUE;
  61. }
  62.  
  63.  
  64. WXWidget wxStaticLine::GetMainWidget() const
  65. {
  66.     return m_statbox->GetMainWidget();
  67. }
  68.  
  69. void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags)
  70. {
  71.     m_statbox->SetSize(x, y, width, height, sizeFlags);
  72. }
  73.  
  74. void wxStaticLine::DoMoveWindow(int x, int y, int width, int height)
  75. {
  76.     m_statbox->SetSize(x, y, width, height);
  77. }
  78.