> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I'm designing a page (you can access it at http://www.scmbb.ulb.ac.be/
> ~jean/ModMol/4proteines.html) for viewing 4 proteins.
> As the page will be shown on a touch screen with no mouse available,
> I'm using a jmolCheckbox to allow the user to zoom in and out.

OK

> The problem is that when one zooms in and next loads a new molecule,
> the image is shown in non-zoomed shape but the zoom checkbox remains
> checked.

Correct.
This type of problem frequently arises when building graphics user
interfaces.

> Is it possible to uncheck the checkbox  the button for loading a new
> protein is pressed ?
> Alternatively, is it possible to "know" that the checkbox is checked
> and execute the zooming command after loading the new protein.

You need to write the JavaScript to do this yourself.

When you create the checkbox control it is possible for you to pass in an
identifier (the last parameter) that will be used as the 'name' and 'id'
of the control.

function jmolCheckbox(scriptWhenChecked, scriptWhenUnchecked,
                      labelHtml, isChecked, id) {

(If you do not pass in a parameter, then the default id/name is
'jmolCheckbox0', 'jmolCheckbox1', ..., etc.)

The checkbox control associated with this id is a normal JavaScript
checkbox control.

When events occur in your UI, you can call
getElementById("yourCheckBoxControlID"), and query/modify the state of the
control to make the state presented to the user consistent.


Sorry ... there is no easy way.

** 1 minute later **

Actually, that is not completely true. This is a generic problem. It is
*possible* that there are user interface libraries written in JavaScript
that provide a general framework to make it easier to do this. I am not
aware of such a thing, but maybe someone else is.

(If a JavaScript and/or GUI guru wants to talk about building a more
general (but very complex) mechanism to support this into Jmol.js then
please post to [EMAIL PROTECTED])


Miguel



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to