request - Text editor center alignment

Discussion and support for general JUCE issues

request - Text editor center alignment

Postby red_muze » Sat Feb 07, 2009 7:39 am

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
User avatar
red_muze
JUCE Obsessive
 
Posts: 97
Joined: Sat May 31, 2008 9:20 pm

Postby jules » Sat Feb 07, 2009 2:22 pm

Yes, I've got some code to do that, which I've been meaning to merge in..
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby red_muze » Sat Feb 07, 2009 5:14 pm

yay you rock! :D
User avatar
red_muze
JUCE Obsessive
 
Posts: 97
Joined: Sat May 31, 2008 9:20 pm

Postby igor » Tue Mar 03, 2009 11:37 pm

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.
igor
JUCE UberWeenie
 
Posts: 231
Joined: Wed Mar 29, 2006 5:07 pm

Postby atom » Fri Nov 06, 2009 11:27 am

was this done ? i can't find anything about justification in the TextEditor class.
User avatar
atom
JUCE UberWeenie
 
Posts: 1115
Joined: Thu Feb 15, 2007 11:36 am

Postby jules » Fri Nov 06, 2009 12:07 pm

I don't think I ever added it (..?)
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby atom » Fri Nov 06, 2009 12:17 pm

could you ? :)

or was there a problem and it can't be done.
User avatar
atom
JUCE UberWeenie
 
Posts: 1115
Joined: Thu Feb 15, 2007 11:36 am

Postby jules » Fri Nov 06, 2009 6:11 pm

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.
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby justin » Sat Nov 07, 2009 11:23 am

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:
User avatar
justin
JUCE UberWeenie
 
Posts: 297
Joined: Mon May 19, 2008 1:37 pm
Location: Canada

Postby atom » Sat Nov 07, 2009 4:39 pm

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
Image
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.
User avatar
atom
JUCE UberWeenie
 
Posts: 1115
Joined: Thu Feb 15, 2007 11:36 am

Postby jules » Sun Nov 08, 2009 7:58 pm

(I thought that was spelt "pitta"...?)

Not to hijack, but what's the possibility of adding unicode(MLTE) text entry to texteditor?


It's already unicode, of course - so do you mean right-to-left layout?
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby justin » Sun Nov 08, 2009 8:42 pm

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.
User avatar
justin
JUCE UberWeenie
 
Posts: 297
Joined: Mon May 19, 2008 1:37 pm
Location: Canada

Postby justin » Sun Nov 08, 2009 8:43 pm

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.
User avatar
justin
JUCE UberWeenie
 
Posts: 297
Joined: Mon May 19, 2008 1:37 pm
Location: Canada

Postby justin » Sun Nov 08, 2009 9:00 pm

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
User avatar
justin
JUCE UberWeenie
 
Posts: 297
Joined: Mon May 19, 2008 1:37 pm
Location: Canada

Postby justin » Mon Nov 09, 2009 12:22 am

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
User avatar
justin
JUCE UberWeenie
 
Posts: 297
Joined: Mon May 19, 2008 1:37 pm
Location: Canada

Next

Return to General JUCE discussion

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests