As the splitpane is resized, currently it does not send out any "action" events. The "slider" however, does.
I have a thinlet (www.cedarsoft.net), that could benefit from this. The thinlet displays a section of buttons in the right side of a splitpane. As the splitpane is resized, I would like to dynamically change the number of buttons displayed.
Without the "action" event being fired, it is very difficult to do this. This would be an easy (and very small) change to the Thinlet class, to have it invoke "action" events, similar to how the slider is doing that.
Without this notification, I am going to have to do something ugly, like trap all events (using the Toolkit) API, and do my own hit-test logic.
Based on the simplicity of the change, the fact that it is natural to Thinlet (makes it more consistent across components), please give this a high priority.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As the splitpane is resized, currently it does not send out any "action" events. The "slider" however, does.
I have a thinlet (www.cedarsoft.net), that could benefit from this. The thinlet displays a section of buttons in the right side of a splitpane. As the splitpane is resized, I would like to dynamically change the number of buttons displayed.
Without the "action" event being fired, it is very difficult to do this. This would be an easy (and very small) change to the Thinlet class, to have it invoke "action" events, similar to how the slider is doing that.
Without this notification, I am going to have to do something ugly, like trap all events (using the Toolkit) API, and do my own hit-test logic.
Based on the simplicity of the change, the fact that it is natural to Thinlet (makes it more consistent across components), please give this a high priority.
I'm answering my own post. I've made the 3-line change to Thinlet.java to make this work. Here's the change:
The "splitpane" portion of the DTD object at the bottom of the Thinlet class:
"splitpane", "component", new Object[][] {
{ "choice", "orientation", "validate", orientation },
{ "integer", "divider", "layout", integer_1 },
{ "method", "action" } },
Note the addition of "method" "action".
Next, in the processKeyPress() method, in the "splitpane" section add the "invoke" line:
if (d != 0) {
setInteger(component, "divider", divider + d, -1);
validate(component);
invoke(component, null, "action");
}
Finally, in the handleMoustEvent() method, in the "splitpane" section, add the "invoke" line:
if (divider != moveto) {
setInteger(component, "divider", moveto, -1);
validate(component);
invoke(component, null, "action");
}
That's it. With this 3-line change, Thinlet fires "action" events whenever the splitpane divider is moved.