Luxor Does the SWT Dog Show Layout Example Using FormLayout

Gerald Bauer <[email protected]> Sun, 9 Nov 2003 12:38:06 -0800 (PST)
Newsgroups gmane.comp.java.luxor-xul.user
Message-ID <[email protected]>
Hi,

  I just finished up testing Luxor's new XML Format
for the Standard Widget Toolkit (SWT) FormLayout using
the "famous" Dog Show example from the "Understanding
Layouts in SWT" article.

  Here's the Luxor XUL version using FormLayout (aka
springbox):

     <springbox hspace="5" vspace="5">

         <sd top="next.center">
           <label value="Dog's Name:" />
         </sd>

         <sd left="prev+5" right="100%">
           <textbox id="dognametext" />
         </sd>
          
         <sd top="next.center">      
            <label value="Breed:" />
         </sd>
                  
         <sd top="dognametext+5"
left="dognametext.left" right="categories-5">
            <choice id="dogbreedcombo"
list="breedtype" />
         </sd>
         
              <sd bottom="categories-5"
left="categories.center">
                 <label value="Categories" />
              </sd>

               <sd top="dogphoto.top">               
	             <label id="photo" value="Photo:" />
	           </sd>

	           <sd top="dogbreedcombo+5"
left="dognametext.left"
	               right="categories-5"
bottom="ownerinfo-5" >
	              <image id="dogphoto"
src="images/fifi.gif" />
	           </sd>
	     
	     
	           <sd top="dogphoto.top" right="100%"
bottom="enter-5">
	              <mchoice id="categories"
list="category" type="list" />                
               </sd>
               
               <sd top="photo+5" right="dogphoto-5">
                 <button id="browse" label="Browse..."
/>
               </sd>

	           <sd left="browse.left" top="browse+5"
right="dogphoto-5">
	             <button label="Delete" />               
	           </sd>


               <sd bottom="enter-5" left="0"
right="categories-5">
                 <groupbox id="ownerinfo">
                    <caption label="Owner Info" />
     
                    
	                <springbox vspace="5" hspace="5">
	                  <sd top="nametext.center">
	                     <label value="Name:" />
	                  </sd>
                      <sd left="phone+5" right="100%">
	                    <textbox id="nametext"/>
	                  </sd>

                      <sd top="phonetext.center">
	                    <label id="phone" value="Phone:"
/>
	                  </sd>  
	                  <sd left="nametext.left"
right="100%" top="55%">
	                    <textbox id="phonetext" />
	                  </sd>
	                </springbox>
                 </groupbox>
              </sd>
                            
              
              <sd right="100%" bottom="100%">
                <button id="enter" label="Enter" />
              </sd>
       </springbox>
   

   Let me know what you think. What layout manager do
you use?

  - Gerald


PS: For comparision. Here's the same dog show example
using GridLayout and using the box layout system:

           <gridbag cols="3">

               <label value="Dog's Name:" />
               <gd colspan="2" align="MAX">
                 <textbox />
               </gd>
               
               <label value="Breed:" />
               <gd align="MAX">
                 <choice list="breedtype" />
               </gd>
               <gd align="CENTER">
                 <label value="Categories" />
               </gd>
               
	           <label value="Photo:" />
	           <gd rowspan="3" fill="BOTH">
	              <image src="images/fifi.gif" />
	           </gd>
	           <gd rowspan="4" align="MAX" valign="MAX">
	              <mchoice list="category" type="list" />
               
               </gd>
               
               <gd align="MAX" hindent="5">
                 <button label="Browse..." />
               </gd>
	           <gd align="MAX" valign="TOP" hindent="5">
	             <button label="Delete" />               
	           </gd>

               <gd colspan="2" align="MAX">
                 <groupbox>
                    <caption label="Owner Info" />
	                <gridbag cols="2">
	                  <label value="Name:" />
	                  <gd fill="HORZ">
	                    <textbox />
	                  </gd>

	                  <label value="Phone:" />
	                  <gd fill="HORZ">
	                    <textbox />
	                  </gd>
	                </gridbag>
                 </groupbox>
              </gd>
              
              <gd align="right" colspan="3">
                <button label="Enter" />
              </gd>
               
           </gridbag>

=====================================================================


 <groupbox id="dogView">
    <caption label="Dog Show Contestant" />

      <hbox>   
        <label value="Dog's Name:"/>
        <textbox id="name" value="Fifi" />
     </hbox>

     <hbox>
      <vbox>
       <hbox>
         <label value="Breed:" />
         <choice id="breedtype" list="breedtype" /> 
       </hbox>

       <hbox>
         <vbox>
	   <label value="Photo:" />
	   <button label="Browse..." />
	   <button label="Delete" />
	 </vbox>
	 <image src="images/fifi.gif" />
       </hbox>

         <groupbox>
            <caption label="Owner" />
	    <hbox>
	       <label value="Name:" />
	       <textbox  value="Mary Smith" />
	    </hbox>
	    <hbox>
	       <label value="Phone:" />
	       <textbox  value="123-4567" />
	    </hbox>
         </groupbox>
      </vbox>
     
      <vbox>
	 <label value="Categories" />
	 <mchoice id="category" list="category" type="list"
/> 
      </vbox>
     </hbox>
    
      <button label="Save" />
    
 </groupbox>



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/