librelist archives

« back to archive

how about forms?

how about forms?

From:
Oliver Gaida
Date:
2014-07-31 @ 15:36
Dear shoes-makers,

i would like to have more than flows and stacks. I need a kind of table 
maybe as in html. Why? I want to have forms with two columns and 1 or 
more rows. The first column always gets the input-field-name and the 
second column the input-field.

in html it could be this:

<form>
   <table border="0" >
     <tr>
       <td align="left" style="width: 200px" 
bgcolor=lightgreen>Input-Field-Name-1-very long text</td>
       <td bgcolor=lightgreen><input name="input1" type="text" size="30" 
maxlength="30"></td>
     </tr>
     <tr>
       <td align="left" bgcolor=lightgreen>Input-Field-Name-2</td>
       <td bgcolor=lightgreen><input name="input2" type="text" size="30" 
maxlength="40"></td>
     </tr>
   </table>
</form>

in shoes if i try this:

Shoes.app :width => 400, :height => 100, title: "flow_stack" do
   flow do
     stack :width => '50%' do
       para "Input-Field-Name-1-very long text"
       para "Input-Field-Name-2"
     end
     stack :width => '50%' do
       edit_line
       edit_line
     end
   end
end

or:

Shoes.app :width => 400, :height => 100, title: "stack_flow" do
   stack :width => '100%' do
     flow do
       para "Input-Field-Name-1-very long text"
       edit_line
     end
     flow do
       para "Input-Field-Name-2"
       edit_line
     end
   end
end

It does not look so nice.

Is there a way with |org.eclipse.swt.layout.GridLayout |?


http://www.java2s.com/Tutorial/Java/0280__SWT/GridLayoutinsertwidgetsintoagridlayout.htm



-- 
Mit freundlichen Grüßen
Oliver Gaida

T-Systems Solutions for Research GmbH
Internet- and Intranet Appl.
Campus IT
Hausanschrift: Bunsenstrasse 10, 37073 Goettingen
Telefon: (0551) 709 2493
Telefax: (0551) 709 2169
E-Mail:oliver.gaida@t-systems-sfr.com
Internet:http://www.t-systems-sfr.com
T-Systems Solutions for Research GmbH
Geschäftsführung: Geschäftsführer:  Bernd Flack (Sprecher), Ralf Scholz, 
Stefan Schreiner
Handelsregister: Amtsgericht München, HRB 12 55 01, Sitz der Gesellschaft: Weßling
USt.-IdNr.: DE 193456493
  
Notice: This transmittal and/or attachments may be privileged or 
confidential. If you are not the intended recipient, you are hereby 
notified that you have received this transmittal in error; any review, 
dissemination, or copying is strictly prohibited. If you received this 
transmittal in error, please notify us immediately by reply and 
immediately delete this message and all its attachments. Thank you.


Re: [shoes] how about forms?

From:
Kc Erb
Date:
2014-07-31 @ 16:39
Hi Oliver,

This is just one opinion among many. But it has two parts.

1) One way to get the table alignment you talked about with stacks and
flows is like this <https://gist.github.com/KCErb/ae575e895d2c1a624df9>.

2) Alternative layout options (not flows and stacks) are an interesting
idea, but I'd be in favor of letting 3rd party groups gemify their own
shoes layout options instead of increasing the size of shoes' "tiny" dsl.

For example, for fun I've been slowly putting together a little project for
mimicking bootstrap's grid in shoes: Boots <https://github.com/KCErb/boots>.
It's not ready for production yet, but if you want to fork and download it
you'll see that the basic grid example
<https://github.com/KCErb/boots/blob/master/samples/grid-example-basic.rb>
from getbootstrap.com <http://getbootstrap.com/css/#grid-example-basic>
works fine on Shoes4.

I hope that helps in some small way :)

-KC


On Thu, Jul 31, 2014 at 9:36 AM, Oliver Gaida <
oliver.gaida@t-systems-sfr.com> wrote:

>  Dear shoes-makers,
>
> i would like to have more than flows and stacks. I need a kind of table
> maybe as in html. Why? I want to have forms with two columns and 1 or more
> rows. The first column always gets the input-field-name and the second
> column the input-field.
>
> in html it could be this:
>
>  <form>
>   <table border="0" >
>     <tr>
>       <td align="left" style="width: 200px"
> bgcolor=lightgreen>Input-Field-Name-1-very long text</td>
>       <td bgcolor=lightgreen><input name="input1" type="text" size="30"
> maxlength="30"></td>
>     </tr>
>     <tr>
>       <td align="left" bgcolor=lightgreen>Input-Field-Name-2</td>
>       <td bgcolor=lightgreen><input name="input2" type="text" size="30"
> maxlength="40"></td>
>     </tr>
>   </table>
> </form>
>
> in shoes if i try this:
>
> Shoes.app :width => 400, :height => 100, title: "flow_stack" do
>   flow do
>     stack :width => '50%' do
>       para "Input-Field-Name-1-very long text"
>       para "Input-Field-Name-2"
>     end
>     stack :width => '50%' do
>       edit_line
>       edit_line
>     end
>   end
> end
>
> or:
>
> Shoes.app :width => 400, :height => 100, title: "stack_flow" do
>   stack :width => '100%' do
>     flow do
>       para "Input-Field-Name-1-very long text"
>       edit_line
>     end
>     flow do
>       para "Input-Field-Name-2"
>       edit_line
>     end
>   end
> end
>
> It does not look so nice.
>
> Is there a way with org.eclipse.swt.layout.GridLayout ?
>
>
> 
http://www.java2s.com/Tutorial/Java/0280__SWT/GridLayoutinsertwidgetsintoagridlayout.htm
>
>
>
> --
> Mit freundlichen Grüßen
> Oliver Gaida
>
> T-Systems Solutions for Research GmbH
> Internet- and Intranet Appl.
> Campus IT
> Hausanschrift: Bunsenstrasse 10, 37073 Goettingen
> Telefon: (0551) 709 2493
> Telefax: (0551) 709 2169
> E-Mail:  oliver.gaida@t-systems-sfr.com
> Internet: http://www.t-systems-sfr.com
> T-Systems Solutions for Research GmbH
> Geschäftsführung: Geschäftsführer:  Bernd Flack (Sprecher), Ralf Scholz,
Stefan Schreiner
> Handelsregister: Amtsgericht München, HRB 12 55 01, Sitz der 
Gesellschaft: Weßling
> USt.-IdNr.: DE 193456493
>
> Notice: This transmittal and/or attachments may be privileged or 
confidential. If you are not the intended recipient, you are hereby 
notified that you have received this transmittal in error; any review, 
dissemination, or copying is strictly prohibited. If you received this 
transmittal in error, please notify us immediately by reply and 
immediately delete this message and all its attachments. Thank you.
>
>
>
>


-- 
 "If there is an exception to every rule, then every rule must have at
least one exception; the exception to this one being that it has no
exception."