1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 20:59:19 +00:00
|
|
|
// Name: wx/gtk/window.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
#ifndef _WX_GTK_WINDOW_H_
|
|
|
|
#define _WX_GTK_WINDOW_H_
|
|
|
|
|
|
|
|
#include "wx/dynarray.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-06-26 15:25:39 +00:00
|
|
|
// helper structure that holds class that holds GtkIMContext object and
|
|
|
|
// some additional data needed for key events processing
|
|
|
|
struct wxGtkIMData;
|
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
WX_DEFINE_EXPORTED_ARRAY_PTR(GdkWindow *, wxArrayGdkWindows);
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2001-06-26 20:59:19 +00:00
|
|
|
// wxWindowGTK
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1998-07-23 16:08:49 +00:00
|
|
|
public:
|
1999-02-22 11:01:13 +00:00
|
|
|
// creating the window
|
|
|
|
// -------------------
|
2001-06-26 20:59:19 +00:00
|
|
|
wxWindowGTK();
|
|
|
|
wxWindowGTK(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
1999-05-09 22:17:03 +00:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual ~wxWindowGTK();
|
1998-08-17 18:24:32 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
// implement base class (pure) virtual methods
|
|
|
|
// -------------------------------------------
|
2001-08-02 23:32:27 +00:00
|
|
|
|
2005-11-28 00:19:38 +00:00
|
|
|
virtual void SetLabel(const wxString& WXUNUSED(label)) { }
|
2005-11-04 12:50:11 +00:00
|
|
|
virtual wxString GetLabel() const { return wxEmptyString; }
|
2005-11-04 12:30:03 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual bool Destroy();
|
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
1999-02-01 14:40:53 +00:00
|
|
|
|
2005-11-04 12:50:11 +00:00
|
|
|
virtual bool Show( bool show = true );
|
1999-02-01 14:40:53 +00:00
|
|
|
|
2005-11-07 20:00:50 +00:00
|
|
|
virtual void SetWindowStyleFlag( long style );
|
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
virtual bool IsRetained() const;
|
1998-09-02 12:15:35 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void SetFocus();
|
2007-10-24 18:07:24 +00:00
|
|
|
|
2007-09-17 10:17:12 +00:00
|
|
|
// hint from wx to native GTK+ tab traversal code
|
2007-04-05 22:29:14 +00:00
|
|
|
virtual void SetCanFocus(bool canFocus);
|
1999-02-01 14:40:53 +00:00
|
|
|
|
1999-09-29 17:35:52 +00:00
|
|
|
virtual bool Reparent( wxWindowBase *newParent );
|
1999-02-01 14:40:53 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
virtual void WarpPointer(int x, int y);
|
1999-01-27 17:15:34 +00:00
|
|
|
|
2005-11-04 12:50:11 +00:00
|
|
|
virtual void Refresh( bool eraseBackground = true,
|
1999-05-09 22:17:03 +00:00
|
|
|
const wxRect *rect = (const wxRect *) NULL );
|
2002-01-30 13:23:10 +00:00
|
|
|
virtual void Update();
|
2003-08-13 16:47:43 +00:00
|
|
|
virtual void ClearBackground();
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
virtual bool SetBackgroundColour( const wxColour &colour );
|
|
|
|
virtual bool SetForegroundColour( const wxColour &colour );
|
|
|
|
virtual bool SetCursor( const wxCursor &cursor );
|
|
|
|
virtual bool SetFont( const wxFont &font );
|
1998-08-17 18:24:32 +00:00
|
|
|
|
2004-08-29 13:32:45 +00:00
|
|
|
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
|
2005-08-17 21:40:44 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual int GetCharHeight() const;
|
|
|
|
virtual int GetCharWidth() const;
|
1999-05-09 22:17:03 +00:00
|
|
|
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;
|
1998-07-23 16:08:49 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
2005-11-04 12:50:11 +00:00
|
|
|
int range, bool refresh = true );
|
|
|
|
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
1999-05-09 22:17:03 +00:00
|
|
|
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 );
|
2006-02-09 03:53:34 +00:00
|
|
|
virtual bool ScrollLines(int lines);
|
|
|
|
virtual bool ScrollPages(int pages);
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
|
|
|
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
2005-08-17 21:40:44 +00:00
|
|
|
|
2004-07-03 11:16:03 +00:00
|
|
|
virtual void AddChild( wxWindowBase *child );
|
|
|
|
virtual void RemoveChild( wxWindowBase *child );
|
1998-12-09 17:30:17 +00:00
|
|
|
|
2006-09-04 13:35:13 +00:00
|
|
|
virtual void SetLayoutDirection(wxLayoutDirection dir);
|
|
|
|
virtual wxLayoutDirection GetLayoutDirection() const;
|
2006-09-10 19:40:20 +00:00
|
|
|
virtual wxCoord AdjustForLayoutDirection(wxCoord x,
|
|
|
|
wxCoord width,
|
|
|
|
wxCoord widthTotal) const;
|
2006-09-04 13:35:13 +00:00
|
|
|
|
2006-09-11 17:50:12 +00:00
|
|
|
virtual bool DoIsExposed( int x, int y ) const;
|
|
|
|
virtual bool DoIsExposed( int x, int y, int w, int h ) const;
|
2006-09-11 10:32:43 +00:00
|
|
|
|
2006-05-28 14:30:08 +00:00
|
|
|
// currently wxGTK2-only
|
|
|
|
void SetDoubleBuffered(bool on);
|
2006-10-09 16:39:34 +00:00
|
|
|
virtual bool IsDoubleBuffered() const;
|
2006-05-28 14:30:08 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-05-10 22:29:23 +00:00
|
|
|
virtual WXWidget GetHandle() const { return m_widget; }
|
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
// many important things are done here, this function must be called
|
|
|
|
// regularly
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void OnInternalIdle();
|
1999-02-01 14:40:53 +00:00
|
|
|
|
2002-04-19 17:39:49 +00:00
|
|
|
// Internal represention of Update()
|
|
|
|
void GtkUpdate();
|
2005-08-17 21:40:44 +00:00
|
|
|
|
2002-01-30 13:23:10 +00:00
|
|
|
// For compatibility across platforms (not in event table)
|
|
|
|
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
|
1999-03-01 13:06:15 +00:00
|
|
|
|
2002-01-30 13:23:10 +00:00
|
|
|
// Used by all window classes in the widget creation process.
|
2001-06-26 20:59:19 +00:00
|
|
|
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
|
1999-02-22 11:01:13 +00:00
|
|
|
void PostCreation();
|
1999-02-01 14:40:53 +00:00
|
|
|
|
2002-01-30 13:23:10 +00:00
|
|
|
// Internal addition of child windows. differs from class
|
|
|
|
// to class not by using virtual functions but by using
|
|
|
|
// the m_insertCallback.
|
2001-06-26 20:59:19 +00:00
|
|
|
void DoAddChild(wxWindowGTK *child);
|
2005-08-17 21:40:44 +00:00
|
|
|
|
2002-01-30 13:23:10 +00:00
|
|
|
// 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.
|
2005-11-19 01:07:56 +00:00
|
|
|
// also, it is not clear which native widget is the top
|
2002-01-30 13:23:10 +00:00
|
|
|
// widget where (most of) the input goes. even tooltips have
|
|
|
|
// to be applied to all subwidgets.
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual GtkWidget* GetConnectWidget();
|
|
|
|
void ConnectWidget( GtkWidget *widget );
|
1998-12-09 17:30:17 +00:00
|
|
|
|
2006-08-25 13:22:32 +00:00
|
|
|
// Called from several event handlers, if it returns true or false, the
|
|
|
|
// same value should be immediately returned by the handler without doing
|
|
|
|
// anything else. If it returns -1, the handler should continue as usual
|
|
|
|
int GTKCallbackCommonPrologue(struct _GdkEventAny *event) const;
|
2006-08-25 12:59:28 +00:00
|
|
|
|
2006-09-01 22:20:05 +00:00
|
|
|
// override this if some events should never be consumed by wxWidgets but
|
|
|
|
// but have to be left for the native control
|
|
|
|
//
|
|
|
|
// base version just does GetEventHandler()->ProcessEvent()
|
|
|
|
virtual bool GTKProcessEvent(wxEvent& event) const;
|
|
|
|
|
2006-09-04 13:35:13 +00:00
|
|
|
// Map GTK widget direction of the given widget to/from wxLayoutDirection
|
|
|
|
static wxLayoutDirection GTKGetLayout(GtkWidget *widget);
|
|
|
|
static void GTKSetLayout(GtkWidget *widget, wxLayoutDirection dir);
|
|
|
|
|
2007-04-23 15:16:06 +00:00
|
|
|
// return true if this window must have a non-NULL parent, false if it can
|
|
|
|
// be created without parent (normally only top level windows but in wxGTK
|
|
|
|
// there is also the exception of wxMenuBar)
|
|
|
|
virtual bool GTKNeedsParent() const { return !IsTopLevel(); }
|
|
|
|
|
2007-08-15 21:01:30 +00:00
|
|
|
// This is called when capture is taken from the window. It will
|
|
|
|
// fire off capture lost events.
|
|
|
|
void GTKReleaseMouseAndNotify();
|
|
|
|
|
2006-05-05 17:04:48 +00:00
|
|
|
protected:
|
2006-03-12 14:21:19 +00:00
|
|
|
// Override GTKWidgetNeedsMnemonic and return true if your
|
2007-03-26 19:30:20 +00:00
|
|
|
// needs to set its mnemonic widget, such as for a
|
2006-03-12 14:21:19 +00:00
|
|
|
// GtkLabel for wxStaticText, then do the actual
|
|
|
|
// setting of the widget inside GTKWidgetDoSetMnemonic
|
|
|
|
virtual bool GTKWidgetNeedsMnemonic() const;
|
|
|
|
virtual void GTKWidgetDoSetMnemonic(GtkWidget* w);
|
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
// Get the GdkWindows making part of this window: usually there will be
|
|
|
|
// only one of them in which case it should be returned directly by this
|
|
|
|
// function. If there is more than one GdkWindow (can be the case for
|
|
|
|
// composite widgets), return NULL and fill in the provided array
|
|
|
|
//
|
|
|
|
// This is not pure virtual for backwards compatibility but almost
|
|
|
|
// certainly must be overridden in any wxControl-derived class!
|
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
|
|
|
|
|
|
|
// Check if the given window makes part of this widget
|
|
|
|
bool GTKIsOwnWindow(GdkWindow *window) const;
|
|
|
|
|
|
|
|
// Set the focus to this window if its setting was delayed because the
|
|
|
|
// widget hadn't been realized when SetFocus() was called
|
|
|
|
//
|
|
|
|
// Return true if focus was set to us, false if nothing was done
|
|
|
|
bool GTKSetDelayedFocusIfNeeded();
|
|
|
|
|
2006-05-05 17:04:48 +00:00
|
|
|
public:
|
2002-12-04 14:11:26 +00:00
|
|
|
// Returns the default context which usually is anti-aliased
|
|
|
|
PangoContext *GtkGetPangoDefaultContext();
|
|
|
|
|
1999-02-01 14:40:53 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
2007-05-30 13:50:36 +00:00
|
|
|
// applies tooltip to the widget (tip must be UTF-8 encoded)
|
|
|
|
virtual void ApplyToolTip( GtkTooltips *tips, const gchar *tip );
|
1999-02-01 14:40:53 +00:00
|
|
|
#endif // wxUSE_TOOLTIPS
|
1999-02-01 06:44:35 +00:00
|
|
|
|
2006-08-22 12:26:22 +00:00
|
|
|
// Called when a window should delay showing itself
|
|
|
|
// until idle time. This partly mimmicks defered
|
|
|
|
// sizing under MSW.
|
|
|
|
void GtkShowOnIdle() { m_showOnIdle = true; }
|
2007-03-26 19:30:20 +00:00
|
|
|
|
2006-08-22 21:50:28 +00:00
|
|
|
// This is called from the various OnInternalIdle methods
|
|
|
|
bool GtkShowFromOnIdle();
|
2002-01-19 19:31:19 +00:00
|
|
|
|
2002-05-31 14:00:01 +00:00
|
|
|
// fix up the mouse event coords, used by wxListBox only so far
|
|
|
|
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
|
|
|
|
wxCoord& WXUNUSED(x),
|
|
|
|
wxCoord& WXUNUSED(y)) { }
|
|
|
|
|
2002-05-31 14:13:17 +00:00
|
|
|
// is this window transparent for the mouse events (as wxStaticBox is)?
|
2005-11-04 12:50:11 +00:00
|
|
|
virtual bool IsTransparentForMouse() const { return false; }
|
2002-05-31 14:13:17 +00:00
|
|
|
|
2002-05-31 14:17:23 +00:00
|
|
|
// is this a radiobutton (used by radiobutton code itself only)?
|
2005-11-04 12:50:11 +00:00
|
|
|
virtual bool IsRadioButton() const { return false; }
|
2002-05-31 14:17:23 +00:00
|
|
|
|
2006-05-17 04:54:13 +00:00
|
|
|
// Common scroll event handling code for wxWindow and wxScrollBar
|
|
|
|
wxEventType GetScrollEventType(GtkRange* range);
|
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
// position and size of the window
|
|
|
|
int m_x, m_y;
|
|
|
|
int m_width, m_height;
|
2000-01-15 20:06:47 +00:00
|
|
|
int m_oldClientWidth,m_oldClientHeight;
|
1998-09-02 22:23:57 +00:00
|
|
|
|
2001-08-19 21:36:25 +00:00
|
|
|
// see the docs in src/gtk/window.cpp
|
|
|
|
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
|
2004-05-23 14:56:36 +00:00
|
|
|
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
|
2002-01-19 19:31:19 +00:00
|
|
|
|
2007-04-26 18:42:23 +00:00
|
|
|
// return true if the window is of a standard (i.e. not wxWidgets') class
|
|
|
|
bool IsOfStandardClass() const { return m_wxwindow == NULL; }
|
2007-10-24 18:07:24 +00:00
|
|
|
|
2001-08-19 21:36:25 +00:00
|
|
|
// this widget will be queried for GTK's focus events
|
|
|
|
GtkWidget *m_focusWidget;
|
1999-05-09 22:17:03 +00:00
|
|
|
|
2004-06-26 15:25:39 +00:00
|
|
|
wxGtkIMData *m_imData;
|
2002-02-04 14:05:28 +00:00
|
|
|
|
2006-08-19 10:53:37 +00:00
|
|
|
|
|
|
|
// indices for the arrays below
|
|
|
|
enum ScrollDir { ScrollDir_Horz, ScrollDir_Vert, ScrollDir_Max };
|
|
|
|
|
2006-05-17 04:54:13 +00:00
|
|
|
// horizontal/vertical scroll bar
|
2006-08-19 10:53:37 +00:00
|
|
|
GtkRange* m_scrollBar[ScrollDir_Max];
|
|
|
|
|
2006-05-17 04:54:13 +00:00
|
|
|
// horizontal/vertical scroll position
|
2006-08-19 10:53:37 +00:00
|
|
|
double m_scrollPos[ScrollDir_Max];
|
|
|
|
|
|
|
|
// return the scroll direction index corresponding to the given orientation
|
|
|
|
// (which is wxVERTICAL or wxHORIZONTAL)
|
|
|
|
static ScrollDir ScrollDirFromOrient(int orient)
|
|
|
|
{
|
|
|
|
return orient == wxVERTICAL ? ScrollDir_Vert : ScrollDir_Horz;
|
|
|
|
}
|
|
|
|
|
|
|
|
// return the orientation for the given scrolling direction
|
|
|
|
static int OrientFromScrollDir(ScrollDir dir)
|
|
|
|
{
|
|
|
|
return dir == ScrollDir_Horz ? wxHORIZONTAL : wxVERTICAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// find the direction of the given scrollbar (must be one of ours)
|
|
|
|
ScrollDir ScrollDirFromRange(GtkRange *range) const;
|
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
// extra (wxGTK-specific) flags
|
2001-08-19 21:36:25 +00:00
|
|
|
bool m_noExpose:1; // wxGLCanvas has its own redrawing
|
|
|
|
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
|
1999-05-09 22:17:03 +00:00
|
|
|
bool m_hasScrolling:1;
|
|
|
|
bool m_hasVMT:1;
|
2002-05-31 13:51:43 +00:00
|
|
|
bool m_hasFocus:1; // true if == FindFocus()
|
|
|
|
bool m_isScrolling:1; // dragging scrollbar thumb?
|
2005-11-04 12:50:11 +00:00
|
|
|
bool m_clipPaintRegion:1; // true after ScrollWindow()
|
2006-09-18 14:29:16 +00:00
|
|
|
wxRegion m_nativeUpdateRegion; // not transformed for RTL
|
2004-07-03 11:16:03 +00:00
|
|
|
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
|
|
|
|
// chain needs update
|
2004-08-29 13:32:45 +00:00
|
|
|
bool m_needsStyleChange:1; // May not be able to change
|
|
|
|
// background style until OnIdle
|
2006-05-17 04:54:13 +00:00
|
|
|
bool m_mouseButtonDown:1;
|
2007-03-26 19:30:20 +00:00
|
|
|
|
2006-08-22 12:26:22 +00:00
|
|
|
bool m_showOnIdle:1; // postpone showing the window until idle
|
1999-05-17 17:07:46 +00:00
|
|
|
|
2007-05-25 05:08:18 +00:00
|
|
|
protected:
|
1999-05-10 22:29:23 +00:00
|
|
|
// 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.
|
2007-05-25 05:08:18 +00:00
|
|
|
typedef void (*InsertChildFunction)(wxWindowGTK*, wxWindowGTK*);
|
|
|
|
InsertChildFunction m_insertCallback;
|
1999-02-24 13:15:42 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
// implement the base class pure virtuals
|
1999-05-19 01:00:57 +00:00
|
|
|
virtual void DoClientToScreen( int *x, int *y ) const;
|
|
|
|
virtual void DoScreenToClient( int *x, int *y ) const;
|
1999-05-09 22:17:03 +00:00
|
|
|
virtual void DoGetPosition( int *x, int *y ) const;
|
|
|
|
virtual void DoGetSize( int *width, int *height ) const;
|
|
|
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1999-12-29 19:18:01 +00:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
2007-05-25 05:08:18 +00:00
|
|
|
virtual void DoEnable(bool enable);
|
1998-07-23 16:08:49 +00:00
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
|
|
|
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
|
|
|
#endif // wxUSE_MENUS_NATIVE
|
|
|
|
|
2002-01-19 19:31:19 +00:00
|
|
|
virtual void DoCaptureMouse();
|
|
|
|
virtual void DoReleaseMouse();
|
2005-08-17 21:40:44 +00:00
|
|
|
|
1999-05-09 22:17:03 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
virtual void DoSetToolTip( wxToolTip *tip );
|
|
|
|
#endif // wxUSE_TOOLTIPS
|
|
|
|
|
2002-05-31 14:00:01 +00:00
|
|
|
// common part of all ctors (not virtual because called from ctor)
|
1999-05-09 22:17:03 +00:00
|
|
|
void Init();
|
2005-08-17 21:40:44 +00:00
|
|
|
|
2004-07-03 11:16:03 +00:00
|
|
|
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
|
2007-03-26 22:10:04 +00:00
|
|
|
virtual bool DoNavigateIn(int flags);
|
|
|
|
|
2004-07-03 11:16:03 +00:00
|
|
|
|
|
|
|
// Copies m_children tab order to GTK focus chain:
|
|
|
|
void RealizeTabOrder();
|
2005-08-17 21:40:44 +00:00
|
|
|
|
2004-06-14 17:34:00 +00:00
|
|
|
// Called by ApplyWidgetStyle (which is called by SetFont() and
|
|
|
|
// SetXXXColour etc to apply style changed to native widgets) to create
|
2004-06-18 08:02:01 +00:00
|
|
|
// 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);
|
2004-06-14 17:34:00 +00:00
|
|
|
|
|
|
|
// Overridden in many GTK widgets who have to handle subwidgets
|
2004-06-18 08:02:01 +00:00
|
|
|
virtual void ApplyWidgetStyle(bool forceStyle = false);
|
2005-08-17 21:40:44 +00:00
|
|
|
|
2005-11-04 12:50:11 +00:00
|
|
|
// helper function to ease native widgets wrapping, called by
|
2004-06-19 17:49:26 +00:00
|
|
|
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
|
|
|
|
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
1999-05-09 22:17:03 +00:00
|
|
|
|
2006-04-16 23:38:26 +00:00
|
|
|
// sets the border of a given GtkScrolledWindow from a wx style
|
|
|
|
static void GtkScrolledWindowSetBorder(GtkWidget* w, int style);
|
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
// set the current cursor for all GdkWindows making part of this widget
|
|
|
|
// (see GTKGetWindow)
|
2006-09-01 21:44:22 +00:00
|
|
|
//
|
2006-08-25 12:59:28 +00:00
|
|
|
// should be called from OnInternalIdle() if it's overridden
|
|
|
|
void GTKUpdateCursor();
|
|
|
|
|
2007-04-26 05:22:09 +00:00
|
|
|
void ConstrainSize();
|
|
|
|
|
1998-10-19 14:18:56 +00:00
|
|
|
private:
|
2006-08-19 10:53:37 +00:00
|
|
|
enum ScrollUnit { ScrollUnit_Line, ScrollUnit_Page, ScrollUnit_Max };
|
|
|
|
|
|
|
|
// common part of ScrollLines() and ScrollPages() and could be used, in the
|
|
|
|
// future, for horizontal scrolling as well
|
|
|
|
//
|
|
|
|
// return true if we scrolled, false otherwise (on error or simply if we
|
|
|
|
// are already at the end)
|
|
|
|
bool DoScrollByUnits(ScrollDir dir, ScrollUnit unit, int units);
|
|
|
|
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
|
2001-07-04 12:23:32 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowGTK)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
|
2001-07-03 19:38:19 +00:00
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
#endif // _WX_GTK_WINDOW_H_
|