Shift focus by navigation key using clutter toolkit in c? - c

I have to create a vertical menu using clutter in C. Can anyone help me how to implement focus shift using the navigation keys for the menu where i want to highlight the focused menu option.

the easiest way is to mark the actor that contains all the menu items as reactive, assign to it the key focus using clutter_actor_grab_key_focus() and connect to the key-press-event signal. then you can use clutter_event_get_key_symbol() on the ClutterEvent passed to the signal and match it agains key symbols like CLUTTER_KEY_Down or CLUTTER_KEY_Up.
then there's even the possibility to use ClutterBindingPool to handle tuples of (key symbol, modifier) and assign them to a specific callback function.
for more information, see the API reference:
http://developer.gnome.org/clutter/stable/ClutterActor.html#clutter-actor-grab-key-focus
http://developer.gnome.org/clutter/stable/ClutterActor.html#ClutterActor-key-press-event
http://developer.gnome.org/clutter/stable/clutter-Events.html#clutter-event-get-key-symbol
http://developer.gnome.org/clutter/stable/clutter-Key-Bindings.html
the list of key symbols in in the clutter-keysyms.h header:
http://git.gnome.org/browse/clutter/tree/clutter/clutter-keysyms.h
there are various recipes in the Cookbook as well:
https://developer.gnome.org/clutter-cookbook/stable/events-handling-key-events.html

Related

ReactJS - make text input that contains tags and free text as template

I'm researching an easy way to make a free text input that can also contain multiple replaceable tags to create templates. As on this picture example
In that picture, the information witch player (tag) made the goal would be stored.
Later I would reuse that template and replacing the tag by a value.
Like: Goal of Iniesta, Goal of Rivaldo, ...
I couldn't find a lib that would do the job. The few attempts that I made to try to resolve it lead to extremely complex inputs with redefining selects (onClick, onKeydown, onSelect, maintaining current select) as the user can't edit the tag by hand (they are trigger by clicking buttons).
Does somebody already had to handle this kind of input?
Edit: As my question seems to be not clear, I will add a few details.
In fact, the input should work as it is a free text input but should also allow adding tags/chips that are provided by external triggers (onClick buttons)
Example: I will make [activity] on [day]
First I type "I will make " then I click the button "activity" that will add a "activity" tag/chip to the input. I continue with typing " on " and finaly click the button "day" to add the tag "day".
Then I will store this as template and reuse it in several scenarios by replacing the tags. Like:
I will make sandwiches on Monday
I will make sport on Friday
If somebody else have the same issue. I finally found the right lib Tagify. It has a mixed mode (text + tag)

Is it possible with an ADF ComboBox component to type in values not present in the given LOV?

I am working on an input form using ADF. I have an input field in which I want to show a list from which the user can select the value and also require a type option in case the value user want is not in the list.
I use the JDeveloper 12.2.1.3 for development. I have tried using ADF ComboBox component based on a static list. The component gives a list a expected. But I cannot type in a new value in case the value I wanted is not in the list. I can only type whatever is in the list already.
I am looking for something similar to the HTML input-datalist combination which gives a list and allows type if the intended value is not in the list.
The InputListOfValues and other LOV components only allow you to enter data which is present in the list. That is the way these components are designed. It would not make sense to allow other input as you normally use such components in places where you want to make sure the user can only input reference data defined in other data.
Anyway, it's easy to create some kind of component which allows you exactly what you want. I wrote a blog n this here https://tompeez.wordpress.com/2013/02/03/jdeveloper-11-1-1-6-0-afinputtext-with-self-made-look-up-not-using-lov/
From this page you can download and run the ADF Faces Rich Client Demo, which shows all components and what they do.

How to Multi-Select options on a drop down menu on a web using Blue Prism

