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
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.
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
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.
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.