Keywords or Tags in an Editfield / Textarea

I would love to find a way to add tags to an editfield or textarea, the same way FaceBook deals with “friend names” in a post. A tag would be threaded as one object, instead of individual letters. You can find this function in many applications. Like the photo cataloging software Aperture by Apple. A keyword looks like a rounded rectangle box with the keyword string inside.

I would love to see something like this in Xojo. How has an idea how to approach this issue?

[quote=221685:@Edwin van den Akker]I would love to find a way to add tags to an editfield or textarea, the same way FaceBook deals with “friend names” in a post. A tag would be threaded as one object, instead of individual letters. You can find this function in many applications. Like the photo cataloging software Aperture by Apple. A keyword looks like a rounded rectangle box with the keyword string inside.

I would love to see something like this in Xojo. How has an idea how to approach this issue?[/quote]

If you could post pictures of what you refer to, it would help greatly. I tried to look at Facebook and do not get what you refer to. Pictures of the Aperture app in Google images show nothing like what you describe.

I noticed that Aperture doesn’t actually deals with keywords as I thought it did.
In the OS-X app “Photos” it does.

I use OS-X. So, I will look into the plugin packs. But it would be nice to have a similar function for the Windows platform as well. It would be nice to compile my app for Windows as well. Xojo is cross-platform. And I would like to make my apps cross platform as well :slight_smile:

Unfortunately, there is nothing on the Windows platform because the keyword is a native field (NSTokenField) on OS X. NSTokenField has no equivalent on Windows. You will have to develop your own custom control.

You can probably obtain a decent result using a ListBox instead so you can control the color of the background and the text in CellTextPaint :

If Me.cell(Row, Column) <> "" then g.ForeColor = &c00FFFF00 g.FillRoundRect(0,0,g.width*0.9,g.Height*0.9,g.Height/2, g.Height/2) g.ForeColor = &c00000000 end if

Each tag is in a cell, and it should not be too difficult to manage. This code creates a box behind the text only if the cell contains text. And that will be cross platform.

[quote=221880:@Michel Bujardet]You can probably obtain a decent result using a ListBox instead so you can control the color of the background and the text in CellTextPaint :

If Me.cell(Row, Column) <> "" then g.ForeColor = &c00FFFF00 g.FillRoundRect(0,0,g.width*0.9,g.Height*0.9,g.Height/2, g.Height/2) g.ForeColor = &c00000000 end if

Each tag is in a cell, and it should not be too difficult to manage. This code creates a box behind the text only if the cell contains text. And that will be cross platform.[/quote]

Ok, I kinda see what you mean. But it wouldn’t be like the kind of tags in a textfield, right?
This is what would look more like it: While typing it fires some sort of autocomplete in the form of a popup menu. By selecting a “menuitem” it puts that text in the text area. But the text is treated as one symbol. So, selecting one letter will select the entire keyword.

[quote=221882:@Edwin van den Akker]Ok, I kinda see what you mean. But it wouldn’t be like the kind of tags in a textfield, right?
This is what would look more like it: While typing it fires some sort of autocomplete in the form of a popup menu. By selecting a “menuitem” it puts that text in the text area. But the text is treated as one symbol. So, selecting one letter will select the entire keyword.[/quote]

If you code it right, to the eye of a user, a ListBox will look just like a TextArea : blinking caret, text entry, etc. Then its up to you to manage the behavior of the control. What I see in Photo looks fairly easy to emulate.

I would love to have a cross platform token field like they have on OSX. I would pay $$ for it.

Maybe I’m too much of a standard coder :wink:
I have tried several things. Nothing came close to the keyword field in Photos

If I have some spare time, I will see what I can do.

That is what I love about the Xojo community. We all love to help each other out. I wish I were a better coder. But for now I guess all I can offer is a professional video production :wink:

GrafittiSuite has something similar for the desktop called GrafittiTagField. I played with the first iterations of it before my subscription lapsed. It seemed a little rough then, may be better now.

Pictures look good on their site.Too bad there does not seem to be any downloadable evaluation software.

Never noticed that. Too bad, they have some very useful and unique controls in their collection. Updates can be a bit sporadic though, and I’m not sure if anything has been/will be updated for R3 x64. Of course, you do get the source…

I needed a cross-platform NSTokenField, and wasn’t really interested in any of the fill-ins linked here. Ended up making one myself using the canvas control.

It does auto-compete, works very much like a regular edit field, allows copy/paste, etc. Saw this message after the fact but I would consider cleaning it up a bit for general consumption and selling it for a small fee if there was still interest.

Take my money :wink:
I am still interested, Tom. I think you nailed it!

How customizable will it be?

Looks neat, Tom :slight_smile:

if it is cross platform (Mac/Win/Lin) than I am very interested in it.

sell it to Xojo, Inc …

Yep works on Mac/Win/Lin(haven’t tested on Linux but it’s using all built-in controls).

It’s already pretty customizable via the custom properties exposed in the Inspector:

I’ll post back here when it’s cleaned up a bit.