]>
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 and Markus Holzem | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_GENERIC_SCROLLWIN_H_ | |
13 | #define _WX_GENERIC_SCROLLWIN_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
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 | WXDLLEXPORT_DATA(extern 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 | #pragma warning(disable:4355) // 'this' used in base member initializer list | |
36 | #endif | |
37 | ||
38 | // ---------------------------------------------------------------------------- | |
39 | // wxGenericScrolledWindow | |
40 | // ---------------------------------------------------------------------------- | |
41 | ||
42 | class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel, | |
43 | public wxScrollHelper | |
44 | { | |
45 | public: | |
46 | wxGenericScrolledWindow() : wxScrollHelper(this) { } | |
47 | wxGenericScrolledWindow(wxWindow *parent, | |
48 | wxWindowID id = -1, | |
49 | const wxPoint& pos = wxDefaultPosition, | |
50 | const wxSize& size = wxDefaultSize, | |
51 | long style = wxScrolledWindowStyle, | |
52 | const wxString& name = wxPanelNameStr) | |
53 | : wxScrollHelper(this) | |
54 | { | |
55 | Create(parent, id, pos, size, style, name); | |
56 | } | |
57 | ||
58 | virtual ~wxGenericScrolledWindow(); | |
59 | ||
60 | bool Create(wxWindow *parent, | |
61 | wxWindowID id, | |
62 | const wxPoint& pos = wxDefaultPosition, | |
63 | const wxSize& size = wxDefaultSize, | |
64 | long style = wxScrolledWindowStyle, | |
65 | const wxString& name = wxPanelNameStr); | |
66 | ||
67 | virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } | |
68 | ||
69 | // lay out the window and its children | |
70 | virtual bool Layout(); | |
71 | ||
72 | virtual void DoSetVirtualSize( int x, int y ); | |
73 | ||
74 | protected: | |
75 | // this is needed for wxEVT_PAINT processing hack described in | |
76 | // wxScrollHelperEvtHandler::ProcessEvent() | |
77 | void OnPaint(wxPaintEvent& event); | |
78 | ||
79 | // we need to return a special WM_GETDLGCODE value to process just the | |
80 | // arrows but let the other navigation characters through | |
81 | #ifdef __WXMSW__ | |
82 | virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
83 | #endif // __WXMSW__ | |
84 | ||
85 | private: | |
86 | DECLARE_ABSTRACT_CLASS(wxGenericScrolledWindow) | |
87 | DECLARE_EVENT_TABLE() | |
88 | }; | |
89 | ||
90 | #ifdef __VISUALC__ | |
91 | #pragma warning(default:4355) | |
92 | #endif | |
93 | ||
94 | #endif | |
95 | // _WX_GENERIC_SCROLLWIN_H_ | |
96 | ||
97 | // vi:sts=4:sw=4:et |