Default way to scroll chart is to drag mouse holding right button. I need to scroll with mouse wheel. I haven't found any API to enable/disable mouse wheel scrolling.
I also tried to add MouseWheelListener to the chart itself, but it never gets called.
Is it possible to use mouse wheel in TeeChart lib?
My application is Eclipse RCP using SWT.
The following code works fine for me with TeeChart Java SWT in Eclipse:
Bar bar1 = new Bar(tChart1.getChart());
bar1.fillSampleValues();
tChart1.addMouseWheelListener(new MouseWheelListener() {
#Override
public void mouseScrolled(MouseEvent arg0) {
Axis tmpA = tChart1.getAxes().getLeft();
double tmpInc = tmpA.getRange()/10;
if (arg0.count>0)
tmpA.setMinMax(tmpA.getMinimum()+tmpInc, tmpA.getMaximum()+tmpInc);
else
tmpA.setMinMax(tmpA.getMinimum()-tmpInc, tmpA.getMaximum()-tmpInc);
}
});
Related
So I have a pause menu created in unity. There is a panel and on it, there are three buttons but they do not seem to be working, meaning I can not click on them. Also, interactable of every button is checked and event system is present in the hierarchy.
Hierarchy image
Following is the code for the resume button:
public void resumegame()
{
levemusic.UnPause();
pausemenu.SetActive(false);
Cursor.visible = false;
gameisPaused = false;
Time.timeScale = 1;
}
Either disable this component on the panel
Or move the panel object such that it is on top of the hierarchy in the object hierarchy
i think the title is clear , i want to make the mouse Cursor which is set in GazeInpuModule to be always enabled and in center of the both Left And Right Cameras , can anyone help me ?!
ive tried changing the GazeInputModule code to place the cursor in center , but got nothing !
Here's what worked for me:
Create a Cursor GameObject in the Head hierarchy
Add EventSystem in the project hierarchy
In the EventSystem Gaze Input Module component, ensure "Show Cursor" is selected.
In GazeInputModule.cs, PlaceCursor(), change the SetActive() to:
private void PlaceCursor() {
// ...
cursor.SetActive(showCursor);
// ...
}
I want to create a PopUp for my game, my requirement is to open a popUp when user click a button.
And popUp contains a image for its background, a close button on upper-right corner and two buttons on the popUp (lets say YES & NO).
I make R&D but nothing found relevant.
Any help would be appriciated.
P.S. I don't want to use any third party plugIn Like NGUI, 2D ToolKit etc.
Unity till 4.5
You can build most components with GUITexture wiht the legacy UI system.
http://docs.unity3d.com/Manual/class-GuiTexture.html
Build your background and buttons from textures of the scheme below. For the buttons you also use GUIText and make the clickable/touchable.
For more info see the scripting guide.
http://docs.unity3d.com/Manual/GUIScriptingGuide.html
Unity 4.6 or newer
The GUI system of Unity easily allows you to do that. You will need a Canvas and a Sprite for the background. And two buttons as children for YES and NO.
See the introduction first
http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/the-new-ui
The manual shows all components
http://docs.unity3d.com/Manual/UISystem.html
GUI Reference
http://docs.unity3d.com/ScriptReference/GUI.html
Try creating something like this for the pop-up button(JavaScript):
var popupactive : boolean = false;
var (Name of the GUI window) : GUITexture;
var (Picture1) : GUITexture;
var (Picture2) : GUITexture;
var (Picture3) : GUITexture;
(Name off the GUI window).enabled = false;
(Picture1).enabled = false;
(Picture2).enabled = false;
(Picture3).enabled = false;
function OnMouseUp(){
if(popupactive==false){
popupactive = true;
}
else{
popupactive = false;
(Name of the GUI window).enabled = false;
}
}
Then try adding a function that closes the GUI for the exit button and "no" button to close the opened GUIs, Also remember to import the separate scripts assigned to the separate buttons inside the code! Remember also to assign them in the Unity editor. Hope it helps!
In GXT, I've got a control with an important panel added to the bottom component, basically like this:
public class SamplePanel extends ContentPanel {
ContentPanel panel = new ContentPanel();
public SamplePanel() {
setBottomComponent(panel);
}
public void setVisible(boolean isVisible) {
panel.setVisible(isVisible);
}
The panel is being set as the "bottom component" because it needs to stay at the bottom of the widget and viewable at all times.
The problem is, while the visibility of the panel toggles correctly, the 'bottom component' area doesn't resize to become smaller and fit the new dimensions of the bottom area.
However, I've noticed that the bottom area does resize when I manually change the size of the widget with the mouse.
Is there any way to programatically force a redraw/repaint/re-layout... anything to have the bottom component change to reflect the new size of its contents?
I've tried all of these and they don't work:
public void setVisibility(boolean isVisible) {
panel.setVisible(isVisible);
doLayout(true);
recalculate();
repaint();
}
Thanks
In the last gxt you can do.
this.layout(true);
Otherwise you can fire an Events.Resize event.
I don't know about GXT, but in GWT I would use one of the force() or forceLayout() methods on my panel. Perhaps there is a similar API for doing that!
HTH.
Have you tried using the setLayoutOnChange() method of the ConentPanel?
I would suggest looking at this:
http://davidmaddison.blogspot.com/2008/12/gwt-rendering-process.html
What you can try to do is addListeners to the Panel and try calling panel.layout() there
This post claims that the top and bottom components to not participate in layout once the panel has been rendered and suggests a manual workaround (using RowLayout) or manually setting the size of the panel.
Consider finding the sizes from the parent and calling onResize(width, height)
Using Eclipse RCP to build an application. I would like the toolbar to be vertical and on the left hand side of the window. So far I managed to make it vertical in the ApplicationActionBarAdvisor.
#Override
protected void fillCoolBar(ICoolBarManager coolBar) {
ToolBarManager toolbar = new ToolBarManager(coolBar.getStyle()
| SWT.HORIZONTAL);
coolBar.add(toolbar);
}
However, it is still on top of the editors and view. I cannot find any way to move it to the left. Does anybody know if it is possible at all and how to do that?
Thanks,
Martin
You can use the extension point o.e.ui.menu, and use the locationURIs "toolbar:org.eclipse.ui.trim.vertical1" for left trim and "toolbar:org.eclipse.ui.trim.vertical2" for the right trim. You can your tool items there.
Also see the contribution examples plugin for more samples: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.ui.examples.contributions/