MarvinView Example - Fine-tuning the layout
Differences from the previous example:- no scrolling
- additional parameters for the label and button layout
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.
Description of the used parameters:<script type="text/javascript" SRC="../../../marvin.js"></script> <script type="text/javascript"> <!--mview_begin("../../..", 439, 385); mview_param("rows", "3"); mview_param("cols", "2"); mview_param("border", "1"); mview_param("layoutH", ":1:3:L:0:0:1:2:L:0:2:"); mview_param("paramH", ":L:12b:L:12b"); mview_param("cell0", "|Molecule|Image"); mview_param("cell1", "|Molecule|Image"); 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("cell2", "|../../../mols-2d/caffeine.csmol" +"|first" +"| Search |%|example-searchmore1.cgi?mol=first" +"|../../../img/easychart1.gif||"); mview_param("cell3", "|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("cell4", "|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("cell5", "|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 buttons and checkboxes and how to trigger CGI calls and JavaScript expression evaluations.
Do you have a question? Would you like to learn more? Please browse among the related topics on our support forum or search the website. If you want to suggest modifications or improvements to our documentation email our support directly!
