layouts

Testing rendering of a given layout with RSpec & Rails

Is it possible to test the use of a given layout using RSpec with Rails, for example I'd like a matcher that does the following: response.should use_layout('my_layout_name') I found a use_layout matcher when Googling but it doesn't work as neither the response or controller seem to have a layout property that matcher was looking for. ...

2 column layout in CSS

Hi, I want a nice 2 column layout using CSS float's. Column#1 160 px Column#2 100% (i.e. the rest of the space). I want to place the Col#2's div first, so my layout looks like: <div id="header"></div> <div id="content"> <div id="col2"></div> <div id="col1"></div> </div> <div id="footer"></div> What has to be get this effec...

Implementing Rails' layout functionality with Apache Tiles

Has anybody tried duplicating Ruby on Rails' layout functionality with Apache Tiles 2 ? I'm trying to integrate Tiles 2 with Spring. I have a previously written custom view resolver for the Spring framework that does this quite nicely, but I'm upgrading to Spring Webflow 2 and I need to be able to integrate Tiles 2 ...

Vertical center a TextFlow in GEF

I'm trying to vertical center a multiline textbox within a RectangleFigure in GEF. It needs to be ajusted on resize. This would be best done with a layout, but I can't figure out how that works. I'm adding a BorderMargin to the parent FlowPage and changing the margin when the RectangleFigure gets resized. Unfortunately, at that particu...

<div css help!

Hi there, i am trying to create a website with div's and css styleing, what i want to do is sit 2 divisions one on top of the other, but centered to the middle of the page, so the top box will be called container, and the bottom box will be called quicklinks an example of what im trying to achieve is http://www.whirlpool.net.au/ so i h...

<table> for layouts is evil right?

Hi, Just found out that this site uses tables for layouts. Does anyone find this disturbing considering the nature of the site? I really don't know what to believe anymore :-) http://www.w3schools.com/ ...

CakePHP Generate layout content as a string

I'm building a CakePHP site where users can press a button to "save this newsletter as HTML". It seemed like a good idea to use a combination of requestAction and a media view to serve up the content to them, so that they get the exact same content as the live app. The only downside is that requestAction uses an empty layout, so there ar...

How does Grails know to apply a "layout" to pages it renders?

I've been going through the book "The Definitive Guide to Rails" (Rocher/Brown) and in Chapter 04, this mysterious thing called a "layout" just appeared with no explanation. (And there's no "layout" in the index. As far as I know, it's never explained.) How does the system know to "inherit" the pages from layout/main.gsp? There's nothin...

Using different layouts in GUIs

This is what my program should look like and I'm a bit confused on where I should use different layouts. I have a Window class which calls the Panel class and the Panel class calls the InputPanel and DisplayPanel classes. My InputPanel class calls my DetailsPanel, CrimePanel and ButtonPanel classes so they make up what is seen under th...

How does rendering different formats/layouts in Rails affect SEO?

I have been reading a lot about cloaking and redirects, and am wondering how this fits into rendering and layouts in Rails... Two parts: 1) If I have different data formats to render in (json, xml, html, and iphone), and they all use the same url, differing by the ".format" at the end, is this considered "content duplication"? It seem...

Can a Grails Layout call a template?

I want my main layout to conditionally put in some blocks of html that I want to be defined in a separate file. I have more than one kind of navigation bar defined. I want to have a file for each navigation bar. Then I want to just set a variable in my controller or specific gsp file so that the layout chooses which navigator to use. ...

Set included PHP and HTML content to a variable

I am working on a small MVC "framework", which will simply provide a more organized workspace for me, as I've found I love CakePHP but only for it's organization. Now, I'm trying to replicate the layouts (which contain <?php echo $title_for_layout; ?> and <?php echo $content_for_layout; ?>,) and I'm curious how I would be able to load a ...

Getting Parent Layout in Qt

Hi, quick question. Is there any way to (easily) retrieve the parent layout of a widget in Qt? PS: QObject::parent() won't work, for logical reasons. EDIT: I'm positive the widget has a parent layout, because I added it to a layout earlier in the code. Now, I have many other layouts in the window and while it is possible for me to keep...

Why is the W3C box model considered better?

Why do most developers consider the W3C box-model to be better than the box-model used by Internet Explorer? I know it's very frustrating developing pages that look the way you want them on Internet Explorer, but I find the W3C box-model to be counter-intuitive. For example, if margins, padding, and border were factored into the width,...

Multiple Layout Managers in Java

Is there way to use more than 1 layout manager in Java. Right now I'm using a gridLayout to implement a chess board but beneath it I would like to put some other stuff but not in a gridLayout. Maybe a FlowLayout or some other layout. How would I go about doing this? Thanks! ...

JavaFX layouts question.

I am having some problem understanding layouts in JavaFX. Consider following code. Stage { title: "ListView test" scene: Scene { width: 400 height: 400 content: [ VBox { content: [ ListView { height: 200 width...

Can I force automatic wrapping in BorderLayout

I was wondering if it is possible to force components in BorderLayout to wrap like they do in FlowLayout. ...

Use layout_alignBaseline with Spinner

Hello everybody, I've noticed that layout_alignBaseline of TextVew control doesn't work with Spinner control. I'm trying to place a text to the left of spinner, but it goes to the top of the parent control. <Spinner android:id="@+id/locations" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layo...

Help with Android LinearLayout or RelativeLayout

I need to create two views programmatically (because I need to access the ondraw of one of the views). For some reason, no matter what I do to add the views to the contentview, they don't show up vertically stacked, one below the other. I can do it just fine using the XML using a RelativeLayout and layout positioning, but with the XML ...

Android and Layouts

Hi all, I need your help! I need to locate text on view as showed on the picture: text 'Some more text' should be located in bottom|center_horizontal text 'Short text' should be located on with align right, but about 10% from the top of the screen text 'x.x.x.x' should be aligned to the center of the screen (right/bottom align of th...