]>
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 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
16 | #pragma interface "genscrolwin.h" | |
17 | #endif | |
18 | ||
19 | // ---------------------------------------------------------------------------- | |
20 | // headers and constants | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
23 | #include "wx/window.h" | |
24 | #include "wx/panel.h" | |
25 | ||
26 | extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr; | |
27 | ||
28 | // default scrolled window style | |
29 | #ifndef wxScrolledWindowStyle | |
30 | #define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL) | |
31 | #endif | |
32 | ||
33 | // avoid triggering this stupid VC++ warning | |
34 | #ifdef __VISUALC__ | |
35 | #if _MSC_VER > 1100 | |
36 | #pragma warning(push) | |
37 | #endif | |
38 | #pragma warning(disable:4355) // 'this' used in base member initializer list | |
39 | #endif | |
40 | ||
41 | // ---------------------------------------------------------------------------- | |
42 | // wxGenericScrolledWindow | |
43 | // ---------------------------------------------------------------------------- | |
44 | ||
45 | class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel, | |
46 | public wxScrollHelper | |
47 | { | |
48 | public: | |
49 | wxGenericScrolledWindow() : wxScrollHelper(this) { } | |
50 | wxGenericScrolledWindow(wxWindow *parent, | |
51 | wxWindowID winid = wxID_ANY, | |
52 | const wxPoint& pos = wxDefaultPosition, | |
53 | const wxSize& size = wxDefaultSize, | |
54 | long style = wxScrolledWindowStyle, | |
55 | const wxString& name = wxPanelNameStr) | |
56 | : wxScrollHelper(this) | |
57 | { | |
58 | Create(parent, winid, pos, size, style, name); | |
59 | } | |
60 | ||
61 | virtual ~wxGenericScrolledWindow(); | |
62 | ||
63 | bool Create(wxWindow *parent, | |
64 | wxWindowID winid, | |
65 | const wxPoint& pos = wxDefaultPosition, | |
66 | const wxSize& size = wxDefaultSize, | |
67 | long style = wxScrolledWindowStyle, | |
68 | const wxString& name = wxPanelNameStr); | |
69 | ||
70 | virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } | |
71 | ||
72 | // lay out the window and its children | |
73 | virtual bool Layout(); | |
74 | ||
75 | virtual void DoSetVirtualSize(int x, int y); | |
76 | ||
77 | // wxWindow's GetBestVirtualSize returns the actual window size, | |
78 | // whereas we want to return the virtual size | |
79 | virtual wxSize GetBestVirtualSize() const; | |
80 | ||
81 | // Return the size best suited for the current window | |
82 | // (this isn't a virtual size, this is a sensible size for the window) | |
83 | virtual wxSize DoGetBestSize() const; | |
84 | ||
85 | protected: | |
86 | // this is needed for wxEVT_PAINT processing hack described in | |
87 | // wxScrollHelperEvtHandler::ProcessEvent() | |
88 | void OnPaint(wxPaintEvent& event); | |
89 | ||
90 | // we need to return a special WM_GETDLGCODE value to process just the | |
91 | // arrows but let the other navigation characters through | |
92 | #ifdef __WXMSW__ | |
93 | virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
94 | #endif // __WXMSW__ | |
95 | ||
96 | private: | |
97 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow) | |
98 | DECLARE_EVENT_TABLE() | |
99 | }; | |
100 | ||
101 | #if defined(__VISUALC__) && (_MSC_VER > 1100) | |
102 | #pragma warning(pop) | |
103 | #endif | |
104 | ||
105 | #endif | |
106 | // _WX_GENERIC_SCROLLWIN_H_ | |
107 |