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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "genscrolwin.h"
19 // ----------------------------------------------------------------------------
20 // headers and constants
21 // ----------------------------------------------------------------------------
23 #include "wx/window.h"
26 extern WXDLLEXPORT_DATA(const wxChar
*) wxPanelNameStr
;
28 // default scrolled window style
29 #ifndef wxScrolledWindowStyle
30 #define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
33 // avoid triggering this stupid VC++ warning
36 #pragma warning(disable:4355) // 'this' used in base member initializer list
39 // ----------------------------------------------------------------------------
40 // wxGenericScrolledWindow
41 // ----------------------------------------------------------------------------
43 class WXDLLEXPORT wxGenericScrolledWindow
: public wxPanel
,
47 wxGenericScrolledWindow() : wxScrollHelper(this) { }
48 wxGenericScrolledWindow(wxWindow
*parent
,
49 wxWindowID winid
= wxID_ANY
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
52 long style
= wxScrolledWindowStyle
,
53 const wxString
& name
= wxPanelNameStr
)
54 : wxScrollHelper(this)
56 Create(parent
, winid
, pos
, size
, style
, name
);
59 virtual ~wxGenericScrolledWindow();
61 bool Create(wxWindow
*parent
,
63 const wxPoint
& pos
= wxDefaultPosition
,
64 const wxSize
& size
= wxDefaultSize
,
65 long style
= wxScrolledWindowStyle
,
66 const wxString
& name
= wxPanelNameStr
);
68 virtual void PrepareDC(wxDC
& dc
) { DoPrepareDC(dc
); }
70 // lay out the window and its children
71 virtual bool Layout();
73 virtual void DoSetVirtualSize(int x
, int y
);
75 // wxWindow's GetBestVirtualSize returns the actual window size,
76 // whereas we want to return the virtual size
77 virtual wxSize
GetBestVirtualSize() const;
79 // Return the size best suited for the current window
80 // (this isn't a virtual size, this is a sensible size for the window)
81 virtual wxSize
DoGetBestSize() const;
84 // this is needed for wxEVT_PAINT processing hack described in
85 // wxScrollHelperEvtHandler::ProcessEvent()
86 void OnPaint(wxPaintEvent
& event
);
88 // we need to return a special WM_GETDLGCODE value to process just the
89 // arrows but let the other navigation characters through
91 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
95 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow
)
104 // _WX_GENERIC_SCROLLWIN_H_