Request - Text editor center alignment

it would be nice to have the text editor be able to center the edited text inside. (useful for controllers)

and perhaps a right to left alignment can be nice for right to left languages.
cheers!

thanks!
Assaf

Yes, I’ve got some code to do that, which I’ve been meaning to merge in…

yay you rock! :smiley:

I just spent time looking for a way to do alignment or justification with a TextEditor component, and came to this thread.

I’d like to second the motion for left, right and center alignment of text.

was this done ? i can’t find anything about justification in the TextEditor class.

I don’t think I ever added it (…?)

could you ? :slight_smile:

or was there a problem and it can’t be done.

I think it was just a bit of a PITA to write, and I never got round to it. It is still there on my to-do-list.

Not to hijack, but what’s the possibility of adding unicode(MLTE) text entry to texteditor? I’d fly to the UK and hug your feet…not much of an incentive i know, but… :wink:

on the subject of PITA, apart from beeing a urban dictionary acronym for pain in the ass it’s also a type of food, that was sold in all theese little booths on the central train station in a town i used to live in. there was like 20-30 of theese booths and they all sold this

it had this white sauce in it, that got everywhere but your mouth. at some point someone got interested in this fenomen (it got very popular) and did a test on what did those PITA sandwiches contain. Apart from the obvious unhealthy chemicals and rotten veggies it also contained some amounts of Sperm, but the most interesting part (if that wasn’t enough) is that it was HORSE sperm (i always thought it would be human, some bored sauce maker person getting off on the job).

I just wanted to tell you that PITA can mean both of theese things.

And it it comes to foot fetish stuff, i offer my services as well.

(I thought that was spelt “pitta”…?)

It’s already unicode, of course - so do you mean right-to-left layout?

Hey Jules. I mean multiple language text input. So if I swap to say hiragana keyboard layout and type puru I get ぷる

the two “western” characters pu make the first symbol and ru the next. It’s not just Asian characters but scandanivian as well (and others needing two or more keystrokes)

on cocoa an nsview is too lowlevel I think(on a keydown). An nstextview works but then we’d lose the functionality of your texteditor. Carbon had an interface that worked without a control but we obviously want to get away from that

i’ll happily spend some time on the mac side if someone wants to suggest windows/Linux trappings(I’d hate to waste time if it couldn’t be rolled into juce platforms)

I’ve seen someone work around it on iPhone by using a hidden nstextview equivalent to trap the events and then forward the Unicode string to the control.

Hey Jules. I mean multiple language text input. So if I swap to say hiragana keyboard layout and type puru I get ぷる

the two “western” characters pu make the first symbol and ru the next. It’s not just Asian characters but scandanivian as well (and others needing two or more keystrokes)

on cocoa an nsview is too lowlevel I think(on a keydown). An nstextview works but then we’d lose the functionality of your texteditor. Carbon had an interface that worked without a control but we obviously want to get away from that

i’ll happily spend some time on the mac side if someone wants to suggest windows/Linux trappings(I’d hate to waste time if it couldn’t be rolled into juce platforms)

I’ve seen someone work around it on iPhone by using a hidden nstextview equivalent to trap the events and then forward the Unicode string to the control.

Sorry about the double post(mobile safari).

From what I know every nswindow has a nstextview that is used for all key entry. When an nstextfield, nstextfieldcell goes into edit mode this controls go visible and moves into position. For the character palette to work(which it currently doesn’t with juce) I’m not sure what the os is looking for. (as a test call up the character palette and try to insert Unicode characters/symbols)

anyway if I find more info I’ll create a new post

NSTextInput Protocol Reference seems to be promising (NSTextInputClient on >10.5). Adding the functions to JuceNSView might do the trick

Apple’s links don’t seem to last long these days but here it is for what its worth

http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSTextInput_Protocol/Reference/Reference.html

I might have to do something like this this week…if I do i’ll contribute any code

Thanks - that’s all new to me, I’ll have to take a look.

I’ve hacked something together in NSViewComponentPeer, i’ll send you off list…

It currently looks for the focused component to be able to be dynamically cast to TextEditor before passing the events for interpretation.

Ok, thanks, I’d be interested to see that.

Hi there, just wondering if this was ever added.

yes, me too. Did the code went into the current version ? I would like to be able to center-align and right-align the text in a TextEditor.