I am trying to get blue prism to multi-select some options on a webpage. What I did was spy the html combo box and then use navigate to create four elements:
Global send keys, with text value = "<{CTRL}>".
Global Mouse click, with text value = option name
repeat 2 on other options I want to choose
Global send keys, with text value = "{CTRL}".
Error message was "Keyword "CTRL" is not valid". Very confused on how to proceed...
If you want to do press a key, then do some actions, then release the key, then Global Send Keys is not the function to use. Go for Global Send Key Events.
The < and > function as a state modifier, using these you specify what key event you want to do. The character < is for key pressing, > is for releasing. So, to press Control, you would use <{CTRL} and to release it you would use >{CTRL}.

#mention autocomplete on nested objects

I'm looking to do some really complex autocomplete in a textarea kind of like what occurs with libraries like #mention. I'd like to have autocomplete options start after a delimiter, and then continue after periods to quickly navigate object trees. For example, typing # would give an autocomplete menu to all the keys in an object, then after selecting that key, the next period starts an new autocomplete that is an autocomplete for all the keys specific to that previously selected object. If the top level object had 3 different layers, the below would be the end result of the final autocomplete.
#[key1.key2.key3]
'#[this.category.UnitPrice]'
'#[topKey.midKey.finalKey]'
Anyone ever run into this kind of situation?

Render a page differently based on which list that opened it

I have two lists of different PageTypes - NewsItems and PressReleases. They are displayed in one list each, with links to the individual items.
Now I want to include the press release items into the news list and use the style of the news items to display them as news items. They share properties like "Heading" and "BodyText", which are used in the News Template.
I imagine that it won't be that difficult to feed the NewsItems' ListPage with both sets of pages, but I don't understand how I can control the rendering of the item page.
I would like to take the PageData object from a NewsItem OR a PressReleaseItem and display it using the News-Item.aspx template, if it is selected in a NewsList. But EPiServer will always render the PressReleaseItem with the PR-Item.aspx since it's coupled in the PageType settings.
Anyone know how to accomplish this?
EDIT: An effort to clarify:
The important issue is how to know the "list parent" and choose the right template from that. In the ListPage I can apply different looks on the PR and News items respectively using tompipes answer, but when selecting to see an individual item EPi will render the PR-Item-1 the same way regardless of their "list parent". That's the problem.
I'm not following exactly what you are attempting here. But I think I get the gist of it.
Why not use one aspx template for both page types, but in the code behind switch off sections using the visible attribute.
If you are using PageTypeBuilder you could use the "is" keyword:
somePlaceHolder.Visible = CurrentPage is NewsItemList;
If you're not using PTB, you could use something like:
somePlaceholder.Visble = CurrentPage.PageTypeID == 10;
or
somePlaceholder.Visble = CurrentPage.PageTypeName == "NewsItemList";
I'll point out now I'm not a fan of hardcoding anything, so I would place the template name, or ID into a config file, or a property on the start/root page to avoid hardcoding them.
Let me know if this will help, or if I have misunderstood please try elaborate on your issue.
Depending on how much the templates share you could go with user controls, placeholders or even different masterpages to switch view in a suitable way.
To know when to switch you could use a querystring parameter, session variable or the nicest looking way would probably be to lookup and get the list's PageData object by the HTTP referrer. If it's empty you will get press release rendering as the worst case.
I tried lots of solutions, including the adding of querystring to the PR items in the list links, the getting of referring url in the item template and different types of event hooking for automatic publishing of news items from a PR item (although I only looked at the code samples for that one), and finally came to the conclusion that they all had something that told me not to go that way. (Making the code too complex, or the markup logic too hard to understand and so forth)
I ended up using Fetch data from another EPiServer page, and creating a "shortcut pagetype" in which I let my editors pick which PR item should be used as base for a news item.
This shortcut pagetype is called "PR-as-news-itemPage" and it is rendered with the same aspx as ordinary news items: News-Item.aspx. Having no properties of its own, it will take all relevant data from the PR item selected with "Fetch..."
To render PR items with all its properties I created an ordinary new pagetype called PR-Item.aspx. This renders the "Attribute 2" property, which is only rendered by PR-item.aspx, and not by News-Item.aspx.
(I could have gone even simpler, by letting the editors use the old News-Item page type and use the "Fetch..." property there, but I have some mandatory properties in that page type which I didn't want to make optional for this sake.)

Resources