MarvinView Example 2.3

Differences from the previous example:

The additional parameters c:n:1:1 for the label mean that the label is in the center of its subcell, it is not resized, and it has a vertical weight 1 and a horizontal weight 1. The button extra parameters are c:b:1:1, so the button is resized in both directions (horizontal and vertical) to fill all the available space in its subcell. The image extra parameters are s:n:1:1, so it is placed in the bottom (south).

The first extra parameter could be n (north), ne (northeast), e (east), etc. also. The second could also be h (horizontal resize) or v (vertical resize). The weights are nonnegative integers.

If you are familiar with the Java class java.awt.GridBagLayout, then you find that here you really specify the GridBagConstraints for a component. The only difference is that the weights must be integers here.

<script LANGUAGE="JavaScript1.1" SRC="../../marvin.js"></script>
<script LANGUAGE="JavaScript1.1">
<!--
mview_begin("../..", 439, 369);
mview_param("rows", "2");
mview_param("cols", "2");
mview_param("border", "1");
mview_param("layout", ":2:2:"
+"M:1:0:1:2:"
+"L:0:0:1:1:c:n:1:1:"
+"B:0:1:1:1:c:b:1:1:"
+"I:0:2:2:1:s:n:1:1");
mview_param("param", ":M:150:150:"
+"L:10:"
+"B:10:search for more molecules like this:_self");
mview_param("cell0", "|../../mols-2d/caffeine.csmol"
+"|first"
+"| Search |%|example-searchmore1.cgi?mol=first"
+"|../../img/easychart1.gif||");
mview_param("cell1", "|O[C@H](\C=C\[C@@H](O)C1=CC=CC=C1)C2=CC=CC=C2"
+"|second"
+"| Search |%|example-searchmore1.cgi?mol=second"
+"|../../img/easychart2.gif||");
mview_param("cell2", "|Ethane\n"
+"  Marvin  07119915552D\n"
+"\n"
+"  2  1  0  0  0  0  0  0  0  0999 V2000\n"
+"   -0.5625    1.2500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"
+"   -0.5625    0.2500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"
+"  1  2  1  0  0  0  0\n"
+"M  END\n"
+"|third"
+"| Search |%|example-searchmore1.cgi?mol=third"
+"|../../img/easychart3.gif||");
mview_param("cell3", "|C[C@]12CC[C@@H]3[C@H](CC[C@H]4CC(=O)C(\C[C@]34C)=C\O)[C@@H]1CCC(=O)O2"
+"|fourth"
+"| Search |%|example-searchmore1.cgi?mol=fourth"
+"|../../img/easychart4.gif||");
mview_end();
//-->
</script>

The next example shows how to use checkboxes and how to trigger CGI calls and JavaScript expression evaluations.