revUp - Updates and news for the LiveCode community
Issue 108 | April 21st 2011 Contact the Editor | How to Contribute

DataGrid Helper
Or, How I Stopped Tearing My Hair Out

By Zyrip the Slug

Introduction
A long time ago, my first experience learning a development language was reading the HyperTalk 1.2 book. I remember literally devouring it in a few hours. The same thing happened when I bought HyperCard 2.2 some years later. All the readings were done in an afternoon.

After many books, several languages and discovering LiveCode later, my opinion is that when reading development environment documentation, you can discern four different types of commands, functions or concepts.

Measuring Development Concepts Learning Difficulty
Classifying a concept in the four levels, below, depends on your opinion and your experience with the concepts. Your Mileage May Vary.

  1. Some you immediately understand. It's obvious. You see in your mind what you could do with the concepts. A possible example might be the LiveCode answer or ask dialogs.
  2. This might have you saying: Hey wait a minute, this is amazing! You'll try the command immediately. A possible example might be the case of the mouseColor function. You immediately see in your mind the picker of any great tool such as a Photoshop, Fireworks or GraphicConverter. You just create a button and a graphic, then experiment with the mouseColor function and keep it in a lab stack with the idea of reuse in one of your future projects.
  3. With this type of concept, you understand partially or completely on first sight, but with time and experience, you'll learn that they are much more powerful or complex than you first thought.
  4. Last, you have no idea how it works, what parameters are or should be passed, etc. You look at it blankly, and move along to the next concept.

The more concepts of type one and two any given development environment contains, the more intuitive you will find the language. If a development tool contains many concepts in category three and especially four, it will appear more abstract and difficult to learn.

Experience and experimentation will progressively move the concepts of your level three and four understanding to level one or two.

First Tool Contact: Interface Objects
Long before you read the language documentation and learn the development tool concepts, the first step in using a development tool is to play with the available objects: Drop some buttons and fields in a window, try to change their parameters (text style, dimensions, etc).
Building an attractive and intuitive interface requires exploring and experimenting with the properties available for the object. Sometimes you know what you have to do, but have difficulties to mentally represent it. By simply playing with some object's properties then combining them together, you can build an amazing interface you never thought possible.

So far, so good. LiveCode is pretty intuitive... but...

What Is The DataGrid Object Level?
The DataGrid object might not be immediately understandable, because:

  • Abstract concepts are used such as parent scripts, arrays, templates and groups.
  • You don't have the object in hand. All properties are not in the Properties Inspector, and you have to read the documentation about the missing properties, then type the required commands in the message box
  • Customizing the template has no immediate visible effects if your DataGrid data area is empty
  • Trying your custom template has no effect until you have customized the corresponding script
  • Dealing with data or objects in the DataGrid requires that you learn its special syntax.

Depending on your LiveCode familiarity, you will probably classify the DataGrid concepts as being at level three or four. If you are a total LiveCode newbie, you will probably start at level four. If you have already dealt with DataGrids in other languages, you'll probably start at level three or four but with the feeling you will ultimately be faced with a level two (Amazing Object) concept.

Why Was Data Grid Helper Developed?
The purpose of Data Grid Helper (DGH) is to give immediate, visible and concrete answers to all the possibilities of the DataGrid objects without having to read the documentation. We can consider that the goal of DGH is to provide an intuitive level (one or two) concept of the DataGrid object and it's Application Programming Interface (API) for all users, from LiveCode newbies to experienced developers.

This is possible by using the several areas, which comprise the DGH plug-in. We will explore these DataGrid areas, in future articles:

  • The DGH properties palette provides parameters for all the available DataGrid properties. You can immediately experiment with them without knowing about the required syntax. You can, for example, change the color of the header, add a color gradient to the header, etc.

 


  • DGH Script Installer brings to life concepts you have already encountered in numerous applications: reorders lines, reorder columns, fit the column to it's content by a double click on the header separator, etc. The script installer of DGH contains scripts you could write yourself, if you had more familiarity with the object.

 


  • The DGH template area provides an intuitive interface to deal with a template for a DataGrid Table or DataGrid Form
  • Script Builder creates a ready to use script for the Column script (DataGrid Table) or Form script (DataGrid Form). The script builder adds all the necessary handlers: Fillindata, LayoutControl, etc.
  • DataGrid Preview provides visualization while trying out the changes done in the Column content, the Form content and their scripts. In this preview, you can experiment with the result of your modification(s) by typing text, clicking a button, checking / unchecking a checkbox, etc.
  • DataGrid Preview also provides: Visually creating columns, reordering them by a simple drag & drop, modifying the properties of the selected column, etc.

 


  • Behavior Picker provides changing how the DataGrid Header or the DataGrid Columns will respond to user actions.

 

  • The DataGrid iOS topic helps building DataGrids for iOS device(s). Scroll the DataGrid content (only available for DataGrids Forms), edit a cell, store the data of the DataGrid in the device.
  • Mimetism allows the replication in a fresh DataGrid, of the properties and the content (template) of any existing DataGrid
  • Special DGH's Column Properties, helps setting alternating Column Colors.

  •  Column Selection script helps with the selection of a column in a DataGrid.

 

I look forward to bringing you more information on all these topics in future articles! You can learn more about Data Grid Helper, download a free trial, and purchase it via the online store.

zyrip

About the Author

Zyrip is a long time xTalk user. By day, he is a developer in a small firm creating applications or websites for clients in languages such as Visual Basic, VB.Net, PHP and Fourth Dimension. By night, he develops with LiveCode, his favorite development environment.

 

Main Menu

What's New

sanjose