CLIM mail archive

[Prev][Next][Index][Thread]

two clim questions



    Date: Thu, 25 Apr 1991 07:48 EDT
    From:     Rainer Koenig <king@fzi.uka.de>

	    Date: Wed, 24 Apr 1991 07:42 EDT
	    From:     Rainer Koenig <king@fzi.uka.de>
    
	    1. Question:
    
	    When I "present" a line (in CLIM) using presentation types and try
	    to "accept" it, all the functions work well.
    
	    But when I "present" a line in a scaled environment, the function 
	    "accept" seems to be pure chance.
	    I think that the origin of this problem lies in the projection of the
	    original coordinates to the scaled coordinates.
	    The functions in CLIM use the scaled coordinates (normally not integer
	    values, but coordinates like (12.34 | 7.75)), but when we use the mouse
	    we only get integer coordinates. So the congruency of mouse coordinates
	    and scaled coordinates is only given in some special cases (which happens 
	    when the scaled coordinates and the mouse coordinates are the same).
    
	    Therfore I wonder if I made a mistake or if, possibly, there is a bug in
	    CLIM.
    
	    (I tried this with CLIM of ILA and SYMBOLICS)
    
	Could you please forward a small test case?

    ;;;********************************************************************************
    (use-package '(clos clim common-lisp))

    ;;; part of the examples.lisp file of ILA

    ...

Ah ha.  The example you forward appears to be written in a dialect of CLIM
0.9.  The real CLIM 1.0 will be based on the Symbolics implementation of
CLIM, not CLIM 0.9.  Of course, someone at ILA should probably investigate
this to make sure that it works in the CLIM 2.0 stream (which currently
descends from CLIM 0.9, not from 1.0).

    To accept 

    - section1 fails.  The scaled Y-coordinate of that line is a real value.
    - section2 is possible, because the scaled Y-coordinate could be converted
      without rest to an integer value (the X-coordinate is in that example
      irrelevant - parallel to X-axis)
	      89.34 -> integer 89 rest 0.34 
	      88.0  -> integer 88 rest 0
    - section3 is possible, because the scaled X-coordinate could be converted
      without rest to an integer value (parallel to Y-axis)
    - section1 fails.  The scaled X-coordinate of that line is a real value.
    - section5 or section6 is possible at those points, where the X- and Y-coordinates
      could be converted without rest to integer values.
    ;;;********************************************************************************
    
	I also don't understand how it is that you have "Symbolics" CLIM.  Did you
	get it via Symbolics GmbH?  What version of Symbolics CLIM are you using
	(what does :Show Herald tell you)?

    The test was carried out on a symbolics using CLIM 15 distributed with CLOE
    
CLIM 15 is now ancient history.  This works properly in the real CLIM 1.0.

	    2. Question
    
	    I now want to draw a picture in a scrollable pane, which exceeds the 
	    boundaries. So I'm now looking for some functions/methods
    
	    - in order to get the coordinates of the visible part 
	    - which indicate us the cases when the scrollbar has been used.
    
    
	CLIM:WINDOW-VIEWPORT will return a rectangle object that corresponds to the
	visible region in the output history.  You can use WITH-BOUNDING-RECTANGLE*
	on WINDOW-VIEWPORT to get the four values corresponding to the left, top,
	right, and bottom coordinates of the viewport.
    
    Is there an appropriate function to CLIM:WINDOW-VIEWPORT in CLIM of ILA.
    I tried CLIM:PANE-VIEWPORT, but the returened values seem to be constant (independent
    from the visible part, CLIM:WINDOW-VIEWPORT is not available)

My guess is that you want CLIM:SHEET-REGION in CLIM 0.9.

	I have no idea what you mean by the second part of the question.  What is
	it you are trying to do?

    I draw a picture in a "first" pane, which exceeds the boundaries. In the "second" pane
    I want to draw the scaled picture and a rectangle, indicating the visible part of the
    "first" pane. Therefore I need the coordinates of the visible part and the method,
    which indicate us the scrolling of the "first" pane to adjust the "second" pane.
    
CLIM 1.0 uses the generic function WINDOW-SET-VIEWPORT-POSITION* in
order to scroll a window.  To do what you want, I wold create a new
window class that has an :AFTER method on WINDOW-SET-VIEWPORT-POSITION*
that notifies the other window that it needs to change.

You may be able to do the same trick with CLIM:SCROLL-EXTENT in CLIM 0.9,
although I am not sure.

0,,


Main Index | Thread Index