X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6ebb51430cd8e4a9a11c6c5a5ca7c3ff9d7a72a..4d876ee3f727afa0d79aa5f7b03bf9a59673bef6:/include/wx/os2/statline.h diff --git a/include/wx/os2/statline.h b/include/wx/os2/statline.h index ccab4479ed..a0142e87b6 100644 --- a/include/wx/os2/statline.h +++ b/include/wx/os2/statline.h @@ -21,29 +21,62 @@ class WXDLLEXPORT wxStaticLine : public wxStaticLineBase { - DECLARE_DYNAMIC_CLASS(wxStaticLine) public: // constructors and pseudo-constructors wxStaticLine() { } + wxStaticLine( wxWindow* pParent + ,wxWindowID vId + ,const wxPoint& rPos = wxDefaultPosition + ,const wxSize& rSize = wxDefaultSize + ,long lStyle = wxLI_HORIZONTAL + ,const wxString& rsName = wxStaticTextNameStr + ) + { + Create(pParent, vId, rPos, rSize, lStyle, rsName); + } + + bool Create( wxWindow* pParent + ,wxWindowID vId + ,const wxPoint& rPos = wxDefaultPosition + ,const wxSize& rSize = wxDefaultSize + ,long lStyle = wxLI_HORIZONTAL + ,const wxString& rsName = wxStaticTextNameStr + ); + + inline bool IsVertical(void) const { return((GetWindowStyleFlag() & wxLI_VERTICAL) != 0); } + inline static int GetDefaultSize(void) { return 2; } - wxStaticLine( wxWindow *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticTextNameStr ) + // + // Overriden base class virtuals + // + inline virtual bool AcceptsFocus(void) const {return FALSE;} + +protected: + inline wxSize AdjustSize(const wxSize& rSize) const { - Create(parent, id, pos, size, style, name); + wxSize vSizeReal( rSize.x + ,rSize.y + ); + + if (IsVertical()) + { + if (rSize.x == -1 ) + vSizeReal.x = GetDefaultSize(); + } + else + { + if (rSize.y == -1) + vSizeReal.y = GetDefaultSize(); + } + return vSizeReal; } - bool Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticTextNameStr ); -}; + inline wxSize DoGetBestSize(void) const { return (AdjustSize(wxDefaultSize)); } + +private: + DECLARE_DYNAMIC_CLASS(wxStaticLine) +}; // end of CLASS wxStaticLine #endif // _WX_OS2_STATLINE_H_