1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/scrolwin.h
3 // Purpose: wxGenericScrolledWindow class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_SCROLLWIN_H_
13 #define _WX_GENERIC_SCROLLWIN_H_
15 // ----------------------------------------------------------------------------
16 // headers and constants
17 // ----------------------------------------------------------------------------
19 #include "wx/window.h"
22 extern WXDLLEXPORT_DATA(const wxChar
*) wxPanelNameStr
;
24 // default scrolled window style
25 #ifndef wxScrolledWindowStyle
26 #define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
29 // avoid triggering this stupid VC++ warning
34 #pragma warning(disable:4355) // 'this' used in base member initializer list
37 // ----------------------------------------------------------------------------
38 // wxGenericScrolledWindow
39 // ----------------------------------------------------------------------------
41 class WXDLLEXPORT wxGenericScrolledWindow
: public wxPanel
,
45 wxGenericScrolledWindow() : wxScrollHelper(this) { }
46 wxGenericScrolledWindow(wxWindow
*parent
,
47 wxWindowID winid
= wxID_ANY
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& size
= wxDefaultSize
,
50 long style
= wxScrolledWindowStyle
,
51 const wxString
& name
= wxPanelNameStr
)
52 : wxScrollHelper(this)
54 Create(parent
, winid
, pos
, size
, style
, name
);
57 virtual ~wxGenericScrolledWindow();
59 bool Create(wxWindow
*parent
,
61 const wxPoint
& pos
= wxDefaultPosition
,
62 const wxSize
& size
= wxDefaultSize
,
63 long style
= wxScrolledWindowStyle
,
64 const wxString
& name
= wxPanelNameStr
);
66 virtual void PrepareDC(wxDC
& dc
) { DoPrepareDC(dc
); }
68 // lay out the window and its children
69 virtual bool Layout();
71 virtual void DoSetVirtualSize(int x
, int y
);
73 // wxWindow's GetBestVirtualSize returns the actual window size,
74 // whereas we want to return the virtual size
75 virtual wxSize
GetBestVirtualSize() const;
77 // Return the size best suited for the current window
78 // (this isn't a virtual size, this is a sensible size for the window)
79 virtual wxSize
DoGetBestSize() const;
82 // this is needed for wxEVT_PAINT processing hack described in
83 // wxScrollHelperEvtHandler::ProcessEvent()
84 void OnPaint(wxPaintEvent
& event
);
86 // we need to return a special WM_GETDLGCODE value to process just the
87 // arrows but let the other navigation characters through
89 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
93 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow
)
97 #if defined(__VISUALC__) && (_MSC_VER > 1100)
102 // _WX_GENERIC_SCROLLWIN_H_