Lisp HUG Maillist Archive

Q: capi:form-layout with mnemonics possible?

Hello Lispworkers,

Assume the following layout wanted with the text input panes adjusted by
their left and accelerator letters underscored within the titles:
    Mnemonic title 1:    Text-input-1
    Mnemonic title 2:    Text-input-2

I can approach this by means of two ways:
(1) By a column layout around the panes like this:
    (text-input-pane-1 capi:text-input-pane
      :mnemonic-title "&Mnemonic title 1")
    (text-input-pane-2 capi:text-input-pane
      :mnemonic-title "M&nemonic title 1")

The drawback here is the apparent absence of adjusting - I have to adjust
manually by adding spaces to the titles or the like.

(2) By a grid layout with two columns, the titles in the first and the text
inputs in the second, and
    :x-adjust '(:left :left)

The drawback here is the total lack of accelerators. Though defining titles
as capi::mnemonic-title-pane displays underscores:
    (title-1 capi::mnemonic-title-pane
        :text "Mnemonic title 1" :mnemonic 0),
the accelerators do not work.

The deprecated capi:form-layout is unlikely to help.

In (1), coupling the panes and titles is implemented internally via
undocumented titler and decoration objects. Any takers about how to achieve
a similar functionality in the grid-layout?
--
Sincerely,
Dmitri Ivanov
www.ystok.ru





Re: Q: capi:form-layout with mnemonics possible?

Unable to parse email body. Email id is 1437

Re: Q: capi:form-layout with mnemonics possible?

Hello David,

| This is the best we can do at the moment, it looks OK, though it
| doesn't resize nicely:
| 
| (capi:define-interface dmitri () 
|   ()
|   (:panes
|    (text-input-pane-1 capi:text-input-pane
|                       :mnemonic-title "&Mnemonic title 1"
|                       :title-args '(:visible-max-width nil) ; Allow the
| title to stretch.
|         :visible-min-width '(character 40)   ; Fix the text-input-pane
|                     :visible-max-width t             ;  size at 40 chars.
|                       )   
|    (text-input-pane-2 capi:text-input-pane
|                       :mnemonic-title "M&nemonic title 2"
|                       :title-args '(:visible-max-width nil)
|                       :visible-min-width '(character 40) 
|                       :visible-max-width t
|                       ))
|   (:layouts
|    (main 
|     capi:column-layout
|     '(text-input-pane-1 text-input-pane-2))))

I see, thanks.
 
| We are going to investigate making CAPI:GRID-LAYOUT support what you
| need.

It would be really nice.
--
Sincerely,
Dmitri Ivanov
www.ystok.ru


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