void Led_MacOS_Helper < BASE_INTERACTOR > ::AlignTextEditRects ()
Lays out the scrollbars, and specifies the window-rect (TextImager::GetWindowRect ) based on the
window frame rect (Led_MacOS_Helper::GetWindowFrameRect), and its own internal algorithm.
A default algorithm is supplied by @Led_MacOS_Helper::AlignTextEditRects_' with enough parameters
that you can probably get what you want by just subclassing this routine and
calling Led_MacOS_Helper::AlignTextEditRects_
with different arguements.
This routine should generally not be overridden. Instead, call
Led_MacOS_Helper::SetAlwaysLeaveSpaceForSizeBox or
Led_MacOS_Helper::SetScrollBarsOverlapOwningFrame to control the behavior of the scrollbar layout.
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::AlignTextEditRects_ (bool alwaysLeaveSpaceForSizeBox, bool scrollBarsOverlapOwningFrame, bool vSBarShown, bool hSBarShown)
Helper to implement the Led_MacOS_Helper::AlignTextEditRects_ algorithm.
This method takes a 'alwaysLeaveSpaceForSizeBox' parameter which you can use to force the editor to leave room for
a size box when laying out the scrollbar. This is useful if you are putting the editor into a window that has a grow-box,
and where the window takes up the entire content area.
The 'scrollBarsOverlapOwningFrame' is for a similar situation. The Mac window layout has a quirk - where scrollbars
are supposed to be layed out so that one pixel of their edge overlaps with the edge of the window - sharing a single line.
Actaully - the Mac's UI has changed since then - but they still define things and lay them out based on this hisorical quirk.
So if your editor is going to take over a window entirely - you probably wnat to specify true for this, and false otherwise..
|
bool Led_MacOS_Helper < BASE_INTERACTOR > ::GetAlwaysLeaveSpaceForSizeBox () const
The 'alwaysLeaveSpaceForSizeBox' property allows you to force the editor to leave room for
a size box when laying out the scrollbar. This is useful if you are putting the editor into a window that has a grow-box,
and where the window takes up the entire content area.
The property is used from Led_MacOS_Helper::AlignTextEditRects .
This value defaults to true (which works best for when a Led view is embedded in a window).
|
bool Led_MacOS_Helper < BASE_INTERACTOR > ::GetScrollBarsOverlapOwningFrame () const
The 'scrollBarsOverlapOwningFrame' is similar to Led_MacOS_Helper::GetAlwaysLeaveSpaceForSizeBox .
The Mac window layout has a quirk - where scrollbars
are supposed to be layed out so that one pixel of their edge overlaps with the edge of the window - sharing a single line.
Actaully - the Mac's UI has changed since then - but they still define things and lay them out based on this hisorical quirk.
So if your editor is going to take over a window entirely - you probably wnat to specify true for this, and false otherwise.
The property is used from Led_MacOS_Helper::AlignTextEditRects .
This value defaults to true (which works best for when a Led view is embedded in a window).
|
GrafPtr Led_MacOS_Helper < BASE_INTERACTOR > ::GetUseGrafPort () const
Get the grafport associated with this editor instance. This must be specified (Led_MacOS_Helper::SetUseGrafPort )
early on, before any drawing, or sizing etc, can be performed.
|
Led_Rect Led_MacOS_Helper < BASE_INTERACTOR > ::GetWindowFrameRect () const
The window frame rect is the bounds on the current grafport (Led_MacOS_Helper::GetUseGrafPort )
in which we place the scrollbars, and windowrect (TextImager::GetWindowRect ). These are layed out within the frame rect
each time the frame rect changes by the Led_MacOS_Helper::AlignTextEditRects method.
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::HandleActivateEvent ()
Call this method when this edit view becomes the input focus (so it will start blinking the caret, etc)
See also Led_MacOS_Helper::HandleDeactivateEvent .
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::HandleCursorKeyPress (char theChar, bool optionPressed, bool shiftPressed, bool commandPressed)
Helper for handling key events.
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::HandleDeactivateEvent ()
Call this method when this edit view loese the input focus (so it will stop blinking the caret, etc).
See also Led_MacOS_Helper::HandleActivateEvent .
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::HandleIdleEvent ()
Call this method when your applicaiton recieves idle events. This only needs to be called if you are the input
focus, but can be safely called otherwise.
|
bool Led_MacOS_Helper < BASE_INTERACTOR > ::HandleKeyEvent (const EventRecord& inKeyEvent)
Call this method when in response to Macintosh Key Event.
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::Handle_Draw (Led_Region updateRgn)
Call this method when in response to Macintosh update event. Be sure to pass in the updateRegion (in local / port coordinates).
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::SetAlwaysLeaveSpaceForSizeBox (bool alwaysLeaveSpaceForSizeBox)
See also Led_MacOS_Helper::GetAlwaysLeaveSpaceForSizeBox
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::SetScrollBarsOverlapOwningFrame (bool scrollBarsOverlapOwningFrame)
See also Led_MacOS_Helper::GetScrollBarsOverlapOwningFrame
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::SetUseGrafPort (GrafPtr grafPort)
See Led_MacOS_Helper::GetUseGrafPort .
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::SetWindowFrameRect (const Led_Rect& windowFrameRect)
See Led_MacOS_Helper::GetWindowFrameRect .
|
void Led_MacOS_Helper < BASE_INTERACTOR > ::SetWindowMargin (const Rect& windowMargin)
Sets the margins around the window frame rect (see Led_MacOS_Helper::GetWindowFrameRect )
inside which the actual window-rect (TextImager::GetWindowRect ) will go.
NB: This rect is not interpretted as a normal rectable. Its top/left/bottom/right are just interpreted as offets
in from the edge of the window frame rect to place the window rect in Led_MacOS_Helper::AlignTextEditRects .
|
virtual void SetupCurrentGrafPort () const = 0;
This pure-virtual method must be overriden in subclasses.
|