JX Application Framework
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
JXWidget Class Reference

#include <JXWidget.h>

Inheritance diagram for JXWidget:
[legend]

Classes

class  GotFocus
 
class  LostFocus
 

Public Types

enum  HSizingOption {
  kFixedLeft ,
  kFixedRight ,
  kHElastic
}
 
enum  VSizingOption {
  kFixedTop ,
  kFixedBottom ,
  kVElastic
}
 

Public Member Functions

 ~JXWidget () override
 
void Deactivate () override
 
void Refresh () const override
 
void RefreshRect (const JRect &rect) const
 
void Redraw () const override
 
void RedrawRect (const JRect &rect) const
 
bool Focus ()
 
bool Unfocus ()
 
bool HasFocus () const
 
bool WillAcceptFocus () const
 
void SetSingleFocusWidget ()
 
virtual bool OKToUnfocus ()
 
bool WantsTab () const
 
bool WantsModifiedTab () const
 
virtual void HandleKeyPress (const JUtf8Character &c, const int keySym, const JXKeyModifiers &modifiers)
 
bool WillAcceptShortcut () const
 
virtual void HandleShortcut (const int key, const JXKeyModifiers &modifiers)
 
JPoint GlobalToLocal (const JCoordinate x, const JCoordinate y) const override
 
JPoint LocalToGlobal (const JCoordinate x, const JCoordinate y) const override
 
void Place (const JCoordinate enclX, const JCoordinate enclY) override
 
void Move (const JCoordinate dx, const JCoordinate dy) override
 
void SetSize (const JCoordinate w, const JCoordinate h) override
 
void AdjustSize (const JCoordinate dw, const JCoordinate dh) override
 
HSizingOption GetHSizing () const
 
VSizingOption GetVSizing () const
 
void SetSizing (const HSizingOption hSizing, const VSizingOption vSizing)
 
void CenterWithinEnclosure (const bool adjustHoriz, const bool adjustVert)
 
void FitToEnclosure (const bool fitHoriz=true, const bool fitVert=true)
 
bool Scroll (const JCoordinate dx, const JCoordinate dy)
 
bool ScrollTo (const JCoordinate x, const JCoordinate y)
 
bool ScrollTo (const JPoint &pt)
 
bool ScrollToRect (const JRect &r)
 
bool ScrollToRectCentered (const JRect &r, const bool forceScroll)
 
JRect GetBoundsGlobal () const override
 
JRect GetFrameGlobal () const override
 
JRect GetApertureGlobal () const override
 
JSize GetBorderWidth () const
 
void SetBorderWidth (const JSize width)
 
JColorID GetCurrBackColor () const
 
JColorID GetBackColor () const
 
void SetBackColor (const JColorID color)
 
JColorID GetFocusColor () const
 
void SetFocusColor (const JColorID color)
 
JString ToString () const override
 
virtual JPoint GlobalToLocal (const JCoordinate x, const JCoordinate y) const=0
 
JPoint GlobalToLocal (const JPoint &pt) const
 
JRect GlobalToLocal (const JRect &r) const
 
virtual JPoint LocalToGlobal (const JCoordinate x, const JCoordinate y) const=0
 
JPoint LocalToGlobal (const JPoint &pt) const
 
JRect LocalToGlobal (const JRect &r) const
 
- Public Member Functions inherited from JXContainer
 ~JXContainer () override
 
bool IsAncestor (JXContainer *obj) const
 
virtual void Show ()
 
virtual void Hide ()
 
bool IsVisible () const
 
void SetVisible (const bool vis)
 
bool WouldBeVisible () const
 
virtual void Activate ()
 
bool IsActive () const
 
void SetActive (const bool active)
 
bool WouldBeActive () const
 
virtual void Suspend ()
 
virtual void Resume ()
 
bool IsSuspended () const
 
bool IsDNDSource () const
 
bool IsDNDTarget () const
 
JPoint GlobalToLocal (const JPoint &pt) const
 
JRect GlobalToLocal (const JRect &r) const
 
JPoint LocalToGlobal (const JPoint &pt) const
 
JRect LocalToGlobal (const JRect &r) const
 
JRect GetBounds () const
 
JCoordinate GetBoundsWidth () const
 
JCoordinate GetBoundsHeight () const
 
JRect GetFrame () const
 
JRect GetFrameLocal () const
 
JCoordinate GetFrameWidth () const
 
JCoordinate GetFrameHeight () const
 
JRect GetAperture () const
 
JCoordinate GetApertureWidth () const
 
JCoordinate GetApertureHeight () const
 
JXDisplayGetDisplay () const
 
JXWindowGetWindow () const
 
JXContainerGetEnclosure () const
 
JFontManagerGetFontManager () const
 
JXFontManagerGetXFontManager () const
 
JXSelectionManagerGetSelectionManager () const
 
JXDNDManagerGetDNDManager () const
 
JXMenuManagerGetMenuManager () const
 
JCursorIndex GetDefaultCursor () const
 
bool GetHint (JString *text) const
 
void SetHint (const JString &text)
 
void ClearHint ()
 
bool GetVisibleRectGlobal (const JRect &origRectG, JRect *visRectG) const
 
void ForEach (const std::function< void(JXContainer *)> &f, const bool recurse)
 
void ForEach (const std::function< void(const JXContainer *)> &f, const bool recurse) const
 
void ExpandToFitContent ()
 
virtual bool RunInternalFTC (const bool horizontal, JCoordinate *newSize)
 
JRect ComputePaddingForInternalFTC () const
 
bool FindContainer (const JPoint &ptG, JXContainer **container) const
 
virtual bool IsMenu () const
 
virtual bool IsMenuTable () const
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Static Public Attributes

static const JUtf8BytekGotFocus = "GotFocus::JXWidget"
 
static const JUtf8BytekLostFocus = "LostFocus::JXWidget"
 

Protected Member Functions

 JXWidget (JXContainer *enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h)
 
void WantInput (const bool wantInput, const bool wantTab=false, const bool wantModifiedTab=false)
 
virtual void HandleFocusEvent ()
 
virtual void HandleUnfocusEvent ()
 
virtual void HandleWindowFocusEvent ()
 
virtual void HandleWindowUnfocusEvent ()
 
void UnlockBounds ()
 
void SetBounds (const JCoordinate w, const JCoordinate h)
 
void AdjustBounds (const JCoordinate dw, const JCoordinate dh)
 
void DrawBackground (JXWindowPainter &p, const JRect &frame) override
 
bool AcceptDrag (const JPoint &pt, const JXMouseButton button, const JXKeyModifiers &modifiers) override
 
JXDragPainterCreateDragInsidePainter ()
 
JXDragPainterCreateDragOutsidePainter ()
 
bool GetDragPainter (JXDragPainter **p) const
 
bool GetDragPainter (JPainter **p) const
 
void DeleteDragPainter ()
 
void BoundsMoved (const JCoordinate dx, const JCoordinate dy) override
 
void EnclosingBoundsMoved (const JCoordinate dx, const JCoordinate dy) override
 
void BoundsResized (const JCoordinate dw, const JCoordinate dh) override
 
void EnclosingBoundsResized (const JCoordinate dw, const JCoordinate dh) override
 
virtual void ApertureMoved (const JCoordinate dx, const JCoordinate dy)
 
virtual void ApertureResized (const JCoordinate dw, const JCoordinate dh)
 
void FTCAdjustSize (const JCoordinate dw, const JCoordinate dh) override
 
bool BeginDND (const JPoint &pt, const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers, JXSelectionData *data, JXDNDManager::TargetFinder *targetFinder=nullptr)
 
virtual void DNDInit (const JPoint &pt, const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers)
 
virtual void GetSelectionData (JXSelectionData *data, const JString &id)
 
virtual void DNDFinish (const bool isDrop, const JXContainer *target)
 
virtual void DNDCompletelyFinished ()
 
virtual Atom GetDNDAction (const JXContainer *target, const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers)
 
virtual void GetDNDAskActions (const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers, JArray< Atom > *askActionList, JPtrArray< JString > *askDescriptionList)
 
virtual void HandleDNDResponse (const JXContainer *target, const bool dropAccepted, const Atom action)
 
bool WillAllowUnboundedScrolling () const
 
void ShouldAllowUnboundedScrolling (const bool allow)
 
- Protected Member Functions inherited from JXContainer
 JXContainer (JXWindow *window, JXContainer *enclosure)
 
 JXContainer (JXDisplay *display, JXWindow *window, JXContainer *enclosure)
 
void TurnOnBufferedDrawing ()
 
void DrawAll (JXWindowPainter &p, const JRect &frameG)
 
virtual void Draw (JXWindowPainter &p, const JRect &rect)=0
 
