isekaijin
isekaijin

Reputation: 19772

Converting a VB6-like specification of a form into a Web page displaying the form

As a part of my current pet project, I have to write an program that takes as input the specification of a form and generates as output the necessary HTML and CSS code to display the form as a Web page. The exact input format is irrelevant to this question, but the information it contains is similar to the information in a Visual Basic 6 form file, minus the Visual Basic code. In particular, the sizes and positions of the form's controls are represented as XY pairs in an absolute coordinate system.

The main problem I am facing is that I do not know how to map the information contained in the input format (control sizes and positions, tab order, etc.) to the information contained in the HTML and CSS files (when to use placeholder divs, when to use CSS floats, etc.).

I emphasize on the word information because I do of course know how to generate HTML- and CSS-formatted files given the information they should contain.

Upvotes: 2

Views: 958

Answers (1)

thirtydot
thirtydot

Reputation: 228302

In particular, the sizes and positions of the form's controls are represented as XY pairs in an absolute coordinate system.

In that case, the easiest method is to use absolute positioning.

Something like this: http://jsfiddle.net/R8K6u/

You should be able to directly map width/height/left/top from the VB6 equivalent.

Upvotes: 1

Related Questions