Skip to content

chooser.gadget: pop-up list, label arrays, ReAction look - #1852

Open
terminills wants to merge 7 commits into
aros-development-team:masterfrom
terminills:reaction-2-chooser
Open

terminills wants to merge 7 commits into
aros-development-team:masterfrom
terminills:reaction-2-chooser

Conversation

@terminills

Copy link
Copy Markdown
Contributor

Depends on #1851 (its commits are included; review the last three).

  • pop-up list, CHOOSER_LabelArray, ShowChooser/HideChooser
  • hit-test from the input event (gpi_Mouse), GM_DOMAIN
  • ReAction look: raised frame, centred text, chevron glyph, pop-up by default

Built for pc-x86_64 and pc-i386; QEMU (x86_64): ClassAct's chooser example opens, the list pops up and a pick is reported.

The class headers name Class but did not include intuition/classes.h, so
a program including only <proto/chooser.h> (or the stubs below) failed to
compile; every class cdef now includes it.

chooser, clicktab, layout, listbrowser, radiobutton and speedbar declare
the varargs forms of their tag-list functions - AllocListBrowserNode(),
SetChooserNodeAttrs(), AllocSpeedButtonNode() and the rest - as their
AmigaOS clib headers do; the stubs are in libreaction.a.
libreaction.a gains what reaction.lib offers programs on AmigaOS:
ChooserLabels(A), ClickTabs(A), RadioButtons(A), BrowserNodes(A) and their
Free* functions build and free label lists through the classes' own
allocators; LBAddNode(A), LBEditNode(A) and LBRemNode() wrap the
listbrowser methods. Prototypes in <clib/reaction_lib_protos.h>.

The varargs forms of the class tag-list functions (19, declared in the
class headers) are implemented here as well.

ClassAct 2's example sources compiled against these: 17 of 30 build,
from 6; the rest use SAS/C register syntax or ClassAct-only tags.
Forty-one files defined DEBUG 1 and logged every method call to the
debug output.
reaction_labels.c and reaction_varargs.c include the protos of chooser,
clicktab, layout, listbrowser, radiobutton and speedbar, which are
generated by those classes. In a fresh build tree the link library could
be compiled first and failed with proto/chooser.h missing.
Clicking the chooser cycled to the next entry like a cycle gadget. It now
opens its list under the gadget: the entry under the pointer is
highlighted, releasing on an entry picks it, a plain click on the gadget
leaves the list open for the next click, and a click elsewhere or the
menu button closes it. Separators and disabled entries are drawn and
cannot be picked.

CHOOSER_LabelArray builds the class's own label list from a
NULL-terminated string array (it was accepted and ignored), freed when
replaced or on dispose; an open list is closed on dispose.

ShowChooser() opens the list at a position in the window and
HideChooser() closes it, completing the chooser.gadget function table
(version 45.3).
The list's hit-test read the screen's mouse position, which is not kept
current while the gadget holds the input; it now uses the event's own
coordinates, relative to the gadget. Pressing on the chooser, dragging
to an entry and releasing picks it (QEMU: ClassAct's chooserexample,
1200 -> 2400).

GM_DOMAIN reports the chooser's size - widest label plus the arrow box,
one text line high - so layouts no longer have to guess it.
A raised frame like a button, the entry centred left of the glyph box,
and the double chevron of a pop-up chooser (the down arrow stays for
CHOOSER_DropDown). Pop-up is the default mode, as in ReAction; the class
defaulted to drop-down.

Compared with ClassAct 2's own screenshots (NewYork's display
preferences) in QEMU with ClassAct's chooser example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant