]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/generic/scrolwin.h | |
3 | // Purpose: wxGenericScrolledWindow class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_GENERIC_SCROLLWIN_H_ | |
13 | #define _WX_GENERIC_SCROLLWIN_H_ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // headers and constants | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | #include "wx/window.h" | |
20 | #include "wx/panel.h" | |
21 | ||
22 | extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr; | |
23 | ||
24 | // default scrolled window style | |
25 | #ifndef wxScrolledWindowStyle | |
26 | #define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL) | |
27 | #endif | |
28 | ||
29 | // avoid triggering this stupid VC++ warning | |
30 | #ifdef __VISUALC__ | |
31 | #if _MSC_VER > 1100 | |
32 | #pragma warning(push) | |
33 | #endif | |
34 | #pragma warning(disable:4355) // 'this' used in base member initializer list | |
35 | #endif | |
36 | ||
37 | // ---------------------------------------------------------------------------- | |
38 | // wxGenericScrolledWindow | |
39 | // ---------------------------------------------------------------------------- | |
40 | ||
41 | class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel, | |
42 | public wxScrollHelper | |
43 | { | |
44 | public: | |
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) | |
53 | { | |
54 | Create(parent, winid, pos, size, style, name); | |
55 | } | |
56 | ||
57 | virtual ~wxGenericScrolledWindow(); | |
58 | ||
59 | bool Create(wxWindow *parent, | |
60 | wxWindowID winid, | |
61 | const wxPoint& pos = wxDefaultPosition, | |
62 | const wxSize& size = wxDefaultSize, | |
63 | long style = wxScrolledWindowStyle, | |
64 | const wxString& name = wxPanelNameStr); | |
65 | ||
66 | virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } | |
67 | ||
68 | // lay out the window and its children | |
69 | virtual bool Layout(); | |
70 | ||
71 | virtual void DoSetVirtualSize(int x, int y); | |
72 | ||
73 | // wxWindow's GetBestVirtualSize returns the actual window size, | |
74 | // whereas we want to return the virtual size | |
75 | virtual wxSize GetBestVirtualSize() const; | |
76 | ||
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; | |
80 | ||
81 | protected: | |
82 | // this is needed for wxEVT_PAINT processing hack described in | |
83 | // wxScrollHelperEvtHandler::ProcessEvent() | |
84 | void OnPaint(wxPaintEvent& event); | |
85 | ||
86 | // we need to return a special WM_GETDLGCODE value to process just the | |
87 | // arrows but let the other navigation characters through | |
88 | #ifdef __WXMSW__ | |
89 | virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
90 | #endif // __WXMSW__ | |
91 | ||
92 | private: | |
93 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow) | |
94 | DECLARE_EVENT_TABLE() | |
95 | }; | |
96 | ||
97 | #if defined(__VISUALC__) && (_MSC_VER > 1100) | |
98 | #pragma warning(pop) | |
99 | #endif | |
100 | ||
101 | #endif | |
102 | // _WX_GENERIC_SCROLLWIN_H_ | |
103 |