]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
8614c467 | 2 | // Name: wx/generic/scrolwin.h |
1e6feb95 | 3 | // Purpose: wxGenericScrolledWindow class |
c801d85f KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
8614c467 VZ |
12 | #ifndef _WX_GENERIC_SCROLLWIN_H_ |
13 | #define _WX_GENERIC_SCROLLWIN_H_ | |
c801d85f | 14 | |
8614c467 VZ |
15 | // ---------------------------------------------------------------------------- |
16 | // headers and constants | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
c801d85f | 19 | #include "wx/window.h" |
053f9cc1 | 20 | #include "wx/panel.h" |
c801d85f | 21 | |
f4fffffc | 22 | extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr; |
c801d85f | 23 | |
8614c467 | 24 | // default scrolled window style |
fa3541bd | 25 | #ifndef wxScrolledWindowStyle |
dc429f89 | 26 | #define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL) |
fa3541bd | 27 | #endif |
8614c467 | 28 | |
1e6feb95 VZ |
29 | // avoid triggering this stupid VC++ warning |
30 | #ifdef __VISUALC__ | |
688bdfe9 MB |
31 | #if _MSC_VER > 1100 |
32 | #pragma warning(push) | |
33 | #endif | |
1e6feb95 VZ |
34 | #pragma warning(disable:4355) // 'this' used in base member initializer list |
35 | #endif | |
36 | ||
8614c467 | 37 | // ---------------------------------------------------------------------------- |
fa3541bd | 38 | // wxGenericScrolledWindow |
8614c467 VZ |
39 | // ---------------------------------------------------------------------------- |
40 | ||
1e6feb95 VZ |
41 | class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel, |
42 | public wxScrollHelper | |
c801d85f | 43 | { |
0cf5b099 | 44 | public: |
6463b9f5 | 45 | wxGenericScrolledWindow() : wxScrollHelper(this) { } |
fa3541bd | 46 | wxGenericScrolledWindow(wxWindow *parent, |
ca65c044 | 47 | wxWindowID winid = wxID_ANY, |
8614c467 VZ |
48 | const wxPoint& pos = wxDefaultPosition, |
49 | const wxSize& size = wxDefaultSize, | |
50 | long style = wxScrolledWindowStyle, | |
6463b9f5 JS |
51 | const wxString& name = wxPanelNameStr) |
52 | : wxScrollHelper(this) | |
53 | { | |
54 | Create(parent, winid, pos, size, style, name); | |
55 | } | |
c801d85f | 56 | |
1e6feb95 | 57 | virtual ~wxGenericScrolledWindow(); |
c801d85f | 58 | |
8614c467 | 59 | bool Create(wxWindow *parent, |
b935bec2 | 60 | wxWindowID winid, |
8614c467 VZ |
61 | const wxPoint& pos = wxDefaultPosition, |
62 | const wxSize& size = wxDefaultSize, | |
63 | long style = wxScrolledWindowStyle, | |
64 | const wxString& name = wxPanelNameStr); | |
c801d85f | 65 | |
1e6feb95 | 66 | virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } |
ecab4dba | 67 | |
dc429f89 | 68 | // lay out the window and its children |
30486297 RD |
69 | virtual bool Layout(); |
70 | ||
2b5f62a0 VZ |
71 | virtual void DoSetVirtualSize(int x, int y); |
72 | ||
844adaa4 JS |
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 | ||
349efbaa VZ |
81 | protected: |
82 | // this is needed for wxEVT_PAINT processing hack described in | |
83 | // wxScrollHelperEvtHandler::ProcessEvent() | |
84 | void OnPaint(wxPaintEvent& event); | |
85 | ||
0cf5b099 VZ |
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__ | |
c140b7e7 | 89 | virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); |
0cf5b099 VZ |
90 | #endif // __WXMSW__ |
91 | ||
ecab4dba | 92 | private: |
fc7a2a60 | 93 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow) |
349efbaa | 94 | DECLARE_EVENT_TABLE() |
c801d85f KB |
95 | }; |
96 | ||
688bdfe9 | 97 | #if defined(__VISUALC__) && (_MSC_VER > 1100) |
97cffad5 | 98 | #pragma warning(pop) |
1e6feb95 VZ |
99 | #endif |
100 | ||
c801d85f | 101 | #endif |
8614c467 | 102 | // _WX_GENERIC_SCROLLWIN_H_ |
566d84a7 | 103 |