virtual void DrawBorder (JXWindowPainter &p, const JRect &frame)=0
 
virtual void HandleMouseEnter ()
 
virtual void HandleMouseHere (const JPoint &pt, const JXKeyModifiers &modifiers)
 
virtual void HandleMouseLeave ()
 
virtual void HandleMouseDown (const JPoint &pt, const JXMouseButton button, const JSize clickCount, const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers)
 
virtual void HandleMouseDrag (const JPoint &pt, const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers)
 
virtual void HandleMouseUp (const JPoint &pt, const JXMouseButton button, const JXButtonStates &buttonStates, const JXKeyModifiers &modifiers)
 
virtual bool HitSamePart (const JPoint &pt1, const JPoint &pt2) const
 
virtual bool WillAcceptDrop (const JArray< Atom > &typeList, Atom *action, const JPoint &pt, const Time time, const JXWidget *source)
 
virtual void HandleDNDEnter ()
 
virtual void HandleDNDHere (const JPoint &pt, const JXWidget *source)
 
virtual void HandleDNDLeave ()
 
virtual void HandleDNDDrop (const JPoint &pt, const JArray< Atom > &typeList, const Atom action, const Time time, const JXWidget *source)
 
virtual void HandleDNDScroll (const JPoint &pt, const JXMouseButton scrollButton, const JXKeyModifiers &modifiers)
 
bool DispatchClientMessage (const XClientMessageEvent &clientMessage)
 
virtual bool HandleClientMessage (const XClientMessageEvent &clientMessage)
 
void NotifyBoundsMoved (const JCoordinate dx, const JCoordinate dy)
 
void NotifyBoundsResized (const JCoordinate dw, const JCoordinate dh)
 
virtual bool IncludeInFTC () const
 
virtual bool NeedsInternalFTC () const
 
virtual JCoordinate GetFTCMinContentSize (const bool horizontal) const
 
virtual JRect GetFrameForFTC () const
 
bool GetEnclosedObjects (JPtrArrayIterator< JXContainer > **iter) const
 
void DeleteEnclosedObjects ()
 
void ShowCursor ()
 
void HideCursor ()
 
void SetDefaultCursor (const JCursorIndex index)
 
void DispatchCursor (const JPoint &ptG, const JXKeyModifiers &modifiers)
 
virtual void AdjustCursor (const JPoint &pt, const JXKeyModifiers &modifiers)
 
void DisplayCursor (const JCursorIndex index)
 
JXCursorAnimatorCreateCursorAnimator ()
 
JXCursorAnimatorGetCursorAnimator () const
 
void AnimateCursor () const
 
void RemoveCursorAnimator ()
 
void ActivateCursor (const JPoint &ptG, const JXKeyModifiers &modifiers)
 
void DeactivateCursor ()
 
std::ostream & GetFTCLog () const
 
