statline.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/statline.h
  3. // Purpose: MSW version of wxStaticLine class
  4. // Author: Vadim Zeitlin
  5. // Created: 28.06.99
  6. // Copyright: (c) 1998 Vadim Zeitlin
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_OS2_STATLINE_H_
  10. #define _WX_OS2_STATLINE_H_
  11. // ----------------------------------------------------------------------------
  12. // wxStaticLine
  13. // ----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
  15. {
  16. public:
  17. // constructors and pseudo-constructors
  18. wxStaticLine() { }
  19. wxStaticLine( wxWindow* pParent
  20. ,wxWindowID vId = wxID_ANY
  21. ,const wxPoint& rPos = wxDefaultPosition
  22. ,const wxSize& rSize = wxDefaultSize
  23. ,long lStyle = wxLI_HORIZONTAL
  24. ,const wxString& rsName = wxStaticLineNameStr
  25. )
  26. {
  27. Create(pParent, vId, rPos, rSize, lStyle, rsName);
  28. }
  29. bool Create( wxWindow* pParent
  30. ,wxWindowID vId = wxID_ANY
  31. ,const wxPoint& rPos = wxDefaultPosition
  32. ,const wxSize& rSize = wxDefaultSize
  33. ,long lStyle = wxLI_HORIZONTAL
  34. ,const wxString& rsName = wxStaticLineNameStr
  35. );
  36. inline bool IsVertical(void) const { return((GetWindowStyleFlag() & wxLI_VERTICAL) != 0); }
  37. inline static int GetDefaultSize(void) { return 2; }
  38. //
  39. // Overridden base class virtuals
  40. //
  41. inline virtual bool AcceptsFocus(void) const {return FALSE;}
  42. protected:
  43. inline wxSize AdjustSize(const wxSize& rSize) const
  44. {
  45. wxSize vSizeReal( rSize.x
  46. ,rSize.y
  47. );
  48. if (IsVertical())
  49. {
  50. if (rSize.x == -1 )
  51. vSizeReal.x = GetDefaultSize();
  52. }
  53. else
  54. {
  55. if (rSize.y == -1)
  56. vSizeReal.y = GetDefaultSize();
  57. }
  58. return vSizeReal;
  59. }
  60. inline wxSize DoGetBestSize(void) const { return (AdjustSize(wxDefaultSize)); }
  61. //
  62. // Usually overridden base class virtuals
  63. //
  64. virtual WXDWORD OS2GetStyle( long lStyle
  65. ,WXDWORD* pdwExstyle
  66. ) const;
  67. private:
  68. DECLARE_DYNAMIC_CLASS(wxStaticLine)
  69. }; // end of CLASS wxStaticLine
  70. #endif // _WX_OS2_STATLINE_H_