[Cuis-dev] [Changesets] Some typos in a method and some class comments
Douglas Brebner
kirtai+st at gmail.com
Wed Jul 1 09:46:25 PDT 2020
Hi,
attached are a couple of changesets. One changes #isQuesitonMark to
#isQuestionMark in classes KeyboardEvent and Autocompleter.
The second fixes some class comment typos and other errors. (Please
check these since I'm not completely certain about a couple).
Also, after looking at the keyboard events, am I right in saying that
function keys are not supported?
-------------- next part --------------
'From Cuis 5.0 [latest update: #4249] on 1 July 2020 at 5:36:25 pm'!
!RunNotArray commentStamp: '<historical>' prior: 0!
A replacement for RunArray that does not optimize space. Essentially just an array, with a few idiosyncratic methods for compatibility with RunArray.
Rationale: When styling Smalltalk text, runs are very short. Space saving is not significant. Maybe 90% of the time is spent building and coalescing RunArrays. So, don't save space. Save time!!!
!Editor commentStamp: '<historical>' prior: 0!
New text editors.
TextEditor provides most of the functionality that used to be in TextMorphEditor.
SmalltalkEditor has Smalltalk code specific features.
SimpleEditor provides basic functionality for single line text editing. It does not handle fonts and styles, aligning and Smalltalk utilities. It handles one single line.!
!TextAlignment commentStamp: '<historical>' prior: 0!
Warning: TextAlignment and ParagraphStyleReference (What is this referring to?) should always be applied to whole 'paragraphs' in the text. See #isParagraphAttribute
(
(Text string: 'This text has no style set', String crString),
(Text string: 'This is centered', String crString attribute: TextAlignment centered),
(Text string: 'This text has no style set', String crString)
) edit!
!StringMorph commentStamp: '<historical>' prior: 0!
StringMorph is a "lightweight" Morph to display a String. It supports only a single font, color, and emphasis combination. For multiple text styles, use TextModelMorph.
Structure:
instance var Type Description
font StrikeFont (normally nil; then the accessor #font gives back a Font or nil #defaultFont)
emphasis SmallInteger bitmask determining character attributes (underline, bold, italics, struckThrough)
contents String The text that will be displayed.
!
!TaskbarMorph commentStamp: '<historical>' prior: 0!
A simple task bar written for Cuis.
dashBoard contains views/controls
viewBox contains graphic buttons of "iconized" windows/morphs.
scale allows 1x 2x 4x taskbar height. [scale= 1,2,4]!
!AutoCompleter commentStamp: '<historical>' prior: 0!
An InnerTextMorph can have an autocompleter in the same way it might have a styler. My instances implement autocompletion.!
-------------- next part --------------
'From Cuis 5.0 [latest update: #4249] on 1 July 2020 at 5:10:38 pm'!
!KeyboardEvent methodsFor: 'testing' stamp: 'db 7/1/2020 17:09:47'!
isQuestionMark
^ self keyCharacter = $? ! !
!AutoCompleter methodsFor: 'keyboard' stamp: 'db 7/1/2020 17:09:47'!
handleKeystrokeBefore: kbEvent
"I return a boolean. true when I have handled the event and no futher processing is needed by the caller."
| shouldOpenMorph |
shouldOpenMorph _ self shouldOpenMorph.
"Stuff to do if the menu is not open"
menuMorph ifNil: [ ^ self openCompletionMenuFor: kbEvent if: shouldOpenMorph ].
"Starting here, stuff to do if the menu is open"
menuMorph stillActive.
kbEvent isEsc ifTrue: [ self closeMenu. ^ true].
kbEvent isBackspace ifTrue: [ shouldOpenMorph ifFalse: [ self closeMenu ]. ^ false].
kbEvent isHome ifTrue: [ menuMorph goHome. ^ true ].
kbEvent isEnd ifTrue: [ menuMorph goToEnd. ^ true].
kbEvent isQuestionMark ifTrue: [ menuMorph help. ^true].
kbEvent isArrowUp ifTrue: [ menuMorph goUp. ^ true].
kbEvent isArrowDown ifTrue: [ menuMorph goDown. ^ true].
kbEvent isPageUp ifTrue: [ menuMorph goPageUp. ^ true].
kbEvent isPageDown ifTrue: [ menuMorph goPageDown. ^ true].
self canShowSelectorDocumentation
ifTrue: [
kbEvent isArrowRight ifTrue: [ menuMorph showSelectorDocumentation. ^ true ].
kbEvent isArrowLeft ifTrue: [ menuMorph hideSelectorDocumentation. ^ true ]]
ifFalse: [
"If it is showing identifiers I eat the right arrow key because the user is used to it when
showing selectors, so to avoid an unexpected behavior I do nothing with it -Hernan"
kbEvent isArrowRight ifTrue: [ ^ true ]].
(self shouldInsertSelected: kbEvent) ifTrue: [ self insertSelected ifTrue: [^ true]].
(self shouldCloseMenu: kbEvent) ifTrue: [ self closeMenu ].
^false! !
!methodRemoval: KeyboardEvent #isQuesitonMark stamp: 'db 7/1/2020 17:09:47'!
KeyboardEvent removeSelector: #isQuesitonMark!
!AutoCompleter reorganize!
('accessing' setModel: textMorph textMorph:)
('menu morph' closeMenu menuClosed openCompletionMenu)
('keyboard' autoCompletionAround:keyStroke: handleKeystrokeAfter: handleKeystrokeBefore:)
('keyboard - private' isTab:and: openCompletionMenuFor:if: shouldCloseMenu: shouldInsertSelected: shouldOpenMorph shouldOpenMorphWhenNoPrefixAt: shouldOpenMorphWhenNoPrefixFor: shouldOpenMorphWhenPrefixAt:and:)
('entries' computeEntries entries entryAt: entryCount insertSelected newCursorPosition: selectedEntry selectedEntryFormatted)
('testing' canSelect: canSelectEntryAt: canShowSelectorDocumentation isPossibleInvalidEntry: opensWithTab)
!
More information about the Cuis-dev
mailing list