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
|
|
|
|
// 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
|
|
|
|
2002-08-31 07:29:13 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
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
|
|
|
|
1999-04-14 07:55:35 -04:00
|
|
|
WXDLLEXPORT_DATA(extern 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:
|
2001-06-26 16:59:19 -04:00
|
|
|
wxGenericScrolledWindow() : wxScrollHelper(this) { }
|
2001-04-30 08:35:54 -04:00
|
|
|
wxGenericScrolledWindow(wxWindow *parent,
|
2000-01-23 18:23:46 -05:00
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxScrolledWindowStyle,
|
|
|
|
const wxString& name = wxPanelNameStr)
|
2001-06-26 16:59:19 -04:00
|
|
|
: wxScrollHelper(this)
|
1999-10-15 10:59:44 -04:00
|
|
|
{
|
2000-01-23 18:23:46 -05:00
|
|
|
Create(parent, id, pos, size, style, name);
|
1999-10-15 10:59:44 -04:00
|
|
|
}
|
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,
|
|
|
|
wxWindowID id,
|
|
|
|
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);
|
|
|
|
|
2003-01-12 17:20:46 -05:00
|
|
|
#if WXWIN_COMPATIBILITY
|
|
|
|
virtual void GetScrollUnitsPerPage(int *x_page, int *y_page) const;
|
|
|
|
virtual void CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const;
|
|
|
|
// Need to do this otherwise the compiler gets confuced
|
|
|
|
// between float and int calls to this function.
|
|
|
|
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
|
|
|
{ wxScrollHelper::CalcScrolledPosition(x, y, xx, yy); }
|
|
|
|
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
|
|
|
{ return wxScrollHelper::CalcScrolledPosition(pt); }
|
|
|
|
#endif // WXWIN_COMPATIBILITY
|
|
|
|
|
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__
|
|
|
|
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
#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
|
|
|
|