How to implement Mouse hover listener in vaadin chart - vaadin-charts

How can I add cursor hover listener in vaadin chart?
I want to change the icon of the cursor to a hand or similar icon to indicate that the bar in the chart is clickable?
public static final Cursor POINTER

Give your chart ID in java.
myChart.setId("forzaJuve");
Then in your theme, you can write like this:
#import "../valo/valo.scss";
#mixin mytheme {
#include valo;
#forzaJuve:hover {
*Do whatever you want to do here*
}
Make sure you recompile and do clean & build to save everything.
Hope i helped :)

Related

how to make Slider Animation

How to make some different type animation in side slider. Is there any library. if any library please provide me.
use ViewPager
ViewPager show next and before item preview on screen
Check above url and find the solution.

How to make an expandable window or dialog in FLTK?

I want an 'expandable' window/widget.When clicking a button on the current window, another widget will shows up, which is attached to the current window, and it can be 'fold' back if clicking the button again.
It is not a pop-up window which is free to move with respect to the main window. I want it to be attached to the main window. Anyone has any idea? Thanks a lot.
I tried making a large window consisting of two box, with one being tackled to show or hide, but the window size does not change. If you resize the window, then the position does not look right.
Have you had a look at http://seriss.com/people/erco/fltk/ and the test programs that come with the fltk distribution?
Basically you need to set one resizable widget for the window/dialog. Make this the group that you are showing/hiding when you press the button.
If you have an FLTK distribution, have a look at the program test/resize.cxx as an example of how to do resizing based on button clicks.
I'm not sure I understand what your exact problem is...
Perhaps you need a widget that's not always shown on your main Fl_Window.
Then pressing another button makes it visible and attached somewhere in
the window, according to the window's size...
And when you resize the window, it changes its position, so it is always located,
let's say, at the bottom right of it. If I have understood your problem correctly,
then make a class, myWindow or whatever, a subclass of Fl_Window.
And override the resize function, which is called when the window is being resized.
class myWindow:public Fl_Window{
Fl_Button *mySpecialWidget; //the movable widget (not allways a button ofc)
public:
myWindow(int x, int y, int w, int h, const char *L=NULL):
Fl_Window(x,y,w,h,L){
mySpecialWidget = new Fl_Button(.....); //initialize subwidget here
add(mySpecialWidget); //add it as a subwidget of myWindow
//may also include all the other needed widgets here...
}
void resize(int x, int y, int w, int h){
//override this Fl_Window function, with
//any extra functionality that you need
//example, check window size-> set relevant position for mySpecialWidget
}
}

Android UI: Button with shape inside?

I need to create a button that looks like this:
button
I was hoping to create it without using images. To create the pink part, I wanted to use a drawable.
How can I include a shape drawable within a button?
You can create a Layout, set background color for that layout as you wish. In that layout add two textviews. Set background for one layout pink. add another under the first textview. Then you can set onClickListener on layout. It'll work same as that of button and it'll be easy to change colors and text programatically.
Try using an ImageButton and setting android:src to point to your ShapeDrawable resource.

A keyboard with a UITextField

I have a table listing some strings, and what I want is when I tap the add button on the navigation bar, a keyboard with a textField would jump up, so I can input a string in the textField, then when I tap the return key, the keyboard disappear as well as the textField, and the new string is added to the table.
I already make up a nib file with a toolBar containing a textField, and I just failed to go on.
How can I implement this idea? Use the inputAccessoryView? If so, that means the inputAccessoryView of the textField which belongs to the toolBar is gonna be the toolBar itself!
This seem kind of weird and I have not been able to make it work till now.
Or is there another way for this idea?
Thanks a lot!
I've solved the problems by using notification instead of inputAccessoryView.
There is a sample code in XCode called "KeyboardAccessory", and it gives a good example about using keyboard notifications!
Or custom a view with a tab, and set it as the textField's inputAccessoryView, that would also work!

Android: always show menu bar/static menu bar

I would like to use the menu bar instead of a tab bar (tabs are not made for being at the bottom of the view ...).
Is there any chance to give the menu bar a static behaviour?
Related post:
android : set the menu out / visible with the solution:
new Handler().postDelayed(new Runnable() { public void run() { openOptionsMenu(); } }, 2000);
It works fine, but hides away constantly.
Many thankx!
It sounds like you're trying to abuse menu functionalities. What could be the solution: create a vertical LinearLayout with two additional layouts inside. Let the top one have layout_weight="1" and here place your content. In the bottom one place images or buttons or similar, which you could make look like tab options or whatever you want.

Resources