[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

585.0. "Question about UIL coordinates" by IOSG::LOVELUCK (Dave) Wed Apr 12 1989 10:37

    If I specify the postion of a pushbutton in a UIL file, and I move a
    widget to the same coordinates using XtMoveWidget() the button
    appears in two different postions.  Can anyone explain what I am doing
    worng or failing to understand?
    
    I first of all defined several push bttons in a UI�!�9C=�(s9�sa73333331
    x, y, width and height  and then manage and realize everything. The buttons �
   were spaced out more than i e
ected and weren't quite where I expected them �I    to be. They should have been almost touching, bu
0 units�    apart. �    �M    From code I called 
tValue to look at their position  and the the values�J    returned were OK, but if I move the button
ith XtMoveWidget() to the�O    position I orignally specified it  puts it in a different physical po
reen and the screen looks as I had originally intended. Getvalue() �9    still returns the same val
 as if nothing had moved.�    �D    Is there some argument (such as spacing)in the UIL file, that b
    default spaces out the display, or am I just totally misunderstanding
    the way things work?
    
    dave
    
    
    
    
    
    
    
                                                

T.RTitleUserPersonal
Name
DateLines
585.1LDP::WEAVERLaboratory Data Products/ScienceWed Apr 12 1989 17:287
    UIL widget positioning is definitely non-intuitive, perhaps someone
    can explain?  I think it tends to be character (Latin1) relative
    when dealing with objects that handle text, but I am just guessing.
    Hopefully someone "in the know" will explain it better.
    
    						-Dave

585.2LEOVAX::TREGGIARIWed Apr 12 1989 21:5610
    The only "unexpected" thing about widget coordinates is that 
    positioning in Dialog boxes (and subclasses) is by default in
    font units, not pixels.
    
    An application should not call XtMoveWidget.  Only a widget's
    parent widget should be calling that.  An application should use
    XtSetValues of DwtNx and DwtNy.
    
    Leo

585.3.2 fixes it, but I'm still puzzledIOSG::LOVELUCKDaveMon Apr 17 1989 08:3522
    Re .2
    
    Thanks for the advice - I tried using XtSetValues and the positioning
    is consistent.
    
    I'm still a little puzzled by the behaviour however, and I would
    appreciate some explanation or a pointer to the right bit of
    documentation (I admit it, I haven't read *all* the manuals :-)).
    
    Am I right in understanding that the UIL definition and the result of
    XtSetvalue is to express the position in Font units but the XtMove uses
    pixels? If so then how come, I didn't get a different results back from
    XtGetValue after I moved it. Did XtGetValue start returning me values
    in the different units as well? Am I confusing the whole system by using
    XtMoveWidget in an inappropriate way?
    
    
    Cheerse
    
    Dave
    

585.4LEOVAX::TREGGIARIMon Apr 17 1989 09:0115
>    Did XtGetValue start returning me values
>    in the different units as well? 
    
    XtGetValues of XtNx and XtNy will always return pixel coordinates.
    To get the font unit coordinates of an item in a dialog box you
    need to call XtGetValues of DwtNfontX and DwtNfontY. 
    
>    Am I confusing the whole system by using
>    XtMoveWidget in an inappropriate way?
    
    Very likely...
    
    Leo
                                    

585.5How big are font units?NITMOI::WITHERSAnother Hallmark Moment. -Al BundyWed May 23 1990 15:0511
    RE: .4
    
    >    XtGetValues of XtNx and XtNy will always return pixel coordinates.
    >    To get the font unit coordinates of an item in a dialog box you
    >    need to call XtGetValues of DwtNfontX and DwtNfontY.
    
    For Latin1 character what does the "font unit coordinates" breakdown
    as?  Are they the size of the largest character?  smallest character?
    
    George
    
585.6Font-unitsLEOVAX::TREGGIARIWed May 23 1990 15:418
In the X direction, the value of the AVERAGE_WIDTH property / 35.
In the Y direction, the value of the POINT_SIZE property *
                    the value of the RESOLUTION_Y property / 5825.24

The odd divisors are the result of the algorithm changing after V1, but
attempting to get compatible values.

Leo