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 // ----------------------------------------------------------------------------
30 // wxGenericScrolledWindow
31 // ----------------------------------------------------------------------------
33 class WXDLLEXPORT wxGenericScrolledWindow
: public wxPanel
,
37 wxGenericScrolledWindow() : wxScrollHelper(this) { }
38 wxGenericScrolledWindow(wxWindow
*parent
,
39 wxWindowID winid
= wxID_ANY
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
42 long style
= wxScrolledWindowStyle
,
43 const wxString
& name
= wxPanelNameStr
)
44 : wxScrollHelper(this)
46 Create(parent
, winid
, pos
, size
, style
, name
);
49 virtual ~wxGenericScrolledWindow();
51 bool Create(wxWindow
*parent
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
55 long style
= wxScrolledWindowStyle
,
56 const wxString
& name
= wxPanelNameStr
);
58 virtual void PrepareDC(wxDC
& dc
) { DoPrepareDC(dc
); }
60 // lay out the window and its children
61 virtual bool Layout();
63 virtual void DoSetVirtualSize(int x
, int y
);
65 // wxWindow's GetBestVirtualSize returns the actual window size,
66 // whereas we want to return the virtual size
67 virtual wxSize
GetBestVirtualSize() const;
69 // Return the size best suited for the current window
70 // (this isn't a virtual size, this is a sensible size for the window)
71 virtual wxSize
DoGetBestSize() const;
74 // this is needed for wxEVT_PAINT processing hack described in
75 // wxScrollHelperEvtHandler::ProcessEvent()
76 void OnPaint(wxPaintEvent
& event
);
78 // we need to return a special WM_GETDLGCODE value to process just the
79 // arrows but let the other navigation characters through
81 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
85 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow
)
89 #endif // _WX_GENERIC_SCROLLWIN_H_