on panel design - auto layout? 
Author Message
 on panel design - auto layout?

Panel Design. (mostly J related)

While certain ergonomic needs should be met in all screen designs,
there are also a lot of personal choices as to approach and details.
Not all implementations support the approaches one might wish to

For example, "in context help" for data entry can be desirable, but easy
implementation needs an "on focus" event associated with a field (control)
to allow display of the help mesage in the context of the active field.

At least the elementary validation as to whether and entry is usable
as a number or a date benefits from instant action, which needs a
"lost focus" event for the field.  Some would argue that validation of
an entry of a "Part ID" or "Customer ID" should also be done instantly,
and not reserved for the data base update.

In transactions involving several panels of forms for header, detail,
address, description, ...  reading the data off the panels for storage
is likely driven by a control button on yet another panel.  The simple
mechanism which temporarily loads a global? variable is then unusable,
and the more complex wd 'psel formaname" with a wd 'qd' and extract of
the results is required for each panel.  A mechanism to automatically
relate or match the form data with variable names, globally, would simplify
the operation, even if the "name" has to be forname_controlname for each one.

Building one simple panel is not the issue in a business context.  The problem
is the hundreds of panels ultimately required, many having the same data yet
with no mechanism to ensure common attributes nor names.  When other factors
dictate a change to a field type, size, or label name, the fun starts.  What
is needed is a means to lay out a form dynamically based on field attributes
retained in a data dictionary.  Labels have a certain size, so do fields.  If
a multi-layered printed circuit board can be layed out automatically by comnputer
why are we still specifying every x y w and h coordinate for a label, button and
field? Some simple rules and minimal meta data would allow a program to do it 98%
of the time.

As an example of an automatic button layout, one has J3 code below.  
It provides a horizontal or vertical layout of buttons on their own form.  
In addition it renames the formname_buttonname_button =: buttonname
Unfortunately, the vertical layut form size seems to be constrained larger
than needed by windows.  A similar, if more complex verb can lay out a form
for fielded data capture or display.

calcBxywh =: 3 : 0  NB. rev 1
NB. lays out button positions and text to rename actions
NB. x. is 1 for vertical, 0 for horizontal layout
bx =. 2 [. by =. 2  NB. change if used within another form
n =. > {. y.  [.  l =. }. y. =. ;: y.    NB. name and labels
w =. 4 + 4* >./; # each l  [.  h =. 10
x =. ,. bx + (2+w) * (-.x.)*i. #l
y =. ,. by + (2+h) * x.* i. #l
xywh =. 'xywh ',"1 ": x,"1 y,"1  w,h
t =.  (xywh  ,"1 ' ;cc '),"1 (> l) ,"1 ' button;'  
tt =. >  (< n,'_')  ,each l ,each  (< '_button =: ') ,each l
t ; tt  NB. returns text for wd and do to reset event names

test =: 3 : 0
'wd' =. x. calcBxywh y.
wd 'pc ',(t =. > {. ;: y.)  ,' closeok nomax '
wd ; w   NB. creates buttons
wd 'pas 2 2;  pshow;'
do d   NB. sets button responses to simple names

Exit =: 3 : 0 NB. one sample handler
wd 'reset;'
NB. 2!:55 0

NB. use this to test, first name is form name, rest are buttons.

0 test 'Do View Add Update Delete First Prior Next Last Clear Save Unsave Exit'

NB. paste it to a new .js window and run it.
NB. to see the output of calcBxywh do
NB. 0 calcBxywh 'Do View Add Update Delete First Prior Next Last Clear Save Unsave Exit'

Mon, 28 Sep 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. front panel layout changes when moved to computer with lcd screen

2. front panel layout changes when moved to computer with lcd screen

3. End-User Print Layout Design Tools?

4. flatten in design compiler and layout tools.

5. help designing record layout

6. Panel Design


8. Can I use ActiveX to embed a front-panel inside another front-panel

9. Auto resize of the front panel objects screws up tab controls ... BUG!?

10. Design Patterns for HW design ?

11. Jobs, Denver/Boulder Colorado, ASIC Design, Board Design Engineers

12. Digital Design/ASIC Design @ Sun Mass


Powered by phpBB® Forum Software