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