Curl classes which books do not yet mention

Having out-of-date books on Curl, the language, and no standard Class Browser leaves Curl5 users confined largely to the otherwise excellent Documentation Viewer with its live applets and their one-click file export.

But sometimes the useful bits are not immediately evident. One is this: the RecordGrid. You will find the demo applet on the page entitled

Controls at a Glance

which came up when I search for Dialog. One section of that page is called

DataControl

The View Code link is worth a click. What you see is this:

{RecordGrid
    height = 3cm,
    record-source =
        {RecordSet
            {RecordFields
                {RecordField
                    "First", caption = "First Name", domain = String
                },
                {RecordField
                    "Last", caption = "Last Name", domain = String
                },
                {RecordField "Age", domain = int}
            },
            {RecordData First = "John", Last = "Smith", Age = 25},
            {RecordData First = "Jane", Last = "Smith", Age = 29},
            {RecordData First = "Jane", Last = "Jones", Age = 28}
        }
}

This is not an HTML Table. This is a spreadsheet widget, as can be seen with a right-click. The resulting context menu has choices for sorts and filters in addition to commit and revert.

As a class, RecordGrid inherits from

SelectionContext
RecordSetDisplay
MultiUIControlFrame
RecordGridOptions
TestTabularData

RecordSetDisplay inherits from Visual and CommandContext. Becuase it inherits from Visual, options are available such as

{RecordGrid
    column-resizable? = true,
    height = 3cm,
...

What I would like to see is how these widgets resize on panels on a notebook widget.

In the VLE or Visual Layout Editor, the RecordGrid can be found on the Palette under Data Access. The properties include a name for a QuickTest and and a wide range of settings but none to indicate that height and width are not fixed at a Pt size.

But this is Curl, and the Elastic class underlies any Dimension (the class Elastic is in the same package as Dimension, that is,

CURL.UTIL.ELASTIC

But RecordGrid does not inherit from Grid (, but rather from Visual. A Visual object can be cloned, but can they all be made elastic? My usual approach is to find a word, in this case “Visual’, and then click the F1 key.

Now usually to get content to fill a container, some option such as hstretch? must have the value true. If I can get this sorted, I’ll post the answer right here.

Of course, now that I have seen the class browser, inspector and workspaces of the IDE for XOTcl, I will expect nothing less to evolve for any language as sensible as Tcl … or Curl.

Leave a Reply

You must be logged in to post a comment.