473,804 Members | 3,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Draw frames around some items

I have a file which contains component definitions, along with their
x/y coordinates and width and height. Examples for components are a
short text string, a text entry field, a date entry field, a
selection box, a checkbox.

The aim is to produce an HTML page that looks like those definitions
specify.

So I computed a grid which covers all the corners of all components
(actually only top left corners) and created an HTML table with
appropriate row heights and column widths. Into that table I
positioned all the elements and gave them the right width and height.

So far, so good.

Now, comes along a new kind of component, a frame. It has the usual
location and dimension attributes, plus some text, which is used as a
title, like so:

+-example frame--------+
| |
| |
| |
+----------------------+

I hope you can see the ascii graphics.

The idea behind the frame is that the frame frames all of the
components that are inside it.

(What happens when a component overlaps a frame border is
unspecified. They are drawn on top of each other, I guess. I'd
rather ignore this problem and pretend that all components will be
either fully inside a frame, or fully outside it.)

A logical implementation for this kind of frame would be the an HTML
table with a border. But this implementation doesn't fit the current
grid implementation too well. A way to deal with this is to do a
kind of a recursive layout, where I figure out which components are
inside the frame and then recursively call my table-building
algorithm for those.

Can you think of a clever HTML trick that would help me to avoid this?

For example, it might be possible to decompose the frame into the four
sides, and to consider each of them a separate component. Then I
could compute table rows and columns normally for the four sides. But
I'm afraid that the lines for the sides would then not join
correctly. (How to draw horizontal and vertical lines in HTML?)
Another approach might be to use absolute positioning with CSS. It
would lead to a simple algorithm, since the input is close to the
output. But if the browser doesn't grok absolute positioning, then
this approach will show nothing useful, whereas the table approach
might produce something that at least topologically looks like the
specification. Thus, I decided against the absolute positioning
approach. WDYT?

Kai
Jul 20 '05 #1
4 3598
Kai Grossjohann wrote:
I have a file which contains component definitions, along with their
x/y coordinates and width and height. Examples for components are a
short text string, a text entry field, a date entry field, a
selection box, a checkbox.


Is there a reason you can't use <fieldset> for that:
<fieldset>
<legend>Examp le Frame</legend>
<input type="text">
<select>
<option>Optio n 1</option>
</select>
<input type="checkbox" >
</fieldset>

?
Jul 20 '05 #2
Keith Bowes <do****@spam.me > wrote:
Is there a reason you can't use <fieldset> for that:


Isn't it sufficient to state that there was no hint of any form being
involved? It would be very misleading to use form-related constructs
for something that isn't a form at all.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3
"Jukka K. Korpela" <jk******@cs.tu t.fi> wrote in message news:<Xn******* *************** ******@193.229. 0.31>...
Keith Bowes <do****@spam.me > wrote:
Is there a reason you can't use <fieldset> for that:


Isn't it sufficient to state that there was no hint of any form being
involved? It would be very misleading to use form-related constructs
for something that isn't a form at all.


I apologize. It is a form. I didn't think it was relevant to the
question, that's why I didn't state so in my original message.

Kai
Jul 20 '05 #4
Keith Bowes <do****@spam.me > wrote in message news:<106625464 0.834784@cache3 >...
Kai Grossjohann wrote:
I have a file which contains component definitions, along with their
x/y coordinates and width and height. Examples for components are a
short text string, a text entry field, a date entry field, a
selection box, a checkbox.


Is there a reason you can't use <fieldset> for that:


I didn't know that <fieldset> exists. Thanks for pointing this out.

Does this play well with my table layout? I think it would lead to
unbalanced start/end tags, if applied naively. But I am naive, so how
to apply it non-naively?

Let's say the original meta data specify four controls:

(1,1) - (20,5) text field A
(10,10)-(50,40) frame
(12,12)-(35,20) text field B
(55,10)-(65,15) text field C

As you can see, the frame frames text field B only. Thus, the HTML
code needs to look like this: the <fieldset> tag must come before the
text field B and the </fieldset> tag must come after text field B.

But my row/column algorithm will produce a table with 3 or 4 columns.
The first row contains text field A, the second row contains the frame
and also text field C, the third row contanis text field B.

So I get something like

....<tr>...<fie ldset>...</tr>...
....<tr>...</fieldset>...</tr>...

which means unbalanced start/end tags.

Ideas?

(I hope you can understand what I mean; I fear that the above is not
explained very well.)

Kai
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2265
by: Dave Smithz | last post by:
Hi there, I have implemented a login sequence using session variables for a PHP/MySQL DB which I took over development. I read some books and this NG and it seemed straight forward. However the website I have taken over uses two frames. The left hand side is always a navigation frame with the righthand side of the screen always being the target. I developed a main web page where login takes place and if successful a session variable...
13
5033
by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code I'm using: FrameSet ------------------------------------------------------- <html>
40
2952
by: JohnnyCJohnny | last post by:
Is it pretty safe to say that almost all web surfers now use browsers that are Frames compatible? What are most people using these days? IE? Thanks
1
1049
by: ruca | last post by:
Hi, I have a Web Application that have 3 frames. Top, Contents and Main are the 3 frames presents in App. My Top frame have only a image and a label, both represent application. My Contents frame, basically is where i have menu items. My Main frame is where the items choosen are displayed. What I want to know, is if there is anyway to avoid that my clients (were I have app installed) chenge the top frame with another page that is not...
1
3569
by: Robin Tucker | last post by:
Hi ppl, My owner draw list box controls do not "refresh" old selected items when a new selection is made. This means that as you click to make selections, the previously selected items stay highlighted along with the new ones too. It draws correctly when I minimize the window and then maximise it again, but I just don't seem to be getting a "DrawItem" event for switching of an item from Selected to NotSelected! Any ideas??? Here is...
2
3138
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I get all kinds of screen artifacts and weirdness. My general goal is: list item with a few areas for text, every other item shaded a light color for readability, font color changes with selection. The listbox is populated with custom structurs...
0
1300
by: Adam Clauss | last post by:
I have a ListView in which I am attempting to get it to not draw the 'dotted' rectangle around items which are selected. All other drawing should be normal. I am using the listbox in SmallIcon mode (has an icon + label). I've tried setting various properties, even overriding my own ListView class, but I cannot seem to find the right combination. Any thoughts? -- Adam Clauss
1
4274
by: nickyeng | last post by:
i have to design a simple game. I asked some question before in this forum. Now the game version is the new version with more items in it. now, i have a 11 items to draw, '$'. and i have a function in a header file called utils.h, GetRandom() function. code: inline unsigned GetRandom(unsigned min, unsigned max) { return rand() % (max - min + 1) + min;
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.