Led 3.0 Class Library Documentation

Module Led_MacOS


Classes and Global Functions Index

Module Description:

NEW in Led 3.0. Based on templates in Led_PP, and Led_Win32 - from Led 2.3.


Class: Led_MacOS_Helper < BASE_INTERACTOR > [public]

Base Classes: BASE_INTERACTOR = TextInteractor
Description:

This helper template can be used to integrate a Led TextInteractor class (such as WordProcessor) with the Mac OS. If you are using PowerPlant, you may want to use Led_PPView directly.

Subclassers must override the pure virtual method:

And they will have to hook themselves into the Macintosh event-handling mechanism, and arrange to call

and many more. Document later, as time permits.

Member Details

Led_MacOS_Helper < BASE_INTERACTOR > ::AlignTextEditRects [public]

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.

Led_MacOS_Helper < BASE_INTERACTOR > ::AlignTextEditRects_ [public]

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..

Led_MacOS_Helper < BASE_INTERACTOR > ::GetAlwaysLeaveSpaceForSizeBox [public]

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).

Led_MacOS_Helper < BASE_INTERACTOR > ::GetScrollBarsOverlapOwningFrame [public]

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).

Led_MacOS_Helper < BASE_INTERACTOR > ::GetUseGrafPort [public]

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_MacOS_Helper < BASE_INTERACTOR > ::GetWindowFrameRect [public]

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.

Led_MacOS_Helper < BASE_INTERACTOR > ::HandleActivateEvent [public]

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.

Led_MacOS_Helper < BASE_INTERACTOR > ::HandleCursorKeyPress [public]

void Led_MacOS_Helper < BASE_INTERACTOR > ::HandleCursorKeyPress (char theChar, bool optionPressed, bool shiftPressed, bool commandPressed)

Helper for handling key events.

Led_MacOS_Helper < BASE_INTERACTOR > ::HandleDeactivateEvent [public]

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.

Led_MacOS_Helper < BASE_INTERACTOR > ::HandleIdleEvent [public]

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.

Led_MacOS_Helper < BASE_INTERACTOR > ::HandleKeyEvent [public]

bool Led_MacOS_Helper < BASE_INTERACTOR > ::HandleKeyEvent (const EventRecord& inKeyEvent)

Call this method when in response to Macintosh Key Event.

Led_MacOS_Helper < BASE_INTERACTOR > ::Handle_Draw [public]

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).

Led_MacOS_Helper < BASE_INTERACTOR > ::SetAlwaysLeaveSpaceForSizeBox [public]

void Led_MacOS_Helper < BASE_INTERACTOR > ::SetAlwaysLeaveSpaceForSizeBox (bool alwaysLeaveSpaceForSizeBox)

See also Led_MacOS_Helper::GetAlwaysLeaveSpaceForSizeBox

Led_MacOS_Helper < BASE_INTERACTOR > ::SetScrollBarsOverlapOwningFrame [public]

void Led_MacOS_Helper < BASE_INTERACTOR > ::SetScrollBarsOverlapOwningFrame (bool scrollBarsOverlapOwningFrame)

See also Led_MacOS_Helper::GetScrollBarsOverlapOwningFrame

Led_MacOS_Helper < BASE_INTERACTOR > ::SetUseGrafPort [public]

void Led_MacOS_Helper < BASE_INTERACTOR > ::SetUseGrafPort (GrafPtr grafPort)

See Led_MacOS_Helper::GetUseGrafPort.

Led_MacOS_Helper < BASE_INTERACTOR > ::SetWindowFrameRect [public]

void Led_MacOS_Helper < BASE_INTERACTOR > ::SetWindowFrameRect (const Led_Rect& windowFrameRect)

See Led_MacOS_Helper::GetWindowFrameRect.

Led_MacOS_Helper < BASE_INTERACTOR > ::SetWindowMargin [public]

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.

Led_MacOS_Helper < BASE_INTERACTOR > ::SetupCurrentGrafPort [public]

virtual void SetupCurrentGrafPort () const = 0;

This pure-virtual method must be overriden in subclasses.


Return to Led Page Return to Led ClassLib Documentation Index Return to Led Reference Manual Index
Last Updated 2001-10-20