WordGuise, the Word Graphical User Interface Smart Editor

WordGuise Class

The editable text field of the WordGuise class may contain text of multiple fonts, font sizes, styles, text encodings as well as pictures and can have the focus, similar to the EditField, Canvas or Listbox. The super class of this class is the WordGuiseContainer a control. A WordGuise instance can be instantiated on the fly by a variety of ways, without the need to put a template on the window first in design mode.

Technique 1:

dim wg as WordGuise
wg = new WordGuise
wg.left = 0
wg.top = 0
wg.width = 100
wg.height = 100
wg.embedWithin Window1

Technique 2:

dim wg as WordGuise
wg = new WordGuise
wg.embedWithin Window1, 0, 0, 100, 100

Technique 3:

dim wg as WordGuise
wg = new WordGuise(Window1, 0, 0, 100, 100

Technique 4:

In the RB-IDE drag a WordGuiseContainer on the window, set the super to WordGuise. RB will automatically embed it in the window, no need to call EmbedWithin.

Remark:

EmbedWithin can be used multiple times. Under the hood the plugin will take care of closing and reopening of the WordGuise widget.

WordGuiseContainer
   WordGuise

class WordGuise implements

WordGuiseInterface

Properties

AcceptFocusIf true, the WordGuise can have the focus. It can accept the GotGocus and LostFocus events and can display a focus ring if UseFocusRing is set to true.
AcceptTabsIf true and AcceptFocus is true, then pressing tab triggers the keydown event for processing.
ActiveIf true WordGuise displays the blinking caret and active sliders.
AlignmentSets or gets paragraph alignment for entire contents of the field. You can use four character strings or the Alignment constants defined in WordGuise Module.
AllCapsApplies the capital characters to the contents of the field.
AllLowercaseApplies lowercase to all characters being typed in the field.
AutoDeactivateSets or gets the AutoDeactivate feature to WordGuise field.
AutoScrollGets or sets the ability of wordguise to auto scroll text.
BackColorSets or Gets the back color of the characters to be typed.
BackdropSets or gets the backdrop picture of the field.
BackgroundColorSets or gets the background color of the widger
BoldApplies the bold style to the text to be typed.
BorderSets or unsets a drawn border around the widget. The default setting is false. If set to true, the BorderStyle property becomes effective.
BorderStyleThere are 3 choices when "Border" has been set: "Sunken" = 0 "Beveled" = 1 "Custom" = 2 Sunken means that we try to draw an OS specific border around the widget, Beveled means a Beveled style, and Custom means that we provide drawing space for those that don't like Sunken or Beveled. The space is 2 pixels wide and drawing should be done by using the graphics instance in the paint event.
BottomBorderStyleApplies the bottom border style of the paragraph. Utilize a four character string or the border-style constants defined in WordGuise module.
CondensedApplies the condensed style to the text to be typed.
DefaultTabWidthSets or gets the default tab width for the entire paragraph.
DirectionSets or gets the direction of typing (left to right, or vice versa). Use a four character string or the Direction constants supplied in WordGuise Module to manipulate direction.
DontAutoEmbedGets or sets the value. This property is used to prevent RB from instantiating an instance of wordguise, if wordguise was put on the window in the IDE.
DragAndDropUsed to let WordGuise do dragging. If set, make sure the dragflavor is set.
DragFlavorA four character code, for example: "RTF ", "utxt".
EmbeddingWindow
EmbossedSets or gets the embossed style at the current caret position.
EnabledSets or gets the enabled state of the WordGuise widget.
EngravedSets or gets the engraved style at the current caret position.
ExtendedSets or gets the extended style of text to be typed.
FirstLineIndentSets or gets the indentation of the first line of a paragraph.
FontIDThe ATSUI font identifier set or get
FreezeUpdate
GraphicsRetrieves the graphics class of the WordGuise widget
HasBackgroundColorSets or gets the background state of the widget
HasGrowBoxCutOutUsed to indent the scrollbar to accommodate a windows grow box.
HasHScrollSets or gets the horizontal scrollbar visible state.
HasRulersets or gets the build-in ruler tied to WordGuise
HasToolbar
HasVScrollSets or gets the vertical scrollbar visible state.
HeightSets or gets the height of the WordGuise widget.
HelpTagSets or gets the Help-tag text.
HiddenSets or gets the hidden state of characters to be typed.
HideSelection
HScrollIndentSets or gets the horizontal scrollbar left-indent. Useful if you want to use space left of the horizontal scrollbar.
IsStatic
IsUTF8
ItalicSets or gets the italic style of text to be typed.
KerningIt sets or gets the kerning factor on a character-level basis, where a factor of 0.0 means no kerning at all, 1.0 uses the kerning specified by the font designer, and any intermediate value between 0.0 and 1.0 uses a loosened kerning somewhere between no kerning and the default kerning. Of course, the kerning factor has no effect on fonts that don't have kerning tables.
Left
LeftIndentSets or gets the left text indentation of the paragraph.
LeftMarginSets or gets the left-Margin of the text-rendering area. This is useful to draw left of the text-rendering area. For example, you could use the graphics.drawstring method to draw line numbers, independent of the text-rendering engine.
LengthGets the length of the text.
LiveHScroll
LiveVScroll
LockBottomSets or gets the Lock-Bottom state of the WordGuise widget.
LockLeftSet or gets the Lock-Left state of the WordGuise widget.
LockRightSets or gets the Lock-Right state of the WordGuise widget.
LockTopSets or gets the Lock-Top state of WordGuise widget.
MarginBottom
MarginLeft
MarginRight
MarginTop
MouseX
MouseY
NoTabzoneWithsets or gets the ruler distance from left and right text edges where tabs are disallowed.
NoTrackingSets or gets the default tracking. It sets it only if condensed/tighten or expanded/loosen was set on the font.
OutlineSets or gets the outline style of text to be typed.
PageHeightSets or gets the page height.
PageWidthSets or gets the page width.
PaneIndexGets or sets the pane (panel) index when the widget needs to live in a panel.
PlainSets or gets the plain style of text to be typed.
ReadOnly
RightIndentSets or gets the right indentation of the paragraph.
RulerDiscretesets or gets the indicator behavior of the ruler widgets to move in determined, discrete amounts.
RulerTypesets or gets the ruler unit measurement as inches, centimeters, points or picas.
SelAllCapsSets or gets the All-Caps style of selected text.
SelAllLowercaseSets or gets the All-LowerCase style of selected text.
SelBackColorSets or gets the back color style of selected text.
SelBoldSets or gets the bold style of selected text.
SelCondensedSets or gets the condensed style of selected text.
SelEmbossedSets or gets the embossed style of selected text.
SelEngravedSets or gets the engraved style of selected text.
SelExtendedSets or gets the extended style of selected text.
SelFontIDThe ATSUI font identifier set or get
SelHiddenSets or gets the hidden style of selected text.
SelItalicSets or gets the italic style of selected text.
SelKerningIt sets or gets the kerning factor on a character-level basis, where a factor of 0.0 means no kerning at all, 1.0 uses the kerning specified by the font designer, and any intermediate value between 0.0 and 1.0 uses a loosened kerning somewhere between no kerning and the default kerning. Of course, the kerning factor has no effect on fonts that don't have kerning tables.
SelLengthSets or gets the length of selected text.
SelNoTrackingSets or gets the default tracking. It sets it only if condensed/tighten or expanded/loosen was set on the font.
SelOutlineSets or gets the outline style of selected text.
SelPlainSets or gets the plain style of selected text.
SelShadowSets or gets the shadow style of selected text.
SelSmallCapsSets or gets the small caps style on selected text.
SelStartSets or gets the start position of selected text.
SelStrikethroughSets or gets the strikethrough style of selected text.
SelSubScriptSets or gets the Subscript style of selected text.
SelSuperScriptSets or gets the Superscript style of selected text.
SelTextGets the selected text as string or inserts it.
SelTextColorSets or gets the text-color of selected text.
SelTextFontSets or gets the font of selected text.
SelTextSizeSets or gets font size of selected text.
SelUnderlineSets or gets the underline style of selected text.
SelUnderlineStyleSets or gets the underline styling of selected text.
SelUrlLink
ShadowSets or gets the shadow style of text to be typed.
SmallCapsSets or gets the small caps style at the current caret position.
SoftWrapSets or gets the soft wrapping feature.
SpaceAfterSets or gets the space after the paragraph.
SpaceBeforeSets or gets the space before the paragraph.
StrikethroughSets or gets the strikethrough style of text to be typed.
SubScriptSets or gets the subscript style at the current caret position.
SuperScriptSets or gets the superscript style at the current caret position.
TabIndex
TabStop
TextGets or sets the total text present in WordGuise widget.
TextColorSets or gets the text-color of text to be typed.
TextFontGets or sets the text font of text to be typed.
TextMarginGets or sets the text-margin of the WordGuise widget. The margin applies to the left, right, top and bottom of the text-rendering area.
TextSizeGets or sets the font size style of text to be typed.
Top
TransparentSets or Gets the (semi) transparent state.
TrueWindowReturns the "true" window the widget lives in.
UnderlineGets or sets the underline style of text to be typed.
UnderlineStyleSets or gets the underline style at the current caret position.
UrlLink
UseFocusRingGets or sets the UseFocusRing state of the WordGuise widget.
VerticalShiftGets or sets the vertical displacement of text lines.
VisibleSets or gets the visible state of WordGuise widget.
VScrollIndentSets or gets the vertical scroll indentation at the top of the bar. Useful to add something else on the top of the vertical scrollbar.
WidthSets or gets the width of WordGuise widget.

Methods

AcceptDataDrop
AcceptFileDrop
AcceptPictureDrop
AcceptTextDrop
AcceptWGDropsPrivate way for the widget to accept drops of a particular flavor
Activate
AddMenuHandlerMethod to be used with user-defined menuItem handlers. The syntax here is: AddMenuHandler EditCut, AddressOf myEditCutHandler
AddMenuHandlerMethod to be used together with the WordGuiseInterface to add WordGuise owned MenuItem handlers.
AlignmentMenuItems
BackColorMenuItems
BeginUndo
BorderStyleMenuItems
CanPastetells whether stuff on the scrap/clipboard can be pasted into WordGuise.
CanRedotells whether a previously undo command can be reversed.
CanUndo
ChangeCaseChanges upper or lower case of selected text.
CharGets the keyCode of the char at charPosition.
CharPosAtXYReturns the character position at the controls x,y coordinates.
CharPosAtXYReturns the character position at the controls x,y coordinates.
CharPosToXYConverts the char position to x,y coordinates.
CharPosToXYConverts the char position to x,y coordinates.
ClearClears the selected text.
ClearUndoClears the list of actions the Undo engine had stored.
CloseUsed when you want to close a WordGuise widget and still want to retain the instance and its settings.
Constructor
ConstructorThis is a default constructor that REALbasic will call when an instance of this class, WordGuise, is created in the RB-IDE. You do this by dragging the WordGuiseContainer from the "Plugin Controls" palette onto Window1 located in the design frame panel. Note that "WordGuiseContainer Control" is the base class to WordGuise, and therefore you will need to set the super of "WordGuiseContainer1" to "WordGuise". You do this by navigating in the "Property Pane" of REALbasic and make the adjustment. An alternative way is to right-clicked (control-clicked) on a window or a tabpanel.
Constructor
Copy
CopyToScrap
Cutcuts the selected text to the scrap/clipboard
DestinationHeightreturns the total height of the current text
DestinationWidthreturns the destination width (current page width)
DirectionMenuItems
EmbedWithin
EmbedWithin
EmbedWithinPanel
EndUndo
FeatureGets the WordGuiseFeature class instance, associated with WordGuise. Each WordGuise instance has a valid feature object to manage the behavior of text rendering at runtime.
Findwill find the indicated search string in the text.
FindNextObjectFinds the nearest object from the offset supplied.
FindPreviousObjectfinds the nearest object upstream of the offset supplied.
FocusAlternative way to set focus (or remove focus)
FontMenuItems
FromClipboard
GetObjectObtains the array-based object.
GetObjectCountGets the total number of objects living in the widget,
GetSelectionreturns the selection of text in the selStart and selEnd fields of the method
HideHides the widget
IndentationMenuItems
InsertObjectInserts a picture at the current cursor position and returns a newly created WordGuiseObject
IsTyping
LanguageMenuItems
LineNumAtCharPosReturns the line number at char position.
LinePosAtXYreturns an instance of wordGuiseLine when interrogating the line position at x,y coordinates.
LineRangeAtIndex
LineSpacingSets or gets the line-spacing of a paragraph.
Modified
NewDragItemCreates a new dragItem containing selected text
ObjectAtOffsetReturns an object when present at the offset in the text.
OleInsertA windows only feature that will allow launching of applications when the object is double clicked
Operator_Convert
PanelChangesame as panelchange
ParagraphNumAtCharPosReturns the paragraph number at charPosition.
ParagraphPosAtXYGets the paragraph position at x,y coordinate. The function returns a WordGuiseParagraph instance.
Paste
PasteFromScrap
PinScroll
PrintSession
ReCalTextRecalculates text drawing
ReDraw
RedoReverses a previous undo action.
ReFreshShadowed method, will work in RB 2k, but not in RB5.5.5. Alternative is ReDraw
RefreshRulerForces the redrawing of the ruler and its widgets.
RegisterCustomTagItem
ResetModified
ResizeResize is a method to be utilized in the windows resizing and resized events when WordGuise was instantiated.
ScrollAllows the scrolling of WordGuise in the horizontal and/or vertical dimensions.
ScrollRead
ScrollToSelelection
ScrollWrite
SelectAllselects the text in WordGuise.
SelectedObjectIf an Object (Picture) is selected it will return a new instance of WordGuiseObject.
SelectionAnchor
SelectNone
SetFocusA shadowed method. will work in RB 2k5, but not in RB 5.5.5. In the latter case use: focus = true
SetSelectionsets the selection of text using the selTart and selEnd boundaries
ShowShows the widget
SizeMenuItems
StyleGets or sets the WordGuiseStyledText instance to utilize specific methods that also include the methods and properties defined in WordGuise.
StyleMenuItems
StyleRunNumAtCharPosReturns the StyleRun index at the char position in the text.
TabGets or sets the WordGuiseTabItem property.
Table
TabPanelChangeMethod to be used in the TabPanelChange event handler when a WordGuise widget is created in code and lives on a tabpanel.
TextColorMenuItems
ToClipboard
TransferModeMenuItems
UnderlineStyleMenuItems
UndoUndoes the current user action.
UndoInfoProvides the current Undo Info by returning a value, corresponding to Undo constants defined in WordGuise module.
UndoInfo
UndoMessageProvides the Undo Info as an Undo message.
ViewHeightreturns the view height (rendering height)
ViewWidthreturns the view width (rendering width)
Window
WordPosAtXYReturns the Word position at the x-y coordinates.
_Index
_SetIndex
_SetWindow
iCopy (Inherited)
iCut (Inherited)
iDelete (Inherited)
iOpen (Inherited)
iPaste (Inherited)
iRedo (Inherited)
iSave (Inherited)
iSaveAs (Inherited)
iSelectAll (Inherited)
iSelectNone (Inherited)
iUndo (Inherited)

Events

CloseFired when the WordGuise widget closes.
ConstructContextualMenu
ContentSizeChange
ContextualMenuAction
DragEnter
DragExit
DragOver
DropObject
EnableMenuItems
GotFocusCalled when the class has obtained the keyboard focus.
KeyDownCalled when a key was pressed.
KeyUp
LostFocusCalled when the class looses the keyboard focus.
MouseDowncalled when the mouse was clicked. mousemoved is additional functionality one can use to detect the start of a drag.
MouseDownObject
MouseDragMouse button was pressed inside the WordGuise region and moved (dragged) at the x,y location. This event occurs when the previous mouse down was handled by returning true.
MouseEnter
MouseEnterObject
MouseExit
MouseHoverObject
MouseLeaveObject
MouseMove
MouseUpThe mouse was released inside the WordGuise region at the x,y position.
MouseWheel
Moved
OpenThis event is fired when the WordGuise widget has been instantiated successfully. This event can be used to provide further initializing properties to be set.
Paint
PanelChange
Resized
Resizing
RulerChange
ScrollChange
SelChange
StyleChange
TextChange
Undo
UrlLink
WordBreakThis event will be fired when FindWord or a double click is issued. When you implement this event, it'll provide a custom Word-Break hook, so you could conceivably implement RegEx here to allow a word like "WordGuise_Monster" to be recognized as one word and not be seen as two separate words. In order to get this to work you will need to instantiate a WordGuiseWord class containing the start and end offsets.

Supported Platforms:

  • PPC - MacOS 9
  • Carbon - MacOS X (PEF)
  • MacOS X PPC - (Mach-O)
  • MacOS X Universal Binary (Mach-O)
  • Win32 - Windows

    Unsupported Platforms:

  • Linux x86