tags:

views:

56

answers:

4

This doesn't work

panel1.layout: layout [
  offset: 0x0
  yuml-image: image img
]

panel2.layout: layout [
  offset: 0x0
  area (yuml-command0) yellow
]

panelbuttons.layout: layout [

    button "Save" [request-save]
    button "Refresh" [request-refresh]
    button "Quit" [quit]

]

Main: layout [
  panel1: box 640x300 white
  return
  panelbuttons: box 640x20
  return
  panel2: box 640x180 yellow
]

panel1/pane: panel1.layout
panel2/pane: panel2.layout
panelbuttons/pane: panelbuttons.layout

view/title/options center-face Main "askuml.com" [no-border]

I just wanted the equivalent of this:

Main: layout [
    offset: 0x0
    yuml-image: image img
    return
    across
    button "Save" [request-save]
    button "Refresh" [request-refresh]
    button "Quit" [quit]
    return
    area (yuml-command0) yellow
]

Also why do I have a border whereas I asked offset 0x0 see the ugly grey border below: alt text

Update: now I have this ugly window alt text

see http://askuml.com/blog/yuml-use-case-desktop-client/

I updated the code now I can't see the (even your :)) buttons:

alt text

+1  A: 

You need:

layout [
    origin 0x0
    ...
]

You also have space 0x0 and backcolor 238.234.221 to dispense with the grey. I'm partial to changing the area edge as well - area edge [size: 1x1 effect: none]

Some other options: layout/tight [...] (space and origin 0), layout/origin [...] 0x0.

view/options [no-border] refers to the OS window. Any set-word! in the layout dialect specifically refers to assigning a word to the subsequent style.

rgchris
Thanks for all options will try all. But currently I can't even make work origin 0x0: it says 0x0 misplaced. And return doesn't work either see http://askuml.com/blog/yuml-use-case-desktop-client/
Rebol Tutorial
That doesn't sound right - are you using View 2.7.x?
rgchris
Looks like there's still an `offset: 0x0` in your code...
rgchris
view layout/offset [btn "test"] 0x0 ;this should work as offset is a refinement for layout function.
endo64
+1  A: 

I'd say your first instinct was correct, but would modify it thus:

Main: layout [
    origin 0 space 6
    yuml-image: image img 600x400
    across pad 6
    btn "Save" [request-save]
    btn "Refresh" [request-refresh]
    btn "Quit" [quit]
    below
    area (yuml-command0) yellow 600x200
]

If you really need to break up the panels, let the 'panel style do the heavy lifting:

image-panel: [
    yuml-image: image 600x400 img
]

btn-panel: [
    across origin 6 space 6
    btn "Save" [request-save]
    btn "Refresh" [request-refresh]
    btn "Quit" [quit]
]

area-panel: [
    area yellow 600x200
]

main: layout [
    origin 0 space 0
    panel image-panel
    panel btn-panel
    panel area-panel
]
rgchris
thanks, this works but I don't understand what is panel : where is it in official doc: I can only see pane ?
Rebol Tutorial
Not sure where it's referenced in the docs (it is name-dropped). There's this though: http://en.wikibooks.org/wiki/REBOL_Programming/Language_Features/VID#Panels
rgchris
OK thank you will read it. I can't see it in the doc here http://www.rebol.com/docs/view-face-content.html or am I mistaken ? It is very confusing that such important thing would not be mentionned in official doc.
Rebol Tutorial
+1  A: 

try this,

w: layout/size [backcolor red btn "test"] 300x300
v: layout/tight [box blue 100x100]
append w/pane v
view w

or use insert instead of append to put the face behind of others:

insert w/pane v
endo64
Sorry if I'm stupid I don't understand how to apply your code to my use case :)
Rebol Tutorial
may be I'm stupid and misunderstood your question :) I tried to show you to add a layout into another one with offset 0x0. So you may apply this to your case. Note that the second layout (which is 'v) is tight.
endo64
+1  A: 

Panel is just a layout, nothing else. You can create layouts and adds them to another layout's pane, or just use panel style.

http://www.rebol.com/how-to/subpanels.html

view layout [backcolor yellow size 200x200 origin 0x0 space 0x0 b: panel red [btn "test" lbl "Test"] return panel blue [btn "x" lbl "rest" lbl "x"]]
>> ? b
== B is an object of value:
type            word!     face      ;<--- just a face
offset          pair!     0x0
size            pair!     36x49
span            none!     none
pane            block!    length: 2 ;<--- btn & lbl
...
endo64
I thought I did in the 1st place but will look at panel again.
Rebol Tutorial