virtual bool StealMouse (const int eventType, const JPoint &ptG, const JXMouseButton button, const unsigned int state)
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
virtual void Receive (JBroadcaster *sender, const Message &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 
virtual void ReceiveGoingAway (JBroadcaster *sender)
 

Friends

class JXWindow
 
class JXDNDManager
 
class JXSelectionData
 

Additional Inherited Members

- Static Public Member Functions inherited from JXContainer
static void DebugExpandToFitContent (const bool horiz)
 
static void DebugExpandToFitContentExtras (const bool noop, const bool overlap)
 

Detailed Description

Frame is the bounding rect that the user sees in the window.  Aperture
is the bounding rect of the area that can be drawn to in the window and
is smaller than the frame.  Bounds is the actual size of the Widget,
which can be larger or smaller than Aperture.  If it is smaller, it is
stuck in the upper left corner of Aperture.  If it is larger, it can
scroll, but Aperture must always be entirely inside Bounds.  The default
is Bounds locked equal to Aperture.  Use UnlockBounds() to change this.

Global coordinates are defined by the upper left corner of the window.
Local coordinates are defined by the upper left corner of Bounds.
Enclosure coordinates are the local coordinates of the enclosing Widget.

All rectangles are stored in global coordinates.  Frame can be gotten in
enclosure or global coordinates.  Bounds and Aperture can be gotten in
local or global coordinates.

Moving the Frame (Place,Move) is done in enclosure coordinates.
Changing the Frame size (SetSize,AdjustSize) and incremental scrolling
(Scroll) are obviously independent of the coordinate system. Absolute
scrolling (ScrollTo, ScrollToRect) uses local coordinates.

This class also implements the keypress dispatcher and default event
handling (do nothing) so derived classes only have to implement handlers
for the events that they support.

If the contents of the object must be validated before focus can shift
to something else, override OKToUnfocus().  If this returns false,
you will retain the focus.

HandleKeyPress is public because key press events have to propagate from
leaf to root of the enclosure tree, unlike mouse events that propagate
from root to leaf.  HandleShortcut is public because JXWindow needs to
call it, and there is no harm in letting others call it.

Member Enumeration Documentation

◆ HSizingOption

Enumerator
kFixedLeft 
kFixedRight 
kHElastic 

◆ VSizingOption

Enumerator
kFixedTop 
kFixedBottom 
kVElastic 

Constructor & Destructor Documentation

◆ ~JXWidget()

JXWidget::~JXWidget ( )
override

◆ JXWidget()

JXWidget::JXWidget ( JXContainer enclosure,
const HSizingOption  hSizing,
const VSizingOption  vSizing,
const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  w,
const JCoordinate  h 
)
protected

Member Function Documentation

◆ AcceptDrag()

bool JXWidget::AcceptDrag ( const JPoint pt,
const JXMouseButton  button,
const JXKeyModifiers modifiers 
)
overrideprotectedvirtual

Reimplemented from JXContainer.

◆ AdjustBounds()

void JXWidget::AdjustBounds ( const JCoordinate  dw,
const JCoordinate  dh 
)
protected

◆ AdjustSize()

void JXWidget::AdjustSize ( const JCoordinate  dw,
const JCoordinate  dh 
)
overridevirtual

Implements JXContainer.

◆ ApertureMoved()

void JXWidget::ApertureMoved ( const JCoordinate  dx,
const JCoordinate  dy 
)
protectedvirtual

Reimplemented in JXScrollableWidget.

◆ ApertureResized()

void JXWidget::ApertureResized ( const JCoordinate  dw,
const JCoordinate  dh 
)
protectedvirtual

◆ BeginDND()

bool JXWidget::BeginDND ( const JPoint pt,
const JXButtonStates buttonStates,
const JXKeyModifiers modifiers,
JXSelectionData data,
JXDNDManager::TargetFinder targetFinder = nullptr 
)
protected

Call this to begin the DND process. If this returns true, you will not get any more HandleMouseDrag() messages, nor will you get a HandleMouseUp() message.

data should be constructed using the delayed evaluation constructor unless the copying is always very fast because one should never make the user wait when the drag begins.

The caller should not delete data even if this function returns false.

The caller retains ownership of targetFinder.

◆ BoundsMoved()

void JXWidget::BoundsMoved ( const JCoordinate  dx,
const JCoordinate  dy 
)
overrideprotectedvirtual

Update our DragPainter.

Implements JXContainer.

◆ BoundsResized()

void JXWidget::BoundsResized ( const JCoordinate  dw,
const JCoordinate  dh 
)
overrideprotectedvirtual

Implements JXContainer.

◆ CenterWithinEnclosure()

void JXWidget::CenterWithinEnclosure ( const bool  adjustHoriz,
const bool  adjustVert 
)

◆ CreateDragInsidePainter()

JXDragPainter * JXWidget::CreateDragInsidePainter ( )
inlineprotected

Create a DragPainter that works inside our aperture.

◆ CreateDragOutsidePainter()

JXDragPainter * JXWidget::CreateDragOutsidePainter ( )
inlineprotected

Create a DragPainter that works inside our enclosure's aperture.

◆ Deactivate()

void JXWidget::Deactivate ( )
overridevirtual

Reimplemented from JXContainer.

◆ DeleteDragPainter()

void JXWidget::DeleteDragPainter ( )
protected

◆ DNDCompletelyFinished()

void JXWidget::DNDCompletelyFinished ( )
protectedvirtual

This may be called when DND is terminated. It is guaranteed to be called after the data has been transferred.

If the drop is within the application, this is guaranteed to be called. Otherwise, don't count on it. And don't blame me – it's a result of safety concerns in the underlying protocol. The reason that this message is not completely useless is that it is only likely to be useful for cleaning up after highly optimized, intra-app drops.

It is not called simply DNDFinished() because that is too close to the more frequently used DNDFinish().

◆ DNDFinish()

void JXWidget::DNDFinish ( const bool  isDrop,
const JXContainer target 
)
protectedvirtual

This is called when DND is terminated, but before the actual data transfer.

If it is not a drop, or the drop target is not within the same application, target is nullptr.

Reimplemented in JXTEBase.

◆ DNDInit()

void JXWidget::DNDInit ( const JPoint pt,
const JXButtonStates buttonStates,
const JXKeyModifiers modifiers 
)
protectedvirtual

This is called when DND is initiated.

Reimplemented in JXDirectSaveSource.

◆ DrawBackground()

void JXWidget::DrawBackground ( JXWindowPainter p,
const JRect frame 
)
overrideprotectedvirtual

Implements JXContainer.

◆ EnclosingBoundsMoved()

void JXWidget::EnclosingBoundsMoved ( const JCoordinate  dx,
const JCoordinate  dy 
)
overrideprotectedvirtual

Move ourselves so we end up in the same place relative to our enclosure.

Implements JXContainer.

◆ EnclosingBoundsResized()

void JXWidget::EnclosingBoundsResized ( const JCoordinate  dw,
const JCoordinate  dh 
)
overrideprotectedvirtual

Implements JXContainer.

◆ FitToEnclosure()

void JXWidget::FitToEnclosure ( const bool  fitHoriz = true,
const bool  fitVert = true 
)

◆ Focus()

bool JXWidget::Focus ( )

Returns true if successful.

◆ FTCAdjustSize()

void JXWidget::FTCAdjustSize ( const JCoordinate  dw,
const JCoordinate  dh 
)
overrideprotectedvirtual

Reimplemented from JXContainer.

◆ GetApertureGlobal()

JRect JXWidget::GetApertureGlobal ( ) const
overridevirtual

Returns the aperture in global coordinates.

Implements JXContainer.

◆ GetBackColor()

JColorID JXWidget::GetBackColor ( ) const
inline

◆ GetBorderWidth()

JSize JXWidget::GetBorderWidth ( ) const
inline

◆ GetBoundsGlobal()

JRect JXWidget::GetBoundsGlobal ( ) const
overridevirtual

Returns the bounds in global coordinates.

Implements JXContainer.

◆ GetCurrBackColor()

JColorID JXWidget::GetCurrBackColor ( ) const
inline

◆ GetDNDAction()

Atom JXWidget::GetDNDAction ( const JXContainer target,
const JXButtonStates buttonStates,
const JXKeyModifiers modifiers 
)
protectedvirtual

This is called repeatedly on the drag source so the drop action can be changed based on the current target, buttons, and modifier keys.

If the drop target is not within the same application, target is nullptr.

The default is to return the default action: copy.

Reimplemented in JXDirectSaveSource, JXDocktab, JXFileListTable, and JXTEBase.

◆ GetDNDAskActions()

void JXWidget::GetDNDAskActions ( const JXButtonStates buttonStates,
const JXKeyModifiers modifiers,
JArray< Atom > *  askActionList,
JPtrArray< JString > *  askDescriptionList 
)
protectedvirtual

This is called when the value returned by GetDNDAction() changes to XdndActionAsk. If GetDNDAction() repeatedly returns XdndActionAsk, this function is not called again because it is assumed that the actions are the same within a single DND session.

This function must place at least 2 elements in askActionList and askDescriptionList.

The first element should be the default action.

The default is to do nothing, so classes that never return XdndActionAsk don't have to implement it and classes that forget to implement it will force an assert() in JXDNDManager by not returning at least 2 elements.

Reimplemented in JXTEBase.

◆ GetDragPainter() [1/2]

bool JXWidget::GetDragPainter ( JPainter **  p) const
protected

Not inline to avoid including JXDragPainter.h in header file.

◆ GetDragPainter() [2/2]

bool JXWidget::GetDragPainter ( JXDragPainter **  p) const
inlineprotected

◆ GetFocusColor()

JColorID JXWidget::GetFocusColor ( ) const
inline

◆ GetFrameGlobal()

JRect JXWidget::GetFrameGlobal ( ) const
overridevirtual

Returns the frame in global coordinates.

Implements JXContainer.

◆ GetHSizing()

JXWidget::HSizingOption JXWidget::GetHSizing ( ) const
inline

◆ GetSelectionData()

void JXWidget::GetSelectionData ( JXSelectionData data,
const JString id 
)
protectedvirtual

This is called when DND is terminated by a drop or when the target requests the data during a drag, but only if the delayed evaluation constructor for JXSelectionData was used.

id is the string passed to the JXSelectionData constructor.

Reimplemented in JXFileListTable, and JXTEBase.

◆ GetVSizing()

JXWidget::VSizingOption JXWidget::GetVSizing ( ) const
inline

◆ GlobalToLocal() [1/4]

JPoint JXWidget::GlobalToLocal ( const JCoordinate  x,
const JCoordinate  y 
) const
overridevirtual

Implements JXContainer.

◆ GlobalToLocal() [2/4]

virtual JPoint JXContainer::GlobalToLocal ( const JCoordinate  x,
const JCoordinate  y 
) const
virtual

Implements JXContainer.

◆ GlobalToLocal() [3/4]

JPoint JXContainer::GlobalToLocal ( const JPoint pt) const
inline

◆ GlobalToLocal() [4/4]

JRect JXContainer::GlobalToLocal ( const JRect r) const

◆ HandleDNDResponse()

void JXWidget::HandleDNDResponse ( const JXContainer target,
const bool  dropAccepted,
const Atom  action 
)
protectedvirtual

This is called on the source when the target indicates whether or not it will accept the drop. If !dropAccepted, the action is undefined. If the drop target is not within the same application, target is nullptr.

The default implementation is to display the appropriate default cursor provided by JXDNDManager.

Note that part of the cursor should always be the standard arrow. This way, the user will feel like they really are dragging something.

Reimplemented in JXDirectSaveSource, and JXFileListTable.

◆ HandleFocusEvent()

void JXWidget::HandleFocusEvent ( )
protectedvirtual

◆ HandleKeyPress()

void JXWidget::HandleKeyPress ( const JUtf8Character c,
const int  keySym,
const JXKeyModifiers modifiers 
)
virtual

◆ HandleShortcut()

void JXWidget::HandleShortcut ( const int  key,
const JXKeyModifiers modifiers 
)
virtual

◆ HandleUnfocusEvent()

void JXWidget::HandleUnfocusEvent ( )
protectedvirtual

Reimplemented in JXFSInputBase, JXInputField, and JXTEBase.

◆ HandleWindowFocusEvent()

void JXWidget::HandleWindowFocusEvent ( )
protectedvirtual

Reimplemented in JXTEBase.

◆ HandleWindowUnfocusEvent()

void JXWidget::HandleWindowUnfocusEvent ( )
protectedvirtual

Reimplemented in JXTEBase.

◆ HasFocus()

bool JXWidget::HasFocus ( ) const

◆ LocalToGlobal() [1/4]

JPoint JXWidget::LocalToGlobal ( const JCoordinate  x,
const JCoordinate  y 
) const
overridevirtual

Implements JXContainer.

◆ LocalToGlobal() [2/4]

virtual JPoint JXContainer::LocalToGlobal ( const JCoordinate  x,
const JCoordinate  y 
) const
virtual

Implements JXContainer.

◆ LocalToGlobal() [3/4]

JPoint JXContainer::LocalToGlobal ( const JPoint pt) const
inline

◆ LocalToGlobal() [4/4]

JRect JXContainer::LocalToGlobal ( const JRect r) const

◆ Move()

void JXWidget::Move ( const JCoordinate  dx,
const JCoordinate  dy 
)
overridevirtual

Implements JXContainer.

◆ OKToUnfocus()

bool JXWidget::OKToUnfocus ( )
virtual

Returns whether or not the object is willing to give up focus.

Reimplemented in JXFLInputBase, and JXInputField.

◆ Place()

void JXWidget::Place ( const JCoordinate  enclX,
const JCoordinate  enclY 
)
overridevirtual

Implements JXContainer.

◆ Redraw()

void JXWidget::Redraw ( ) const
overridevirtual

Implements JXContainer.

◆ RedrawRect()

void JXWidget::RedrawRect ( const JRect rect) const

◆ Refresh()

void JXWidget::Refresh ( ) const
overridevirtual

Implements JXContainer.

◆ RefreshRect()

void JXWidget::RefreshRect ( const JRect rect) const

◆ Scroll()

bool JXWidget::Scroll ( const JCoordinate  userdx,
const JCoordinate  userdy 
)

Positive values scroll up and to the left. Negative values scroll down and to the right.

Unlike on the Mac, we can't optimize scrolling via XCopyArea() because PointToFocus means that part of the window could be obscured.

Returns true if Bounds had to be scrolled.

◆ ScrollTo() [1/2]

bool JXWidget::ScrollTo ( const JCoordinate  x,
const JCoordinate  y 
)

Scroll to place the given point (in local coords) at the top left corner of the aperture.

Returns true if Bounds had to be scrolled.

◆ ScrollTo() [2/2]

bool JXWidget::ScrollTo ( const JPoint pt)
inline

◆ ScrollToRect()

bool JXWidget::ScrollToRect ( const JRect r)

Scroll the minimum distance to make the given rectangle visible in Aperture. If rectangle is larger than Aperture, top left corner has priority.

Returns true if Bounds had to be scrolled.

To scroll a rectangle that is below the aperture to the top of the aperture, extend the rectangle's bottom to the Bounds' bottom and scroll to that. Similarly for the other 3 cases.

◆ ScrollToRectCentered()

bool JXWidget::ScrollToRectCentered ( const JRect origRect,
const bool  forceScroll 
)

Scroll to center the given rectangle in Aperture. If rectangle is larger than Aperture, top left corner of rectangle has priority.

If the given rectangle is smaller than the aperture, we simply expand it symmetrically to fill the aperture. Otherwise, we leave it alone. Then we can use ScrollToRect().

Returns true if Bounds had to be scrolled.

◆ SetBackColor()

void JXWidget::SetBackColor ( const JColorID  color)
inline

◆ SetBorderWidth()

void JXWidget::SetBorderWidth ( const JSize  width)

Reserves the specified area inside the frame for drawing a border. The aperture is inside this area.

◆ SetBounds()

void JXWidget::SetBounds ( const JCoordinate  w,
const JCoordinate  h 
)
protected

◆ SetFocusColor()

void JXWidget::SetFocusColor ( const JColorID  color)
inline

◆ SetSingleFocusWidget()

void JXWidget::SetSingleFocusWidget ( )
inline

Call this function if this widget will always be the only one in the window that accepts focus.

◆ SetSize()

void JXWidget::SetSize ( const JCoordinate  w,
const JCoordinate  h 
)
overridevirtual

Implements JXContainer.

◆ SetSizing()

void JXWidget::SetSizing ( const HSizingOption  hSizing,
const VSizingOption  vSizing 
)
inline

◆ ShouldAllowUnboundedScrolling()

void JXWidget::ShouldAllowUnboundedScrolling ( const bool  allow)
protected

◆ ToString()

JString JXWidget::ToString ( ) const
overridevirtual

Reimplemented from JBroadcaster.

◆ Unfocus()

bool JXWidget::Unfocus ( )

Returns true if we had focus and were able to lose it.

◆ UnlockBounds()

void JXWidget::UnlockBounds ( )
inlineprotected

Clear the flag so Bounds is no longer locked to Aperture.

◆ WantInput()

void JXWidget::WantInput ( const bool  wantInput,
const bool  wantTab = false,
const bool  wantModifiedTab = false 
)
protected

wantInput: everything else wantTab: tab and Shift-tab wantModifiedTab: Meta-tab, Ctrl-tab, etc.

If there is more than one input area in a window, do not grab both tab and modified tab, because otherwise the user won't be able to switch focus from one input area to another.

◆ WantsModifiedTab()

bool JXWidget::WantsModifiedTab ( ) const
inline

◆ WantsTab()

bool JXWidget::WantsTab ( ) const
inline

◆ WillAcceptFocus()

bool JXWidget::WillAcceptFocus ( ) const
inline

Returns true if the widget will accept a Focus() message in its current state.

◆ WillAcceptShortcut()

bool JXWidget::WillAcceptShortcut ( ) const
inline

Returns true if the widget will accept a HandleShortcut() message in its current state.

◆ WillAllowUnboundedScrolling()

bool JXWidget::WillAllowUnboundedScrolling ( ) const
inlineprotected

Unbounded scrolling does not constrain the scroll offset.

Friends And Related Symbol Documentation

◆ JXDNDManager

friend class JXDNDManager
friend

◆ JXSelectionData

friend class JXSelectionData
friend

◆ JXWindow

friend class JXWindow
friend

Member Data Documentation

◆ kGotFocus

const JUtf8Byte * JXWidget::kGotFocus = "GotFocus::JXWidget"
static

◆ kLostFocus

const JUtf8Byte * JXWidget::kLostFocus = "LostFocus::JXWidget"
static

The documentation for this class was generated from the following files: