I've noticed that at times the onMouseOver(e) function gets triggered when I hover over my chart but other times the onContainerPointerMove() function gets triggered. How do these 2 differ? What triggers each function? Can the trigger event be changed?
Reference for onContainerPointerMove function: https://github.com/highcharts/highcharts/blob/master/js/parts/MSPointer.js
There doesn't seem to be documentation for the onContainerPointerMove function in the API reference.
First of all, onContainerPointerMove is an internal Highcharts function and that is why it is not documented.
As the name suggests, onMouseOver is fired when the mouse pointer enters the element or one of its children. onContainerPointerMove is called on every poiner move over the element.
Related
Inside a loop I change the text of a textfield. But corona does not render until the loop is finished. Is it possible to force a render inside a loop?
I have tried with display.setDrawMode( "forceRender" ) and to do a sleep in the loop but it does not matter. Im trying to do a progressbar that updates.
Corona only renders between your event handlers. While your handler loops, Corona cannot update the display. Basically all commands in your handler than affect the display take effect only after the handler returns control to Corona. So if you want to show a value change repeatedly in a text field, you can't use a loop, only last change to the value will be visible on display, and only after return.
Therefore, you need to use one of Corona's mechanisms to cause the update to occur again. For example, you could listen for Runtime's enterFrame event; in there, determine if it is time to update the value and/or the text field and act accordingly. If this leads to too many updates (it will be 30 or 60 times per second), then another way would be to schedule an update of text field for later, as suggested by Frozire:
function updateValueDisplayed()
...compute new value...
...if changed, update the display object that shows the value...
end
timer.performWithDelay( 500, updateValueDisplayed, -1 )
The above will call updateValueDisplayed twice per second, until you exit. If the delay should be different every time, or should stop under certain conditions, then you could performWithDelay only once (remove third call parameter) and call timer.performWithDelay( delay, updateValueDisplayed) from within updateValueDisplayed as appropriate.
Clarification: you can't use a for loop. You can only use a repeated function call, two ways are described above.
I was trying to get if Window is focused or not so i gone through available method of Window class ,did not get any getFocus(); or isFocus(); method. Is there any reason to ZK drop this method ? There is only focus() method with void type.
I have a complex problem ,In my application single page have two parts left hand side contain a.zul and right part b.zul and have tabs. I have to fire CTRL key event something like this if focus on a.zul then fire event on A.Java class and When focus on b.zul then fire event in B.Java class. But as i am not able to get focus its hard to determine which window or zul is focused now? ANy one know any other solution of this problem?
Lots of elements (dom level elements) cannot receive focus, e.g., div, span, ul/li, table, tr, td, ..., etc
Also lots of widgets (ZK widgets) cannot receive (and do not handle) focus, e.g., window, div, label, grid, ..., etc
This is why there is no getFocus/isFocus methods by default since they are not that 'common' for a component, lots of components cannot receive focus, some of components work with 'default' focus (e.g., a, textbox) and some of components work with 'hand made' focus (e.g., listbox contains a dom element 'a' and play around it for focus).
You can try to listen to onFocus event or onClick event at server side to know which component is focused/clicked(selected), or override doFocus_(evt) method of widget and log the focused widget at client side for further processing.
But why do you need to fire onCtrlKey event manually? It will be fired from client to server automatically by default.
I thought OnSetEditText was fired whenever text in a cell changed. After setting a breakpoint and experimenting, I know that's wrong :-) So, first, when is this event fired?
Second, if I would like to have the text inside a grid cell continuously autosized, which event should I be coding to make this happen (note: I am using TMS's string grid derivative which includes a method for autosizing rows; I just have to figure out when to call it)?
The OnSetEditText event is fired every time the user changes the contents of the in-place editor control, assuming, of course, the control is editable (goEditing in Options). This is confirmed by the documentation, the VCL source code, and black-box verification.
I have a Delphi 6 app with a TListBox control set to lbOwnerDrawVariable. At run-time I add a single string to the list box. I have event handlers for OnMeasureItem() and OnDrawItem() and I set breakpoints on the very first line of code in each event handler. However neither of them are ever called. Not once. Not even if I make an Explicit Refresh or Repaint call on the list box.
This is really basic stuff so what is it that I am doing wrong that could inhibit the calling of those event handlers and subsequently disrupting my owner draw code? The single string does show in the list box properly. I threw in an OnClick() event handler just to see if it worked and did.
The OnMeasureItem and OnDrawItem events are (indirectly) triggered in response to the WM_MEASUREITEM and WM_DRAWITEM messages from Windows. Make sure you do not have any message handlers in your app that are filtering out that message, or the VCL's internal CN_MEASUREITEM and CN_DRAWITEM messages.
It turns out the problem was due to a non-zero value in the Columns property of the TListBox I was using. I had been experimenting with using columns earlier before I converted over to owner-draw and had left the TListBox.Columns property with a non-zero value. Apparently a non-zero Columns property value inhibits the triggering of owner-draw related event triggering. Once I set that property back to zero OnMeasureItem() and OnDrawItem() started firing.
There's really very little that can go wrong here. If you set up a test app to try this out then it functions just as you would expect and the event handlers are called.
The most likely cause of the behaviour you report is if the items are added before the event handlers are assigned. This typically happens if the items are added at design time in the .dfm file. You say you are adding the items at runtime. Perhaps you are adding them too soon, before the event handlers are assigned. What happens if you add items in response to an event, e.g. a button click. Try that out because you can be sure then then the event handlers are assigned by that point.
If that doesn't help then clearly you have some code in your app that is interfering with the VCL code.
I had this same issue: my OnDrawItem event handler was not being called if the Columns property was non-zero. It turned out this was because the Style property was set to lbOwnerDrawVariable. Variable item height is not allowed in conjunction with multiple columns, presumably because the rows would not line up across the columns if the item heights were allowed to be different. Once the Style property was set to lbOwnerDrawFixed the OnDrawItem event handler was called as expected.
I had a similar problem with a csOwnerDrawVariable-style combobox not triggering the OnMeasureItem event. As David Heffernan suggested, the issue was that the items had been added to the list at design time. The work-around I ended up using was to add code to the FormCreate event handler to copy the design-time list to a temporary variable, then clear the list and add the items back. Kludgy but effective.
I'm using jQueryUI Accordion, and genereate the elements on the fly. I need to prevent accordion expanding if we click Remove action link inside the header.
To stop further handlers from executing after one bound using .live(), the handler must return false. Calling .stopPropagation() will not accomplish this.
No luck with return false. Please see the demo.
I don't think you will have too much luck achieving what you want with live(), as jQuery only supports event bubbling and not event capturing. The design decision was probably due to the fact the IE does not support event capturing, even though W3C's speicification has the flexibility for both.
Your best bet is to attach a click event to the remove button right after it is inserted into the DOM (to stop the event propagation) before you re-initiate the accordion. You may need to take care not to bind click event to the existing remove buttons multiple times.
The pseudocode would look something like this:
call .accordion('destory') on the current accordion
create the new element, i.e. <h2>...<a class="revmoe">...</a></h2><div>...</div>
insert the new element to the existing accordion
bind a click event to the remove button in the new element to stop event propagation
initiate the accordion, i.e. .accordion({..})
SO posts on event capturing in jQuery:
event capturing with jQuery
Event Capturing vs Event Bubbling
Just use the given functions by the plugin:
$('#accordion').accordion({active:8, disabled:true});
jQuery('.remove').click(function(){
$('#accordion').accordion('disable');
})
I chose the option "active:8" because this way no header is opened from the beginning (index -1 does not work for IE). Check the function and options out at: http://docs.jquery.com/UI/Accordion
Hope this is what you were looking for :-)