single scroll bar for multiple lists boxes. flash CS6 - actionscript-3

I have been having issues getting a single scrollbar to work with multiple list boxes. I wanted something similar to how Excel does it visually
i ended up using a slider bar and using the value of this bar to change the selectedIndex of the list box. This did not work however.
This is the code i was using:
import flash.events.MouseEvent;
slider1.addEventListener(MouseEvent.MOUSE_OVER,scrolling);
function scrolling(evt:MouseEvent)
{
trace(slider1.value);
slider1.maximum=InstanceName_1.length;
InstanceName_1.selectedIndex=slider1.value;
InstanceName_2.selectedIndex=slider1.value;
InstanceName_3.selectedIndex=slider1.value;
InstanceName_4.selectedIndex=slider1.value;
}
with InstanceName_n being the different lists i used.
Thank you so much in advance!

I think the listener function is wrong, try using this
slider1.addEventListener(MouseEvent.MOUSE_MOVE,scrolling);
this might help , because this is when mouse is down and is moving , normally used for drag/drop times , still you can try it , it will work

Related

Redraw select menu in JQuery Mobile

I am trying to make a JQuery Mobile select menu button larger by changing the data-mini property from true to false on the fly. I am able to change the property, but the select menu does not redraw.
It works with a button, by using .buttonMarkup({mini: false}) (which redraws the button instantly), but as far as I know there is no equivalent for select menus.
I have tried .selectmenu("refresh") and .change() - neither redraws the select menu button.
Here is an illustration of the problem: http://jsfiddle.net/YYXuZ/
Does anyone have a solution?
Hey this works for me -
$('#testselectmenu').parent('div').addClass('ui-fullsize');
jsFiddle Demo
I noticed you won't need the $('#testselectmenu').selectmenu('refresh'); with this approach.
/Update
To play it safe I would do this (it does the same thing while removing the data-mini attribute and ui-mini class) -
$('#testselectmenu').parent('div').attr('data-mini', 'false').removeClass('ui-mini').addClass('ui-fullsize');
I think jQM should handle this automatically when you call a .selectmenu('refresh'), I'm not sure why it doesn't.

Primefaces Charts without shadow

I am using Primefaces barChart in one of my projects where in a small area I need to display a chart that contains multiple data points. When the chart is rendered, the bars become very thin, which is ok for me. However, there are shadows of each of the bars that look confusing on the chart.
Is it possible to disable shadows in Primefaces charts?
The bar chart has a 'shadow' attribute. Setting it to false should make the shadow dissapear.
However, at least in version 3.1.1 I was not able to make the shadow dissapear using this attribute, it seems that it doesn't work. If you have the same issue, add the following style to your css file:
.jqplot-series-shadowCanvas {
display: none;
}
It hides the shadows of bar chart (and probably the shadow of other charts too, I haven't tested it).
I know that it is an old question but for anyone else looking for help here you can do:
BarChartModel barChartModel = new BarChartModel();
barChartModel.setShadow(false);
It work also with linecharts:
LineChartModel result = new LineChartModel();
result.setShadow(false);
and should work with other kinds of charts as well.

Can I hide the ToolTipText for a Slider Bar?

In VBA programming, is it possible to hide the ToolTipText for a Slider Bar?
The picture below shows a Slider Bar on a form in a Microsoft Access database. I would like to hide the ToolTipText in the red circle.
The reason I want to do this is because the Slider Bar cannot show decimal values (example: 0,1), so I want to display the values in a box next to the slider after they are scaled to decimal values. I know how to do this, but not how to hide the ToolTipText for the Slider that shows only integer values.
There is no easy way to remove that indicator as it's not exposed through the control itself.
However, there are a couple of solutions:
Subclassing the control and intercepting Windows messages
Not for the faint of heart, complex and overkill, but you theoretically could intercept windows messages and drop those that correspond to the tooltip.
This is not easy in VBA at all, and I wouldn't even try it.
If you feel like delving into this, have a look at an example in KB278379
Just display something else.
More interesting is the ability to change the displayed text to something else:
To change the text, handle the Scroll event and update the slider's Text property:
Private Sub MySlider_Scroll()
MySlider.Text = "Awesomeness: " & (MySlider.Value * 7.89)
End Sub
The event is not visible from the control's properties themselves, but if you open the IDE and select the Slider from the list of controls, you will be able to create the code for handling the Scroll event:

Java swing CheckBox is not visible in JCheckBoxMenuItem

The checkbox icon is not visible in my JCheckBoxMenuItem..I add this JCheckBoxMenuItem to JideMenu which extends JMenu.How to make this checkbox visible eventhough if it is not selected..?
Thanks in advance.
I'm not entirely certain where your problem is coming from. It sounds that just the checkbox component isn't visible, while all other MenuItem types are showing up on the Menu.
I'm not very experienced with the Swing library, but if you could put a few lines of code regarding your Menu/MenuItems, I'm certain you'll get a much better answer.
Taking a shot in the dark, you mention that the MenuItem (checkbox) is added to the menu, but have you added the menu into a MenuBar/JMenuBar object and set your JFrame to use that Bar via the setMenuBar() method? This is under the assumption that the entire menu isn't showing up (not just the checkbox component), but figured I'm try to preempt a solution here.
menuBar = new JMenuBar();
menu = new JMenu("A Menu");
menuBar.add(menu);
cbMenuItem = new JCheckBoxMenuItem("A check box menu item");
menu.add(cbMenuItem);
It´s pretty much straightforward and taken directly from here. I guess it´s all anyone can say about it until you show us your code.
setState(true) will show the checkmark… IIRC there's also a constructor that you can pass a boolean if you want it created with the checkmark visible.

JScrollBar, remove keyListener?

Hey you all, just a quick question of what i havent found anywhere. Im adding a scrollpane to a JPanel, with 2 JScrollBars. One vertical and one horizontal. Everything works fine just that i dont want the ScrollBars to scroll using the arrow keys. How do i achieve this?
I´ve been checking out adjustmentlisteners but really havent found anything of high value to me. Thanks for any help!
you have to tweak the keybinding in the scrollPane's inputMap and point the navigation keys into nirwana, like:
InputMap inputMap = scrollPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke("RIGHT"), "do-nothing");
// same for all navigation keys you want to disable
...
to find which keyStrokes are registered, look into the BasicLookFeel - the section in getDefaults which relates to "ScrollPane"
Beware: that's highly unusual, you user's might be annoyed!