Lisp HUG Maillist Archive

rich-text on a pinboard?

I keep coming back to the question of whether I can use predefined pane types, 
e.g. rich-text-pane, on pinboard layouts.  I think I've asked a similar 
question before, so there must be something fundamental in my understanding 
about pinboards that is wrong or incomplete...

I have an app that displays a background and I want to scribble selection 
rectangles and text snippets over top of the background.

It would seem that pinboard layouts contain much of the mechanism I need for 
tracking x,y coords and hit-testing, etc.

Rich-text-pane has all of the editing facilities I want (i.e. "notepad" with 
various fonts).

A simple test (below) shows that I *can* draw a rich-text-pane on top of a 
pinboard layout.

The rich-text-pane, in this test, is not a pinboard object. (!?)

I don't see how to make the rich-text-pane into a pinboard-object.  Maybe it 
really doesn't matter, since I want to "pop up" the edit box at specific 
x,y's and then make it disappear when the edit is "done"?

I could continue to dig inside of pinboard layouts and figure out how to make 
the rtf pane appear and disappear, but, it would seem that there should be 
a "sanctioned" way of doing this - or - I shouldn't do it at all 'cause it 
ain't supported.

Am I heading in the right direction or am I heading for disaster?  


(capi:define-interface itest ()
    ()
  (:panes
   (rtpane
    capi:rich-text-pane
    :accessor rtpane
    :min-height 100
    :min-width 100
    :x 100
    :y 100))
  (:layouts
   (one
    capi:pinboard-layout
    '(rtpane)
    :accessor one))
  (:default-initargs
   :best-height 500
   :best-width 500))

(defun test ()
  (let ((it (make-instance 'itest)))
    (capi:display it)))


thanx
pt


Re: rich-text on a pinboard?

Paul Tarvydas wrote on Fri, 18 Jan 2008 16:24:09 -0500 00:24:

| I keep coming back to the question of whether I can use predefined pane
| types, e.g. rich-text-pane, on pinboard layouts.  I think I've asked a
| similar question before, so there must be something fundamental in my
| understanding about pinboards that is wrong or incomplete...
|
| I have an app that displays a background and I want to scribble
| selection rectangles and text snippets over top of the background.

I cannot say for the rich-text-pane but the editor-pane works quite well for
me (see http://lisp.ystok.ru/ygrid/).

| The rich-text-pane, in this test, is not a pinboard object. (!?)
|
| I don't see how to make the rich-text-pane into a pinboard-object.

Including panes of other types into a pinboard-layout is no problem.

| Maybe it really doesn't matter, since I want to "pop up" the edit box
| at specific x,y's and then make it disappear when the edit is "done"?

I would suggest going this way. You can hide (almost) every pane via capi:hide-pane.

In YGrid, I actually create only one "editing pane" per pinboard. Though,
the editor-pane seems to provide more benefit over the rich-text-pane: it
accepts additional keyboard gestures, which are useful, for example, to move
the current cell.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Updated at: 2020-12-10 08:44 UTC