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

"clickable" objects in scrolling windows





Hi, i hope someone can help me with this problem:

I'm using allegro common lisp (version 1.3.2) and its interface to
QuickDraw routines to create selectable button objects and scrolling
text objects that can be placed upon a scrolling window. Although
allegro v. 1.3.1 had such objects, in this current version of allegro,
its old scrolling window will not accept "click-able" user interface
objects such as buttons and scrolling texts. Consequently, I've been
trying to invent my own classes of button, scrolled texts, and
scrolling windows that will all this behavior.  Thus far, I've
implemented 1) a scrolling window class (*esc-scrolling-window*) to
which one can add user interface, 2) a button class (*esc-button*) that
will call a callback upon detecting a click from the
window-event-handler, and 3) a scrolling text class
(*esc-scrolled-text*) that can perform a "display-only" function.
Although the implementation somewhat works, I've run into several
problems that I need help with:

1) the scroll bar thumb and arrow objects do not appear "selected" when 
	they are clicked upon, even though a click is actually registered 
	by the arrow or thumb object

2) the scrolled window (containing the button and text objects)
	does not redraw its contents when a change-value event is 
	registered by the window scrollbar thumb or the scroll-bar object

3) if a scrolled text object is placed on a scrolling window when the text
	object is completely visible, and both scroll bars for the scrolling
	window are at the very top left corner of the document window (the
	scroll bar values are equal to 0), the scrolling window event handler 
	does not catch events that occur on points within the scrolled text. 
	Instead, the text scroll bars are operable and trigger scrolled window 
	redraw events.
		(Please see diagram #1 below)
	If the scrolled window's scroll bar values are greater than about 14, 
	then the window event handler captures events that occur on points 
	within the scrolled text and the scrolled text's scroll bars are 
	inoperable.
	(see diagram #2 below)

Can anyone help me resolve these problems?

I can email the source code to any one who needs it.

Thanks in advance for the help!

Please send a reply via email to: boyd@devvax.jpl.nasa.gov

Bonnie L. Boyd


A: an instance of a special button object class (*esc-button*)
B: another instance of *esc-button*
C: an instance of the allegro common lisp's *scroller* class
D: an instance of a subclass of allegro common lisp's 
	*scrolling-window* (*esc-scrolling-window*)

	DIAGRAm #1
+-------------------------------------+----+
|                                     |****| <--- scroll bar thumb is
|                                     |****|	at very top of window
|  +-----+   +-----+                  |    |
|  |  A  |   |  B  |        D         |    |
|  |     |   |   <---------------------------- window click events are caught
|  +-----+   +-----+                  |    | in button objects with no
|                                     |    | problems
|  +------------------------+         |    |
|  |                     |^ |         |    |
|  |                     | <----------------------- events are captured
|  |                     |  |         |    |	on text scroll bar
|  |         C         <-------------------------- window click events not
|  |                     |  |         |    |       caught inside scrolling
|  |                     |V |         |    |	text region
|  +---------------------+--+         |    |
|  | <|               |> |**|         |    |
|  +------------------------+         |    |
|                                     |    |
|                           <----------------- window click events are
+-------------------------------------+----+  caught here with no problem
|                                     |    |
+-------------------------------------+----+

      DIAGRAM #2		               +--- click events NOT caught
+-------------------------------------+----+   | on text scroll bar anymore
|  |                     | <-------------------+
|  |          <-------------------------------- now, window click events
|  +---------------------+--+         |    | are caught here
|  | <|               |> |**|         |    |
|  +------------------------+         |****| <-- the scroll bar thumb
|                                     |****|	has been dragged towards
|                                     |    |    the bottom of scroll bar
+-------------------------------------+----+ 
|                                     |    |
+-------------------------------------+----+