Implementing text navigation shortcuts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Implementing text navigation shortcuts

laura
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura
Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

Nicolai Hess

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai

Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

laura
Hi Nicolai,

Thank for your answer, it was excellent! 
It is nice to know that the editing functions are MVC way separated.

:)

On Thu, Jan 29, 2015 at 8:48 PM, Nicolai Hess <[hidden email]> wrote:

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai


Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

stepharo
In reply to this post by Nicolai Hess
Yes we should continue to remove the old key-bindings hard-coded.

Stef

Le 30/1/15 00:48, Nicolai Hess a écrit :

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai


Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

Tudor Girba-2
Rubric is already in the image and has most of these keybindings properly defined.

Doru

On Fri, Jan 30, 2015 at 11:09 AM, stepharo <[hidden email]> wrote:
Yes we should continue to remove the old key-bindings hard-coded.

Stef

Le 30/1/15 00:48, Nicolai Hess a écrit :

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai





--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

kilon.alios
Can Rubric be used for displaying paragraphs etc ? I want to improve the documentation situation for pharo by improving the help tool. 

Nothing major just something that will improve the general look. Shortucts also play a huge role in this, I really like Emacs documentation system that allow you to navigate via shortcuts . 

On Fri, Jan 30, 2015 at 12:13 PM, Tudor Girba <[hidden email]> wrote:
Rubric is already in the image and has most of these keybindings properly defined.

Doru

On Fri, Jan 30, 2015 at 11:09 AM, stepharo <[hidden email]> wrote:
Yes we should continue to remove the old key-bindings hard-coded.

Stef

Le 30/1/15 00:48, Nicolai Hess a écrit :

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai





--

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

Tudor Girba-2
Rubric is basically a clone of TextMorph that was significantly refactored by Alain.

Just keep in mind that Rubric is just a bridge solution. The goal is to adopt TxText as soon as possible.

Cheers,
Doru



On Fri, Jan 30, 2015 at 11:23 AM, kilon alios <[hidden email]> wrote:
Can Rubric be used for displaying paragraphs etc ? I want to improve the documentation situation for pharo by improving the help tool. 

Nothing major just something that will improve the general look. Shortucts also play a huge role in this, I really like Emacs documentation system that allow you to navigate via shortcuts . 

On Fri, Jan 30, 2015 at 12:13 PM, Tudor Girba <[hidden email]> wrote:
Rubric is already in the image and has most of these keybindings properly defined.

Doru

On Fri, Jan 30, 2015 at 11:09 AM, stepharo <[hidden email]> wrote:
Yes we should continue to remove the old key-bindings hard-coded.

Stef

Le 30/1/15 00:48, Nicolai Hess a écrit :

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai





--

"Every thing has its own flow"




--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Implementing text navigation shortcuts

kilon.alios
Ok thanks that means I will wait for TxText too, I am in no big hurry. Well unless TxText takes more than a year to be added to Pharo. 

On Fri, Jan 30, 2015 at 12:37 PM, Tudor Girba <[hidden email]> wrote:
Rubric is basically a clone of TextMorph that was significantly refactored by Alain.

Just keep in mind that Rubric is just a bridge solution. The goal is to adopt TxText as soon as possible.

Cheers,
Doru



On Fri, Jan 30, 2015 at 11:23 AM, kilon alios <[hidden email]> wrote:
Can Rubric be used for displaying paragraphs etc ? I want to improve the documentation situation for pharo by improving the help tool. 

Nothing major just something that will improve the general look. Shortucts also play a huge role in this, I really like Emacs documentation system that allow you to navigate via shortcuts . 

On Fri, Jan 30, 2015 at 12:13 PM, Tudor Girba <[hidden email]> wrote:
Rubric is already in the image and has most of these keybindings properly defined.

Doru

On Fri, Jan 30, 2015 at 11:09 AM, stepharo <[hidden email]> wrote:
Yes we should continue to remove the old key-bindings hard-coded.

Stef

Le 30/1/15 00:48, Nicolai Hess a écrit :

2015-01-29 23:06 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I like to implement a keyboard shortcut for, while editing any text, move the text pointer to the next position after $: .

Seems that the base of all text editing is the class #TextMorphForEditView. I see there there is an instance variable for the text. My problem is i can not find a method that tells/sets the current position in the text of the text pointer.

I've tried going through the list of methods of #TextMorphForEditView and its superclasses. Also through the one of senders of #arrowRight trying to find the instantiation of #KMKeyCombination needed to implement the existing shortcut "ctrl + right arrow" which jumps to the next position after an space, but i found nothing.

Best,
Laura

Hello Laura,

not all editing functions are actually in the TextMorph (TextMorphForEditView ...) classes or the Text class, instead they delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the caret after the space.

nicolai





--

"Every thing has its own flow"




--

"Every thing has its own flow"