Re: Desire to unify UI for HyperCard VisualBasic Java and HTMLform

From: Phlip (phlip_cpp_at_yahoo.com)
Date: 09/03/04


Date: Thu, 02 Sep 2004 22:03:41 GMT

rem642b@Yahoo.Com wrote:

> > Gerry Quinn wrote:

> > If VB is like VC++, it isn't quite exact to the pixel when you drag
> > and drop, because dialogs have slight rigidities to do with fonts
> > etc. But it's pretty close.
>
> Ah, thanks for jogging my memory. Indeed in VB6 there's pattern of
> little squares and all alignment of controls on the form must be
> aligned with those squares, so it's not free to a single pixel, more
> like units of several pixels. So in that respect, layout in VB is
> slightly different from in HyperCard. In either case, that's much more
> free/haphazard layout than either grid bag layout in Java or tables
> with colspan/rowspan in HTML.
>
> I've never used VC++ for dialog layout so I can't comment on the
> VB/VC++ comparison.

There are two kinds of layout management in the world - automatic
hierarchical layout, and pixel-oriented layout.

VB and VC++ use the same system because they wrap the same underlying
library. The raw Win32 SDK uses only pixel-oriented layout, as a
convenience, and has no built-in geometry management. However, the raw Win32
SDK supports a transformation between raw pixels and "dialog units", which
base on the size of the dialog's font. If you copy and paste a dialog, then
change ones font to a bigger point size, and run a program, you will see a
little and a big dialog, with all elements linearily expanded to fit their
font.

Both the VB and VC++ editors satisfy esthetics by optionally snapping new
geometries to the nearest grid coordinate; it looks like 5 pixels. These
features belong to the form painters, not the underlying window systems.
Microsoft (and originally IBM) leveraged their ability to build and promote
form painting tools to programmers to bypass the need for good geometry
management in their core architectures.

Both those systems can use more sophisticated geometry management, based on
handling the WM_RESIZE event. A Windows Template Library dialog, for
example, can inherit CDialogResize to specify which controls stretch and
which move at resize time.

By contrast, "toolkit" style windowing systems use hierarchical layout, like
HTML. Each Tk widget supports .pack(), which is incomprehensible and should
be avoided, and .grid(), which behaves like an HTML <table> tag. One passes
to .grid() the row and column index to place a control, and any overlapping
or default justification. Tk adds up all grids to determine a virtual table,
and resizes it to fit all its inhabitants.

Qt's geometry management uses a hierarchy of widget ownership. When a
horizontal box owns widgets it stretches them out horizontally; a vertical
box stacks them vertically. These boxes can nest to form grids. (This is
what Tk's pack system was trying to do, but less intuitively.) Qt also
supports a "spacer", which is a little widget that behaves like a spring. It
pushes its sibling widgets apart within their box.

The OP is advised (based on the Subject line) to write unit tests that drive
all four of those GUIs, testing "inside" the code and not thru a screen
driver. Then merge the common behavior of those tests together into an
abstract base class, such that the same test suite must satisfy all four
GUIs. Pull the GUI-specific code down into concrete classes that help each
test case operate on its target GUI. Then ensure that all these "skins" pass
all these tests all the time.

If all four GUIs must lay out the same, despite different geometry managers,
the OP should of course write a few tests that ensure controls layed out
similarly. This effort is open-ended, so to completely constrain the
situation, the OP should configure unit tests to record screenshots of each
form in each GUI, and upload these to a Web server for rapid review.

-- 
  Phlip
  http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces


Relevant Pages

  • Re: Fitting the Page to Various Resolutions
    ... You can't "lock" font size with CSS. ... > Thomas A. Rowe (Microsoft MVP - FrontPage) ... >>> You can design for a fixed width layout, ...
    (microsoft.public.frontpage.client)
  • Re: Worst State Highway Signage?
    ... but the signage lacks consistency from ... one sign to the next in terms of layout and style. ... When you're used to seeing lots of CV signs in Texas set in CV 5WR and then see 6W signs in Oklahoma it does kind of make you feel like the legends have been distorted even if they haven't. ... the worst of the worst, with severe font distortion, wrong font ...
    (misc.transport.road)
  • Re: Too small!
    ... allowing arbitrary resize? ... You can change the default font in Preferences. ... After you have done that in one layout, ... How the hell did they program the dimension resizing that is so ...
    (comp.databases.filemaker)
  • Re: Is the end of HTML as we know it?
    ... I almost always increase the font size a step or two. ... The first one uses an awful table layout + some small bits of very bad CSS. ... The second one uses CSS with many non-semantic nested DIV whose only purpose is CSS styling. ... I tried for hours to find CSS selectors specifically identifying some parts of the site. ...
    (alt.html)
  • Re: Netbeans 5 GUI Editor -> errors
    ... diesem komischen neuen null layout dann geht es auch. ... ich baue öfter mal GUIs mit dem NetBeans ...
    (de.comp.lang.java)

Loading