Compare commits

..

3 Commits

Author SHA1 Message Date
Bryan Petty
d20948ae09 This commit was manufactured by cvs2svn to create tag 'GTK_1_2_10'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/GTK_1_2_10@40641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-08-16 19:34:46 +00:00
Michael Wetherell
66a4c5295f Import gtk.m4 from gtk+ 1.2.10.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/GTK1@40640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-08-16 19:34:46 +00:00
Bryan Petty
7e9d2aa355 This commit was manufactured by cvs2svn to create branch 'GTK1'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/GTK1@35560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-18 13:24:14 +00:00
14 changed files with 194 additions and 19140 deletions

194
build/aclocal/gtk.m4 Normal file
View File

@@ -0,0 +1,194 @@
# Configure paths for GTK+
# Owen Taylor 97-11-3
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
dnl
AC_DEFUN(AM_PATH_GTK,
[dnl
dnl Get the cflags and libraries from the gtk-config script
dnl
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
gtk_config_prefix="$withval", gtk_config_prefix="")
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
, enable_gtktest=yes)
for module in . $4
do
case "$module" in
gthread)
gtk_config_args="$gtk_config_args gthread"
;;
esac
done
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
fi
fi
if test x$gtk_config_prefix != x ; then
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
if test x${GTK_CONFIG+set} != xset ; then
GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
fi
fi
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
min_gtk_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
no_gtk=""
if test "$GTK_CONFIG" = "no" ; then
no_gtk=yes
else
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gtktest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
dnl
dnl Now check if the installed GTK is sufficiently new. (Also sanity
dnl checks the results of gtk-config to some extent
dnl
rm -f conf.gtktest
AC_TRY_RUN([
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gtktest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version");
exit(1);
}
if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) ||
(gtk_micro_version != $gtk_config_micro_version))
{
printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf ("*** was found! If gtk-config was correct, then it is best\n");
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
#endif /* defined (GTK_MAJOR_VERSION) ... */
else
{
if ((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
printf("*** correct copy of gtk-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gtk" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GTK_CONFIG" = "no" ; then
echo "*** The gtk-config script installed by GTK could not be found"
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GTK_CONFIG environment variable to the"
echo "*** full path to gtk-config."
else
if test -f conf.gtktest ; then
:
else
echo "*** Could not run GTK test program, checking why..."
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
AC_TRY_LINK([
#include <gtk/gtk.h>
#include <stdio.h>
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK or finding the wrong"
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GTK_CFLAGS=""
GTK_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
rm -f conf.gtktest
])

View File

@@ -1,90 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/scrolwin.h
// Purpose: wxGenericScrolledWindow class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_SCROLLWIN_H_
#define _WX_GENERIC_SCROLLWIN_H_
// ----------------------------------------------------------------------------
// headers and constants
// ----------------------------------------------------------------------------
#include "wx/window.h"
#include "wx/panel.h"
extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr;
// default scrolled window style
#ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// ----------------------------------------------------------------------------
// wxGenericScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
public wxScrollHelper
{
public:
wxGenericScrolledWindow() : wxScrollHelper(this) { }
wxGenericScrolledWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrollHelper(this)
{
Create(parent, winid, pos, size, style, name);
}
virtual ~wxGenericScrolledWindow();
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
// lay out the window and its children
virtual bool Layout();
virtual void DoSetVirtualSize(int x, int y);
// 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;
protected:
// this is needed for wxEVT_PAINT processing hack described in
// wxScrollHelperEvtHandler::ProcessEvent()
void OnPaint(wxPaintEvent& event);
// we need to return a special WM_GETDLGCODE value to process just the
// arrows but let the other navigation characters through
#ifdef __WXMSW__
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
#endif // __WXMSW__
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow)
DECLARE_EVENT_TABLE()
};
#endif // _WX_GENERIC_SCROLLWIN_H_

View File

@@ -1,193 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/scrolwin.h
// Purpose: wxScrolledWindow class
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_SCROLLWIN_H_
#define _WX_GTK_SCROLLWIN_H_
// ----------------------------------------------------------------------------
// headers and constants
// ----------------------------------------------------------------------------
#include "wx/window.h"
#include "wx/panel.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
// default scrolled window style
#ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// ----------------------------------------------------------------------------
// wxScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxScrolledWindow : public wxPanel
{
public:
wxScrolledWindow()
{ Init(); }
wxScrolledWindow(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
{ Create(parent, id, pos, size, style, name); }
void Init();
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
// Normally the wxScrolledWindow will scroll itself, but in
// some rare occasions you might want it to scroll another
// window (e.g. a child of it in order to scroll only a portion
// the area between the scrollbars (spreadsheet: only cell area
// will move).
virtual void SetTargetWindow( wxWindow *target, bool pushEventHandler = FALSE );
virtual wxWindow *GetTargetWindow() const;
// Set the scrolled area of the window.
virtual void DoSetVirtualSize( int x, int y );
// 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;
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// Number of pixels per user unit (0 or -1 for no scrollbar)
// Length of virtual canvas in user units
// Length of page in user units
// Default action is to set the virtual size and alter scrollbars
// accordingly.
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = FALSE );
// Physically scroll the window
virtual void Scroll(int x_pos, int y_pos);
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
// Enable/disable Windows scrolling in either direction.
// If TRUE, wxWidgets scrolls the canvas and only a bit of
// the canvas is invalidated; no Clear() is necessary.
// If FALSE, the whole canvas is invalidated and a Clear() is
// necessary. Disable for when the scroll increment is used
// to actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
// Override this function if you don't want to have wxScrolledWindow
// automatically change the origin according to the scroll position.
void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
// lay out the window and its children
virtual bool Layout();
// Adjust the scrollbars
virtual void AdjustScrollbars();
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// implementation from now on
void OnScroll(wxScrollWinEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
void OnChar(wxKeyEvent& event);
void GtkVScroll( float value, unsigned int scroll_type );
void GtkHScroll( float value, unsigned int scroll_type );
void GtkVConnectEvent();
void GtkHConnectEvent();
void GtkVDisconnectEvent();
void GtkHDisconnectEvent();
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
// Overridden from wxWidgets due callback being static
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual void DoPrepareDC(wxDC& dc);
protected:
wxWindow *m_targetWindow;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
// FIXME: these next four members are duplicated in the GtkAdjustment
// members of wxWindow. Can they be safely removed from here?
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
double m_scaleY,m_scaleX;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxScrolledWindow)
};
#endif
// _WX_GTK_SCROLLWIN_H_
// vi:sts=4:sw=4:et

View File

@@ -1,300 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/window.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKWINDOWH__
#define __GTKWINDOWH__
// helper structure that holds class that holds GtkIMContext object and
// some additional data needed for key events processing
struct wxGtkIMData;
//-----------------------------------------------------------------------------
// callback definition for inserting a window (internal)
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK;
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
//-----------------------------------------------------------------------------
// wxWindowGTK
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
{
public:
// creating the window
// -------------------
wxWindowGTK();
wxWindowGTK(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxWindowGTK();
// implement base class (pure) virtual methods
// -------------------------------------------
virtual bool Destroy();
virtual void Raise();
virtual void Lower();
virtual bool Show( bool show = TRUE );
virtual bool Enable( bool enable = TRUE );
virtual bool IsRetained() const;
virtual void SetFocus();
virtual bool AcceptsFocus() const;
virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
virtual void ClearBackground();
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont( const wxFont &font );
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
virtual void GetTextExtent(const wxString& string,
int *x, int *y,
int *descent = (int *) NULL,
int *externalLeading = (int *) NULL,
const wxFont *theFont = (const wxFont *) NULL)
const;
#if wxUSE_MENUS_NATIVE
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
#endif // wxUSE_MENUS_NATIVE
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE );
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL );
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget );
#endif // wxUSE_DRAG_AND_DROP
#ifdef __WXGTK20__
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
#endif
// implementation
// --------------
virtual WXWidget GetHandle() const { return m_widget; }
// I don't want users to override what's done in idle so everything that
// has to be done in idle time in order for wxGTK to work is done in
// OnInternalIdle
virtual void OnInternalIdle();
// Internal represention of Update()
void GtkUpdate();
// For compatibility across platforms (not in event table)
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
virtual void OnParentEnable( bool WXUNUSED(enable) ) {}
// Used by all window classes in the widget creation process.
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
void PostCreation();
// Internal addition of child windows. differs from class
// to class not by using virtual functions but by using
// the m_insertCallback.
void DoAddChild(wxWindowGTK *child);
// This methods sends wxPaintEvents to the window. It reads the
// update region, breaks it up into rects and sends an event
// for each rect. It is also responsible for background erase
// events and NC paint events. It is called from "draw" and
// "expose" handlers as well as from ::Update()
void GtkSendPaintEvents();
// The methods below are required because many native widgets
// are composed of several subwidgets and setting a style for
// the widget means setting it for all subwidgets as well.
// also, it is nor clear, which native widget is the top
// widget where (most of) the input goes. even tooltips have
// to be applied to all subwidgets.
virtual GtkWidget* GetConnectWidget();
virtual bool IsOwnGtkWindow( GdkWindow *window );
void ConnectWidget( GtkWidget *widget );
#ifdef __WXGTK20__
// Returns the default context which usually is anti-aliased
PangoContext *GtkGetPangoDefaultContext();
// Returns the X11 context which renders on the X11 client
// side (which can be remote) and which usually is not
// anti-aliased and is thus faster
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
// not depend on libpangox - which is completely deprecated.
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
PangoContext *GtkGetPangoX11Context();
PangoContext *m_x11Context; // MR: Now unused
#endif
#if wxUSE_TOOLTIPS
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
#endif // wxUSE_TOOLTIPS
// Called from GTK signales handlers. it indicates that
// the layouting functions have to be called later on
// (i.e. in idle time, implemented in OnInternalIdle() ).
void GtkUpdateSize() { m_sizeSet = FALSE; }
// fix up the mouse event coords, used by wxListBox only so far
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
wxCoord& WXUNUSED(x),
wxCoord& WXUNUSED(y)) { }
// is this window transparent for the mouse events (as wxStaticBox is)?
virtual bool IsTransparentForMouse() const { return FALSE; }
// is this a radiobutton (used by radiobutton code itself only)?
virtual bool IsRadioButton() const { return FALSE; }
// position and size of the window
int m_x, m_y;
int m_width, m_height;
int m_oldClientWidth,m_oldClientHeight;
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
#ifdef __WXGTK20__
wxGtkIMData *m_imData;
#else // GTK 1
#ifdef HAVE_XIM
// XIM support for wxWidgets
GdkIC *m_ic;
GdkICAttr *m_icattr;
#endif // HAVE_XIM
#endif // GTK 2/1
#ifndef __WXGTK20__
// The area to be cleared (and not just refreshed)
// We cannot make this distinction under GTK 2.0.
wxRegion m_clearRegion;
#endif
// scrolling stuff
GtkAdjustment *m_hAdjust,*m_vAdjust;
float m_oldHorizontalPos;
float m_oldVerticalPos;
// extra (wxGTK-specific) flags
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
bool m_noExpose:1; // wxGLCanvas has its own redrawing
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
bool m_hasScrolling:1;
bool m_hasVMT:1;
bool m_sizeSet:1;
bool m_resizing:1;
bool m_acceptsFocus:1; // true if not static
bool m_hasFocus:1; // true if == FindFocus()
bool m_isScrolling:1; // dragging scrollbar thumb?
bool m_clipPaintRegion:1; // TRUE after ScrollWindow()
#ifdef __WXGTK20__
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
// chain needs update
#endif
bool m_needsStyleChange:1; // May not be able to change
// background style until OnIdle
// C++ has no virtual methods in the constrcutor of any class but we need
// different methods of inserting a child window into a wxFrame,
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
wxInsertChildFunction m_insertCallback;
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetClientSize( int *width, int *height ) const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS
protected:
// common part of all ctors (not virtual because called from ctor)
void Init();
#ifdef __WXGTK20__
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
// Copies m_children tab order to GTK focus chain:
void RealizeTabOrder();
#endif
// Called by ApplyWidgetStyle (which is called by SetFont() and
// SetXXXColour etc to apply style changed to native widgets) to create
// modified GTK style with non-standard attributes. If forceStyle=true,
// creates empty GtkRcStyle if there are no modifications, otherwise
// returns NULL in such case.
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
// Overridden in many GTK widgets who have to handle subwidgets
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
private:
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
DECLARE_NO_COPY_CLASS(wxWindowGTK)
};
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
#endif // __GTKWINDOWH__

View File

@@ -1,193 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/scrolwin.h
// Purpose: wxScrolledWindow class
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_SCROLLWIN_H_
#define _WX_GTK_SCROLLWIN_H_
// ----------------------------------------------------------------------------
// headers and constants
// ----------------------------------------------------------------------------
#include "wx/window.h"
#include "wx/panel.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
// default scrolled window style
#ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// ----------------------------------------------------------------------------
// wxScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxScrolledWindow : public wxPanel
{
public:
wxScrolledWindow()
{ Init(); }
wxScrolledWindow(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
{ Create(parent, id, pos, size, style, name); }
void Init();
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
// Normally the wxScrolledWindow will scroll itself, but in
// some rare occasions you might want it to scroll another
// window (e.g. a child of it in order to scroll only a portion
// the area between the scrollbars (spreadsheet: only cell area
// will move).
virtual void SetTargetWindow( wxWindow *target, bool pushEventHandler = FALSE );
virtual wxWindow *GetTargetWindow() const;
// Set the scrolled area of the window.
virtual void DoSetVirtualSize( int x, int y );
// 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;
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// Number of pixels per user unit (0 or -1 for no scrollbar)
// Length of virtual canvas in user units
// Length of page in user units
// Default action is to set the virtual size and alter scrollbars
// accordingly.
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = FALSE );
// Physically scroll the window
virtual void Scroll(int x_pos, int y_pos);
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
// Enable/disable Windows scrolling in either direction.
// If TRUE, wxWidgets scrolls the canvas and only a bit of
// the canvas is invalidated; no Clear() is necessary.
// If FALSE, the whole canvas is invalidated and a Clear() is
// necessary. Disable for when the scroll increment is used
// to actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
// Override this function if you don't want to have wxScrolledWindow
// automatically change the origin according to the scroll position.
void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
// lay out the window and its children
virtual bool Layout();
// Adjust the scrollbars
virtual void AdjustScrollbars();
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// implementation from now on
void OnScroll(wxScrollWinEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
void OnChar(wxKeyEvent& event);
void GtkVScroll( float value, unsigned int scroll_type );
void GtkHScroll( float value, unsigned int scroll_type );
void GtkVConnectEvent();
void GtkHConnectEvent();
void GtkVDisconnectEvent();
void GtkHDisconnectEvent();
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
// Overridden from wxWidgets due callback being static
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual void DoPrepareDC(wxDC& dc);
protected:
wxWindow *m_targetWindow;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
// FIXME: these next four members are duplicated in the GtkAdjustment
// members of wxWindow. Can they be safely removed from here?
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
double m_scaleY,m_scaleX;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxScrolledWindow)
};
#endif
// _WX_GTK_SCROLLWIN_H_
// vi:sts=4:sw=4:et

View File

@@ -1,300 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/window.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKWINDOWH__
#define __GTKWINDOWH__
// helper structure that holds class that holds GtkIMContext object and
// some additional data needed for key events processing
struct wxGtkIMData;
//-----------------------------------------------------------------------------
// callback definition for inserting a window (internal)
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK;
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
//-----------------------------------------------------------------------------
// wxWindowGTK
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
{
public:
// creating the window
// -------------------
wxWindowGTK();
wxWindowGTK(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxWindowGTK();
// implement base class (pure) virtual methods
// -------------------------------------------
virtual bool Destroy();
virtual void Raise();
virtual void Lower();
virtual bool Show( bool show = TRUE );
virtual bool Enable( bool enable = TRUE );
virtual bool IsRetained() const;
virtual void SetFocus();
virtual bool AcceptsFocus() const;
virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
virtual void ClearBackground();
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont( const wxFont &font );
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
virtual void GetTextExtent(const wxString& string,
int *x, int *y,
int *descent = (int *) NULL,
int *externalLeading = (int *) NULL,
const wxFont *theFont = (const wxFont *) NULL)
const;
#if wxUSE_MENUS_NATIVE
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
#endif // wxUSE_MENUS_NATIVE
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE );
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL );
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget );
#endif // wxUSE_DRAG_AND_DROP
#ifdef __WXGTK20__
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
#endif
// implementation
// --------------
virtual WXWidget GetHandle() const { return m_widget; }
// I don't want users to override what's done in idle so everything that
// has to be done in idle time in order for wxGTK to work is done in
// OnInternalIdle
virtual void OnInternalIdle();
// Internal represention of Update()
void GtkUpdate();
// For compatibility across platforms (not in event table)
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
virtual void OnParentEnable( bool WXUNUSED(enable) ) {}
// Used by all window classes in the widget creation process.
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
void PostCreation();
// Internal addition of child windows. differs from class
// to class not by using virtual functions but by using
// the m_insertCallback.
void DoAddChild(wxWindowGTK *child);
// This methods sends wxPaintEvents to the window. It reads the
// update region, breaks it up into rects and sends an event
// for each rect. It is also responsible for background erase
// events and NC paint events. It is called from "draw" and
// "expose" handlers as well as from ::Update()
void GtkSendPaintEvents();
// The methods below are required because many native widgets
// are composed of several subwidgets and setting a style for
// the widget means setting it for all subwidgets as well.
// also, it is nor clear, which native widget is the top
// widget where (most of) the input goes. even tooltips have
// to be applied to all subwidgets.
virtual GtkWidget* GetConnectWidget();
virtual bool IsOwnGtkWindow( GdkWindow *window );
void ConnectWidget( GtkWidget *widget );
#ifdef __WXGTK20__
// Returns the default context which usually is anti-aliased
PangoContext *GtkGetPangoDefaultContext();
// Returns the X11 context which renders on the X11 client
// side (which can be remote) and which usually is not
// anti-aliased and is thus faster
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
// not depend on libpangox - which is completely deprecated.
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
PangoContext *GtkGetPangoX11Context();
PangoContext *m_x11Context; // MR: Now unused
#endif
#if wxUSE_TOOLTIPS
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
#endif // wxUSE_TOOLTIPS
// Called from GTK signales handlers. it indicates that
// the layouting functions have to be called later on
// (i.e. in idle time, implemented in OnInternalIdle() ).
void GtkUpdateSize() { m_sizeSet = FALSE; }
// fix up the mouse event coords, used by wxListBox only so far
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
wxCoord& WXUNUSED(x),
wxCoord& WXUNUSED(y)) { }
// is this window transparent for the mouse events (as wxStaticBox is)?
virtual bool IsTransparentForMouse() const { return FALSE; }
// is this a radiobutton (used by radiobutton code itself only)?
virtual bool IsRadioButton() const { return FALSE; }
// position and size of the window
int m_x, m_y;
int m_width, m_height;
int m_oldClientWidth,m_oldClientHeight;
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
#ifdef __WXGTK20__
wxGtkIMData *m_imData;
#else // GTK 1
#ifdef HAVE_XIM
// XIM support for wxWidgets
GdkIC *m_ic;
GdkICAttr *m_icattr;
#endif // HAVE_XIM
#endif // GTK 2/1
#ifndef __WXGTK20__
// The area to be cleared (and not just refreshed)
// We cannot make this distinction under GTK 2.0.
wxRegion m_clearRegion;
#endif
// scrolling stuff
GtkAdjustment *m_hAdjust,*m_vAdjust;
float m_oldHorizontalPos;
float m_oldVerticalPos;
// extra (wxGTK-specific) flags
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
bool m_noExpose:1; // wxGLCanvas has its own redrawing
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
bool m_hasScrolling:1;
bool m_hasVMT:1;
bool m_sizeSet:1;
bool m_resizing:1;
bool m_acceptsFocus:1; // true if not static
bool m_hasFocus:1; // true if == FindFocus()
bool m_isScrolling:1; // dragging scrollbar thumb?
bool m_clipPaintRegion:1; // TRUE after ScrollWindow()
#ifdef __WXGTK20__
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
// chain needs update
#endif
bool m_needsStyleChange:1; // May not be able to change
// background style until OnIdle
// C++ has no virtual methods in the constrcutor of any class but we need
// different methods of inserting a child window into a wxFrame,
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
wxInsertChildFunction m_insertCallback;
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetClientSize( int *width, int *height ) const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS
protected:
// common part of all ctors (not virtual because called from ctor)
void Init();
#ifdef __WXGTK20__
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
// Copies m_children tab order to GTK focus chain:
void RealizeTabOrder();
#endif
// Called by ApplyWidgetStyle (which is called by SetFont() and
// SetXXXColour etc to apply style changed to native widgets) to create
// modified GTK style with non-standard attributes. If forceStyle=true,
// creates empty GtkRcStyle if there are no modifications, otherwise
// returns NULL in such case.
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
// Overridden in many GTK widgets who have to handle subwidgets
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
private:
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
DECLARE_NO_COPY_CLASS(wxWindowGTK)
};
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
#endif // __GTKWINDOWH__

