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