GtkOL Reference Manual |
---|
<cwidget shown="true|false" enabled="true|false"> ... </cwidget> |
DECLARE_GENERIC_METACLASS ('wdgt', CWidget, CControl); DECLARE_GENERIC_METACLASS ('_wdg', CWidgetListener, CObjectListener); |
#include "ccontrol.h" class CWidget; typedef TBuffer <CWidget *> CWidgets; typedef enum { SHIFTSTATE_LBUTTON =(1L), // mouse left button SHIFTSTATE_MBUTTON =(1L<<1), // mouse middle button SHIFTSTATE_RBUTTON =(1L<<2), // mouse right button SHIFTSTATE_DBUTTON =(1L<<3), // button double click SHIFTSTATE_TBUTTON =(1L<<4), // triple click SHIFTSTATE_SHIFT =(1L<<5), // shift key hold SHIFTSTATE_CONTROL =(1L<<6), // control key hold SHIFTSTATE_ALT =(1L<<7), // alt key hold SHIFTSTATE_LOCK =(1L<<8) // shift lock active } TShiftState; class CWidgetListener : public CObjectListener { public : CWidgetListener (); virtual ~CWidgetListener () =0; public : virtual void OnQueryDestroy (CObject *inSender, Bool &ioDoDestroy) { } virtual void OnDestroy (CObject *inSender) { } virtual void OnShow (CObject *inSender) { } virtual void OnHide (CObject *inSender) { } virtual void OnSetFocus (CObject *inSender) { } virtual void OnKillFocus (CObject *inSender) { } virtual void OnQueryResize (CObject *inSender, TSize &ioSize) { } virtual void OnResize (CObject *inSender) { } virtual void OnKeyPress (CObject *inSender, int inShiftStates, UInt16 &ioKey) { } virtual void OnKeyRelease (CObject *inSender, int inShiftStates, UInt16 inKey) { } virtual void OnMouseEnter (CObject *inSender) { } virtual void OnMouseExit (CObject *inSender) { } virtual void OnMouseDown (CObject *inSender, int inShiftStates, TPoint inRelativePoint) { } virtual void OnMouseUp (CObject *inSender, int inShiftStates, TPoint inRelativePoint) { } virtual void OnMouseMove (CObject *inSender, int inShiftStates, TPoint inRelativePoint) { } virtual void OnDragStart (CObject *&ioSender, TPoint &ioRelativePoint, CPixbuf *&ioPixbuf) { } virtual void OnDragOver (CObject *inDragged, CObject *inReceiver, CObject *inTargeted, TPoint inRelativePoint, Bool &ioAccept) { } virtual void OnDragDrop (CObject *inDragged, CObject *inReceiver, CObject *&ioTargeted, SInt16 &ioIndex, TPoint inRelativePoint, Bool &ioDoDrop) { } virtual void OnDragStop (CObject *inSender) { } virtual void OnPaint (CObject *inSender, CGraphics &ioGraphics) { } virtual void OnEventAfter (CObject *inSender, GdkEvent *inGdkEvent) { } SECTION_GENERIC_METACLASS; }; class CWidget : public CControl { public : CWidget (CComponent *inOwner, const CWidgetListener *inListener=NULL); virtual ~CWidget (); protected : static Bool CreateWidget (CWidget *This); static Bool DestroyWidget (CWidget *This); protected : virtual GtkWidget * PerformWidgetInstanciate () =0; virtual void PerformWidgetInitialize () =0; public : static CWidget * GetGtkolWidget (const GtkWidget *); static CWidget * GetGtkolWidget (const GdkWindow *); GtkWidget * GetGtkWidget () const; virtual const CMetaClass * ListenerMustBe () const; virtual Bool CheckSetOwner (const CComponent *inCandidate) const; virtual Bool SetOwner (CComponent *inOwner, const SInt16 inIndex=-1); virtual CMetaClasses OwnerMustBe () const; virtual CMetaClasses ChildMustBe () const; virtual void SetBounds (const TBounds &inBounds); virtual void SetDraggable (const Bool inDraggable); virtual void SetDropSite (const Bool inDropSite); virtual CPixbuf * GetControlPixbuf () const; virtual CControl * GetControlAtPoint (const TPoint &inRelativePoint) const; virtual void Show (const Bool inAll=false); virtual void Hide (const Bool inAll=false); Bool IsShown () const; virtual void Enable (); virtual void Disable (); Bool IsEnabled () const; Bool CanFocus () const; virtual void SetFocus (); virtual Bool IsFocused () const; virtual void Invalidate (const TBounds &inInvalidate=TBounds()); virtual void Validate (); virtual void Serialize (CXMLElementNode *&ioXMLElementNode, const int inMode) THROWABLE; private : GtkWidget * m_GtkWidget; static CWidget * m_DraggedWidget; static CControl * m_DraggedControl; static TPoint m_DraggedPoint; protected : bool m_PerformContainerProcess; bool m_PerformSignalConnection; bool m_SerializeShown; bool m_SerializeEnabled; protected : static gboolean OnQueryDestroy (GtkWidget *, GdkEvent *, gpointer); static void OnDestroy (GtkWidget *, gpointer); static void OnShow (GtkWidget *, gpointer); static void OnHide (GtkWidget *, gpointer); static gboolean OnSetFocus (GtkWidget *, GdkEventFocus *, gpointer); static gboolean OnKillFocus (GtkWidget *, GdkEventFocus *, gpointer); static gboolean OnKeyPress (GtkWidget *, GdkEventKey *, gpointer); static gboolean OnKeyRelease (GtkWidget *, GdkEventKey *, gpointer); static gboolean OnMouseDown (GtkWidget *, GdkEventButton *, gpointer); static gboolean OnMouseUp (GtkWidget *, GdkEventButton *, gpointer); static gboolean OnMouseMove (GtkWidget *, GdkEventMotion *, gpointer); static gboolean OnMouseEnter (GtkWidget *, GdkEventCrossing *, gpointer); static gboolean OnMouseExit (GtkWidget *, GdkEventCrossing *, gpointer); static void OnDragDataGet (GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, gpointer); static void OnDragDataReceived (GtkWidget *, GdkDragContext *, gint, gint, GtkSelectionData *, guint, guint, gpointer); static void OnDragStart (GtkWidget *, GdkDragContext *, gpointer); static gboolean OnDragOver (GtkWidget *, GdkDragContext *, gint, gint, guint, gpointer); static gboolean OnDragDrop (GtkWidget *, GdkDragContext *, gint, gint, guint, gpointer); static void OnDragStop (GtkWidget *, GdkDragContext *, gpointer); static gboolean OnConfigure (GtkWidget *, GdkEventConfigure *, gpointer); static void OnQueryResize (GtkWidget *, GtkRequisition *, gpointer); static void OnResize (GtkWidget *, GtkAllocation *, gpointer); static void OnEventAfter (GtkWidget *, GdkEvent *, gpointer); static gboolean OnPaint (GtkWidget *, GdkEventExpose *, gpointer); friend class CContainer; SECTION_GENERIC_METACLASS; }; |
virtual void CWidgetListener::OnQueryDestroy (CObject *inSender, Bool &ioDoDestroy); |
virtual void CWidgetListener::OnDestroy (CObject *inSender); |
virtual void CWidgetListener::OnShow (CObject *inSender); |
virtual void CWidgetListener::OnHide (CObject *inSender); |
virtual void CWidgetListener::OnSetFocus (CObject *inSender); |
virtual void CWidgetListener::OnKillFocus (CObject *inSender); |
virtual void CWidgetListener::OnQueryResize (CObject *inSender, TSize &ioSize); |
virtual void CWidgetListener::OnResize (CObject *inSender); |
virtual void CWidgetListener::OnKeyPress (CObject *inSender, int inShiftStates, UInt16 &ioKey); |
virtual void CWidgetListener::OnKeyRelease (CObject *inSender, int inShiftStates, UInt16 inKey); |
virtual void CWidgetListener::OnMouseEnter (CObject *inSender); |
virtual void CWidgetListener::OnMouseExit (CObject *inSender); |
virtual void CWidgetListener::OnMouseDown (CObject *inSender, int inShiftStates, TPoint inRelativePoint); |
virtual void CWidgetListener::OnMouseUp (CObject *inSender, int inShiftStates, TPoint inRelativePoint); |
virtual void CWidgetListener::OnMouseMove (CObject *inSender, int inShiftStates, TPoint inRelativePoint); |
virtual void CWidgetListener::OnDragStart (CObject *&ioSender, TPoint &ioRelativePoint, CPixbuf *&ioPixbuf); |
virtual void CWidgetListener::OnDragOver (CObject *inDragged, CObject *inReceiver, CObject *inTargeted, TPoint inRelativePoint, Bool &ioAccept); |
virtual void CWidgetListener::OnDragDrop (CObject *inDragged, CObject *inReceiver, CObject *&ioTargeted, SInt16 &ioIndex, TPoint inRelativePoint, Bool &ioDoDrop); |
virtual void CWidgetListener::OnDragStop (CObject *inSender); |
virtual void CWidgetListener::OnEventAfter (CObject *inSender, GdkEvent *inGdkEvent); |
virtual void CWidgetListener::OnPaint (CObject *inSender, CGraphics &ioGraphics); |
CWidget::CWidget (CComponent *inOwner, const CWidgetListener *inListener=NULL); |
virtual CWidget::~CWidget (); |
static
Bool
CWidget::CreateWidget
(CWidget *This); |
static
Bool
CWidget::DestroyWidget
(CWidget *This); |
virtual GtkWidget * CWidget::PerformWidgetInstanciate () =0; |
virtual void CWidget::PerformWidgetInitialize () =0; |
static CWidget * CWidget::GetGtkolWidget (const GtkWidget *); |
static CWidget * CWidget::GetGtkolWidget (const GdkWindow *); |
GtkWidget
*
CWidget::GetGtkWidget
() const; |
virtual const CMetaClass * CWidget::ListenerMustBe () const; |
virtual
Bool
CWidget::CheckSetOwner (const CComponent *inCandidate) const; |
virtual
Bool
CWidget::SetOwner
(CComponent *inOwner, const SInt16 inIndex=-1); |
virtual CMetaClasses CWidget::OwnerMustBe () const; |
virtual CMetaClasses CWidget::ChildMustBe () const; |
virtual
void
CWidget::SetBounds
(const TBounds &inBounds); |
virtual
void
CWidget::SetDraggable (const Bool inDraggable); |
virtual
void
CWidget::SetDropSite
(const Bool inDropSite); |
virtual CPixbuf * CWidget::GetControlPixbuf () const; |
virtual CControl * CWidget::GetControlAtPoint (const TPoint &inRelativePoint) const; |
virtual
void
CWidget::Show
(const Bool inAll=false); |
virtual
void
CWidget::Hide
(const Bool inAll=false); |
Bool CWidget::IsShown
(); |
virtual
void
CWidget::Enable
(); |
virtual
void
CWidget::Disable
(); |
Bool
CWidget::IsEnabled
() const; |
Bool
CWidget::CanFocus
() const; |
virtual
void
CWidget::SetFocus
(); |
virtual
Bool
CWidget::IsFocused
() const; |
virtual
void
CWidget::Invalidate
(const TBounds &inInvalidate=TBounds()); |
virtual
void
CWidget::Validate
(); |
virtual
void
CWidget::Serialize
(CXMLElementNode *&ioXMLElementNode, const int inMode) THROWABLE; |
GtkWidget * CWidget::m_GtkWidget; |
static CWidget * CWidget::m_DraggedWidget; |
static CControl * CWidget::m_DraggedControl; |
static TPoint CWidget::m_DraggedPoint; |
bool
CWidget::m_PerformContainerProcess; |
bool
CWidget::m_PerformSignalConnection; |
bool
CWidget::m_SerializeShown; |
bool
CWidget::m_SerializeEnabled; |
static gboolean CWidget::OnQueryDestroy (GtkWidget *, GdkEvent *, gpointer); |
static
void
CWidget::OnDestroy
(GtkWidget *, gpointer); |
static
void
CWidget::OnShow
(GtkWidget *, gpointer); |
static
void
CWidget::OnHide
(GtkWidget *, gpointer); |
static gboolean CWidget::OnSetFocus
(GtkWidget *, GdkEventFocus *, gpointer); |
static gboolean CWidget::OnKillFocus
(GtkWidget *, GdkEventFocus *, gpointer); |
static gboolean CWidget::OnKeyPress
(GtkWidget *, GdkEventKey *, gpointer); |
static gboolean CWidget::OnKeyRelease
(GtkWidget *, GdkEventKey *, gpointer); |
static gboolean CWidget::OnMouseDown
(GtkWidget *, GdkEventButton *, gpointer); |
static gboolean CWidget::OnMouseUp
(GtkWidget *, GdkEventButton *, gpointer); |
static gboolean CWidget::OnMouseMove
(GtkWidget *, GdkEventMotion *, gpointer); |
static gboolean CWidget::OnMouseEnter
(GtkWidget *, GdkEventCrossing *, gpointer); |
static gboolean CWidget::OnMouseExit
(GtkWidget *, GdkEventCrossing *, gpointer); |
static void
CWidget::OnDragDataGet
(GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, gpointer); |
static void CWidget::OnDragDataReceived (GtkWidget *, GdkDragContext *, gint, gint, GtkSelectionData *, guint, guint, gpointer); |
static
void
CWidget::OnDragStart
(GtkWidget *, GdkDragContext *, gpointer); |
static
gboolean
CWidget::OnDragOver
(GtkWidget *, GdkDragContext *, gint, gint, guint, gpointer); |
static
gboolean
CWidget::OnDragDrop
(GtkWidget *, GdkDragContext *, gint, gint, guint, gpointer); |
static
void
CWidget::OnDragStop
(GtkWidget *, GdkDragContext *, gpointer); |
static
gboolean
CWidget::OnConfigure
(GtkWidget *, GdkEventConfigure *, gpointer); |
static
void
CWidget::OnQueryResize
(GtkWidget *, GtkRequisition *, gpointer); |
static
void
CWidget::OnResize
(GtkWidget *, GtkAllocation *, gpointer); |
static
void
CWidget::OnEventAfter
(GtkWidget *, GdkEvent *, gpointer); |
static
gboolean CWidget::OnPaint
(GtkWidget *, GdkEventExpose *, gpointer); |