View File

@@ -1,238 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/scrolwin.h
// Purpose: wxScrolledWindow, wxScrolledControl and wxScrollHelper
// Author: Vadim Zeitlin
// Modified by:
// Created: 30.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SCROLWIN_H_BASE_
#define _WX_SCROLWIN_H_BASE_
#include "wx/window.h"
class WXDLLEXPORT wxScrollHelperEvtHandler;
class WXDLLEXPORT wxTimer;
// ----------------------------------------------------------------------------
// wxScrollHelper: this class implements the scrolling logic which is used by
// wxScrolledWindow and wxScrolledControl. It is a mix-in: just derive from it
// to implement scrolling in your class.
// ----------------------------------------------------------------------------
#if !defined(__WXGTK__) || defined(__WXUNIVERSAL__)
class WXDLLEXPORT wxScrollHelper
{
public:
// ctor and dtor
wxScrollHelper(wxWindow *winToScroll = (wxWindow *)NULL);
void SetWindow(wxWindow *winToScroll);
virtual ~wxScrollHelper();
// configure the scrolling
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = false );
// scroll to the given (in logical coords) position
virtual void Scroll(int x, int y);
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// get the size of one logical unit in physical ones
virtual void GetScrollPixelsPerUnit(int *pixelsPerUnitX,
int *pixelsPerUnitY) const;
// Enable/disable Windows scrolling in either direction. If true, wxWidgets
// scrolls the canvas and only a bit of the canvas is invalidated; no
// Clear() is necessary. If false, the whole canvas is invalidated and a
// Clear() is necessary. Disable for when the scroll increment is used to
// actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Adjust the scrollbars
virtual void AdjustScrollbars(void);
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
// Normally the wxScrolledWindow will scroll itself, but in some rare
// occasions you might want it to scroll [part of] another window (e.g. a
// child of it in order to scroll only a portion the area between the
// scrollbars (spreadsheet: only cell area will move).
virtual void SetTargetWindow(wxWindow *target);
virtual wxWindow *GetTargetWindow() const;
void SetTargetRect(const wxRect& rect) { m_rectToScroll = rect; }
wxRect GetTargetRect() const { return m_rectToScroll; }
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) { }
// change the DC origin according to the scroll position.
virtual void DoPrepareDC(wxDC& dc);
// are we generating the autoscroll events?
bool IsAutoScrolling() const { return m_timerAutoScroll != NULL; }
// stop generating the scroll events when mouse is held outside the window
void StopAutoScrolling();
// this method can be overridden in a derived class to forbid sending the
// auto scroll events - note that unlike StopAutoScrolling() it doesn't
// stop the timer, so it will be called repeatedly and will typically
// return different values depending on the current mouse position
//
// the base class version just returns true
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
// the methods to be called from the window event handlers
void HandleOnScroll(wxScrollWinEvent& event);
void HandleOnSize(wxSizeEvent& event);
void HandleOnPaint(wxPaintEvent& event);
void HandleOnChar(wxKeyEvent& event);
void HandleOnMouseEnter(wxMouseEvent& event);
void HandleOnMouseLeave(wxMouseEvent& event);
#if wxUSE_MOUSEWHEEL
void HandleOnMouseWheel(wxMouseEvent& event);
#endif // wxUSE_MOUSEWHEEL
// FIXME: this is needed for now for wxPlot compilation, should be removed
// once it is fixed!
void OnScroll(wxScrollWinEvent& event) { HandleOnScroll(event); }
protected:
// get pointer to our scroll rect if we use it or NULL
const wxRect *GetScrollRect() const
{
return m_rectToScroll.width != 0 ? &m_rectToScroll : NULL;
}
// get the size of the target window
wxSize GetTargetSize() const
{
return m_rectToScroll.width != 0 ? m_rectToScroll.GetSize()
: m_targetWindow->GetClientSize();
}
void GetTargetSize(int *w, int *h)
{
wxSize size = GetTargetSize();
if ( w )
*w = size.x;
if ( h )
*h = size.y;
}
// change just the target window (unlike SetWindow which changes m_win as
// well)
void DoSetTargetWindow(wxWindow *target);
// delete the event handler we installed
void DeleteEvtHandler();
double m_scaleX;
double m_scaleY;
wxWindow *m_win,
*m_targetWindow;
wxRect m_rectToScroll;
wxTimer *m_timerAutoScroll;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLines;
int m_yScrollLines;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
#if wxUSE_MOUSEWHEEL
int m_wheelRotation;
#endif // wxUSE_MOUSEWHEEL
wxScrollHelperEvtHandler *m_handler;
DECLARE_NO_COPY_CLASS(wxScrollHelper)
};
#endif
// ----------------------------------------------------------------------------
// wxScrolledWindow: a wxWindow which knows how to scroll
// ----------------------------------------------------------------------------
#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/scrolwin.h"
#else // !wxGTK
#include "wx/generic/scrolwin.h"
class WXDLLEXPORT wxScrolledWindow : public wxGenericScrolledWindow
{
public:
wxScrolledWindow() { }
wxScrolledWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxGenericScrolledWindow(parent, winid, pos, size, style, name)
{
}
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow)
};
#define wxSCROLLED_WINDOW_IS_GENERIC 1
#endif
#endif
// _WX_SCROLWIN_H_BASE_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff