1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-01-23 23:23:46 +00:00
|
|
|
// Name: wx/generic/scrolwin.h
|
2001-06-26 20:59:19 +00:00
|
|
|
// Purpose: wxGenericScrolledWindow class
|
1998-05-20 14:01:55 +00:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 10:34:04 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-01-23 23:23:46 +00:00
|
|
|
#ifndef _WX_GENERIC_SCROLLWIN_H_
|
|
|
|
#define _WX_GENERIC_SCROLLWIN_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2001-07-03 19:38:19 +00:00
|
|
|
#pragma interface "genscrolwin.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
2000-01-23 23:23:46 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers and constants
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/window.h"
|
1999-05-26 09:03:25 +00:00
|
|
|
#include "wx/panel.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2005-01-21 18:26:01 +00:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-01-23 23:23:46 +00:00
|
|
|
// default scrolled window style
|
2001-04-30 12:35:54 +00:00
|
|
|
#ifndef wxScrolledWindowStyle
|
2002-06-07 23:36:36 +00:00
|
|
|
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
|
2001-04-30 12:35:54 +00:00
|
|
|
#endif
|
2000-01-23 23:23:46 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
// avoid triggering this stupid VC++ warning
|
|
|
|
#ifdef __VISUALC__
|
2005-06-07 12:10:48 +00:00
|
|
|
#pragma warning(push)
|
2001-06-26 20:59:19 +00:00
|
|
|
#pragma warning(disable:4355) // 'this' used in base member initializer list
|
|
|
|
#endif
|
|
|
|
|
2000-01-23 23:23:46 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2001-04-30 12:35:54 +00:00
|
|
|
// wxGenericScrolledWindow
|
2000-01-23 23:23:46 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
|
|
|
|
public wxScrollHelper
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2002-02-06 00:58:11 +00:00
|
|
|
public:
|
2004-01-15 13:49:22 +00:00
|
|
|
wxGenericScrolledWindow() : wxScrollHelper(this) { }
|
2001-04-30 12:35:54 +00:00
|
|
|
wxGenericScrolledWindow(wxWindow *parent,
|
2004-06-17 16:22:36 +00:00
|
|
|
wxWindowID winid = wxID_ANY,
|
2000-01-23 23:23:46 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxScrolledWindowStyle,
|
2004-01-15 13:49:22 +00:00
|
|
|
const wxString& name = wxPanelNameStr)
|
|
|
|
: wxScrollHelper(this)
|
|
|
|
{
|
|
|
|
Create(parent, winid, pos, size, style, name);
|
|
|
|
}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual ~wxGenericScrolledWindow();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-01-23 23:23:46 +00:00
|
|
|
bool Create(wxWindow *parent,
|
2003-10-27 03:47:39 +00:00
|
|
|
wxWindowID winid,
|
2000-01-23 23:23:46 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxScrolledWindowStyle,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
|
1999-10-15 14:59:44 +00:00
|
|
|
|
2002-06-07 23:36:36 +00:00
|
|
|
// lay out the window and its children
|
2002-03-15 00:21:47 +00:00
|
|
|
virtual bool Layout();
|
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
virtual void DoSetVirtualSize(int x, int y);
|
|
|
|
|
2005-03-17 21:21:45 +00:00
|
|
|
// wxWindow's GetBestVirtualSize returns the actual window size,
|
|
|
|
// whereas we want to return the virtual size
|
|
|
|
virtual wxSize GetBestVirtualSize() const;
|
|
|
|
|
|
|
|
// Return the size best suited for the current window
|
|
|
|
// (this isn't a virtual size, this is a sensible size for the window)
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
2001-08-13 15:42:29 +00:00
|
|
|
protected:
|
|
|
|
// this is needed for wxEVT_PAINT processing hack described in
|
|
|
|
// wxScrollHelperEvtHandler::ProcessEvent()
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
|
2002-02-06 00:58:11 +00:00
|
|
|
// we need to return a special WM_GETDLGCODE value to process just the
|
|
|
|
// arrows but let the other navigation characters through
|
|
|
|
#ifdef __WXMSW__
|
2004-02-25 10:45:02 +00:00
|
|
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
2002-02-06 00:58:11 +00:00
|
|
|
#endif // __WXMSW__
|
|
|
|
|
1999-10-15 14:59:44 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow)
|
2001-08-13 15:42:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#ifdef __VISUALC__
|
2005-06-07 12:10:48 +00:00
|
|
|
#pragma warning(pop)
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
2000-01-23 23:23:46 +00:00
|
|
|
// _WX_GENERIC_SCROLLWIN_H_
|
2002-04-19 22:12:38 +00:00
|
|
|
|