Home

AreaList Pro User Manual - e-Node

image

Contents

1. This is performed by a call to AL_SetEventCallback which instructs AreaList Pro to call the EventCallBack project method instead of sending the On Plug in Area event to the object method and form method The area s object method is now only used for the On Load phase Case of Form event On Load initialize the Arealist Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 1 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRow Opts cList 1 1 0 0 set multirrows mode and allow no selection parameters AL_SetEntryOpts eList 3 0 0 set double click to enter data entry mode AL_SetCallbacks eList EntryCallback ExitCallback set callback project methods errorcode AL_SetEventCallback eList EventCallBack 3 set event callback 3 do not execute object method and form method DEMO_DefauIt eList vitem End case The callback method code updates the vitem variable by making use of AL_GetSelect Note that this method makes use of the two first parameters that AreaList Pro passes to it the AreaList Pro area reference and the event which triggered the callback method execution The method also uses AreaList Pro s built in constants Project method
2. turn on enhanced Arrow key support Scrolling 25 The AreaList Pro User Interface Selection The user can create a selection in an AreaList Pro area in one of several ways single row multiple rows single cell and multiple cells In single row selection clicking a row will select that row and only one row can be selected at a time In multi rows mode the user can select multiple rows by dragging shift clicking continuous selection or ctrl command clicking discontinuous selection In single cell mode clicking a cell will select only that cell not the entire row In multiple cells mode the user can select none one or several cells The effect of any of these methods on already selected rows or cells will be the same the rows or cells will be deselected The Edit menu Select All command will select all rows when the multi rows selection option has been enabled or select all cells when the multiple cells selection option has been enabled Copy to Clipboard and Edit Menu Rows selected in an AreaList Pro object can be copied to the clipboard via the Edit menu Copy command Because of the limitations of the System clipboard when a selection of rows are copied to the clipboard pictures will not be copied a blank field will appear on the clipboard where the picture would have been Copying rows to the clipboard will not be allowed when displaying fields The Copy menu item will be disabled when fields are displayed
3. scrollAreaSize integer Size of area that will activate scrolling multiRowDrag integer Enable multiple rows dragging dragOntoRow integer Drag rows onto or between rows AL_SetDrgOpts is used to set various options to be used with dragging Call this command before a drag dragRowWithOptKey 0 or 1 0 the user can drag a row by clicking on it without holding down the option alt key default 1 the user can drag a row by clicking on it while holding down the option alt key AL_SetDrgDst AL_SetDrgOpts 193 Dragging Commands scrollAreaSize 0 to 30 This is the number of pixels outside of the destination area rectangle that will cause scrolling when the cursor is over it see the illustration below If scrollAreaSize is 0 then no scrolling will occur The default is 30 Source Destination First Last Dave Carlick Rich Gross 7 Anderson Ed Cheffetz S Arora Daniel Cheifetz Bailey Doug Clapp Sharon Jones Don Clark Rick Barron Raines Cohen i Chris Colburn Coldrick Bill Coldrick Battat Debi Coleman Becker Bud Colligan rel Berkin Rick Coombs 4 5 Bobker Lou Gehrig M Bogas THE SCROLLAREASIZE IS CALCULATED FROM THIS DESTINATION AREA RECTANGLE WHEN RECEIVING A DRAG INTO A ROW multiRowDrag 1 enable multiple rows dragging 0 disable multiple rows dragging default With multiple rows dragging the arrays or records will not be automatically updated even if the source and destinatio
4. AL_SetHeaders is used to specify the value to display in the header for each column Up to fifteen headers can be set at a time The size of the header value is used by the automatic column sizing algorithm If you are displaying a fixed string array with an element size of 2 characters the column will be very narrow unless you specify a header which contains several characters For example states are usually stored in a database as a two character alpha and you would probably display them directly or load them into a string array sized for two characters length But if you specify a header of State the column will be sized about two and a half times wider AL_UpdateArrays AL_SetHeaders 68 Configuring AreaList Pro Using Commands If the header length is less than the values being displayed in the column then the header length will not affect the column width A B C etc will be displayed in the headers if AL_SetHeaders is not used The AL_SetHeaders command can be used in the On load phase or in another phase form event Examples error AL_SetArraysNam cList 1 4 aFN alN aCity aState AL_SetHeaders cList 1 4 First Name Last Name City State error AL_SetArraysNam cList 2 aFN alN AL_SetHeaders cList 1 2 Field name People FirstName Field name People LastName AreaList Pro provides the ability to display icons in AreaList Pro headers See Header Cell Icon Support for informa
5. Adding or Deleting Rows from a Form Button Redrawing the Display from the Callback Method 170 Enterability Exiting Data Entry Entry mode can be terminated procedurally by using AL _ExitCell Commands AL_SetEnterable areaRef L columNumber 1 enterability 1 popupArray X menuPackRef L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column to apply enterability enterability integer Enterability mode popupArray array 4D array to display in popup menu menuPackRef longint Reference to a MenuPack menu AL_SetEnterable is used to set the enterability of a column columnNumber This parameter specifies what column to act on If columnNumber is 0 then all columns will be affected enterability This parameter specifies the methods of enterability for columnNumber Value Description 0 Not enterable Enterable using typed characters only default Enterable using popup menu only Enterable using both typed characters and popup menu Enterable using popup menu only no meta characters Enterable using both typed characters and popup menu no meta characters OI EIAI A You can use enterability 4 or 5 to control meta charaters for a given column If you wish to define the meta character functions globally use the routine AL_Setlnterface metaOption parameter When using the enterability values 4 and 5
6. Desired list foreground green component in RGB color pattern listForeBlue Desired list foreground blue component in RGB color pattern AL_SetForeColor AL_SetForeRGBColor 109 Configuring AreaList Pro Using Commands ftrForeRed Desired footer foreground red component in RGB color pattern ftrForeGreen Desired footer foreground green component in RGB color pattern ftrForeBlue Desired footer foreground blue component in RGB color pattern The following example will tell AreaList Pro to draw the third column using a color scheme standard for OSX AL_SetForeRGBColor cList 3 237 254 243 237 254 243 237 254 243 AL SetBackColor areaRef L columnNumber 1 alpHdrBackColor S 4dHdrBackColor 1 alpListBackColor S AdListBackColor alpFtrBackColor S 4dFtrBackColor Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column number alpHdrBackColor string Header background color from Arealist Pro s palette AdHdrBackColor integer Header background color from 4D s palette alpListBackColor string List background color from Arealist Pro s palette AdListBackColor integer List background color from 4D s palette alpFtrBackColor string Footer background color from Arealist Pro s palette AdFtrBackColor integer Footer background color from 4D s palette AL_SetBackColor is used to specify the background colors for a column
7. Green for column header foreground 13th color from 4D s palette for column foreground 4th column 7th color from 4D s palette for footer foreground AL_SetForeColor clist 4 Green 0 13 7 AL SetForeRGBColor areaRef L columnNumber L hdrForeRed L hdrForeGreen L hdrForeBlue L listForeRed L listForeGreen L listForeBlue L ftrForeRed L ftrForeGreen L ftrForeBlue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber longint Column number hdrForeRed longint Header foreground red hdrForeGreen longint Header foreground green hdrForeBlue longint Header foreground blue listForeRed longint List foreground red listForeGreen longint List foreground green gt listForeBlue longint List foreground blue ftrForeRed longint Footer foreground red ftrForeGreen longint Footer foreground green ftrForeBlue longint Footer foreground blue AL_SetForeRGBColor is used to specify the foreground colors for a column header a list area column and a column footer using the RGB values This routine is similar to AL_SetForeColor hdrForeRed Desired header foreground red component in RGB color pattern hdrForeGreen Desired header foreground green component in RGB color pattern hdrForeBlue Desired header foreground blue component in RGB color pattern listForeRed Desired list foreground red component in RGB color pattern listForeGreen
8. gt blueDarkColor integer Blue dark color clearAllBorders integer Clear all borders within the frame AL_SetCellFrame draws a frame around a range of cells It uses RGB colors light color for both left and top lines dark color for both right and bottom line The range of cells from firstCellCol firstCellRow to lastCellCol lastCellRow will be set offset Offset from cell boundaries in pixels 0 if the frame should be drawn at cell boundaries default width Width of line Although this parameter is a real value only integer widths will be drawn Future versions may allow fractional widths redLightColor greenLightColor blueLightColor RGB components used for both left and top lines colors redDarkColor greenDarkColor blueDarkColor RGB components used for both right and bottom lines colors clearAllBorders It this parameter value is 1 then all cells inside the frame will have their borders removed AL_SetCellFrame 115 Configuring AreaList Pro Using Commands AL SetRGBDividers areaRef L colDividerPattern S colDividerRed L colDividerGreen L colDividerBlue L rowDividerPattern S rowDividerRed L rowDividerGreen L rowDividerBlue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt colDividerPattern string Column divider pattern string colDividerRed longint Column divider Red colDividerGreen longint Column divider Green
9. AL_SetAltRowClr performs the same action as AL_SetAltRowColor except it uses the standard AreaList Pro color formatting parameters as routines such as AL_SetRowColor AreaList Pro has its own palette with the following colors white black blue green yellow magenta red cyan gray light gray alpRowBackColor Name of the color in AreaList Pro s palette This will be the alternate row background color If the name is not in AreaList Pro s palette or it is the empty string then AdRowBackColor will be used AdRowBackColor 1 to 256 Alternate row background color from 4D s palette options Additionally formatting options bitwise operator 1 display alternate background color in odd rows 2 display alternate background color in even rows AL_SetAltRowColor AL_SetAltRowClr 121 Configuring AreaList Pro Using Commands AL SetCellStyle areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X styleNum fontName S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt firstCellCol integer First cell column firstCellRow longint First cell row gt lastCellCol integer Last cell column lastCellRow longint Last cell row gt cellArray two dimensional longint array Discontiguous cells styleNum integer Style of the font fontName string Name of the font AL_SetCellStyle is used to set the font and or styl
10. AreaList Pro is fully compatible with 4D 4D Server 2004 or greater including 4D v11 SQL and 4D v12 It is compatible with MacOS and Windows clients Technical Support Technical support for AreaList Pro will be provided electronically via e mail or our online support reporting system You are encouraged to use the online web reporting form as it will be correctly routed to the appropriate support personnel www e node net Compatibility Information Technical Support 13 About AreaList Pro Registration AreaList Pro requires a registration key to unlock the product making it a full working version Call the AL_Register command see AL_Register for complete details in the On Startup method Without the registration key AreaList Pro will operate in demonstration mode during 20 minutes Version 8 3 introduced a new license design Previous licenses will not work with this release In order to activate AreaList Pro 8 3 and above you need to require a new license key from e Node License types Like all e Node plug ins AreaList Pro offers six different license types There are no such things as MacOS vs Windows or Development vs Deployment Single user license This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Standalone or Runtime Since the registration key is linked to a specific 4D license you need to provide the number returned by the 4D command GET SERIAL INFORMAT
11. In addition AL_SetEditMenuCallback will install a callback method which will be called when any Edit menu action occurs See Using the Callback Methods Drag and Drop The drag and drop feature of AreaList Pro allows the user to drag a row or column in an AreaList Pro object to a different position within that same area This feature may also be used to drag a row or column to a different AreaList Pro object to a CalendarSet object or to an AL_DropArea see Drop Area on the same layout or a different layout To Drag a Row AreaList Pro allows row dragging to be initiated by either option alt clicking on a row and dragging it or by just dragging the row depending on how AreaList Pro is configured When the row is clicked on and dragged it will move freely with the pointer If the row is not accepted by the destination object a rectangle will zoom back to the origin of the drag Selection Copy to Clipboard and Edit Menu Drag and Drop 26 The AreaList Pro User Interface The user selects multiple rows by ctrl command clicking or shift clicking If the dragRowWithOptKey option of AL_SetDrgOpts is set to 1 then the user can also select multiple rows by dragging Once the row s are selected the user may click or option alt click to drag them An outline of the row s will follow the pointer cursor location until the mouse is released You can also specify row dragging to insert between rows or drag onto rows To Drag a
12. allowColumnLock integer hideLastColumns integer displayPixelWidth integer dragColumn integer acceptDrag integer Description Reference of AreaList Pro object on layout User resizable columns Automatically resize columns when events occur in the area Allow user to lock columns Number of columns from the right to hide Display column widths Drag a column to this or another object Accept drag from another AreaList Pro object AL_GetColOpts will return the current settings configured using AL_SetColOpts For complete details about return values please see the AL_SetColOpts routine for possible configuration settings AL SetCellOpts areaRef L cellSelection moveWithData optimization Parameter Type areaRef longint gt cellSelection integer moveWithData integer optimization integer Description Reference of AreaList Pro object on layout Cell selection mode Move cell attributes with data Optimize cell attribute allocation AL_SetCellOpts is used to set options specific to cells cellSelection 0 row selection is enabled according to the multiRows option of AL_SetRowOpts default 1 only one cell at a time may be selected single cell selection 2 several cells may be selected contiguous or discontiguous multiple cells selection 3 row selection is enabled according to the multiRows option of AL_SetRowOpts and the multiple rows keyboard scrolling is active as de
13. colDividerBlue longint Column divider Blue rowDividerPattern string Row divider pattern string rowDividerRed longint Row divider Red rowDividerGreen longint Row divider Green rowDividerBlue longint Row divider Blue AL_SetRGBDividers functions the same as the AL_SetDividers routine except that the column and row divider colors use standard RGB values If neither AL_SetDividers nor AL_SetRGBDividers are called then no column or row dividers will be displayed colDividerPattern String name of the pattern for the column divider If a null string is used then no column divider will be displayed colDividerRed Column divider RGB red component colDividerGreen Column divider RGB green component colDividerBlue Column divider RGB blue component rowDividerPattern String name of the pattern for the row divider If a null string is used then no row divider will be displayed rowDividerRed Row divider RGB red component rowDividerGreen Row divider RGB green component rowDividerBlue Row divider RGB blue component The following example will set the column row dividers using the AL_SetRGBDividers routine Display column and row dividers in a gray pattern AL_SetRGBDividers cList Gray 209 209 209 Gray 209 209 209 AL_SetRGBDividers 116 Configuring AreaList Pro Using Commands AL SetRowStyle areaRef L rowNumber L styleNum 1 fontName S Param
14. user dragged a column AL_GetDrgSrcCol 1 vCol now do something useful End case AL_GetDrgSrcCol 196 Dragging Commands AL_GetDrgArea areaRef L destArea L destProcessID 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout destArea longint ID of the area the item was dragged to destProcessID integer Process ID of the destArea Use AL_GetDrgArea to determine the destination area of the last drag The areaRef parameter should be the source sender area of a drag This command is called from the source area s object or form method or event callback when an event code of 5 7 or 8 user dragged a row column or cell is returned to the callback method or by AL_GetLastEvent command formerly ALProEvt variable See Determining the Users Action on an AreaList Pro Object destArea This parameter is the area reference of the area that is the destination of the drag destProcessID This parameter contains the Process ID in which the window and destination area reside Use the 4D command CALL PROCESS and the form event On Outside call for interprocess communication If the destProcess D is different from the current process you will need to use the 4D command CALL PROCESS and the form event On Outside call to communicate to the window that contains the destination area Example Event callback method C_LONGINT 0 object method and form method will not
15. 5 row 5 aCellSelect 1 4 2 column 2 aCellSelect 2 4 6 row 6 AL_SetCellSel eList 0 0 0 0 aCellSelect select the cells in aCellSelect AL_GetCellSel is used to get the cell selection AL Set ele 120 Configuring AreaList Pro Using Commands AL_SetSort areaRef L column1 1 columnN 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout column columnN integer Column s to perform sort upon AL_SetSort is used to perform a multi level sort column These parameters specify the columns to use for the sort criteria A column greater than 0 causes an ascending sort to be performed upon that column while a column less than 0 causes a descending sort to be performed upon that column The arrow indicator will be up or down accordingly for the column If a column is 0 or it is a picture array or field or it contains a field from a related one table then all subsequent columns will be ignored If the first column has a value other than 0 then the sort indicator will be displayed in its header accordingly If the first column has a value of 0 then AreaList Pro will not sort the columns and no sort indicator wil be displayed If the first two column parameters have the same value then AreaList Pro will not sort the columns but the sort indicator will be displayed in its header accordingly for the first column You can determine what columns a user has sorted u
16. You can also set and get the scroll position procedurally Selection Use AL_SetEntryOpts to set the method of selection and data entry You have extensive control over how the user interacts with a list a mouse click can select a row or place the cursor into the cell for data entry You can also configure the modifier keys ctrl command shift option alt and control to control the selection behavior Please read the section Enterability You can configure an AreaList Pro object for no cell selection single cell selection only or multiple cell selection using the cellSelection parameter of AL_SetCellOpts If you select not to allow cell selection then the multiRows parameter of AL SetRowOpts is used to determine the type of row selection single row only or multiple rows Sorting Scrolling Selection 52 Configuring AreaList Pro Using Commands In single row mode the default configuration requires that one row always be selected This can be overridden using the allowNoSelection option in AL_SetRowOpts which enables the user to ctrl command click to deselect the selected row leaving no rows selected AL_SetRowOpts is also used to configure AreaList Pro for single or multiple rows selection mode You can set the selected rows using AL SetLine if in single row mode or AL_SetSelect if in multiple rows selection mode AL_GetClickedRow returns the last row that was clicked and AL_GetLine returns the currently selected r
17. borderBottom 1 offset width F redColor greenColor blueColor AL _SetCellColor areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X alpForeColor S 4dForeColor 1 alpBackColor S 4dBackColor AL _SetCellEnter areaRef L firstCellCol 1 firstCellRow L lastCellCol lastCellRow L cellArray X enterability 1 AL SetCellFrame areaRef L firstCellCol l firstCellRow L lastCellCol 1 lastCellRow L offset l width F redLightColor 1 greenLightColor 1 blueLightColor redDarkColor greenDarkColor blueDarkColor clearAllBorders AL_SetCellHigh areaRef L startPosition 1 endPosition 1 AL_SetCelllcon areaRef L cellColumn 1 cellRow L pictRef P iconAlignment horPosition vertPosition offset 1 scaling 1 AL_SetCellOpts areaRef L cellSelection moveWithData optimization 1 AL SetCellRGBColor areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X cellForeRed L cellForeGreen L cellForeBlue L cellBackRed L cellBackGreen L cellBackBlue L AL _SetCellSel areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X AL_SetCellStyle areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X styleNum 1 fontName S AL SetCellText areaRef L text T flag L AL SetCellValue areaRef L row L column 1 alphaNumericData S pictData P AL_SetColLock areaRef L columns 1 AL_SetColOpt
18. last clicked column C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C_STRING 255 7 tip string C STRING 255 8 area name C_LONGINT vRow Case of 2 5 user dragged a row AL_GetDrgSrcRow 1 vRow now do something useful End case AL_GetDrgSrcRow 195 Dragging Commands AL_GetDrgSrcCol areaRef L sourceCol Parameter Type Description areaRef longint Reference of AreaList Pro object on layout 4 sourceRow integer Column that was dragged Use AL_GetDrgSrcCol to determine which column or cell was dragged after a drag has completed The areaRef parameter should be the source sender area of a drag This command is called from the source area s object method when an event code of 7 user dragged column or 8 user dragged cell is returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable See Determining the User s Action on an AreaList Pro Object sourceCol This parameter returns the column that was dragged Example Event callback method C_LONGINT 0 object method and form method will not be executed if 0 C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4 column last clicked column C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C_STRING 255 7 tip string C STRING 255 8 area name C_LONGINT vCol Case of 2 7
19. 8 area name C_LONGINT vSortCol vCol 1 vCol2 vCol3 vCol4 vCol5 Case of 2 1 user clicked a sort button AL_GetSort 1 vSortCol get the sorted column End case Sorted AL_ShowSortEd 1 display AreaList Pro Sort Editor If Sorted 1 AL_GetSort 1 vCol1 vCol2 vCol3 vCol4 vCol5 get the sort order do something here AL_SetScroll 1 1 Abs vCol1 scroll to the sorted column End if AL_GetSort 208 User Action Commands AL GetSortedCols areaRef L sortList X gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout lt sortList longint array Column order list resultCode longint Result code AL_GetSortedCols returns the current sort column numbers displayed in the Sort Editor You should use this routine after displaying the AreaList Pro Sort Editor By default the Sort Editor will always use what the user has selected in the sort column and previous Sort Editor actions unless you override the column list procedurally using AL_SetSortedCols sortList A valid AN Dimension array longint which will receive the list of sort columns as displayed in the AreaList Pro Sort Editor if the selected column was sorted in ascending order the returned value will be positive if the selected column was in descending order the returned value will be negative The following example will retrieve the Sort Editor column list ret AL_ShowSortEd c
20. 9 Justification Default Style Color Plain Italic Outline Condensed Text Black Bold Underline Shadow Extended Background _White B ADVANCED PROPERTIES DIALOG Once you click OK to complete the settings these properties will be saved by 4D with the plug in area object on your layout Whenever this layout is opened in the User Runtime environments the settings made here will be applied to your AreaList Pro object before the layout method begins to run Essentially you are replacing the default settings provided by AreaList Pro with new values of your choosing You can specify the the arrays or fields to be displayed and almost every other option in AreaList Pro The only main categories that are not supported in this dialog are row and cell settings Setting the Data to Display Data is passed to AreaList Pro via 4D arrays or fields You can tell AreaList Pro the names of the arrays or fields using the first pane on the Advanced Properties Dialog Displaying Arrays You can configure AreaList Pro to display arrays using the Advanced Properties Dialog You must declare all arrays in 4D before opening the form For example ARRAY STRING 20 aFirstName 0 The array must be declared before the form is opened such as with the 4D Open window function To Display the Advanced Properties Dialog Setting the Data to Display Displaying Arrays 35 Configuring AreaList Pro Using the Advanced Proper
21. Determines if time and or date data is entered as plain text or through inline controls see Data Entry Using Inline Controls for more details 0 use plain text for both times and dates 1 use inline controls for times and plain text for dates 2 use plain text for times and inline controls for dates 3 use inline controls for both times and dates The example below illustrates the combination of AL_SetInterface AL_SetMiscOpts and AL_GetMiscOpts AL_SetInterface 96 Configuring AreaList Pro Using Commands Here is the On load phase of the eList AreaList Pro area s object method result AL_SetArraysNam cList 1 3 rConstant rValue rDescription AL_SetHeaders cList 1 3 Constant Value Description AL_SetFormat cList 2 0 2 0 0 0 AL_SetScroll eList 3 3 no scrollbars AL_GetMiscOpts cList 0 vAreaSelected 0 cModern get default values vAreaSelected 0 cModern 1 vAreaSelected 2 a 2 pixel wide border will be drawn around the plug in area when it is selected AL_SetMiscOpfts eList 0 vAreaSelected 0 cModern vAppearance 1 get the default value AL_SetiInterface eList vAppearance 1 1 1 1 1 now vAppearance is set to default 0 result AL_SetEventCallback eList mCallBack 2 Our list displays the AL_SetInterface constants row 1 being Default Interface value 0 Thus the constant value is the row number minus 1 The mCallBack project method is as follows Even
22. EventCallBack C_LONGINT 0 object method and form method will not be executed if O C_LONGINT 1 area Arealist Pro area C_LONGINT 2 alpEvent AreaList Pro event C_LONGINT 3 alpEventMod event modifier unused now C_LONGINT 4 col column last clicked column C_LONGINT 5 row row last clicked row C_LONGINT 6 modifiers modifiers C STRING 255 7 tip tip string C STRING 255 8 areaName plug in area name see AL_SetAreaName Example 9 Using the Event Callback Interface 236 Examples Case of 2 gt AL Single click event amp 2 lt AL Empty Area Control Click all click types ARRAY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user vitem For i 1 Size of array aRows look at each row selected by user vitem vitem aCity aRows i aState aRows i plug values in vitem End for End case 0 0 event handled Example 10 Drag and Drop Between Areas This example will demonstrate how to implement drag and drop between two AreaList Pro areas Another area has been added to the right with its corresponding variable to display selected row s Example 10 This is Example 10 from the Reference Manual which was built upon Example 9 Option alt drag row s between areas 50 100 50 100 eList w 155 h 155 eListDest w 155 h 155 4reaList Pro v3 0 A4reaList Pro v8 0 1990 2007 Beckware LLC 1
23. Example 5 Allowing Data Entry 230 Examples Example 6 Restricting Data Entry to a Column Now that data entry has been established in our example AreaList Pro area lers prohibit entry to one of the columns This requires executing AL_SetEnterable to override the default enterability for column 1 In this command which is also placed in the On load phase we must specify the columnNumber which is 1 and the enterability which we ll set to 0 not enterable The modified object method is Case of Form event Cn Load initialize the AreaList Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRow Opts cList 1 1 0 0 set multirrows mode and allow no selection parameters AL_SetEntryOpts eList 3 0 0 set double click to enter data entry mode AL_SetEnterable eList 1 0 set column 1 to be non enterable DEMO_Default eList vitem Form event OQn Plug in Area respond to user action Case of AL_GetLastEvent cList 1 did user single click on a row ARRAY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user vitem For i 1 Size of array aRows look at each row selected
24. If vCurrCol 1 city If ptrToStateArray gt vCurrRow CA AL_SkipCell 1 End if End if Project method ExitCallback C_BOOLEAN 0 data valid return value True or False C_LONGINT 1 Arealist Pro object reference C_LONGINT 2 action terminating data entry for this cell C_LONGINT vColumn vRow If AL_GetCellMod cList gt 0 ask AreaList Pro if cell was modified AL_GetCurrCell eList vColumn vRow find out which cell only the state array col 2 will be checked we don t need to worry about the entered column LIST TO ARRAY State Abbrev aPossStates create a new array of all possible States ARRAY TEXT aArrayNames 0 errorcode AL_GetArrayNames 1 aArrayNames 0 ptrloStateArray Get pointer aArrayNames 2 pointer to second col array state If Find in array aPossStates ptrloStateArray gt vRow 1 is modified element not valid 0 False tell AreaList Pro it is invalid this forces the user to re enter it BEEP provide user feedback ALERT aState vRow is not a valid state abbreviation Please re enter Else 0 True tell AreaList Pro entry is valid End if Else 0 True tell Arealist Pro entry is valid End if Example 10 Drag and Drop Between Areas 240 Examples Event Callback First we create a common evtUpdateText project method to update either variable at the bottom of the lists It assumes that the aRows array containing the selected rows has been update
25. Preview Entry and Selection Mode Entry Selection O None Single click None Single and Double click O Single click None O Double click Single click O Command Double click Single and Double click O Shift Double click Single and Double click O Option Double click Single and Double click O Control Double click Single and Double click Callbacks to 4D Methods 4D Method for On Cell Entry 4D Method for On Cell Exit Entry Popups M Use modern popup icon Keyboard Entry Allow user to enter Return character Display seconds during entry of times Arrow keys Move cursor i Enter key Iqnore 2 Decimal character on Windows T ENTERABILITY General Options Enterability 38 Configuring AreaList Pro Using the Advanced Properties Dialog Advanced Options AreaList Pro Advanced Properties AreaList Pro Area AreaList Pro vB 5611 1990 2011 Beckware LLC All Rights Reserved Area Name jeListDest Area Defined Name Column Setup General Options Enterability Advanced Dragging L Preview Scroll Bars Miscellaneous Colors Dividing Lines Hide vertical scrollbar Hide horizontal scrollbar Note the horizontal scrollbar will automatically be hidden if the data displayed fits within the AreaList Pro object Lines and Spacing Number of Header Ines T Number of Row lines 1 Number of Footer lines 1 Callbacks to 4D Methods 4D Meth
26. alpHdrForeColor Name of the color in AreaList Pro s palette This will be the foreground color for the column header If the name is not in AreaList Pro s palette or it is a null string then 4dHdrForeColor will be used AdHdrForeColor 1 to 256 The color at this position in 4D s palette will be used for the foreground color for the column header alpListForeColor Name of the color in AreaList Pro s palette This will be the foreground color for the column If the name is not in AreaList Pro s palette or it is a null string then AdListForeColor will be used AdListForeColor 1 to 256 The color at this position in 4D s palette will be used for the foreground color for the column alpFtrForeColor Name of the color in AreaList Pro s palette If the name is not in AreaList Pro s pa lette or it is a null string then 4dFtrForeColor will be used AdFtrForeColor 1 to 256 The color at this position in 4D s palette will be used for the foreground color for the column footer If AL_SetForeColor is not called the default is black for the header list and footer foreground colors AL_SetForeColor 108 Configuring AreaList Pro Using Commands AL_SetForeColor can be used in the On load phase or in another phase form event Examples Red for column header foreground light gray for column foreground all columns blue for footer foreground AL_SetForeColor cList 0 Red 0 Light Gray 0 Blue 0
27. areaExitedMethod S AL_SetMinRowHeight areaRef L minRowHeight L AL _SetMiscColor areaRef L selector I alpColor S 4dColor AL_SetMiscOpts areaRef L hideHeaders areaSelected postKey S showFooters 1 useModernLook AL_SetMiscRGBColor areaRef L selector L red L green L blue L AL_SetPictureEscape areaRef L escapeChar S AL_SetRGBDividers areaRef L colDividerPattern S colDividerRed L colDividerGreen L colDividerBlue L rowDividerPattern S rowDividerRed L rowDividerGreen L rowDividerBlue L AL _SetRowColor areaRef L rowNumber L alpRowForeColor S 4dRowForeColor L alpRowBackColor S 4dRowBackColor L AL SetRowOpts areaRef L multiRows 1 allowNoSelection dragRow 1 acceptDrag l moveWithData disableRowHighlight AL_SetRowRGBColor areaRef L rowNumber L rowForeRed L rowForeGreen L rowForeBlue L rowBackRed L rowBackGreen L rowBackBlue L AL_SetRowStyle areaRef L rowNumber L styleNum 1 fontName S AL_SetScroll areaRef L verticalScroll L horizontalScroll AL_SetSelect areaRef L rowsToSelect X AL_SetSort areaRef L column1 1 columnN 1 AL_SetSortedCols areaRef L sortList X resultCode L AL_SetSortEditorParams areaRef L windowTitle S prompt S labelList X columnNumberList X gt resultCode L AL_SetSortOpts areaRef L automaticSort userSort allowSortEditor sortEditorPrompt S showSortOrder showSortDirlndicator 1 AL SetStyle areaRef L column
28. did user single click on a row row AL_GetLine eList get the row the user selected vitem aCityState row get the value in that element of the array End if AL_GetLastEvent eList 1 End case The AreaList Pro object now appears in the User or Runtime environment like this ECO CH Example 2 Example 2 This is Example 2 from the Reference Manual loading an array from a 4D List and displaying it using the AL_SetArraysNam command The header has been set using the AL_SetHeaders command Pittsburgh PA co Plano TX Portland OR Richardson TX n a v San Diego CA San Francisco CA Santa Fe NM San Francisco CA Example 2 Displaying Headers on the List 226 Examples Example 3 Displaying Data from a Table We ll change the previous example to load the array from a table in the database rather than a list Tables are commonly used to keep list items when the number of items is large or may change frequently Also we ll display the City and State in separate columns This will require that our table structure keep the City and State values in two different fields We can use the same AreaList Pro object we created in the previous examples and just modify the object method Case of Form event Cn Load initialize the AreaList Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field value
29. entryFilter S AL SetFooters areaRef L colummNumber numFooters I footer1 S footerN S AL _SetForeColor areaRef L columnNumber alpHdrForeColor S 4dHdrForeColor alpListForeColor S 4dListForeColor alpFtrForeColor S 4dFtrForeColor Arealist Pro Command Reference Alphabetical 259 AreaList Pro Command Reference Alphabetical AL_SetForeRGBColor areaRef L columnNumber L hdrForeRed L hdrForeGreen L hdrForeBlue L listForeRed L listForeGreen L listForeBlue L ftrForeRed L ftrForeGreen L ftrForeBlue L AL_SetFormat areaRef L columnNumber format S columnjust l headerJust footerJust 1 usePictHeight AL_SetFtrStyle areaRef L columnNumber fontName S size styleNum 1 AL_SetHdrStyle areaRef L columnNumber fontName S size styleNum 1 AL_SetHeaderlcon areaRef L columnNumber iconAlignment picture P horPosition 1 vertPosition 1 offset scaling 1 AL_SetHeaderOptions areaRef L options L iconRef L callbackMethod S AL_SetHeaders areaRef L columnNumber numHeaders header1 S headerN S AL_SetHeight areaRef L numHeaderLines headerHeightPad 1 numRowLines 1 rowHeightPad numFooterLines footerHeightPad AL Setlnterface areaRef L appearance L sortIndicator L useEllipsis L ignoreMenuMeta L clickDelay L allowPartialRow L useOldPopup L entryControls L AL SetLine areaRef L rowNumber L AL_SetMainCalls areaRef L areaEnteredMethod S
30. paramErr when a wrong parameter has been received In some instances unlikely with the recent hardware and OS versions AreaList Pro routines can also return memory manager errors Constant List Command Descriptions and Syntax 16 Installing AreaList Pro Installing AreaList Pro This chapter outlines the steps necessary for installing AreaList Pro into your existing applications AreaList Pro must be installed and de installed using the bundle installation method described herein Installation Plug In bundle MacOS amp Windows AreaList Pro is provided as a plug in bundle for 4D 2004 4D v11 SQL 4D v12 or higher This single version will work with MacOS and Windows deployments you don t need separate MacOS and Windows versions 1 Locate the folder where AreaList Pro has been installed on your computer 2 Locate the 4 Dimension structure where you wish to install the AreaList Pro plug in 3 If you don t already have a directory labeled Plugins create one now 4 Copy the following plug in to your applications Plugins folder alp bundle Backwards Compatibility If you are using AreaList Pro in an existing application please be aware of the following changes Failure to follow this information will result in a 9939 error see figure below when using AreaList Pro in heterogeneous applications with both MacOS and Windows clients Upgrading to AreaList Pro v8 3 or greater from pre 8 3 versions r
31. user dragged a column AL_GetDrgSrcCol 1 vCol AL_GetDrgArea 1 vDstArea vDstID If VDstArea 1 if dragged within the same area AL_GetDrgDstTyp 1 vDstType get the type of data that was destination of the drag If vDstTyp 2 if dragged into a column AL_GetDrgDstCol 1 vCol get the column number End if Else dragged to a different area vDstArea vDstArea store in interprocess variable CALL PROCESS vDstID End if End case Destination AreaList Pro eDstALP area layout s form method C_LONGINT vCol vDstType Case of Form event On Outside call outside call via CALL PROCESS If vDstArea eDstALP has a drag occurred from another process into this AreaList Pro object AL_GetDrgDstTyp eDstALP vDstType get the type of data that was destination of the drag If vDstTyp 2 if dragged into a column AL_GetDrgDstCol eDstALP vCol get the column number End if End if End case AL_GetDrgDstCol 201 User Action Commands User Action Commands User interaction with an AreaList Pro object used to be handled in the During phase On Plug in Area event of the object method or form method with the deprecated postKey paramter and ALProEvt process variable To accomplish this you will most often use the various AreaList Pro commands from within this 4D method which will also contain the response to user actions such as single clicks and double clicks A newer solution is the AL_GetLastEvent command an
32. 1 The Sort Editor is being displayed in another process in that copy of 4D on that computer In this case you can loop until a different value is returned or continue without sorting 0 The user clicked the Cancel button and the list was not sorted 1 The user clicked the Sort button and the list was sorted Example sorted AL_ShowSortEd cList display Arealist Pro Sort Editor If sorted 1 do something here End if AL SetAreaName areaRef L areaName S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout areaName string AreaList Pro area name AL_SetAreaName provides an interface for defining a name to a given AreaList Pro area This can be helpful when using a generic event handler routine see AL_SetEventCallback providing a method for determining which area has passed along the desired event The following example will define the area name as myArea for the eList plug in area AL_SetAreaName cList myArea AL_ShowSortEd AL_SetAreaName 220 Utility Commands AL GetAreaName areaRef L areaName S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout areaName string AreaList Pro area name AL_GetAreaName returns the name defined by AL_SetAreaName This value is also available in the event callback method parameter 8 AL GetVersion gt version S Parameter Type Description version strin AreaList P
33. 1 fieldNum1 fieldNumN 1 gt il le EE 161 AL GetM d areaRef L res ltCode EE 162 AL_GetTable areaRef L gt Gebeess EENEG EEN 163 AL_GetFields areaRef L tableArray X fieldArray X gt resutCode L sen 163 AL_InsertFields areaRef L tableNum l columnNumber l numFields l fieldNum1 1 fieldNumN I result ode EEN 164 AL_RemoveFields areaRef L columnNumber l numFields sese see eee eee 165 AL_UpdateFields areaRef L updateMethod sss 165 AL_SetSubSelect areaRef L firstRecord L numRecords L sese 166 Enterability 167 Initiating Data Enty E 167 E ternng Le 167 Fiter Srna E EES 168 Click ang Hold Data Entry Nitator EE 168 Emelie 168 Sale 169 MOVinig Bre Current Entry e T 169 Compatibility Note Adding or Deleting Rows from a Form Button 170 Redrawing the Display from the Callback Method sse 170 Exiting Data ENUY Aarne npener etre mre err eter rey tere strne eeh 171 Command EE 171 AL_SetEnterable areaRef L columNumber enterability l popupArray X menuPackRef L 171 AL_SetFilter areaRef L columNumber entrvt lier 173 AL_SetEntryOpts areaRef L entryMode allowReturn 1 displaySeconds moveWithArrows mapEnterKey 1 decimalCharForWin S usehewbopuplconl sss sees eee ee eee eee ee eee 174 AL_SetEntryCtls areaRef L columnNumber l controTvpe h sss sees eee 176 Table of contents AL_SetCellEnter areaRef L firstCellCol firstCellRow L lastCellCol lastCe
34. 1 headerJust 1 footerJust I usePictHeight sese eee 82 AL_GetFtrStyle areaRef L columnNumber l fontName S size l styleNUmM I eee eee 85 ArealList Pro Command Reference Alphabetical 257 AreaList Pro Command Reference Alphabetical AL_GetHdrStyle areaRef L columnNumber L fontName S size styleNum 1 AL_GetHeaderOptions areaRef L options L iconRef L callbackMethod S AL_GetHeaders areaRef L headerList X options L gt resultCode L AL _GetLastEvent areaRef L gt eventCode L AL _GetLine areaRef L gt selectedRow L AL_GetMiscOpts areaRef L hideHeaders I areaSelected postKey S showFooters 1 useModernLook AL_GetMode areaRef L gt resultCode L AL _GetPictureEscape areaRef L gt escapeChar S AL_GetPluginPath gt path S AL_GetPrevCell areaRef L cellColumn l cellRow L AL_GetRowOpts areaRef L multiRows 1 allowNoSelection 1 dragRow 1 acceptDrag l moveWithData disableRowHighlight 1 AL_GetScroll areaRef L verticalScroll L horizontalScroll AL_GetSelect areaRef L array X gt resultCode L AL_GetSort areaRef L column1 1 columnN I AL_GetSortedCols areaRef L sortList X gt resultCode L AL_GetSortEditorParams areaRef L windowTitle S prompt S headerList X sortList X resultCode L AL_GetStyle areaRef L columnNumber fontName S size styleNum 1 AL_GetTable areaRef L gt tableNumber L AL _GetVersion gt version S AL_GetWidths
35. 24 hour clock for example but the method of selecting the time will remain basically the same 12 1 2 3 4 5 6 7 8 3 TIME POPUP MENU OLD MODE TIME POPUP MENU NEW MODE The old date popup menu selects a date using a slightly different method the user begins on the right side of the popup selects the year then month and last the day Click on the arrow to scroll the years displayed on the popup The new date popup is a regular calendar with the upper left and right arrows to navigate to the previous next month and the middle diamond to set the value to the current date k Wed Jun 25 2008 January SS e Mr wt E e February 2004 June 3 2008 E March 2005 1 234356 7 April 2006 SMTWTFS 8 9 10 11 12 13 14 JL Gm L SeSe sune 2008 8 9 10 11 12 13 14 15 16 17 18 19 20 23 July 2009 22 23 24 Miles 27 28 August 2010 15 16 17 18 19 20 21 a ce 22 23 24 25 26 27 28 29 30 ictober 2012 November 2013 29 30 December v DATE POPUP MENU OLD MODE DATE POPUP MENU NEW MODE Enterability 29 The AreaList Pro User Interface Data Entry Using Inline Controls Since version 8 1 AreaList Pro allows time and or date entry through a new interface called Inline Controls This option is a replacement for direct text entry TIME INLINE CONTROL DATE INLINE CONTROL AL _SetEnterable sets if the column is enterable by typing popup or both This settings can be restricted but not ex
36. AreaList Pro Using Commands AL SetCellRGBColor areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X cellForeRed L cellForeGreen L cellForeBlue L cellBackRed L cellBackGreen L cellBackBlue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt firstCellCol integer First cell column firstCellRow longint First cell row gt lastCellCol integer Last cell column lastCellRow longint Last cell row gt cellArray two dimensional longint array Discontiguous cells gt cellForeRed longint Foreground red gt cellForeGreen longint Foreground green gt cellForeBlue longint Foreground blue gt cellBackRed longint Background red cellBackGreen longint Background green gt cellBackBlue longint Background blue AL_SetCellRGBColor is used to set the foreground and or background color of a specific cell range of cells or list of cells This routine works in the same manner as AL_SetCellColor except it allows you to specify the colors using standard RGB values cellForeRed Desired foreground red component in RGB color pattern cellForeGreen Desired foreground green component in RGB color pattern cellForeBlue Desired foreground blue component in RGB color pattern cellBackRed Desired background red component in RGB color pattern cellBackGreen Desired background green component in RGB color pattern cellBackBlue Desired backgr
37. AreaList Pro object on the layout You must use the following declaration in your callback method C_LONGINT 1 Since the long integer 1 parameter contains 4D s representation of the AreaList Pro object it can be used as the first parameter of any AreaList Pro method called The following example will create a custom icon using a 4D Picture Library item ID pictLibID AL_SetHeaderOptions AL_AREA 2 pictLibID Use PicRef SortlconCallback 04 05 2000 Training 4 681 22 01 26 1996 Consulting 21 558 58 CUSTOM HEADER ICON AND ACTION AL _GetHeaderOptions areaRef L options L iconRef L callbackMethod S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout options longint Options attribute iconRef longint Reference of the icon or picture callbackMethod string Header callback method AL_GetHeaderOptions will return the attributes set by AL_SetHeaderOptions AL_SetHeaderOptions AL_GetHeaderOptions 73 Configuring AreaList Pro Using Commands AL SetFooters areaRef L columnNumber numFooters footer1 S footerN S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set the first footer numFooters integer Number of footers to set up to 15 gt footer footerN string Values to display in column footers AL_SetFooters is used to specify the value to
38. Array Elements Procedurally Specifying the Fields to Display 43 Configuring AreaList Pro Using Commands Headers Column headers are set with AL_SetHeaders This routine also provides the ability to display icons in AreaList Pro headers and cell data using picture data contained in the cicn resources or items stored in the 4 Dimension Picture Library If more than one line of text is needed in a column header or when displaying icons the numHeaderLines parameter of AL_SetHeight should be used Additional space can be added to the height of a header by specifying the headerHeightPad parameter of this command Additional header attributes are specified by using AL _SetHdrStyle AL SetFormat AL SetForeColor AL_ SetForeRGBColor AL_SetBackColor and AL_SetBackRGBColor for style justification foreground color and background color respectively Display of column headers can be suppressed using the hideHeaders parameter of AL_SetMiscOpts AL _SetHeaderlcon provides the ability to procedurally place icons with headers AL_SetHeaderOptions provides the ability to customize the interface over the scrollbars sort area You can customize the icon which is displayed using cicn or PICT resource or an item from the AD Picture Library See Header Cell Icon Support for more information AL_GetHeaders will return an array of all headers for the defined AreaList Pro area AreaList Pro includes modern column headers including
39. Column AreaList Pro allows column dragging to be initiated by clicking the column header and dragging If the userSort option of AL_SetSortOpts is disabled column dragging will begin immediately and an outline of the column will appear If user sorting is enabled the drag begins when the mouse pointer is greater than 20 pixels to the left or right of the column or greater than 30 pixels above or below the column header When the column is clicked on and dragged it will move freely with the pointer If the column is not accepted by the destination object a rectangle will zoom back to the origin of the drag Dragging to a Row The list will scroll when the arrow is moved within the number of pixels of the AreaList Pro object specified in AL_SetDrgOpts If row dragging is configured to insert rows a small triangle will appear adjacent to the left side of the destination object indicating the insertion position For dragging onto rows the destination row will highlight Dragging to a Column The list will scroll when the arrow is moved within the number of pixels of the AreaList Pro object specified in AL_SetDrgOpts A small triangle will appear adjacent to the top of the destination object indicating the insertion position To Drag a Cell The user drags a cell by clicking upon it and dragging it An outline of the cell will follow the pointer cursor location until the mouse is released Dragging to a Cell When enabled th
40. Layouts You can place an AreaList Pro area on layouts that contain multiple pages If you ve configured the area to accept a drag from another area you must enable and disable the AreaList Pro area using AL _SetDrgDst depending on whether the area is on the current page If the page containing the AreaList Pro area is not the current page call AL_SetDrgDst with empty strings for the dstCode parameters When the page becomes current call AL_SetDrgDst with the actual dstCode values you wish to allow Please read the section Drag and Drop Changing Form Pages for more information You should always disable an AreaList Pro area which is not on the current layout page Multiple Rows Dragging To enable multiple rows dragging the following options must all be set as follows the cellSelection option of AL_SetCellOpts must be set to 0 row selection is enabled the multiRows option of AL_SetRowOpts must be set to 1 multiple rows selection is enabled the multiRowDrag option of AL_SetDrgOpts must be set to 1 to enable multiple rows dragging To get the rows that were dragged use AL_GetSelect When dragging multiple rows there will be no automatic updating of arrays even if the source and the destination lists are the same Background 190 Dragging Commands Drag DataType The dataType parameters represent the type of the drag for both the source and the destination They are used in the commands AL SetDrgSrc AL Set
41. Pro will be 10 if the popup was clicked on a cell other than the one actively in data entry Mode 11 will be reported if data entry was already established in the cell for which the popup was clicked One of the primary uses of the entryStartedMethod callback when the popup is clicked would be to load the array from which the popup is built then use AL_SetEnterable to pass the array to AreaList Pro If the third parameter is 1 then the record was loaded properly and the field contents can be edited If the third parameter is 0 then the record is locked by another process or user If typed data entry is underway and the record can not be loaded then AL_GotoCell or AL_SkipCell may be used to continue data entry in another cell If neither of these commands is called then data entry will end If popup data entry is underway and the record can not be loaded then data entry will end Executing a Callback Upon Leaving a Cell An entry finished callback method is a AP Dimension project method called when data entry ends for a cell or when an AreaList Pro popup menu is released for a cell not in typed data entry The entry finished callback method is specified by passing the method name in the entryFinishedMethod parameter of AL SetCallbacks If this parameter is a null string then no method will be called The entryFinishedMethod callback method is passed two parameters by AreaList Pro The first parameter is a long integer that corre
42. Record separator for Edit menu copy gt fieldWrapper string Field wrapper for Edit menu copy AL_SetCopyOpts is used to control several AreaList Pro options pertaining to copying the selected row s when Copy is selected from the Edit menu Because of limitations of the clipboard picture co lumns cannot be copied to the clipboard a blank field will be copied instead For greater control over the Edit menu you can use the AL_SetEditMenuCallback interface AL_SetMiscRGBColor AL_SetCopyOpts 10 Configuring AreaList Pro Using Commands includeHiddenCols 1 any values in hidden columns will be included when the user uses the Edit menu Copy command 0 any values in hidden columns will not be included when the user uses the Edit menu Copy command default fieldDelimiter One character string The delimiter used to separate fields when the user copies selected rows to the clipboard Default is the tabulation character ASCII 9 recordDelimiter One character string The delimiter used to separate rows when the user copies selected rows to the clipboard Default is the carriage return character ASCII 13 fieldWrapper One character string The character used to wrap fields when the user copies selected rows to the clipboard This character will be placed both before and after each field If fieldWrapper is the null empty string then no character will wrap the fields The default is that no character wi
43. S prompt S labelList X columnNumberList X gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout windowTitle string Window title prompt string Editor prompt labelList text array Sort column labels gt columnNumberList longint array Sort column numbers resultCode longint Result code AL_SetSortEditorParams provides the ability to customize the appearance of available sort items when displaying the AreaList Pro Sort Editor windowTitle Sets the Sort Editor window title default Sort Options Passing a null string no value will tell AreaList Pro to use the default or current window title AL_SetSortOpts AL_SetSortEditorParams 105 Configuring AreaList Pro Using Commands prompt Sets the Sort Editor dialog prompt default Select columns to sort Passing a null string no value will tell AreaList Pro to use the default or current dialog prompt labelList Sets the displayed names of the columns that will be available for sorting which can be the header names or customized labels columnNumberList Set the column numbers that will be available for sorting If not supplied all displayed columns will be used resultCode Returns a valid AreaList Pro result code The following example will define the Sort Editor to display two columns column 1 and 3 in the Sort Editor overriding the default settings In addition we ll ove
44. Technical Details of the Dragging Implementation You must configure AreaList Pro to allow dragging out of and into an AreaList Pro area Commands provide the control necessary to allow dragging within an area between two or more areas and to not allow dragging between certain areas To allow dragging out of AreaList Pro you must pass an access code for the type of data that is to be dragged You must specify the type of data to allow to be dragged and at least one code to enable dragging using AL_SetDrgSrc Up to ten codes can be passed Allowing many codes provides for more flexibility in enabling and disabling dragging between various areas This will be explained in more depth later In order to allow dragging into AreaList Pro you must pass an access code for the type of data that can be the destination of a drag You must specify the type of data that can receive a drag and at least one code to enable dragging using AL_SetDrgDst AreaList Pro supports dragging to rows columns and cells As with AL_SetDrgSrc up to ten codes can be passed for flexibility reasons To enable cell dragging the cellSelection option of AL_SetCellOpts must be set to 1 or 2 single cell selection or multiple cells selection is enabled To drag a cell out of an AreaList Pro object set the sourceDatalype parameter of AL_SetDrgSrc to 3 AL Drag cell data type To drag data into an AreaList Pro object and drop it as a cell set the destData
45. Yuderman 22 295 00 6 24 AM amp Jeffrey Young 49 687 96 7 48 AM amp Del Yocam 63 118 86 10 16 PM amp Curtis Wright 84 651 42 1 34AM amp William Woodward 26 602 10 8 30AM amp WINXP STYLE COLUMN HEADERS Headers 19 The AreaList Pro User Interface Footers Below the scrollable AreaList Pro area there may be a row of cells called the Footer area This area can be used to store information about the column such as the total of a numeric column s data The Footer area is not editable by the user and will not scroll vertically with the rest of the AreaList Pro area See AL_SetFooters and AL_GetFooters Column Widths The user can resize any column by moving the arrow over the line dividing the columns in the header area The pointer will change to the shape 4D uses in the Quick Report Editor for column resizing Drag this column divider to resize the column AL_SetColOpts can be used to disable this feature A column cannot be resized to greater than the width of the list area minus 20 pixels AreaList Pro will automatically truncate data and display the standard ellipsis when columns are resized smaller than the displayed data Like the column sort icons this setting may be procedurally enabled disabled Footers Column Widths 20 The AreaList Pro User Interface Column Locking One or more columns on the left side of the list can be locked in place to prevent them from scrolling horizontally The user can
46. a single cell If firstCellCol and firstCellRow are greater than 0 and lastCellCol or lastCellRow are less than or equal to 0 then only firstCellCol firstCellRow will be set To specify a range of cells If firstCellCol and firstCellRow are greater than 0 and lastCellCol and lastCellRow are greater than 0 then the range of cells from firstCellCol firstCellRow to lastCellCol lastCellRow will be set To specify discontiguous cells If firstCellCol or firstCellRow are less than or equal to 0 then the cells in cellArray will be set AreaList Pro has its own palette with the following colors white black blue green yellow magenta red cyan gray light gray cellArray Two dimensional long integer array The first dimension must be two The first array is for the column indices and the second array is for the row indices The second dimension must be the same as the number of cells that are to be selected See the following illustration AL_SetCellColor 125 Configuring AreaList Pro Using Commands alpForeColor Name of the color in AreaList Pro s palette This will be the foreground color for the cell If the name is not in AreaList Pro s palette or it is the empty string then 4dForeColor will be used AdForeColor 1 to 256 Foreground color number for the cell from 4D s palette If a cell foreground color has been previously set it may be removed by setting alpForeColor to the empty string and AdFore
47. adjust the lock position by dragging the Column Lock control shown below eee Big File 57081 of 57081 S i New Delete CIE Find 5 Sort Wh show A Select CL Print Gs E E D 57081 Records Displayed 0 Selected Setting Name Default Find Last Name E begins with Z GC Active only e Smart Ups S E Company Name Hire Date Industry me Berklee Abbitt 06 25 2002 Training a Date Range x MITLCS Abbitt 06 25 2002 a L E Hire date June 25 2 BCS Publications Abbitt 06 25 2002 Cl Communication ml SS joelle S Macworld Abbott gt 06 25 2002 a E Last name Abel O J M Errone Co Inc Abbott 06 24 2002 a N s S LINCOLN FILENE CENTER TUFTS Abbott 06 25 2002 a EJ Last name begins e S NAHANT SCHOOLS Abbott 06 25 2002 SS Last name is Abbott S STRATEGIC RELATIONSHIP RESUL Abbott 01 26 1987 a Sets S COMPPRO COMPUTER CORP 06 25 2002 EB Active Jacobson 12 S DREXEL UNIVERSITY 06 25 2002 EI PORTFOLIO SOFTWARE 06 25 2002 a EB B Records 4 O SPEC ULAR 06 25 2002 a E renamedset 3 S COMPUTERNIKS 06 25 1997 Computer LARSEN OF CT INC 06 25 1997 a 3 S BTZ ELECTRIC CO 06 25 1997 Electronics A Independence Public Schools 06 25 1997 a D akesi jair ak COLUMN LOCKING When columns are locked and the user clicks in the horizontal scroll bar the locked columns will not scroll This capability is similar to the Freeze Panes feat
48. also be applied to all rows by passing a zero 0 for the row number This will have no effect on rows that have not been previously set The row background color may be left unchanged by setting alpRowBackColor to the empty string and 4dRowBackColor to 0 See the moveWithData option of AL_SetRowOpts This controls whether row colors stay with their rows whenever sorting or dragging occurs Examples AL_SetRowColor clist 10 Blue 0 Light gray 0 set row 10 to foreground blue background light gray AL_SetRowColor clist 0 Blue 0 Yellow 0 set all rows to blue foreground yellow background AL_SetRowColor clist 0 1 1 reset all row colors to use the column color settings AL_SetRowColor cList 10 Blue 0 Light Gray 0 set the 10th row to display a foreground color of blue and background color of light gray AL_SetRowColor clist 12 Green 0 0 set the 12th row to display a foreground color of green and the current background color AL_UpdateArrays cList 1 AL SetRowRGBColor areaRef L rowNumber L rowForeRed L rowForeGreen L rowForeBlue L rowBackRed L rowBackGreen L rowBackBlue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout rowNumber longint Row number rowForeRed longint Foreground red rowForeGreen longint Foreground green rowForeBlue longint Foreground blue rowBackRed longint Background red rowBackGreen longint B
49. and useful lists These attributes can be set in the On load phase and either of the AreaList Pro callback methods see Using the Callback Methods You can use AL _SetCellColor or AL_SetCellRGBColor to set the color configuration for an individual cell a range of cells or a selection of discontiguous cells AL_GetCellColor and AL_GetCellRGBColor are used to determine any cell specific colors for a particular cell AL_GetCellColor can only determine a color which has been set using the 4D palette of 256 colors not the AreaList Pro palette Use the moveWithData option of AL_SetCellOpts to keep the cell specific information with a cell when a row or column is dragged to a new location or the list is sorted Miscellaneous Colors You can use AL_SetMiscColor or AL_SetMiscRGBColor to set the color of four different areas of an AreaList Pro object These areas are the upper right lower right to the right of the footer if displayed and the lower left if the column lock has locked one or more columns Color 49 Configuring AreaList Pro Using Commands Styles Column Header and Footer Styles Styles for displayed columns can be set on a column by column basis using AL SetStyle to set the style for the data AL_SetHdrStyle to set the header style and AL_SetFtrStyle to set the footer style If a 0 is used in the columnNumber parameter the style will be applied to all columns AL_GetStyle returns the formatting options
50. areaRef L colDividerPattern S colDividerRed L colDividerGreen L colDividerBlue L rowDividerPattern S rowDividerRed L rowDividerGreen L rowDividerBlue L 116 AL_SetRowStyle areaRef L rowNumber L styleNum l fontNaMe S cccccccccssesessseeessesesesseeeeesees 117 AL_SetRowColor areaRef L rowNumber L aloRowForeColor S 4dRowForeColor L al RowBackColor S 4dROWwWBACKC Clot EE 118 AL_SetRowRGBColor areaRef L rowNumber L rowForeRed L rowForeGreen L rowForeBlue L rowBackRed L rowBackGreen L rowackb luel nenne 119 AL_SetAltRowColor areaRef L red L green L blue optionsl sees 120 AL_SetAltRowClr areaRef L aloRowBackColor S 4dRowBackColor option 121 AL_SetCellStyle areaRef L firstCellCol 1 firstCellRow L lastCellCol lastCellRow L cellArray X SNIeNunzl Tont EE 122 AL_GetCellStyle areaRef L cellColumn cellRow L styleNum 1 fonthamep sese eee eee ee eee 124 AL_SetCellColor areaRef L firstCellCol 1 firstCellRow L lastCellCol lastCellRow L cellArray X alpForeColor S 4dForeColor alpBackColor S 4dBackColorl see 125 AL_GetCellColor areaRef L cellColumn cellRow L 4dForeColor AdBackColorh sese 127 AL_SetCellRGBColor areaRef L firstCellCol firstCellRow L lastCellCol lastCellRow L cellArray X cellForeRed L cellForeGreen L cellForeBlue L cellBackRed L cellBackGreen L cellBackBlue L 128 Table of contents AL_GetCellRGBColor areaRef L cel
51. areaRef L columnNumber numWidths width1 1 widthN 1 AL_GotoCell areaRef L cellColumn 1 cellRow L AL_InsArrayNam areaRef L columnNumber numArrays I array1 S arrayN S gt resultCode L AL_InsertFields areaRef L tableNum l columnNumber numFields I fieldNum1 1 fieldNumN I gt resultCode L AL Register registrationKey S gt resultCode L AL RemoveArrays areaRef L columnNumber l numArrays 1 AL_RemoveFields areaRef L columnNumber l numFields AL SetAltRowClr areaRef L alpRowBackColor S 4dRowBackColor l options L AL SetAltRowColor areaRef L red L green L blue L options L AL SetAreaName areaRef L areaName S AL SetArraysNam areaRef L columnNumber l numArrays l array1 S arrayN S gt resultCode L AL SetBackColor areaRef L columnNumber alpHdrBackColor S 4dHdrBackColor l alpListBackColor S 4dListBackColor l alpFtrBackColor S 4dFtrBackColor AL_SetBackRGBColor areaRef L columnNumber L hdrBackRed L hdrBackGreen L hdrBackBlue L listBackRed L listBackGreen L listBackBlue L ftrBackRed L ftrBackGreen L ftrBackBlue L AL_SetCalcCall areaRef L columnNumber calcCallback S AL _SetCallbacks areaRef L entryStartedMethod S entryFinishedMethod S Arealist Pro Command Reference Alphabetical 258 AreaList Pro Command Reference Alphabetical AL SetCellBorder areaRef L cellColumn 1 cellRow L borderLeft borderTop 1 borderRight
52. as such by AL _SetEnterable which defines if the column cells will be enterable with typing and or popup If the column is set as enterable with typing and popup before version 8 1 it was only possible to set which cells were enterable with both methods or not with none of the two methods Values 2 and 3 of the enterability parameter now allow to set cells that will be enterable with popup or typing only This setting is only useful when the column property is enterable with both popup and typing Whenever a cell is enterable with popup the useOldPopup parameter of AL SetlInterface sets what kind of popup will be used old or new See Data Entry Using Popups for more details Whenever a cell is enterable with typing the entryControls parameter of AL_SetInterface sets if the entry is performed using plain text of inline controls See Data Entry Using Inline Controls for more details AL_SetCellEnter 177 Enterability Examples ARRAY LONGINT aCellArray 2 0 Set the cell in the third column first row to be enterable AL_SetCellEnter clist 3 1 0 0 aCellArray 1 Set the cells in the fourth row ten columns to be non enterable the row number is the same for all the cells just the column number changes range of values AL_SetCellEnter clist 1 4 10 4 aCellArray 0 Set the cells in rows 8 9 and 10 the first two columns to be non enterable AL_SetCellEnter clist 1 8 2 10 aCellArray 0 A
53. at this position in 4D s palette will be used for the row divider If neither AL_SetDividers nor AL_SetRGBDividers are called then no column or row dividers will be displayed AL_SetDividers can be used in the On load phase or in another phase form event Examples Display solid gray column dividers and no row dividers AL_SetDividers cList Black Gray 0 0 Display column and row dividers in a gray pattern AL_SetDividers cList Gray Black 0 Gray Black 0 AL_SetDividers 113 Configuring AreaList Pro Using Commands AL SetCellBorder areaRef L cellColumn 1 cellRow L borderLeft borderTop 1 borderRight borderBottom 1 offset width F redColor greenColor 1 blueColor Parameter Type Description areaRef longint Reference of AreaList Pro object on layout cellColumn integer Column cellRow longint Row borderLeft integer Draw left border borderTop integer Draw top border borderRight integer Draw right border borderBottom integer Draw bottom border offset integer Offset from cell boundary in pixels width real Width of line redColor integer Red greenColor integer Green blueColor integer Blue AL_SetCellBorder provides the ability to set the border style and RGB color for a cell cellColumn Column of cell where border will be applied cellRow Row of cell where border will be applied borderLeft Draw left border borde
54. be executed if O C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4 column last clicked column C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C_STRING 255 7 tip string C STRING 255 8 area name C_LONGINT vDstArea vDestID vRow AL_GetDrgArea 197 Dragging Commands Case of 2 5 user dragged a row AL_GetDrgSrcRow 1 vRow AL_GetDrgArea 1 vDstArea vDstID If vDstID Current process if dragged to a different process vDstArea vDstArea store in interprocess variable CALL PROCESS vDstID End if End case AL_GetDrgDstTyp areaRef L destDataType Parameter Type Description areaRef longint Reference of AreaList Pro object on layout destDataType integer Type of data which was destination of drag AL_GetDrgDstTyp is used to determine the type of data that was the destination of the last drag Specifically the user may drag items to either a row column or a cell After the drag has completed AL_GetDrgDstTyp indicates whether the destination of the drag was a row column or a cell The areaRef parameter should be the destination receiver area of a drag If the destination and source areas are actually the same area or different areas within the same process i e they reside on the same layout this command may be called from the source area s object or form method or event callback I
55. clickDelay L allowPartialRow L useOldPopup L entryControls L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt appearance longint Column style gt sortlndicator longint Sort Icon useEllipsis longint Use ellipsis r gt ignoreMenuMeta longint Enable disable meta characters in AreaList Pro enterable popup controls gt clickDelay longint Click delay to initiate data entry gt allowPartialRow longint Allow partial rows to be displayed useOldPopup longint Use old date and time popups r gt entryControls longint Use inline controls for date and time data entry AL_Setinterface provides the ability to customize the default appearance settings of an AreaList Pro area In all parameters except areaRef passing a value of 1 through a variable will return the current setting in this variable and do nothing to the appearance AL_GetCellOpts AL_SetInterface 94 Configuring AreaList Pro Using Commands If this routine is not called AreaList Pro the following defaults will be used useOldPopup Parameter Value Description appearance 0 Appearance will use the default platform interface based on the current client machine using AreaList Pro sortIndicator Sort Icon will appear in column header useEllipsis Ellipsis characters will not be used by default ignoreMenuMeta Meta characters enabled clickDelay 60 AreaList Pro will wait on
56. column and a column footer using the RGB values This routine is similar to AL_SetBackColor hdrBackRed Desired header background red component in RGB color pattern hdrBackGreen Desired header background green component in RGB color pattern hdrBackBlue Desired header background blue component in RGB color pattern listBackRed Desired list background red component in RGB color pattern listBackGreen Desired list background green component in RGB color pattern listBackBlue Desired list background blue component in RGB color pattern ftrBackRed Desired footer background red component in RGB color pattern ftrBackGreen Desired footer background green component in RGB color pattern ftrBackBlue Desired footer background blue component in RGB color pattern The following example will tell AreaList Pro to draw the third column using a color scheme standard for OSX AL_SetBackRGBColor cList 3 237 254 243 237 254 243 237 254 243 AL SetDividers areaRef L colDividerPattern S alpColDividerColor S 4dColDividerColor rowDividerPattern S alpRowDividerColor S 4dRowDividerColor Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt colDividerPattern string Pattern of the column divider alpColDividerColor string Color from AreaList Pro s palette for the column divider AdColDividerColor integer Color from 4D s palette for the column divider
57. column footers The following example will return all the footer values from visible columns only AL_SetMiscOpts eList 0 0 1 1 AL_SetColOpts eList 1 0 0 1 hide last column AL_SetFooters cList 1 1 Footer1 AL_SetFooters cList 2 1 Footer2 AL_SetFooters cList 3 1 Footer3 ARRAY TEXT atAL_FooterList 0 ret AL_GetFooters eList atAl_FooterList 1 retrieve footer data only visible columns When the routine is complete atAL_FooterList will contain two elements atAL_FooterList 1 contains Footer atAL_FooterList 2 contains Footer2 AL _SetWidths areaRef L columnNumber numWidths 1 width I widthN Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set the first width numWidths integer Number of widths to set up to 15 width widthN integer Pixel widths of columns AL_SetWidths is used to set the pixel width for one or more columns Up to fifteen widths can be set at a time A width of zero forces a column to be sized automatically based on its data type A column cannot be less than 3 pixels wide If you pass a value of less than 3 but greater than zero AreaList Pro will ignore it and use 3 AreaList Pro will not let a column be wider than the width of the list area minus 20 If not called the default width for all columns is determined based on the type of array or field displ
58. commands in the On load phase or in another phase form event The columns must be added in sequential order unless the particular column has already been added In other words to set 30 arrays you must set arrays 1 through 15 prior to setting arrays 16 through 30 All arrays set with this command must have the same number of elements as each other and as any other arrays previously set AL_SetArraysNam may be called in the On load phase to initially set the arrays to be displayed Since AreaList Pro can display up to 512 arrays this command may have to be used more than once However it is not mandatory to set any arrays in the On load phase in that case the area on the layout where AreaList Pro is defined will be blank AL_SetArraysNam may be called in other phases form events to set arrays to be displayed or to replace arrays that are already displayed You can pass process arrays and interprocess arrays to AreaList Pro but not local arrays a local array has a name that starts with a character an interprocess array has a name that starts with a 0 character on MacOS and the lt gt characters on Windows One dimension of a two dimensional array may be passed in the array arrayN parameters For example my2DArray 1 may be passed as array areaRef AreaList Pro area reference columnNumber This parameter specifies the column number to set the first array being passed by this call of AL_SetArray
59. copy menu item AL Edit Menu Copy Bit AL Edit Menu Cut Mask 4 Reference to Edit menu cut menu item AL Edit Menu Cut Bit 2 1 AL Edit Menu Redo Mask AL Edit Menu Undo Mask Reference to Edit menu redo menu item AL Edit Menu Redo Bit Cle yw wy Rion Reference to Edit menu undo menu item AL Edit Menu Undo Bit AL_SetEditMenuCallback 153 Using the Callback Methods The Edit menu callback returns a longint 0 result containing details of what action s should take place When working with the callback you can return a series of values If you want AreaList Pro to handle the Edit menu selection return a value of zero 0 If wish to customize the result return AL Edit Menu Handled Mask tells AreaList Pro that we handled the menu in the callback method Edit menu constant Value Description Bit position constant Value AL Edit Menu Handled Mask 131072 Tells AreaList Pro that the callback method AL Edit Menu Handled 17 handled the Edit menu operation Bit For example If you wish to tell AreaList Pro to enable only the Copy and Select All menu items overriding default settings you would return the following result AL_Result AL_Result amp AL Edit Menu All Items Mask 2 AL Edit Menu Handled Bit AL_Result AL_Result 2 AL Edit Menu Copy Bit enable copy menu item AL_Result AL_Result 2 AL Edit Menu Select All Bit enable select all menu item 0 AL_Result Edit Menu Ca
60. direct platform detection The column headers include the standard sort icon which can be enabled disabled procedurally indication arrow to notify users which order the column is sorted Footers Column footers are set with AL_SetFooters If more than one line of text is needed in a column footer the numFooterLines parameter of AL _SetHeight should be used Additional space can be added to the height of a footer by specifying the footerHeightPad parameter of this command Additional footer attributes are specified by using AL SetFtrStyle AL SetFormat AL SetForeColor AL_SetForeRGBColor AL_SetBackColor and AL_SetBackRGBColor for style justification foreground color and background color respectively Display of column footers can be controlled using the showFooters parameter of the AL_SetMiscOpts command Column footers are hidden by default so you must use this command if you wish to display footers AL_GetFooters will return the footer information if you have enabled footers Headers Footers 44 Configuring AreaList Pro Using Commands Column Widths Column widths are by default sized automatically an option which can be overridden with AL_SetWidths Normally there is no need to use this command but for details about exceptions to this rule please read Performance Issues with Formatting Commands Column widths can be set manually by using AL_SetWidths however you may want to view the widths generated by A
61. environment Picture Library pass zero 0 if you do not want any icon for the cell See Header Cell Icon Support for examples See also the 4 Dimension Language Reference regarding the SET LIST ITEM PROPERTIES command which uses the same icon syntax iconAlignment Position of icon each cell can contain up to two icons 0 places icon on left of cell 1 places icon on right of cell horPosition One the following options 0 default left for left icon right for right icon 1 align left 2 align center 3 align right vertPosition One the following options 0 default top 1 align top left 2 align center 3 align bottom offset offset of the icon guide The horizontal position is relative to this position If the horizontal alignment is center the icon is centered between the guide and corresponding side of cell left for left icon right for right icon AL_SetCelllcon 182 Enterability The picture below illustrates the icon guide and its offset icon guide offset ICON GUIDE AND OFFSET In the picture below the left icon is aligned right to the icon guide and the right icon is aligned left to the icon guide LEFT ICON ALIGNED RIGHT RIGHT ICON ALIGNED LEFT In the picture below the left icon is centered between the left border and the icon guide and no right icon is used E LEFT ICON CENTERED scaling One the following options 0 trun
62. footerJust The justification for a column its header and its footer can be controlled independently The possible values are Value Justification 0 Default 1 Left 2 Center 3 Right By default headers are left justified unless the column elements are center justified In that case the header will default to center justification The default footer justification corresponds to the column justifications which for the different column types are Column Type Default Column Justification Integer right Long Integer including Time right Real right Boolean left Date right String left Text left Picture n a see the format parameter The columnJust parameter is ignored for picture columns Use the format parameter to justify picture columns usePictHeight 0 ignore the picture height when calculating the row height default 1 use height of the largest picture when calculating the row height If the column columnNumber does not have a picture column this parameter will be ignored AL_SetFormat can be used in the On load phase or in another phase form event Examples Format a real column 3rd column default column justification center header justification and default footer justification AL_SetFormat names 3 00 0 2 0 0 Format a string 2nd column default column justification and default header justification cente
63. for the column footer If AL_SetBackColor is not called the default is white for the header list and footer background colors AL_SetBackColor can be used in the On load phase or in another phase form event Examples Light gray for header background white for list background all columns gray for the footer background AL_SetBackColor cList 0 Light Gray 0 White 0 Gray 0 White for header background 13th color from 4D s palette for list background 1st column color 246 from AD s palette for footer background AL_SetBackColor cList 1 White 0 13 246 AL SetBackRGBColor areaRef L columnNumber L hdrBackRed L hdrBackGreen L hdrBackBlue L listBackRed L listBackGreen L listBackBlue L ftrBackRed L ftrBackGreen L ftrBackBlue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber longint Column number hdrBackRed longint Header back red hdrBackGreen longint Header back green hdrBackBlue longint Header back blue listBackRed longint List back red listBackGreen longint List back green gt listBackBlue longint List back blue ftrBackRed longint Footer back red ftrBackGreen longint Footer back green ftrBackBlue longint Footer back blue AL_SetBackColor AL_SetBackRGBColor 11 Configuring AreaList Pro Using Commands AL_SetBackRGBColor is used to specify the background colors for a column header a list area
64. form method will not be executed if 0 C_LONGINT 1 area Arealist Pro area C_LONGINT 2 alpEvent AreaList Pro event C_LONGINT 3 alpEventMod event modifier unused now may be used later for passing additional info about the event C_LONGINT 4 col column last clicked column C_LONGINT 5 row row last clicked row C_LONGINT 6 modifiers modifiers C STRING 255 7 tip tip string C STRING 255 8 areaName plug in area name see AL_SetAreaName The 0 result code can be set to 0 or 1 0 indicates that the event was handled by the callback method 1 indicates that the event was not handled by the callback method the object method or form method will be executed with the 2 event as AL_GetLastEvent formerly ALProEvt variable 2 contains the same AreaList Pro event as passed by the AL_GetLastEvent command formerly ALProEvt variable to the area object method or form method The handling of events is similar in both cases so if you want to have both single and double clicks reported AreaList Pro will still wait for the double click time to decide if it received a single or a double click See User Action Commands for additional information about event codes AL_SetEventCallback 152 Using the Callback Methods AL_SetEditMenuCaliback areaRef L callbackMethod S gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on
65. have the ability to include icons within AreaList Pro headers and cell data using a formatted character default to informing AreaList Pro where to look for the icons For more details on using header and cell data icons please refer to the Header Cell Icon Support section escapeChar Sets the alternate escape character The following example will display the cicn resource with a resID of 150 in the header before the header text AL_SetPictureEscape area set escape to tilde AL_SetHeaders area 1 1 150Header AL_SetMinRowHeight AL_SetPictureEscape 137 Configuring AreaList Pro Using Commands AL GetPictureEscape areaRef L escapeChar S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout SC escapeChar string Escape character AL_GetPictureEscape will return the current escape character used to inform AreaList Pro where icon references exist in your cell data or headers escapeChar Returns the alternate escape character The following example will return the escape character we just set in AL_SetPictureEscape AL_SetPictureEscape area set escape to tilde char AL_GetPictureEscape area returns in char AL_GetPictureEscape 138 Using the Callback Methods Using the Callback Methods A callback is a 4D project method which is executed by a plug in AreaList Pro lets you make use of callbacks when entering and exiting an AreaList
66. header and column data on the left side for right aligned text AL_SetInterface 95 Configuring AreaList Pro Using Commands The following example will force Windows XP place the sort icon above the scrollbar and disable the ellipsis AL_Setinterface eList 3 1 0 If this routine were called on Mac OSX the headers would have a WinXP interface Conversely you could do the same thing for Mac OSX appearance on Windows ignoreMenuMeta Provides a global interface for disabling meta characters in AreaList Pro enterable popup controls 0 meta characters enabled 1 meta characters disabled clickDelay Provides the number of ticks 60 ticks 1 second which AreaList Pro will wait before automatically initiating data entry see AL_SetEntryOpts and AL_SetEnterable for additional options 0 inactive 2 use the system s double click time 1 to 300 number of ticks allowPartialRow Instructs AreaList Pro to display partial rows thus causing AreaList Pro to draw in the exact area rectangle defined in form 0 don t display partial row area will be resized vertically to only show full rows default 1 allow display of partial rows area will not be resized useOldPopup Instructs AreaList Pro to display the old style time and date popups or the new one see Data Entry Using Popups for more details 0 use new date and time popups 1 use old date and time popups entryControls
67. if arrays are being displayed or three parameters if fields are displayed the first parameter is a long integer that corresponds to the AreaList Pro object on the layout the second parameter is a long integer that reports what action mode caused data entry to begin in the cell the third parameter is a long integer that reports whether the record was loaded or not when fields are being displayed You must use the following declaration in your callback method C_LONGINT 1 2 3 Executing a Callback Upon Exiting an Area Using Callback Methods During Data Entry 141 Using the Callback Methods As stated above the second parameter passed to the callback routine the long integer 2 contains the mode by which data entry began according to the following table Constant Value Entry Mode AL Click action 1 Click in Cell AL Tab key action 2 Tab AL Shift_Tab key action 3 Shift Tab AL Return key action 4 Return AL Shift_Return key action 5 Shift Return AL GotoCell action 6 AL _GotoCell 7 Not used 8 Not used AL SkipCell action 9 AL _ SkipCell AL Other cell popup action 10 Click on cell popup when cursor not already in cell AL Active cell popup action 11 Click on cell popup when cursor already in cell The entryStartedMethod callback is also executed whenever a popup menu is clicked but before the menu is actually displayed When this occurs the entryStartedMode 2 provided by AreaList
68. installed then the default font will be used size Use this parameter to specify the font size for the specified columnNumber If not called the column s will be displayed in the default size See AL_SetDefaultStyle styleNum The styleNum is a font style code By adding the codes together you can combine styles The numeric codes for styleNum are shown below Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 AL_SetStyle can be used in the On load phase or in another phase form event AL_SetDefaultStyle can be used to set the default values for the list data the headers and the footers of all AreaList Pro areas Examples AL SetStyle clist 0 Geneva 9 0 Geneva 9 plain all columns AL SetStyle clist 4 Helvetica 12 32 Helvetica 12 point condensed 4th column AL SetStyle 84 Configuring AreaList Pro Using Commands AL SetDefaultStyle selector L fontName S size L styleNum L Parameter Type Description gt selector longint Selector area part for which to modify the default fontName string Name of the font to use size longint Size of the font styleNum longint Style of the font AL_SetDefaultStyle is used to control the list data the headers and or the footers appearance of all AreaList Pro areas to be created Existing areas are not affected The appearance can eventually be modified for any
69. is lost AL_SetEntryOpts clist n 8 where n is the desired data entry trigger 2 option two will be to call AL_ExitCell in the object method of the add or delete button on each method which performs a similar action AL_ExitCell eCustomers 3 place a call in each of the exit callback methods to instruct AreaList Pro to exit the cell AL_ExitCell 1 Redrawing the Display from the Callback Method You may want to display a variable which has been updated in one of the available callback methods on the same layout as the AreaList Pro object The variable s value will be successfully updated in the callback method but it will not be displayed on the layout immediately This is because 4D will not refresh the screen when a displayed value changes while a plug in is controlling execution If the command REDRAW WINDOW is called or CALL PROCESS is used with the process id parameter set to 1 4D will refresh all windows displaying an interprocess variable This method requires that if a variable is updated from the callback method then it must be an interprocess variable In addition the REDRAW WINDOW or CALL PROCESS commands should be executed from the callback method Example C_LONGINT 1 2 AL_Object Action i C_REAL Total AL_Object 1 Action 2 Total 0 For i 1 Size of array aAmounts Total Total aAmounts i End for Total Total CALL PROCESS 1 0 True Compatibility Note
70. maintains the current record status when the exit callback method is invoked For example with previous versions you had to do something like the following in your exit callback code AL_GetCurrCell 1 row col GOTO SELECTED RECORD Customers row This is no longer required and if the code is still making this type of call that will change the current selection you will lose your edits When inside the callback method you can obtain the previous table value by using the 4D Command Old prevValue Old Customers Zip If prevValue Customers Zip ret ZC_LookupZip Customers Zip gt Customers City Customers State End if Setting a Calculated Column The commands AL_SetFields and AL_InsertFields are used both to set fields to be displayed and to set up calculated columns If the fieldNum parameter contains an integer greater than or equal to 1 the column wil display the field represented by that number If the fieldNum parameter contains an integer less than or equal to 0 the column will display calculated data The absolute value of fieldNum will determine the type of data to be displayed in the column The following table shows the data types that may be displayed in a calculated column Constant Value Is Alpha Field U Is Real Is Text Is Picture Is Date Is Boolean Is Integer Is LongInt Is Time Bells Mal Md IMA A ch ch For example to di
71. of a calculated column is clicked upon the AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable See Determining the User s Action on an AreaList Pro Object The command AL_SetSort command will not allow sorting of calculated columns Enterability Calculated columns are not enterable by any method including using the AL_GotoCell command Time Data Time data will be converted to a longint since this is how it is stored internally by 4D Setting a Calculated Column 158 Field and Record Commands Displaying 4D Fields Fields from Related One Tables Fields from a main table and from related one tables may be displayed in the same AreaList Pro object See the commands AL_SetFile and AL_SetFields for further information about displaying fields from related one tables Redraw and Scrolling When 4D fields are displayed the visible rows are cached held in memory This is done to improve redraw speed Every field within the visible rows are held in memory so horizontal scrolling is as fast as when displaying arrays Vertical scrolling will be slower since the records not in view have to be retrieved from 4D Type ahead Keyboard type ahead will be disabled when displaying fields Copy Rows to the Clipboard Copying rows to the clipboard will not be allowed when displaying fields The Copy menu item wil
72. or right or 30 pixels above or below the header area It is up to you to keep track of the new position of the columns dragging the first column to the right will cause the second column to become the first Future calls to AreaList Pro code should take these changes into account acceptDrag This parameter controls whether columns may be dragged into the AreaList Pro object areaRef 0 this AreaList Pro object will not accept a column default 1 this AreaList Pro object will accept a column dragged from another AreaList Pro object AL_SetColOpts can be used in the On load phase or in another phase form event Examples Allow user to resize columns don t resize columns while the area is displayed allow column lock hide the last two columns disable the pixel width display don t allow or accept column dragging AL_SetColOpts cList 1 0 1 2 0 0 0 Don t allow user to resize columns resize columns while the area is displayed allow column lock don t hide any columns enable the pixel width display don t allow column dragging but accept dragged columns AL_SetColOpts cList 0 1 1 0 1 0 1 AL_SetColOpts 91 Configuring AreaList Pro Using Commands AL _GetColOpts areaRef L allowColumnResize automaticResize allowColumnLock hideLastColumns displayPixelWidth 1 dragColumn acceptDrag Parameter Type areaRef longint allowColumnResize integer lt automaticResize integer
73. re enable the area s scroll bars and event management Picture Columns Scroll Bars Changing Displayed Form 54 Configuring AreaList Pro Using Commands The following code will work and leave the area disabled AL_SetScroll eList 0 0 inform AreaList Pro object that another form will be displayed DIALOG MyTable MyDialog However the following code AL_SetScroll eList 0 0 CONFIRM Do you want to display the dialog If OK 1 DIALOG MyTable MyDialog do something End if will not work because of the CONFIRM dialog box which triggers an update event to the underlying AreaList Pro area The correct order is as follows CONFIRM Do you want to display the dialog If OK 1 AL_SetScroll eList 0 0 DIALOG MyTable MyDialog do something End if In case of doubt or complex code the developer can also use SET VISIBLE SET VISIBLE cList False AL_SetScroll eList 0 0 do something SET VISIBLE eList True If the area is not visible it cannot get update events therefore invisible areas disabled with AL_SetScroll eList 0 0 won t get any update event and can t be enabled until SET VISIBLE eList True is called The above is needed only when the developer displays a new form in the same window not when the page is switched or another window is used The AL_SetScroll area 0 0 system applies to AreaList Pro Drop Areas as well See Drop Area Scroll Bars Changing Displayed Form 5
74. rowDividerPattern string Pattern of the row divider alpRowDividerColor string Color from AreaList Pro s palette for the row divider AdRowDividerColor integer Color from 4D s palette for the row divider AL_SetDividers is used to set the pattern and color of the column and row dividers These are the available patterns white black gray light gray and dark gray AreaList Pro has its own palette with the following colors white black blue green yellow magenta red cyan gray light gray AL_SetBackRGBColor AL_SetDividers 112 Configuring AreaList Pro Using Commands colDividerPattern Name of the pattern for the column divider If a null string is used then no column divider will be displayed alpColDividerColor Name of the color in AreaList Pro s palette This will be the color for the column divider If the name is not in AreaList Pro s palette or it is a null string then 4dColDividerColor will be used AdColDividerColor 1 to 256 The color at this position in 4D s palette will be used for the column divider rowDividerPattern Name of the pattern for the row divider If a null string is used then no row divider will be displayed alpRowDividerColor Name of the color in AreaList Pro s palette This will be the color for the row divider If the name is not in AreaList Bros palette or it is a null string then 4dRowDividerColor will be used AdRowDividerColor 1 to 256 The color
75. scroll both horizontally and vertically Dragging a row or column When dragging a row or column within an AreaList Pro object or to another valid AreaList Pro object the destination area may scroll See Drag and Drop AreaList Pro provides support for live scrolling click and dragging scrollbar will move the AreaList Pro area accordingly In addition AreaList Pro includes support for wheel mouse navigating When an AreaList Pro area is active and you move the wheel mouse up or down AreaList Pro will respond accordingly as if the user clicked on the scroll buttons When using the wheel mouse you can scroll the AreaList Pro area horizontally by holding down the shift key When AreaList Pro has been configured to allow multiple rows selection pressing the up or down Arrow keys AreaList Pro will correctly respond and move accordingly The following conditions have been set when the up Arrow key is pressed the row prior to the first highlighted row will be selected and will be the new active row when the down Arrow key is pressed the row after the last highlighted row will be selected and will be the new active row This interface is off by default for backwards compatibility with previous applications and may be activated using the AL_SetCellOpts routine second parameter activation The following parameter will activate the new keyboard scrolling options when using multi rows selection option AL_SetCellOpts clist 3
76. sese eee 195 Al GetDrgSrcCol areahienL e EE 196 AL_GetDrgArea areaRef L destArea L destbroceseltl 197 AL GetDraDsttyp areaRef L ERR a caiicsscencsasdudsdutatedinctebevaidu nile ee a e EKRE 198 AL_GetDrgDstRow areaRef L destiowl sese essen 200 AL GetDrgDstCol areaRef L leede eeler 200 User Action Commands 202 Arealist Pro s POSUKCY TT 202 Determining the User s Action on an AreaList Pro Object sek 202 Sr S e E eege CERN eege EEN 203 MOUSE Moved WEE 204 Single click aiid Me TE 204 Ctrl command click in the Column Header Event 205 Event Callback vs Objact PAG a seis pcnceicsacseagutnnnendiaanncssacevbs dociaseuns aean p eaae i ema ERE ian aait 205 Table of contents Object Methods or Project Methods On Plug in Area Event un 205 Event eee 205 Veng Both en ce meee Pa ne UT eS or ee ey oem on ae 206 ee EE 206 SOME El 206 elle WAHMs sects oz oss sak E ee eh ae seg cs ae oS esa ens gates nasa nocd pias ea tessa cone oes Swe eee eros es 206 Column Te ieaie eT TT 206 el Neger EE 207 AL_GetWidths areaRef L columnNumber l numWidths l width1 1 width 207 AL_GetSort areaRef L column1 l column 208 AL_GetSortedCols areaRef L sort st Ol zresuhtCodel nenne 209 Tee Bee e un EE 209 AL_GetClickedRow areaRef L gt clickedRow L sss sees 210 AL GetSelect areaRef L array X gt resultCode L sen 211 AL_GetCellSel areaRef L firstCellCol l firstCellRow L lastCellCol l lastCellRow L cellArray X TESUI
77. the area To use this tool first set the displayPixelWidth parameter of AL_SetColOpts to 1 then click the checkbox as shown 114 102 47 80 Mike Erickson i COLUMN WIDTHS HEADERS TOGGLE The mouse pointer will change from an arrow to a pixel count whenever it is over the list and this option is set Column Widths AreaList Pro Height 45 Configuring AreaList Pro Using Commands When clicked on a row this counter will display the necessary height of the AreaList Pro object for that row to be the bottom row displayed For example if ten rows are displayed in the area and you click the seventh row the number displayed by the pointer will be the height of the object necessary to display exactly seven rows You can then size the AreaList Pro object in the Design environment using the displayed height Please read the section AreaList Pro Object Dimensions for more information The header size footer size and the horizontal scroll bar will be taken into account if they are displayed This feature is unavailable if enterability can be initiated with a single click Partial Rows Display Alternately there is an option whereby you can configure AreaList Pro areas to draw in the exact same height as defined in the form With the settings above AreaList Pro will resize the height of the area to match the font attributes and assure that only a complete row was visible This has an adverse effect that the area may be resized
78. the exit callback method will be called with entryFinishedMode parameter set to the value 8 AL Cell validate action and the cursor will remain in the current cell of the AreaList Pro area no matter the result returned by the callback method Warning the row containing the currently edited data must not be deleted No row should be deleted from any end edit type callback method Event Callback Interface AreaList Pro contains an event management interface which can be used in place of the former During On Plug in Area event When using the callback interface 4D will no longer have the interference previously plagued by the various 4D revisions The callback interface is an alternate method for responding to AreaList Pro events The On Plug in Area method and AL_GetLastEvent command formerly ALProEvt variable can also be used as in older versions See Determining the User s Action on an AreaList Pro Object and Event Callback vs Object Method Edit Menu Callback AL_SetEditMenuCallback provides an interface of overriding the default behavior when working with the 4D edit menu You will have the option of overriding an 4D edit action for a given AreaList Pro area providing an extensive customization interface when using Edit menu Some examples of how the edit menu callback interface can be used You can modify the data which is placed on the clipboard to include an additional information you wish such as header or footer data u
79. the value entered into the cell to be accepted and False for the value to be rejected If the value is rejected the user will not be allowed to leave the cell See the AN Dimension Language Reference for more details about functions and methods The entryFinishedMethod callback function is also called when a popup menu is released In this case the entryFinishedMode 2 reported by AreaList Pro to the callback will be 10 if typed data entry was in progress in the cell which contains the popup or 11 if typed data entry was not in progress in that cell AL_GotoCell can be used to establish typed data entry on the cell if it did not exist before the popup was Clicked If typed data entry is already established for the cell in which the popup exists the entry finished callback function will not run when the popup menu is released When displaying arrays and data entry is initiated in a cell the contents of the array element will be copied into the zero element of the array being displayed in the column Please read the section Initiating Data Entry for more information When fields are displayed the contents of the field are not copied Thus it is up to you to save the field contents in the entry started callback method if they will be needed for comparison in the entry finished callback method When displaying arrays and the entry finished callback method is executed the array element corresponding to the cell has already been updated wit
80. user have security access to this field AL_SkipCell eltems goto the next cell or end data entry End if End if AL_SkipCell 186 Enterability AL_ExitCell areaRef L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout AL_ExitCell will exit the currently enterable cell If there is not a cell being entered then AL_ExitCell will have no effect AL_ExitCell does not need to be used to deselect a cell undergoing data entry if a menu is selected another layout object is clicked the user clicks elsewhere on the AreaList Pro object These cases will all terminate data entry normally without the use of this command and the cell will receive its normal exit callback AL_ExitCell is required however to terminate data entry from an entry callback method Warning in an enterable area the row containing the currently edited data must not be deleted AL_ExitCell must be called before the row array element is deleted See also Compatibility Note New Menu Architecture and Compatibility Note AL ExitCell and AL Cell deselect action become AL ExitCell and AL Cell Validate for details about hard deselect and soft deselect Example Entry callback method don t allow entry into cell at column 3 row 4 AL_GetCurrCell eList vCol vRow If VCol 3 amp vVRow 4 AL_ExitCell cList End if AL_ExitCell 187 Dragging Commands Dragging Commands Background
81. vColumn vRow If AL_GetCellMod cList gt 0 ask AreaList Pro if cell was modified AL_GetCurrCell eList vColumn vRow find out which cell since we only have one enterable array we don t need to worry about the column LIST TO ARRAY State Abbrev aPossStates create a new array of all possible States If Find in array aPossStates aState vRow 1 is modified element not valid 0 False tell AreaList Pro it is invalid this forces the user to re enter it BEEP provide user feedback ALERT aState vRow is not a valid state abbreviation Please re enter Else 0 True tell AreaList Pro entry is valid End if Else 0 True tell Arealist Pro entry is valid End if Example 7 Validating Data Entry 233 Examples In this layout if the user wants to double click into the State column second cell with AR in it enter ZZ and exit the cell this alert would be displayed AAO Example 7 Example 7 This is Example 7 from the Reference Manual which was built upon Example 6 In addition a exit cell callback was added to check the validity of entered data using AL_SetCallbacks AL_GetCellMod is used to detect if the cell was modified and AL_GetCurrCell is used to locate the cell City State m Mobile AL a Fayetteville AR Little Rock ZZ Phoenix AZ Tuscon AZ b Petaluma Alert Los Angel i ZZ is not a valid state abbreviation Please re enter Example 8
82. your approach to use fewer or smaller arrays Example error AL_InsArrayNam cList 4 3 aFN alN aComp starting at column 4 insert 3 arrays AL_InsArraysNam 65 Configuring AreaList Pro Using Commands AL_GetArrayNames areaRef L resultArray X options L gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt resultArray array string or text Result array of array names options longint Return options resultCode longint Result code AL_GetArrayNames will return an array of array names when using array display see AL_GetMode If you have used AL_InsArrayNam this routine will not work You can only use this routine when configuring arrays via AL_SetArraysNam When using this routine you may return either the complete list of arrays used to setup the list or only the visible arrays see options parameter areaRef AreaList Pro area reference resultArray A valid AP Dimension array by reference which will receive the list of array names options Return options 0 return only visible arrays default 1 return all arrays resultCode The possible values are Value _ Result Code Action 0 No error 50 Parameter error Array of wrong type must be string or text array 1 Wrong mode See AL GetMode 2 Arrays were not created using Make sure that all arrays have been created using AL_SetAr
83. 0 000 In addition to standard single dimension arrays one dimension of a two dimensional array may be passed to AL_SetArraysNam or AL_InsArrayNam For example My2DArray 1 may be passed as array While similar in purpose the commands AL_SetArraysNam and AL_InsArrayNam affect previously specified arrays in different ways In the second or any subsequent executions of AL_SetArraysNam if columnNumber is the number of a currently existing column then it and any subsequent columns will be replaced by the arrays specified in the command However AL_InsArrayNam will actually insert the new arrays specified and simply move existing arrays over to accommodate them In both commands the column number specified must either already exist or be the next higher column number available no column numbers can be skipped For more information about adding replacing and deleting arrays read Inserting and Deleting Arrays below Specifying the Arrays to Display 42 Configuring AreaList Pro Using Commands Inserting and Deleting Arrays After the initial setup and display of the AreaList Pro area you may want to insert remove or replace arrays in the currently displayed AreaList Pro object To accomplish this AreaList Pro provides the commands AL_InsArrayNam AL_RemoveArrays AL_SetArraysNam and AL_UpdateArrays These commands allow you to implement a dynamic display of data You should keep in mind that the column number used to re
84. 1 A value of 1 means that the block used to store the cell attributes per row is grown a small chunk at a time A value of 5 means that the block used to store the cell attributes is grown a large chunk at a time Thus a lower number means that setting cell attributes may be slower but will potentially require less memory Conversely a higher number means that setting cell attributes may be faster but requires more memory optimization should not be set above 1 unless the number of columns in the AreaList Pro object is greater than 10 and a large percentage of the cells will have their cell attributes set Example AL_SetCellOpts clist 1 1 1 single cell selection only move data with cells normal optimization AL_SetCellOpts 93 Configuring AreaList Pro Using Commands AL GetCellOpts areaRef L cellSelection moveWithData optimization Parameter Type Description areaRef longint Reference of AreaList Pro object on layout cellSelection integer Cell selection mode moveWithData integer Move cell attributes with data optimization integer Optimize cell attribute allocation AL_GetCellOpts will return the current values set by AL_SetCellOpts or default values if this routine has not been called For complete details about return values please see the AL_SetCellOpts routine for possible configuration settings AL Setinterface areaRef L appearance L sortindicator L useEllipsis L ignoreMenuMeta L
85. 25 AL_InsArrayNam areaRef L columnNumber numArrays array1 S arrayN S gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set the first array numArrays integer Number of arrays to set up to 15 arrayl arrayN string Names of 4D arrays resultCode integer Result code AL_InsArrayNam functions the same as AL_SetArraysNam except that the arrays are inserted before columnNumber AL_SetArraysNam AL_InsArraysNam 64 Configuring AreaList Pro Using Commands All subsequent columns will maintain their settings In other words any header text column styles etc will stay with their corresponding array Up to fifteen arrays can be set at a time Any 4D array type can be used except pointer and two dimensional arrays There are three very important points to note about this command This command or AL_SetArraysNam must be called first before any of the other commands in the On load phase or in another phase form event The columns must be added in sequential order unless the particular column has already been added In other words to set 30 arrays you must set arrays 1 through 15 prior to setting arrays 16 through 30 All arrays set with this command must have the same number of elements as each other and as any other arrays previously set AL_InsArrayNam may be called in the On load phase to init
86. 3rd column in sort list aiAL_SortCols 2 5 include the 5th column in descending order ret AL_SetSortedCols eList aiAL_SortCols AL_GetSortedCols returns the current sort columns as displayed in the Sort Editor AL_GetSortEditorParams AL_SetSortedCols 107 Configuring AreaList Pro Using Commands AL SetForeColor areaRef L columnNumber alpHdrForeColor S 4dHdrForeColor alpListForeColor S AdListForeColor alpFtrForeColor S 4dFtrForeColor Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column number alpHdrForeColor string Header foreground color from Arealist Pro s palette AdHdrForeColor integer Header foreground color from 4D s palette alpListForeColor string List foreground color from Arealist Pro s palette AdListForeColor integer List foreground color from 4D s palette alpFtrForeColor string Footer foreground color from Arealist Pro s palette AdFtrForeColor integer Footer foreground color from 4D s palette AL_SetForeColor is used to specify the foreground colors for a column header a list area column and a column footer AreaList Pro has its own palette with the following colors white black blue green yellow magenta red cyan gray light gray columnNumber The column for which to set the foreground color Use a value of zero 0 for columnNumber to apply the parameters to all columns
87. 5 Configuring AreaList Pro Using Commands Drag and Drop Changing Form Pages If the drag and drop feature of AreaList Pro is used on a multi page layout a similar action must be performed When pages are changed in the layout you must ensure that drag and drop is enabled only for AreaList Pro areas on the current page if this feature is desired and that drag and drop is disabled for any AreaList Pro areas on other pages Please read the section AreaList Pro on Multi Page Layouts for more information AL_SetDropDst should be used to disable a Drop Area on the current page when moving to a different layout page Please read the section Drop Area Objects on a Multi Page Layout for more information Using AreaList Pro on a Resizable Window AreaList Pro adds support for AN Dimension resizable windows We recommend you use 4D s built in resizing capability Please refer to the 4D documentation for information on making a 4D form and its objects resizable Performance Issues with Formatting Commands AreaList Pro uses an algorithm to automatically size the columns Because of this there is usually no need to use AL_SetWidths to manually size a column prior to displaying a list However if the number of items in the list is very large several thousand items with many columns then the list might take one or two seconds to display due to the automatic sizing calculation If this is the case using AL_SetWidths will improve the
88. 990 2007 Beckware LLC All Rights Reserved All Rights Reserved Example 9 Using the Event Callback Interface Example 10 Drag and Drop Between Areas 237 Examples Enabling Drag and Drop The left area s object method allows multiple rows drag and drop to and from the area when the op tion alt key is pressed The drag access code is set for both areas Note that this code makes extensive use of AreaList Pro s built in constants Case of Form event On Load initialize the AreaList Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRowOpts cList AL Multiple row selection AL Allow single or no row 2 1 set multi rows mode allow no selection drag out drag in AL_SetDrgSre elist AL Drag row data type drag set source access code AL_SetDrgDst elist AL Drag row data type drag set destination access code AL_SetDrgOpts elist AL Drag row with option key AL Scroll area size default AL Multiple row dragging AL Drag between rows multiple rows dragging with option key AL_SetEntryOpts elist AL Entry dbl select_sgl 0 0 set double click to enter data entry mode AL_SetCallbacks eList EntryCallba
89. 9y oniran ieia sa ieia tones 56 Performance Issues with Formatting Commande sese seer sees yeee eee eee eee 56 Borders and Frames EEN 57 Headet Cell Ilcon Suppo GE 57 The Escape Sentence E 57 Using Icons with Escape E 58 Using Picture Library Items with Escape Gentences A 59 Longint Reference System seer seer eee eee eee 60 Picture CONS E 60 Eyal Ele EN 61 e E E ENT Kl 61 Table of contents E Bn Sl ME 62 AL_SetArraysNam areaRef L columnNumber numArrays 1 array1 S arrayN S PESUITC OCG EE 63 AL_InsArrayNam areaRef L columnNumber numArrays array1 S arrayN S Se tee 64 AL_GetArrayNames areaRef L resultArray X options L gt resultCode L sese 66 AL_RemoveArrays areaRef L columnNumber pnum ravel sese sees ee ee eee 66 AL UpdateAnays areaRef L uodateMetnod l sse 67 AL_SetHeaders areaRef L columnNumber numHeaders header1 S header 68 AL_GetHeaders areaRef L headerList X options L gt resutCode L sse 69 AL_SetHeaderlcon areaRef L columnNumber 1 iconAlignment picture P horPosition 1 ventPostion k otfsetl ln e K EN 70 AL_SetHeaderOptions areaRef L options L iconRef L cGalbackMeibod Gi 72 AL_GetHeaderOptions areaRef L options L iconRef L calbackMethbod Gi 73 AL_SetFooters areaRef L columnNumber l numFooters l footer1 S Tooterk CG 74 AL_GetFooters areaRef L footerList X options L gt resultCode L sese 74 AL_SetWidths areaRef L column
90. AL_SortNames aiAL_SortColumnOrder 0 AL SetSortedCols areaRef L sortList X gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout sortList longint array Sort column numbers resultCode longint Result code AL_SetSortedCols provides the ability to customize the default list of sorted columns If you don t customize the sort list the Sort Editor will use the current sort order by default and if you have previously displayed the Sort Editor and defined more than one column they will be displayed when the Sort Editor is displayed again By default the Sort Editor will always use what the user has selected in the sort column and previous Sort Editor actions unless you override the column list procedurally using AL_SetSortedCols sortList A valid AN Dimension longint array which will contain the columns you wish to display in the sorted column list If you define a column that is outside the displayed columns nothing will be displayed if you wish to have the column sorted in ascending order pass a positive value if you wish to have the column sorted in descending order pass a negative value resultCode Returns a valid AreaList Pro result code The following example will configure the Sort Editor to display the third column ascending and fifth column descending in the sorted list ARRAY LONGINT aiAL_SoriCols 2 aiAL_SortCols 1 3 include the
91. AY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user vitem For i 1 Size of array aRows look at each row selected by user vitem vitem aCity aRows i aState aRows i plug values in vitem End for End case Al_GetLastEvent eList End case The entry callback method code checks the column number and row information by making use of AL_GetCurrCell Note that this method now makes use of the two parameters that AreaList Pro passes to it the AreaList Pro area reference and the method by which data entry was initiated Project method EntryCallback C_LONGINT 1 Arealist Pro object reference C_LONGINT 2 entry cause passed by AreaList Pro C_LONGINT 3 only useful when fields are being displayed C_LONGINT vCurrCol vCurrRow AL_GetCurrCell 1 vCurrCol vCurrRow If vCurrCol 1 city If aState vCurrRow CA AL_SkipCell 1 End if End if When it is displayed in the Runtime environment the layout in this example will look the same as the layout in Example 7 However the cities in the first column are now enterable except for those which are in California Example 8 Prohibiting Data Entry to a Specific Cell 235 Examples Example 9 Using the Event Callback Interface This example show how a more generic event callback project method can be installed to replace the On Plug in Area AL_GetLastEvent command formerly ALProEvt variable system
92. AreaList Pro User Manual Version 8 5 e Node 30 rue de la R publique 33150 Cenon www e node net Copyright and Trademarks Copyright and Trademarks All trade names referenced in this document are the trademark or registered trademark of their respective holders AreaList Pro is copyright Beckware LLC and exclusively published worldwide by e Node 4 Dimension 4D Compiler 4D 4D Server 4D Client and 4D Insider are trademarks of 4D SAS Windows Excel and Vista are trademarks of Microsoft Corporation Macintosh MacOS and MacOS X are trademarks of Apple Inc Table of contents Copyright and Trademarks 2 Table of Contents 3 About AreaList Pro 13 EGRET 13 Technical eet 13 FN e E E A A T A E E A 14 ee 14 UsingtheAreakist Pro Manual eege 15 EI Raise Oneal sie tossietenieats Orn ietinin die dha douuontiben inated Gondola 15 COTM Tael eebe 15 Constant E a E aE a a a E E 16 Command Descriptions and Ee E EE 16 Installing AreaList Pro 17 Installation Plug In bundle MacOS and VWViINGOWS sscicaicsincssasnaasnonserstioineinaneedontiientoanssiatentatannaaneeanens 17 Backwards CompatiDility T 17 Configuring AreaList Pro 18 The AreaList Pro User Interface 18 FAGAC CNS EEN 19 Kale 20 e le en 20 en lt el E 21 Calculated Columns when Displaying belge eessen Ee eege Gases 21 ll E 21 MLC ADIN eege 21 Rows with Multiple Lines Of Text NENNEN 22 80 0 eebe 22 SE SEE EE A A E EE E E A AT 23 eels E 23 SCONO ne E A E A A S
93. C ode Lnc e ea e aa ea a a aa ae a aaea a 213 AL_GetScroll areaRef L verticalScroll L horizontalScroll l eee 214 AL_GetColLock areaRef L gt columna sese Sie ee 214 AL_GetLine areaRef L gt SSleGieci Ow sn 215 AL_SetCellText areaRef L text T Hag aoceoccogeegsee oeeo ands oladSedionnanbedddendncossobantn gece 215 PUL STC CU eine areaRef L text T Nag NEE 216 AL_GetLastEvent areaRef L gt eventCode L sne 217 Utility Commands 218 Drop RE 218 Drop Area Objects on a MultiPage Leed euegegdtedeeeun deai Z cT etc ernek EEEE EEEREN E EEK K i 218 Disabling Drop Areas E 218 SOM EAO ee 218 Area NaMe enee 218 SI e Ee EE 218 Command EE 219 WAL ieie 219 AL_SetDropDst dropAreaRef L dstCode1 S detCodeh 7 219 AL ShowSortEd areaRet LI gt sortDone EN 220 AL_SetAreaName areaRef L areaName S AEN 220 AL_GetAreaName areaRef L areahlame 2 221 AL_GetVersion gt Version 0 ccccccccccsssssssessssceceeseeeeesseesussesenesneeeseeeseeeesueesaesessnesaneeeseeeeeeessaeasaeeessnenanees 221 AL GetPlugin Pathi aU oe T 221 Obsolete Commands 222 Table of contents Examples 223 Example 1 A Simple One Column LIST a aeaa Rota 909 a2 et ous rE aOd TAEA EA aS 223 Example 2 Displaying Headers on the Ulst nnn nanan an nnana nananana nnana 226 Example 3 Displaying Data from a Table esse eee 227 Example 4 Selecting Multiple ROWS iis ciscsapcesccssnctnissia deed duuiiennctenmaniex A E E aS 228 Example 5 A
94. Color to 1 The cell foreground color may be left unchanged by setting alpForeColor to the empty string and 4dForeColor to 0 alpBackColor Name of the color in AreaList Pro s palette This will be the background color for the cell If the name is not in AreaList Pro s palette or it is the empty string then 4dBackColor will be used AdBackColor 1 to 256 Background color number for the cell from 4D s palette If a cell background color has been previously set it may be removed by setting alpBackColor to the empty string and 4dBackColor to 1 The cell background color may be left unchanged by setting alpBackColor to the empty string and 4dBackColor to 0 The foreground and background colors for a cell may be set differently during data entry by calling AL_SetCellColor in the entry started callback method and again in the entry finished callback method to restore the colors See the moveWithData option of AL_SetCellsOpts This controls whether cell foreground and background colors stay with their cells whenever sorting row dragging or column dragging occurs Example Set all negative values in the third column a real array to have a foreground color of red ARRAY LONGINT aCellArray 2 0 MUST initialize a two dimensional long integer array For i 1 Size of array aRevenue check each element in the array If aRevenue i lt 0 is the value in this element negative AL_SetCellColor clis
95. Column Style Default Automa i Disable Ellipsis C Disable ALP Area 1 Column Settings 7 1 Show Sort Editor AREALIST PRO PLUG IN AREA AreaList Pro provides the ability to display up to 512 columns The AreaList Pro User Interface Headers Above the scrollable AreaList Pro area there may be a row of cells called the Header area This area is usually used to contain a description of the data displayed in each of the columns The Header area is also used to control the sorting of the data and column dragging if these features are enabled The Header area is not editable by the user and will not scroll vertically with the rest of the AreaList Pro area See AL_SetHeaders and AL_GetHeaders The user can click on a header to sort the list using that column See Sorting The user can click and drag a header to move a column to a new location See Drag and Drop AreaList Pro includes modern column headers including direct platform detection The column headers include the standard sort indication arrow which can be enabled disabled procedurally to notify users which order the column is sorted Todd Zipnick 52 230 08 Bob Yuderman 22 295 00 6 24 AM S Jeffrey Young 49 687 96 7 48 AM amp Del Yocam 63 118 86 10 16 PME Curtis Wright 84 651 42 William Woodward 26 602 10 8 30 AM amp MacOS X STYLE COLUMN HEADERS First Name Last Name v Salary Arrival Todd Zipnick 52 230 08 9 17 AM amp Bob
96. ColumnLock 1 hideLastColumns displayPixelWidth 1 dragColumn l acceptragh sss sese eee ee eee 92 AL_SetCellOpts areaRef L cellSelection moveWithData optimtzationl ee eee 92 AL_GetCellOpts areaRef L cellSelection 1 moveWithData optimtzaton l sese sese ee eee 94 AL_SetInterface areaRef L appearance L sortIndicator L useEllipsis L ignoreMenuMeta L clickDelay L allowPartialRow L useOldPopup L entryControls LU 94 AL_SetMiscOpts areaRef L hideHeaders areaSelected postKey S showFooters 1 seMo dernLookK EE 98 AL_GetMiscOpts areaRef L hideHeaders areaSelected postKey S showFooters Ee e Ree ease ln ee rt le se o aa aa a aaa aaea 99 6 Table of contents AL_SetMiscColor areaRef L selector aloColor S 4dColor sse 100 AL_SetMiscRGBColor areaRef L selector L red L green L buet 101 AL_SetCopyOpts areaRef L includeHiddenCols fieldDelimiter S recordDelimiter S TVA Gc EE 101 AL_GetCopyOpts areaRef L includeHiddenCols 1 fieldDelimiter S recordDelimiter S fieldaWrapper S EE 102 AL_SetSortOpts areaRef L automaticSort l userSort allowSortEditor l sortEditorPrompt S showSortOrder l showSortDirlndicator sss sss sese eee eee 103 AL_SetSortEditorParams areaRef L windowTitle S prompt S labelList X columnNumberList X e lf 100 EE 105 AL_GetSortEditorParams areaRef L windowTitle S prompt S headerList X sortList X SEET 106 AL_SetSortedCols areaRef L sort
97. DragCol areaRef L oldColumnNumber newColumnNumber destAreaName L AL_SetDropOpts dropAreaRef L acceptRowDrag acceptColumnDrag AL_SetWinLimits areaRef L enableResize minWidth minHeight maxWidth maxHeight AL_DoWinResize areaRef L AL_SaveData areaRef L savePict P resultCode L AL_RestoreData areaRef L restorePict P gt resultCode L AL_SetSpellCheck areaRef L columnNumber mode Obsolete Commands 222 Examples Examples The examples in this section are designed to provide an overview of the use of AreaList Pro and the basic commands You may also wish to examine the non compiled version of the AreaList Pro demo for more examples on the various AreaList Pro capabilities Example 1 A Simple One Column List Create a simple one column list on a 4D layout containing the elements of a 4D list When the user clicks on an element in the list put the value of the selected element into a variable called vitem First we need to create the layout and draw the AreaList Pro plug in object We ll name the object eList OO e Form asch 1 LAU oe Example 1 AreaListPro This is Example 1 from the Reference Manual loading an j Variable 1 array from a 4D List and displaying it using the AL_SetArraysNam command TTT 50 1 oo 1 50 eList w 303 h 105 AreaList Pro v8 0 1990 2007 Beckware LLC All Rights Reserved All Rights Reserved Grow Grow Always visible N I
98. DrgDst and AL_GetDrgDstTyp These are the possible values 1 row 2 column 3 cell Drop Area AreaList Pro includes a Drop Area object which can be used as a destination for dragged rows and columns Commands AL_SetDrgSrc areaRef L sourceDataType 1 srcCode1 S srcCode10 S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout sourceDatalype integer Type of item dragged srcCodel srcCodel0 sting Used to match drag partners AL_SetDrgSrc is used to enable dragging out of the AreaList Pro object referenced by areaRef by setting the access codes for the source of the drag This command must be called before a drag is initiated usually in the On load phase Please read the section What are access codes for more information sourceDatalype Possible values are 1 row 2 column 3 cell srcCode 15 characters The srcCode can have any value such as RowDrag ColDrag DragloALP etc however it is meant to match a code passed into a potential drag partner The drag partner will be the destination receiver of the drag That destination can be the same AreaList Pro area a different AreaList Pro area or another object Background AL_SetDrgSre 19 Dragging Commands This code can be any value other than an empty string Avoid using the strings TEXT or PICT AreaList Pro performs the following l
99. E TE A TE A S cat ie ousg dvds i T ies sea edb favetbsee desea ode fest 221 KE 64 a E Ze I E 189 AL GetAreaWanie areaRef L area Names issscsssecsscsstcsseaesevesssecvacasaasboasacuenvassendssuassscsesaessencbusesuassoesuvaeveassiespasseasvaendevsacedvassssessvesseess 223 AL_GetArrayNames areaRef L resultArray X options L resultCode L ssssssirerisrsrenisirreirisiisinsniadnnr iiinis nenin 67 AL_GetCellColor areaRef L cellColumn l cellRow L 4dForeColor l 4dBackCoalorlh 129 AL_GetCellEnter areaRef L cellColumni 1 cellRow L enterability l ccsccecceceseesesecsesesessesesesesessesecesecseseeseseeesecaeensessnsesaesneeeaeeeeeeees 180 AL GetGellHigh areaRef L startPositions EnGPOsition l sscscisscsessesececssvssscisssssssivecnsssesssedenstvonscndnesesesissensevesbensassosacusnvnssevdssadacnssscusnveeas 183 AL_GetCellMod areaRef L gt resulttCodel tnta statora tEn En ESASEN ESES SESS NENE NES ESENES SESSE aranan e enean 181 AL GetCellOpts areaRef L cellSelection moveWithData l optimization sees eee 96 AL GetCellRGBColor areaRef L cellColumn l cellRow L cellForeRed L cellForeGreen L cellForeBlue L cellBackRed L e TITe R eT p ET S Te N SU 8 131 AL_GetCellSel areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X gt mesuhtodel see 215 AL_GetCellStyle areaRef L cellColumn l cellRow L styleNum l fonthamep sse eee eee 126 AL GetCellText areaRef L text T fael E 218 AL_GetCellValu
100. ION first parameter A new license will be supplied for free at any time if you change your 4D version and or get a new 4D registration key provided that your previous licenses match the current public version at the exchange time Small server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server up to 10 users The registration key is linked to your 4D Server license just as above Medium server This license allows development interpreted mode or deployment inter preted or compiled mode on 4D Server up with 11 to 20 users The registration key is linked to your 4D Server license just as above Large server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server over 20 users The registration key is linked to your 4D Server license just as above Unlimited Single User This license allows development interpreted mode or deployment interpreted or compiled mode on as many 4D Standalone Runtime or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obso lete license will never expire Unlimited OEM This license allows development interpreted mode or deployment inter preted or compiled mode on as many 4D Server of any umber of users 4D Standalone Runtime or Engine co
101. L Parameter Type areaRef longint cellColumn integer cellRow longint Description Reference of AreaList Pro object on layout Column where entry cell was located Row where entry cell was located AL_GetPrevCell will return the previously enterable cell cellColumn This parameter returns the previous cell s column number cellRow This parameter returns the previous cell s row number AL_GetCurrCell AL_GetPrevCell 185 Enterability AL_SkipCell areaRef L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout AL_SkipCell will skip the current data entry cell and proceed to the next cell This command can only be called from the entry started callback method Please read the section Executing a Callback Upon Entering a Cell for more information If data entry in a cell is begun via a Tab shift Tab Return shift Return or click then AL_SkipCell moves data entry to the next appropriate cell according to the entry method If the cell was entered via a mouse click the cell will be exited and data entry will be ended If the cell was entered because of AL_SkipCell called from the previous cell then data entry will similarly be moved to the next cell If the method by which data entry begun is anything else this command will be ignored Example Entry Callback Method AL_GetCurrCell eltems vCol vRow If vCol 3 unit price If gAccess Sales does
102. L GetCellEnter areaRef L cellColumn 1 cellRow L enterability 1 Parameter Type areaRef longint cellColumn integer cellRow longint enterability integer Description Reference of AreaList Pro object on layout Cell column Cell row Enterability AL_GetCellEnter is used to determine if the enterability of the specified cell has been explicitly set with AL_SetCellEnter Note that AL_GetCellEnter will not get the column enterability enterability 1 0 or 1 1 the cell is enterable by typing 0 the cell is not enterable by typing 1 the cells enterability has not been previously set for the cell AL_SetCellEnter AL_GetCellEnter 178 Enterability AL_GetCellMod areaRef L gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout resultCode longint Result code AL_GetCellMod will report whether or not the contents of the cell have been modified Use this command in the entryFinishedMethod callback Please read the section Executing a Callback Upon Leaving a Cell for more information resultCode This parameter reports whether or not a cell was modified 0 not modified 1 modified Example If AL_GetCellMod cList 1 was the value modified AL_GetCurrCell eList vCol vRow If VCol 5 5th column is Line Item quantity aExtended vRow aQty vRow aPrice vRow AL_UpdateArrays cList 1 End if End if AL G
103. LONGINT 2 alpEvent AreaList Pro event C_LONGINT 3 alpEventMod event modifier unused now C_LONGINT 4 col column last clicked column C_LONGINT 5 row row last clicked row C_LONGINT 6 modifiers modifiers C STRING 255 7 tip tip string C STRING 255 8 areaName plug in area name see AL_SetAreaName ARRAY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user Case of 2 gt AL Single click event A 2 lt AL Empty Area Control Click 2 AL Select all event all click types or select all If 1 eList left area evtUpdateText gt vltem gt aCity gt aState Else right area evtUpdateText gt vltemDest gt aCityDest gt aStateDest End if 2 AL Row drag event row s dragged from this area If 1 eList source is left area evtRowsDragged 1 gt aCity gt aState gt aCityDest gt aStateDest nothing selected on the left rows have been removed vitem eviUpdateText gt vltemDest gt aCityDest gt aStateDest update variable for right area with the new rows AL_SetWidths eListDest 1 2 0 0 resize columns in destination area Else source is right area evtRowsDragged 1 gt aCityDest gt aStateDest gt aCity gt aState wit vitemDest nothing selected on the right rows have been removed evtUpdateText gt vltem gt aCity gt aState update variable for left area wit
104. L_SetHdrStyle eList 1 Geneva 12 1 Geneva 12 point bold column 1 AL_SetHdrStyle eList 0 Palatino 10 3 Palatino 10 point bold italic all columns AL_SetHdrStyle 8 Configuring AreaList Pro Using Commands AL _GetHdrStyle areaRef L columnNumber L fontName S size l styleNum Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Desired list column fontName string Name of the font used size integer Size of the font styleNum integer Style of the font AL_GetHadrStyle returns the formatting options set using the AL_SetHdrStyle routine For complete information on the values which are returned please refer to the AL_SetHdrStyle routine for parameter descriptions The following example will retrieve the information set using the AL_SetHdrStyle routine C_LONGINT fontSize fontStyle C_TEXT fontName AL_GetHadrStyle cList 1 fontName fontSize fontStyle AL SetFtrStyle areaRef L columnNumber fontName S size l styleNum 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column for which to set the footer style fontName string Name of the font to use size integer Size of the font styleNum integer Style of the font AL_SetFtrStyle is used to control the appearance of the AreaList Pro column footers The columns can be controlled individually or as
105. List If ret 1 ARRAY LONGINT aiAL_SortColList 0 ret AL_GetSortCols eList aiAL_SortColList End if AL GetColumn areaRef L gt clickedColumn Parameter Type Description areaRef longint Reference of AreaList Pro object on layout clickedColumn integer Column that the user clicked in Use AL_GetColumn to find out what column the user clicked in AL_GetSortedCols AL_GetColumn 209 User Action Commands clickedColumn This parameter returns the column that the user first clicked in mouse down Thus if the user clicks in column 5 and then drags the mouse and releases it in column 8 the clickedColumn returned will be 5 AL_GetColumn and AL_GetClickedRow routines should not be used in entry or exit callback methods as it reports where the user has clicked not where the cursor may reside If you wish to get the current row and column within exit callback you should use AL_GetCurrCell Example column AL_GetColumn elist get the column clicked on The column number is also available as parameter 4 in the event callback method AL GetClickedRow areaRef L gt clickedRow L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout clickedRow longint Row that the user clicked in Use AL_GetClickedRow formerly AL_GetRow to find out what row the user clicked in This command should not be confused with AL_GetLine AL_GetClickedRow returns the last row that was cli
106. List Pro will update the arrays and refresh the area if the drag is within the same area row to row or column to column After a drag When a row column or cell is dragged out of AreaList Pro the following information is available to you notification that a drag occurred which row column or cell was dragged index in array where the row column or cell was dragged to this area or another area When the drag is completed the AreaList Pro event callback or area s object method will run If a drag occurred a 2 event code of 5 is returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable if a row was dragged 7 if a column was dragged or 8 if a cell was dragged see Determining the User s Action on an AreaList Pro Object Then AL_GetDrgSrcRow or AL_GetDrgSrcCol may be used to get the row column or cell that was dragged To determine which plug in area was the destination of the drag call AL_GetDrgArea This command returns the areaRef a long integer and the process ID of the destination area which may be the same AreaList Pro area another AreaList Pro area or another plug in area When dragging to another object that object can either reside in the same window or on another window which may require use of 4D s CALL PROCESS command to take action on the drag when dragging to other objects AreaList Pro is only providing a user interface to the drag and notifying you the develope
107. List X armesuhttCodel e 107 AL_SetForeColor areaRef L columnNumber alpHdrForeColor S 4dHdrForeColor 1 alpListForeColor S 4dListForeColor alpFtrForeColor S 4dFtrForeColoril sse 108 AL_SetForeRGBColor areaRef L columnNumber L hdrForeRed L hdrForeGreen L hdrForeBlue L listForeRed L listForeGreen L listForeBlue L ftrForeRed L ftrForeGreen L Trtoreb iuet sese 109 AL_SetBackColor areaRef L columnNumber alpHdrBackColor S 4dHdrBackColor 1 alpListBackColor S 4dListBackColor alpFtrBackColor S 4dFtrBackColor l ss sese 110 AL_SetBackRGBColor areaRef L columnNumber L hdrBackRed L hdrBackGreen L hdrBackBlue L listBackRed L listBackGreen L listBackBlue L ftrBackRed L ftrBackGreen L ftrBackBlue L 111 AL_SetDividers areaRef L colDividerPattern S alpColDividerColor S 4dColDividerColor 1 rowDividerPattern S alpRowDividerColor S AdPowividerColorit ss sss sese 112 AL_SetCellBorder areaRef L cellColumn 1 cellRow L borderLeft borderTop borderRight 1 borderBottom offset l width F redColor greenColor blU Color sese eee eee 114 AL_SetCellFrame areaRef L firstCellCol firstCellRow L lastCellCol lastCellRow L offset width F redLightColor greenLightColor blueLightColor redDarkColor greenDarkColor blueDarkColor ClearAlIBOrders l ccccccccssccesssecsssececssseeesssseeesseaeeesaeeescesseecssasecesaeeeessseecessaeesesseeeeee 115 AL_SetRGBDividers
108. Number fontName s size styleNum AL_SetSubSelect areaRef L firstRecord L numRecords L AL_SetWidths areaRef L columnNumber l numWidths width1 l widthN 1 AL_ShowSortEd areaRef L gt sortDone AL_SkipCell areaRef L AL_UpdateArrays areaRef L updateMethod AL_UpdateFields areaRef L updateMethod Arealist Pro Command Reference Alphabetical 260
109. Number l numWidths l width1 l width 75 AL_SetFormat areaRef L columnNumber l format S columnJust l headerJust l fo terJust E E Een E 76 AL SetDefaultFormat selector L ep teen 79 AL_GetFormat areaRef L columnNumber format S columnJust l headerJust 1 footerJust l usePictHeight E 80 AL_SetHdrStyle areaRef L columnNumber l fontName S size l stbvlehluml nenne 81 AL_GetHdrStyle areaRef L columnNumber L fontName S size l StyleNUM I sees eee ee ee eee 82 AL_SetFtrStyle areaRef L columnNumber l fontName S size l Style NUIMII sese eee eee ee eee 82 AL_GetFtrStyle areaRef L columnNumber l fontName S size l stvehluml nenne 83 AL_SetStyle areaRef L columnNumber l fontName S size l stviehlumlt sese eee eee ee eee 84 AL_SetDefaultStyle selector L fontName S size L stvehlum len 85 AL_GetStyle areaRef L columnNumber l fontName S size l StyleNUMII sese eee ee eee eee 86 AL_SetRowOpts areaRef L multiRows l allowNoSelection l dragRow l acceptDrag l moveWithData l disabiebRow Hanlar ss sees sese eee eee eee 87 AL_GetRowOpts areaRef L multiRows 1 allowNoSelection dragRow 1 acceptDrag 1 moveWithData l disableRowHighlight sese s sees eee eee eee 89 AL_SetColOpts areaRef L allowColumnResize automaticResize allowColumnLock 1 hideLastColumns displayPixelWidth l dragColumn acceptragh sss sees eee 89 AL_GetColOpts areaRef L allowColumnResize automaticResize allow
110. OCESS If vDstArea eDstALP has a drag occurred from another process into this AreaList Pro object AL_GetDrgDstTyp eDstALP vDstType get the type of data that was destination of the drag If vDstTyp 1 if dragged into a row AL_GetDrgDstRow eDstALP vRow get the row number End if End if E nd case AL_GetDrgDstTyp 199 Dragging Commands AL_GetDrgDstRow areaRef L destRow L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout destRow longint Row number in area that was dragged to If the destination of the last drag was a row or a cell See AL_GetDrgDstTyp use this command to deter mine which row or cell was the destination of the last drag The areaRef parameter should be the desti nation receiver area of a drag If the destination and source areas are actually the same area or different areas within the same process i e they reside on the same layout this command may be called from the source area s object or form method or event callback If the destination and source areas are in different processes then you will need to use the 4D command CALL PROCESS and the form event On Outside call and interprocess variables to communicate between the two processes destRow This parameter returns the row number of the destination area which received the drag See the AL_GetDrgDstTyp example above AL_GetDrgDstCol areaRef L destCol Parameter Type Descr
111. OPHONS EE 38 Bue gel 38 Advanced Options EE 39 Re e a DT ate aetna gear a odece shomenate nate meee aon es 39 Previo W eessen EEN 40 Configuring AreaList Pro Using Commands 41 Using Defined Constants with AreaList Pro ss sssssse sese sssssse ee eee e eessseeeee eenn nenen 41 Specifying theArrays RTE 41 Inserting and Ae Elte E 43 Modifying Array Elements Procedural y ccscccscceeccaeeeeeceaeccaeeeaeceaeceaeceeceeeceeecceeceeeceeeceseeeeeeeeeeeeeeeass 43 Specifying th Fields to Display EE 43 elle 44 Selen 44 Table of contents Coumi WATS a ee ee 45 Arealist Pro lt e Lt E 45 Complete Rows DIS play oncore e er aeae aa a E a E E a EEE 45 ParialROwS Iei esea n a ceeds 46 EE Ee 47 Se ie Ee nt EE 47 Ee 48 Column Header and Footer Colors sss 48 ROW SPEGCINIC COINS E 48 Alternate ROW C lee v48 REIT Tee Mee 49 MISCCIAMEOUS Te 49 SDE e a a a a 50 Column Header and Footer Styles sees eee 50 Ei EE 50 Eeer Eegeeg 50 Ile KT 51 SOMN ege EE 51 Sort lt T TT 51 SECHER 51 Sont SIN eege ee 51 TEE ugin EE 52 Sorting When Displaying d E 52 elle a E A E E E E EA E E E a T 52 e EE 52 CTS els oa satis E E E E E A E E A E e E E E 53 ae a a a E S EE a a aai 54 scroll Dats Changing Displayed FOM E 54 Eeer eege et dE 54 Details Disabling an AreaList cg 2 rT 54 Drag and Drop Changing Form Pages ics cece scence cat nenesie rnanan aaaeaii are tans raa arnbaii 56 Using Arealist Pro oma Resizable Wi es szy zesg ssa cioa gac
112. Pro object This feature provides you with the ability to enable disable buttons or other variables depending upon which object is active See Executing a Callback Upon Entering an Area and Executing a Callback Upon Exiting an Area See Redrawing the Display from the Callback Method for more information on updating buttons or other variables from a callback method You can also use callback methods when entering and exiting a cell during data entry Please read the section Using Callback Methods During Data Entry for more information The Event Callback Interface is an alternate method for responding to AreaList Pro events the other being the On Plug in Area AL_GetLastEvent formerly ALProEvt variable combination see User Action Commands and Event Callback vs Object Method The Edit Menu Callback system provides an interface of overriding the default behavior when working with the 4D edit menu In addition a callback is available when the user clicks on the icon which is displayed over the scrollbars sort area See AL_SetHeaderOptions Summary AreaList Pro provides eight different callback methods entering an AreaList Pro area areaEnteredMethod parameter of AL_SetMainCalls exiting an AreaList Pro area areaExitedMethod parameter of AL_SetMainCalls entering a cell entryStartedMethod parameter of AL_SetCallbacks exiting a cell entryFinishedMethod parameter of AL_SetCallbacks events occurring while in an area ca
113. Prohibiting Data Entry to a Specific Cell This example takes advantage of another possible AreaList Pro callback which is executed when a cell is entered for data entry We ll make column 1 data City enterable again as in Example 5 but we will use this callback to prohibit changes to for the state of California abbreviation CA The only other change necessary to the AreaList Pro object method is to add the entry callback project method name EntryCallback to the call to AL_SetCallbacks The object method now is Case of Form event Cn Load initialize the AreaList Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays Example 7 Validating Data Entry Example 8 Prohibiting Data Entry to a Specific Cell 234 Examples errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRowOpts cList 1 1 0 0 set multirrows mode and allow no selection parameters AL_SetEntryOpts eList 3 0 0 set double click to enter data entry mode AL_SetCallbacks eList EntryCallback ExitCallback set callback project methods DEMO_DefauIt eList vitem Form event On Plug in Area respond to user action Case of AL_GetLastEvent cList 1 did user single click on a row ARR
114. SetAltRowClr you can configure Area List Pro to automatically display custom row colors including shading rows which do not contain any information First Name Last Mame Salary ES Arrival Sex City MacOS X DEFAULT Row COLORING First Name Last N Salary a Arrival Se WINXP DEFAULT Row COLORING Color 48 Configuring AreaList Pro Using Commands AL_SetAltRowColor provides the ability to set the alternate row colors for an AreaList Pro area The colors are defined using a standard RGB pattern and can optionally be configured to display the alternate row color in blank rows to fill the entire area with a consistent interface You may optionally display the alternate row color for odd and or even rows including empty rows those below the last row AL_SetAltRowClr performs the same action as AL_SetAltRowColor except that it uses the standard AreaList Pro color formatting parameters as routines such as AL_SetMiscColor In addition AL_SetRowColor provides a simple method of setting the alternate row colors for an AreaList Pro area The row colors used will be determined based on the current platform OS9 OSX WinXP or Vista Cell Specific Colors Individual column elements called cells can be assigned a unique foreground color and background color This capability can be used to set negative numbers in red provide special formatting to show the current selected or enterable cell and design more attractive
115. TableNo 0 13 size 0 14 mode 0 15 16 format 17 colJust 0 18 headjust 0 19 fooUust 0 20 usePictHeight 0 21 22 fontName 23 fontsize 0 24 fontStyle 0 25 26 ARRAY TEXT atAL_Printhieaders 0 27 mode AL_GetMode AL_PrintAreaRef nenes raaro RE Seer ECH en ee D Et E E Ke r K DG Big File B Big File e DI AAACompiler 4 RR AL Pro F D Companies D Companies By AAACompiler2 vi gt BE AL Proc K m Filel gt i File1 By aaaDoit DI gt AL pre C gt B Init File B Init File BI aacs Be at ProD Arealist Pro Object Dimensions Creating an Drop Area on a Form Using the AreaList Pro Commands 32 Creating an AreaList Pro Object on a Form Clicking on a topic presents a popup menu of the AreaList Pro commands available Simply select a command and 4D will enter it for you at the current cursor position You can also type the command directly into the method or use the Explorer s Component page Command Descriptions and Syntax Each AreaList Pro command has a syntax or rules that describe how to use the command in your 4D database For each command the name of the command is followed by the command s parameters The parameters are enclosed in parenthesis and separated by semicolons Following the command syntax description an explanation of the command s parameters is provided For each parameter the type of the parameter and a description is shown Several examp
116. Type parameter of AL_SetDrgDst to 3 AL Drag cell data type You can control the behavior of row dragging use the dragOntoRow parameter of AL_SetDrgOpts The two types of behavior are dragging to insert between two rows or dragging onto a row When dragging onto rows AreaList Pro will not automatically reorder displayed arrays What are access codes The access codes that are passed in the AL_SetDrgSrc and AL_SetDrgDst commands are used to enable dragging between specific drag partners These drag partners can be the same AreaList Pro area different AreaList Pro areas or different plug in areas When a drag takes place the drag sender communicates its access codes to the drag receiver The drag receiver will compare the access codes of the sender to its own codes If any of the codes match the drag is allowed This mechanism allows a number of combinations between several drag partners The following is an example of enabling the dragging of a row within the same AreaList Pro area Background 188 Dragging Commands Example Enable drag events to rows within the this area vSelfStr String eList creates a unique code that only allows dragging within this area AL_SetDrgSre cList 1 vSelfStr row data type for source AL_SetDrgDst cList 1 vSelfStr row data type for destination This example also shows how you can create a unique identifier that only enables dragging within the same AreaList Pro area Area
117. _both AL Entry_shift_dbl select_both AL Entry_opt_dbl select_both AL Entry_ctrl_dbl select_both AL Allow return off AL Allow return on AL Display seconds off AL Display seconds on AL Arrows move insertion AL Arrows move cell AL Enter key ignore AL Enter key map to Tab AL Enter key map to return AL Use old popup icon AL Use new popup icon EZ PZ rr Ee SSS EZ ZE Se eee Se e ee E eS eS eee AEN ees PB Value ON OF oaos ON On Li SS Go M S OO KH OO Lu MM CH 252 AreaList Pro Constant List AL Checkbox without title AL Checkbox with title AL Radio buttons AL Cell not modified AL Cell modified ALP Misc commands Constant AL Registration failed AL Registration passed AL Show headers AL Hide headers AL No area selection AL Wide border area selection AL System 7 area selection AL 3D frame area selection AL Post key default AL Hide footers AL Show footers AL Modern look off AL Modern look on AL Copy hidden columns off AL Copy hidden columns on AL Copy field delim default AL Copy record delim default AL Copy field wrap default AL Toggle vert scroll bar AL Show vert scroll bar AL Hide vert scroll bar AL Toggle horz scroll bar AL Show horz scroll bar AL Hide horz scroll bar AL Area above vert scroll bar AL Area below vert scroll bar AL Area left horz scroll bar fee ci He ZE Type elie ie JE Re E E i Aar Er fas FE i Tir ie AE Een ES iy i ee ee E AE E AreaL
118. a group columnNumber This parameter specifies what column footer to apply the style to Use a value of zero 0 to apply the parameters to all columns fontName Use this parameter to specify the font for the specified columnNumber If not called or the specified fontName is not found the footer s will be displayed with the default font See AL_SetDefaultStyle If the font specified by fontName is not installed then the default font will be used AL_GetHadrStyle AL_SetFtrStyle 82 Configuring AreaList Pro Using Commands size Use this parameter to specify the font size for the specified columnNumber If not called the footer s will be displayed in the default size See AL_SetDefaultStyle styleNum The styleNum is a font style code By adding the codes together you can combine styles The numeric codes for styleNum are shown below Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 AL_SetFtrStyle can be used in the On load phase or in another phase form event AL _SetDefaultStyle can be used to set the default values for the list data the headers and the footers of all AreaList Pro areas AL GetFtrStyle areaRef L columnNumber 1 fontName S size styleNum Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Desired list column fontName string Nam
119. aList Pro will still maintain a list of the selected rows even though they will not be highlighted Thus the commands AL_GetClickedRow or AL_GetSelect will still return the correct selected row s This parameter is especially useful if you want to have a different way of showing selected rows such as by having a column of check marks or bullets AL_SetRowOpts can be used in the On load phase or in another phase form event Examples Setup the list for single row selection allow the user to select no rows don t allow the user to drag rows don t accept a drag from another AreaList Pro object don t move the row style and color info with the row don t disable row highlighting AL_SetRow Opts cList 0 1 0 0 0 0 Setup the list for multi rows selection require one row selection allow the user to option altdrag rows only within the list accept a drag from another AreaList Pro object move the row style and color info with the row disable row highlighting AL_SetRow Opts cList 1 0 1 1 1 1 Setup the list for single row selection require one row selection allow the user to drag rows within the list and out of the list without the option alt key accept a drag from another AreaList Pro object move the row style and color info with the row disable row highlighting AL_SetRow Opts cList 0 0 6 1 1 1 AL_SetRowOpts 88 Configuring AreaList Pro Using Commands AL _GetRowOpts areaRef L multiRows 1 allowNoSelecti
120. aRef This gives you the ability to use this callback method for more than one AreaList Pro object The second parameter is the column number This gives you the ability to use this callback method for many columns within a AreaList Pro object The third parameter is the type of data in the column The last three parameters are absolutely necessary The fourth parameter is a pointer to one of the temporary 4D arrays declared in the Compiler_ALP method This is where you will load the data to be displayed in the column The fifth parameter is the number of the first cell that needs to be filled in the column This is the same as the selected number of the row that contains this cell The sixth parameter is the number of cells to be filled in the column You must declare all six parameters 1 to 6 in the calculated column callback If any of these parameters are not declared you will get an error when compiling the database You must use the following declarations in your callback method C_LONGINT 1 2 3 5 6 C_POINTER 4 See Setting a Calculated Column for details Calculated Column Callback 147 Using the Callback Methods Commands AL_SetMainCalls areaRef L areaEnteredMethod S areaExitedMethod S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout areaEnteredMethod string 4D project method called when object is entered areaExitedMethod string 4D project metho
121. able button add 8 to the entryMode parameter See the sections Compatibility Note New Menu Architecture and Compatibility Note AL ExitCell and AL Cell deselect action become AL ExitCell and AL Cell Validate for details about hard deselect and soft deselect The following example will configure area to ignore soft deselect events AL_SetEntryOpts cList 10 single click to initiate entry no row selection ignore soft deselect AL_SetEntryOpts 174 Enterability allowReturn 0 or 1 0 the Carriage Return key will move the enterable cell as described in the Moving the Current Entry Cell default 1 the user can enter a carriage return character into a text array element displaySeconds 0 or 1 0 seconds will not be displayed default 1 seconds will be displayed in time array elements during data entry moveWithArrows 0 or 1 0 the Arrow keys will move the insertion point within the enterable cell default 1 the Arrow keys will move the enterable cell to the next cell according to the key pressed mapEnterKey The Enter key is in many cases used to accept a record or perform some other action in 4D If the Enter key is not acting as expected make sure that it is not being used as a key equivalent somewhere on the layout 0 do not map the Enter key default 1 map the Enter key to act like the Tab key 2 map the Enter key to act like the Return key decima
122. ach row selected by user vitem vitem aCity aRows i aState aRows i plug values in vitem End for AL_GetLastEvent eList 2 double click CANCEL cancel the layout End case AL_GetLastEvent eList End case Example 4 Selecting Multiple Rows 228 Examples Now our layout looks like this ECO CH Example 4 Example 4 This is Example 4 from the Reference Manual The AreaList Pro object has been set to allow multi rows selections using the AL_SetRowOpts command City State Mobile AL 0 Fayetteville AR Little Rock AR Phoenix AZ Tuscon AZ Petaluma CA Los Angeles CA PalmSprings CA lt gt i Fayetteville AR Phoenix AZ Example 5 Allowing Data Entry Now that we have a basic AreaList Pro area displayed on our layout we can implement data entry In AreaList Pro all that needs to be done is to add a line of code to the On load part of the object method To initiate data entry with a double click we use AL_SetEntryOpts with the entryMode parameter set to 3 see Initiating Data Entry for more information about the different options available As a default AreaList Pro allows all columns to be enterable once the method of initiating data entry has been set Of course we must remove the double click CANCEL action The code in the object method is now Case of Form event Cn Load initialize the AreaList Pro object ALL RECORDS Cities load al
123. ackground green rowBackBlue longint Background blue AL_SetRowRGBColor provides the ability to set the foreground and background colors for an individual row using standard RGB colors see AL_SetAltRowColor This routine is similar to AL_SetRowColor except that it uses RGB color values AL_SetRowColor AL_SetRowRGBColor 119 Configuring AreaList Pro Using Commands rowForeRed Desired foreground red component in RGB color pattern rowForeGreen Desired foreground green component in RGB color pattern rowForeBlue Desired foreground blue component in RGB color pattern rowBackRed Desired background red component in RGB color pattern rowBackGreen Desired background green component in RGB color pattern rowBackBlue Desired background blue component in RGB color pattern The following example will tell AreaList Pro to draw the third row using a color scheme standard for OSX AL_SetRowRGBColor cList 3 237 0 243 0 254 0 AL SetAltRowColor areaRef L red L green L blue L options L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout red longint Red green longint Green blue longint Blue options longint Options AL_SetAltRowColor provides the ability to set the alternate background row colors for an AreaList Pro area The colors are defined using a standard RGB pattern and can optionally be configured to display the alternate row color in bla
124. allow the user to move from cell to cell while in data entry using the four Arrow keys mapEnterKey enables you to cause the Enter key to act the same way as either the Tab key or the Return key When using this parameter it should be noted that the Enter key is often used in 4 Dimension for other functions which may conflict with its AreaList Pro meaning A variety of AreaList Pro commands enable you to monitor and control movement during data entry The current and previous data entry cells can be determined by using AL_GetCurrCell and AL_GetPrevCell respectively Movement from cell to cell while staying in data entry mode can be accomplished using AL GotoCell AL_SkipCell can be used in the entry started callback method to cause data entry on a particular cell to be skipped Data entry can be terminated via AL_ExitCell Popups Moving the Current Entry Cell 169 Enterability Compatibility Note Adding or Deleting Rows from a Form Button When using AreaList Pro as an included layout it is common to have buttons in the input form to add or delete rows from the AreaList Pro area The code that performs this type of action if written before version 7 9 requires a small change so that the records are correctly added deleted when using enterability There are three different methods you can use to handle this issue 1 option one will be to modify the call to AL_SetEntryOpts to instruct 4D to commit the current cell when the focus
125. ample to work in multi rows mode We ll add an additional line of code to the On load part of the object method to configure the AreaList Pro object to be in multi rows mode using AL_SetRowOpts We ll initially display the list with no rows selected Since AreaList Pro defaults to no selected rows when in multi rows mode we don t need to use AL_SetSelect in the On load phase When the user clicks on one or more items we ll display the selected items in the vltem variable separated by a dash character Finally if the user double clicks on a row we want to close the layout using the CANCEL command Here s the modified object method Case of Form event On Load initialize the Arealist Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRow Opts cList 1 1 0 0 set multirrows mode and allow no selection parameters DEMO_DefauIt eList wit vitem Form event On Plug in Area respond to user action Case of AL_GetLastEvent eList 1 did user single click on a row ARRAY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user vitem For i 1 Size of array aRows look at e
126. ands must then be called to determine the user selection Then the user s selection must be placed in the array element corresponding to the cell entered If this command is called in the On Plug in Area event phase or in the Event Callback Interface method use AL_UpdateArrays or AL_UpdateFields to redraw the AreaList Pro object as needed See Using Callback Methods During Data Entry for a discussion of using callback methods with popup menus If this command is not called then all columns will be enterable using typed characters only Examples AL_SetEnterable cList 4 1 set column 4 to be enterable using typed characters only AL_SetEnterable eList 0 0 set all columns to be not enterable AL_SetEnterable cList 3 2 aProducts set the third column to be enterable via a popup menu containing the items in the array aProducts The following example will disable meta characters globally for all AreaList Pro areas AL_Setinterface 0 1 1 1 1 O as area parameter defines for all AreaList Pro areas Then you can enable meta characters for a given column in a specific area AL_SetEnterable clist 2 2 atTest AL_SetEnterable 172 Enterability If the data type is time or date AL_SetInterface is also used to specify the interface to be used Whenever a cell is enterable with popup the useOldPopup parameter of AL_SetInterface sets what kind of popup will be used old or new See Data Entry Using Popups for more d
127. anges a configuration attribute must include updating the AreaList Pro object AL_UpdateArrays cList 2 bDeleteRows button method This example shows how to delete elements from displayed arrays and how to update AreaList Pro The routine deletes selected rows in an AreaList Pro object named elist eList is configured for multiple rows selection and it is displaying three arrays aFN oh aComp ARRAY LONGINT aRows 0 create an long integer array with a size of zero OK AL_GetSelect eList aRows get the rows selected by the user put into aRows array If OK 1 enough RAM was available to resize the aRows array For i Size of array aRows 1 1 start at the end of the array and go to top DELETE ELEMENT aFN aRows i delete the selected element from the three arrays DELETE ELEMENT alN cRows i DELETE ELEMENT aComp aRows i End for AL_GetScroll eList vVert vHoriz get current scroll position AL_UpdateArrays cList 2 update the AreaList Pro object AL_SetScroll eList vVert vHoriz reset scroll position so it doesn t change End if AL SetHeaders areaRef L columnNumber numHeaders header1 S headerN S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set up the first header numHeaders integer Number of headers to set up to 15 header1 headerN string Values to display in column headers
128. any of the two areas AlpEventText AL_GetLastEvent gt vGlobalEventText End case Example 11 Getting the Last Event in each Area 244 Examples The A pEventText project method returns the text value based upon our event case of example see Determining the User s Action on an AreaList Pro Object C_LONGINT 1 event code C_POINTER 2 to the event description text Case of 1 1 2 gt Single click 1 2 2 gt Double click 1 3 2 gt Single click in an empty part of the area without displayed data 1 4 2 gt Double click in an empty part of the area without displayed data 1 5 2 gt Control click or right mouse click 1 6 2 gt Control click or right mouse click in an empty part of the area without displayed data 1 7 2 gt Vertical scroll 1 18 2 gt Mouse has been moved callback method only 1 1 2 gt Sort button 1 2 2 gt Edit menu Select All 1 3 2 gt Column resized 1 4 2 gt Column lock changed 1 5 2 gt Row has been dragged from this area 1 6 2 gt User has invoked AreaList Pro Sort Editor 1 7 2 gt Column has been dragged from this area Example 11 Getting the Last Event in each Area 245 Examples 1 8 2 gt Cell has been dragged from this area 1 9 2 gt Object window has been resized 1 10 2 gt User click
129. ast Name First Name To access this feature ctrl command click the header area of the AreaList Pro object The Sort Editor matches the current application platform There are a suite of routines included in AreaList Pro which provide developers with the entry points to customize read write information in the Sort Editor The AreaList Pro default Sort Editor is displayed as a resizable window Sort Options Select columns to sort kK First Name Y Last Name A Last Name Y City 0 5 Salary 2 Arrival 8 Male A City amp State A zip A Country ATitle Am S Birthdate 2 Code A Salutation SS Date Entered LEI Cancel son MacOS X Sort Epitor Styles Sorting 23 The AreaList Pro User Interface Select columns to sort AN First Name A Last Name IE 32 Arrival Ba Sex AN City AM State A Zip AN County AN Title AN MI Birthdate 6 Z Code x cea First Name F BES WINXP Sort EDITOR The area on the left is a list of the columns displayed in the AreaList Pro object An item can be added to the sort order list on the right by dragging it over the rectangle on the right or by double clicking To remove an item from the sort order list drag it outside of the sort order list area To change the direction of the sort 1 Click the arrows to the right of each item in the sort order list up arrow is ascending order down arrow is descending Although picture c
130. ata 2 4 Double click in an empty part of the area without displayed data 2 5 Control click or right mouse click 203 Determining the User Action on an AreaList Pro Object User Action Commands 2 6 Control click or right mouse click in an empty part of the area without displayed data 2 7 Vertical scroll 2 18 Mouse has been moved callback method only 2 1 Sort button 2 2 Edit menu Select All 2 3 Column resized 2 4 Column lock changed 2 5 Row has been dragged from this area 2 6 User has invoked AreaList Pro Sort Editor 2 7 Column has been dragged from this area 2 8 Cell has been dragged from this area 2 9 Object window has been resized 2 10 User clicked on column header automatic sort won t be executed 2 11 Control click on column header 2 12 Click on column footer End case Mouse Moved Event 18 mouse moved is only available in the Event Callback Interface It is NOT available through AL_GetLastEvent command formerly ALProEvt variable Single click and Double click Events If a single click is reported by AreaList Pro event code 1 and the area is in single row mode you can determine whether the event was caused by a mouse click or by a keyboard event the Arrow key or type ahead scrolling Both AL GetColumn and AL_GetClickedRow will return zero if the event was due t
131. ay of an AreaList Pro object You can also use it in other phases to control what element is selected If this command is not used then AreaList Pro will display the columns with the first row selected AL_SetCellValue AL_SetLine 132 Configuring AreaList Pro Using Commands AL_SetLine should only be used with an AreaList Pro object in single row mode If areaRef is in multi rows mode you must use AL_SetSelect rowNumber This parameter specifies what row to highlight Example Case of Form event On Load error AL_SetArraysNam cList 1 3 aFN alN aComp AL_SetLine eList 3 highlight 3rd row End case AL SetSelect areaRef L rowsToSelect X Parameter Type Description areaRef longint Reference of AreaList Pro object on layout rowsToSelect longint array Contains element numbers to select highlight when the multi rows option is enabled AL_SetSelect is used to set the rows to be highlighted This command is used in the On load phase to set up the initial display of an AreaList Pro object You can also use it in other phases to control what elements are selected If this command is not used then AreaList Pro will display the columns with no rows selected AL_SetSelect should only be used with an AreaList Pro object in multi rows mode If areaRef is in single row mode you must use AL_SetLine rowsToSelect Long integer array This parameter contains a list of rows which you wish to select or hig
132. ayed This initialization will be contained in the AreaList Pro plug in area object method or in the form method Using Defined Constants with AreaList Pro There are defined constants that may be used as values for most of the parameters in the AreaList Pro commands See the Constants tab of the Explorer in the 4D Design environment These constants are categorized according to the type of command that they are associated with such as ALP Array commands ALP Field commands etc Other constants are used for the AreaList callback interface See Using the Callback Methods Specifying the Arrays to Display AD arrays are passed to AreaList Pro for display via the AL_SetArraysNam and AL_InsArrayNam commands These should be performed in the On load phase of layout execution or other form events depending upon the desired appearance of the AreaList Pro area upon initial display of the layout If no AreaList Pro setup is performed in the On load phase nothing will be displayed in the space occupied by the plug in area until setup occurs in another phase Whether the AreaList Pro columns are set in the On load phase or in another phase the setup of an AreaList Pro area must follow one main rule AL_SetArraysNam or AL_InsArrayNam must be called before any other AreaList Pro commands are executed This is necessary to provide AreaList Pro with an opportunity to allocate the data structures necessary to store formatting information fo
133. ayed in the column and the footer for the column AL_SetWidths can be used in the On load phase or in another phase form event Example error AL_SetArraysNam cList 1 5 aFN alN aCity aState aZip AL_SetWidths cist 1 5 150 50 0 100 0 O forces autosizing for that column You can get the column widths using AL_GetWidths AL_GetFooters AL_SetWidths 75 Configuring AreaList Pro Using Commands AL SetFormat areaRef L columnNumber format S columnJust headerJust footerJust l usePictHeight Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set the format and justification format string Format to use columnJust integer Justification for column list items headerJust integer Justification for column header footerJust integer Justification for column footer usePictHeight integer Use the picture height in the row height calculation AL_SetFormat is used to control the format and justification of a column being displayed You can control the format of string integer long integer real date boolean and picture columns with the format parameter Time values can be formatted also since they use long integer arrays Any valid AD format including custom formats created in the Design environment may be used with these column types except for string arrays Text columns cannot be formatted Additional
134. because AL_GotoCell only works if the AreaList Pro object is selected If AL_GotoCell is called in the On load phase the AreaList Pro area must be the first in the entry order for the layout cellColumn This parameter specifies the cell s column cellRow This parameter specifies the cell s row Example Entry callback method AL_GetCurrCell eltems vCol vRow If vCol 3 unit price If gAccess Sales does user have security access to this field If 2 2 Tab AL_GotoCell eltems vCol 1 vRow goto the next cell Else not Tab AL_ExitCelleltems end data entry End if End if End if AL_GotoCell 184 Enterability AL GetCurrCell areaRef L cellColumn 1 cellRow L Parameter Type areaRef longint cellColumn integer cellRow longint Description Reference of AreaList Pro object on layout Cell column Cell row AL_GetCurrCell will return the currently enterable cell This command is only valid from a callback method Please read the section Using Callback Methods During Data Entry for more information cellColumn This parameter returns the current cell s column number cellRow This parameter returns the current cell s row number AL_GetCurrCell will return 0 in both cellColumn and cellRow if there is not a cell being entered Example AL_GetCurrCell eList vColumn vRow get the current cell AL GetPrevCell areaRef L cellColumn 1 cellRow
135. by user vitem vitem aCity aRows i aState aRows i plug values in vitem End for End case Al_GetLastEvent eList End case This layout looks identical to that in Example 5 except that column 1 is no longer enterable Test this by double clicking on column 1 the row will be selected but you won t begin data entry Double clicking on column 2 will initiate data entry as in Example 5 Example 6 Restricting Data Entry to a Column 231 Examples Example 7 Validating Data Entry AreaList Pro has the capability to execute a 4 Dimension project method when data entry ends on a cell This is known as a callback method and can be specified using AL_SetCallbacks In this example we add a callback method which checks the value entered in a column 2 cell and warns the user if it is invalid To implement this AL_SetCallbacks is called from the On load phase and sets up the callback project method ExitCal back The new object method is Case of Form event On Load initialize the Arealist Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 1 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRow Opts cList 1 1 0 0 set multirrows mode and allow no sel
136. cated 1 scaled The cell content text is drawn into the space that is left once the icon is drawn If the icon is larger than the remaining available space the text is drawn over the icon For example if the column width is 100 pixels and you draw a 15 pixel icon there is remaining width of 85 pixels where the text will be drawn If however the total width icon text exceeds the column width the text will be drawn over the picture This allows background pictures behind the text The following example will draw an icon in r3c2 using an item resID 1717 from the Picture Library col 2 row 3 iconRef 1717 Use PicRef iconPos 1 right horPos 0 default verPos 2 align center offset 5 scaling 0 AL_SetCelllcon eAl_Output col row iconRef iconPos horPos verPos offset scaling AL_SetCelllcon 183 Enterability AL GotoCell areaRef L cellColumn 1 cellRow L Parameter Type areaRef longint cellColumn integer cellRow longint Description Reference of AreaList Pro object on layout Column to move entry to Row to move entry to AL_GotoCell will place the cursor into the specified cell If the cell does not exist or has been set to not enterable by AL SetEnterable then this command will have no effect If you use AL_GotoCell from an object method or project method other than the entry or exit callback method you must precede it with the 4D command GOTO AREA This is
137. ck ExitCallback set callback project methods errorcode AL_SetEventCallback elist EventCallBack 2 set event callback 2 do not execute object method and form method DEMO_Default eList vitem End case Example 10 Drag and Drop Between Areas 238 Examples Introducing Generic Programming The destination area will behave the same way except that it is empty until a drag occurs This is where we want to go generic First we will call a common dragAreaSetup project method with the area reference as 1 parameter dragAreaSetup called by both areas On Load phases C_LONGINT 1 Arealist Pro area AL_SetHeaders 1 1 2 City State specify the values for the column headers AL_SetRowOpts 1 AL Multiple row selection AL Allow single or no row 2 1 set multi rows mode allow no selection drag out drag in AL_SetDrg rc 1 Al Drag row data type drag set source access code AL_SetDrgDst 1 Al Drag row data type drag set destination access code AL_SetDrgOpts 1 AL Drag row with option key AL Scroll area size default AL Multiple row dragging AL Drag between rows multiple rows dragging with option key AL_SetEntryOpts 1 AL Entry dbl select_sgl 0 0 set double click to enter data entry mode AL_SetCallbacks 1 EntryCallback ExitCallback set callback project methods errorcode AL_SetEventCallback 1 EventCallBack 2 set event callback 2 do not execute object met
138. cked while AL_GetLine returns the currently selected row as a result of a click or any other action clickedRow This parameter returns the row that the user first clicked in mouse down Thus if the user clicks in row 5 and then drags the mouse and releases it in row 8 the clickedRow returned will be 5 AL GetColumn and AL_GetClickedRow routines should not be used in entry or exit callback methods as it reports where the user has clicked not where the cursor may reside If you wish to get the current row and column within exit callback you should use AL_GetCurrCell AL_GetColumn AL_GetClickedRow 210 User Action Commands Example row AL_GetClickedRow elist get the row clicked on The following example will return the selected column and row numbers cell then use the AL_GetCellValue routine to return the associated data displayed in the selected cell then use AL_SetCellValue to modify it Case of Form event OQn Plug in Area row AL_GetClickedRow cList col AL_GetColumn cList ret AL_GetCellValue cList row col sData sData new value AL_SetCellValue eList row col sData AL_UpdateArrays cList 1 End case The row number is also available as parameter 5 in the event callback method AL GetSelect areaRef L array X gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout array longint array Contains element numbers sel
139. column last clicked column C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C_STRING 255 7 tip string C STRING 255 8 area name C_LONGINT result i Case of 2 1 user single clicked ARRAY LONGINT aRows 0 MUST use a long integer array result AL_GetSelect eList aRows get the items selected by user If result 1 For i 1 Size of array aRows process each array item selected by user SEARCH Company Company Name aCompany aRows i do something here End for Else insufficient RAM to get user selection array ALERT Running low on memory quit and restart End if result 1 End case AL_GetSelect 212 User Action Commands AL GetCellSel areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout firstCellCol integer First cell column firstCellRow longint First cell row lastCellCol integer Last cell column lastCellRow longint Last cell row cellArray two dimensional longint array Discontiguous cells resultCode longint Result code AL_GetCellSel is used to get the cell selection Use the cellSelection option of AL_SetCellOpts to specify a cell selection mode prior to using this command You can procedurally set the selected cells using AL_SetCellSel If only one cell is selected then firstCellCol firstCellRow wi
140. command click in the header to display the AreaList Pro Sort Editor 0 the user is not able to display the Sort Editor default If the value of allowSortEditor is 1 the following actions will trigger the display of the AreaList Pro Sort Editor Windows ctrl click MacOS command click In addition similar actions such as right click or MacOS ctrl click can trigger an event report without displaying the AreaList Pro Sort Editor See Ctrl command click in the Column Header Event The AreaList Pro Sort Editor can also be displayed with AL_ShowSortEd AL_SetSortedCols provides the ability to customize the default list of sorted columns AL_GetSortedCols returns the current sort columns as displayed in the Sort Editor sortEditorPrompt optional This is the prompt that will be displayed at the top of the AreaList Pro Sort Editor The default is Select columns to sort The Sort Editor prompt can also be modified using AL_SetSortEditorParams showSortOrder 1 the current sort order will be displayed in the sort order list whenever the AreaList Pro Sort Editor is displayed 0 the sort order list will be empty whenever the AreaList Pro Sort Editor is displayed default showSortDirlndicator 1 a sort direction indicator will be displayed in the upper right corner above the vertical scrollbar 0 no sort direction indicator will be displayed default AL_SetSortOpts 104 Configuring AreaList Pro Usin
141. d also the event callback project method set by AL_ SetEventCallback See Event Callback Interface and Event Callback vs Object Method AreaList Pro s PostKey In response to user activity when using 4D 2003 and older versions AreaList Pro had to send a message to 4D by posting a keyboard event to the event queue to trigger the object method or form method s execution in the During phase On Plug in Area The default keyboard event is command ctrl You can modify this key with the postKey parameter of AL_SetMiscOpts This is no longer the case with 4D 2004 and above Determining the User s Action on an AreaList Pro Object The type of user action that triggered the execution of the callback project method is returned by AreaList Pro to either of the two methods according to the flag parameter of AL_SetEventCallback in the AL_GetLastEvent command formerly ALProEvt process variable to be used by the area s form or object method in the 2 parameter of the event callback method ArealList Pro s PostKkey Determining the User s Action on an AreaList Pro Object 202 User Action Commands The possible values are Constant Value User Action AL Null event D No action AL Single click event 1 Single click AL Double click event 2 Double click see note below AL Empty Area Single click 3 Single click in an empty part of the area without disp
142. d called when object is exited AL_SetMainCalls is used to set callback methods that are used when entering and exiting the AreaList Pro object areaRef AreaList Pro area reference areaEnteredMethod This method will be called whenever the AreaList Pro object is entered If this is a null string then no method will be called The areaEnteredMethod project method is passed one parameter This parameter is a long integer that corresponds to the AreaList Pro object on the layout If the AreaList Pro object is the first object in the entry order when the layout containing the AreaList Pro object is first opened the areaEnteredMethod will not be called This is because 4D gives the event to AreaList Pro to inform it that it is to be the active object when the layout is opened prior to the execution of the layout s method If you want to take action based upon this active object then call the areaEnteredMethod from the On load phase in your 4D code areaExitedMethod This method will be called whenever the AreaList Pro object is exited If this is the null string then no method will be called The areaExitedMethod project method is passed one parameter This parameter is a long integer that corresponds to the AreaList Pro object on the layout Some of the uses of these callbacks are as follows Enabling buttons or other variables that pertain to the AreaList Pro object from the areaEnteredMethod With 4D 2003 and earlier version
143. d prior to the method s call evtUpdateText updates the variable at the bottom of the list C_POINTER 1 gt variable C_POINTER 2 gt city array C_POINTER 3 gt state array 1 gt For i 1 Size of array aRows look at each row selected by user aRows populated by event callback 1 gt 1 gt 4 2 gt aRows i 3 gt aRows i plug values in vitem or vitemDest End for Here is how the layout will look with a few rows selected in both areas once rows have been dragged from the left area to the right one Example 10 Example 10 This is Example 10 from the Reference Manual which was built upon Example 9 Option alt drag row s between areas Fayetteville Little Rock Phoenix Tuscon Los Angeles Palm Springs San Diego Hartford Washington Ft Lauderdale Miami Atlanta Chicago Baton Rouge Ci State Petaluma CA Wilmington DE Orlando FL Tuscon AZ Washington DC Chicago IL Petaluma CA Orlando FL Example 10 Drag and Drop Between Areas 24 Examples The event callback method is common to both areas It now calls evtUpdate Text when a click occurs or select all and calls another project method named evtRows Dragged to handle a drag from the current 1 area Project method EventCallBack C_LONGINT 0 object method and form method will not be executed if O C_LONGINT 1 area Arealist Pro area C_
144. display in the footer for each column Up to fifteen footers can be set at a time The showFooters option of AL_SetMiscOpts must be enabled The size of the footer value is used by the automatic column sizing algorithm the same way that the hea der for a column is used For more information see AL_SetHeaders Nothing will be displayed in the footer area if AL_SetFooters is not used AL_SetFooters can be used in the On load phase or in another phase form event Example For i 1 Size of array aSalary Total Total aSalary i End for AL_SetFooters cEmplist 3 1 String Total AL GetFooters areaRef L footerList X options L gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout footerList array text or string Footer value list options longint Option reference resultCode longint Result code AL_GetFooters will return the footer information if you have enabled footers see AL_SetColOpts When calling AL_GetFooters you have the option of including or omitting invisible column s footerList A valid Am Dimension array text or string which will contain a list of all area footers AL_SetFooters AL_GetFooters 74 Configuring AreaList Pro Using Commands options When extracting the list of footers names you may optionally return only visible column footers 0 no options returns all footers default 1 returns only visible
145. display time of the list Text and string columns will take the longest to automatically size Since you can use AL_SetWidths on just some of the columns if you are displaying very large arrays but only one is text or string you could use the AL_SetWidths command on just the text or string column and let AreaList Pro automatically calculate the other column widths To determine the optimum width for a column you can display the pixel widths of columns in the headers during your design process and then use AL_SetWidths to set the width See Column Widths and the AL_SetWidths definition for more information When AreaList Pro displays fields the automatic column sizing algorithm uses only the first 20 records or less if the selection contains less than 20 records in the selection These records are always read regardless of whether the columns are automatically or manually sized Therefore there is no performance penalty using the automatic column sizing algorithm when displaying fields See Field and Record Commands for more information about displaying fields AL_SetFormat does not affect the performance of AreaList Pro regardless of the size of the columns being displayed This is because AreaList Pro is using 4D s array data directly and as the list is scrolling the formatting is being done on the fly Sorting the columns will have the greatest impact on the time required for AreaList Pro to be displayed in the On load pha
146. dragged from other objects Please read the section Technical Details of the Dragging Implementation for more information The Drop Area is essentially an invisible object which you will place on top of a graphic image such as a trash can icon You can control what types of objects can be dragged to the Drop Area using AL_SetDropDst Drop Area Objects on a Multi Page Layout If you are using a Drop Area on a layout with multiple pages you must disable a Drop Area which is not on the active layout page Use AL_SetDropDst with null strings for the destCode parameters Disabling Drop Areas You may want to disable a Drop Area so that it does not receive update events from 4D or the System This involves the use of AL_SetScroll area 0 0 See Scroll bars Changing Displayed Form Sort Editor AreaList Pro includes a Sort Editor dialog to allow the user to sort a list using more than one column as the sort criteria The user can command ctrl click on the headers to display the dialog You can use AL_ShowSortEd to display this dialog procedurally Area Name AL_SetAreaName provides a more descriptive name for referencing AreaList Pro areas Pass a null string to clear the area name The name can also be obtained with AL_GetAreaName This area name is also available in the event callback method parameter 8 Plug in information AL_GetVersion returns AreaList Pro s version while AL_GetPluginPath returns the active A
147. e C_LONGINT result result AL_Register Place your registration key here If result 1 error ALERT ArealList Pro could not be registered String result End if Example with multiple calls C_LONGINT result ignored in this case result AL_Register Registration key one result AL_Register Registration key two result AL_Register Registration key three etc AreaListPro AreaListPro is the command used to identify the AreaList Pro plug in area when you create a plug in area object on a layout This command is only used in the object definition for an AreaList Pro object and should never be used as a command in a method AL_Register AreaListPro 62 Configuring AreaList Pro Using Commands AL _SetArraysNam areaRef L columnNumber numArrays array1 S arrayN S gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set the first array numArrays integer Number of arrays to set up to 15 array arrayN string Names of 4D arrays resultCode integer Result code AL_SetArraysNam tells AreaList Pro what arrays to display Up to fifteen arrays can be set at a time Any 4D array type can be used except pointer and two dimensional arrays There are three very important points to note about this command This command must be called first before any of the other
148. e areaRef L cellRow L cellColumn 1 alphanumericData T picttiatabt 181 AL_GetClickedRow areaRef L gt clickedRow L c ceeececeeccsessescessescscescessesssccsceecsecesseccecsesssssusaceessssassaeseceesaetaesacescestsstassaseasssseataeeeseees 212 AL Crete ete areaR efi e Columns annn frends Leseuensacias DES Ee SOEN hive EERSTEN 216 AL_GetColOpts areaRef L allowColumnResize I automaticResize allowColumnLock hideLastColumns displayPixelWidth 1 dragColumn l aGCepED Fags a A E E iecbuassoateveseoes CEA deier deieren E E 94 AL GetColumn areaRef L gt dickedColumn atati t ttan ES ESENES ESES SSNAN ENESES ENESES SESS araa nen enean 211 AL_GetCopyOpts areaRef L includeHiddenCols l fieldDelimiter S recordDelimiter S fieldWrapper S sss esse eee eee 104 AL_GetCurrCell areaRef L cellColumn l cellRow L o cc eccececseccessessssescessescecescescescsscssescsscssssessccscsessssascsessssssaesasesceassssausaseasesssataeeeesses 187 AL GetDrgArea areaRef L destAtea L T E T 199 AL Set Dre Deno areaRef l y destCol l sissies sesiis a Eaa iS E E EAER dank LSE ETa E ELE aa 202 AL Ger Dakon areak BE 202 ARRE RIR EE EK EE 200 AL GetDresreCol areaRef L sourceCol assasin itia aE Sa atten A EEAS a TEES Sit 198 AL GED EE 197 AL GetFields areaRef L tableArray X fieldArray X gt resultCode L seene 165 AL GetFooters areaRef L footerList X options L gt resuht ode 76 AL GetFormat areaRef L columnNumber format S columnJust
149. e event occured that requires the end of an editing session The return values will be honored and editing will not end if callback returns False For example it means that if during editing the user tries to scroll the area and exit callback returns False editing will not be terminated and the area will not scroll AL Cell validate action mode 8 means that 4D requested the validation of the area data because it is going to execute some object or form method but 4D does not want to remove focus from AreaList Pro area and editing will not end The return value is not important as editing will not end whatever is returned Note that this event will occur if user clicks on non focusable object including buttons popups etc If the executed method requires that editing ends before the method is executed it has to call AL_ExitCell at its beginning Using Callback Methods During Data Entry 145 Using the Callback Methods For example if a cell is currently edited and the user clicks on an enterable 4D field in the layout the exit callback method will be called with entryFinishedMode parameter set to the value 7 AL ExitCell action If the callback method returns False then the user action will be denied and the cursor will remain in the current cell of the AreaList Pro area If the callback method returns True the cursor will move to the object that was clicked It the user clicks on a non focusable object such as a standard MacOS button
150. e mouse button for the developer determined period of time When you have configured AreaList Pro to allow data entry using AL_SetEntryOpts with an modifier click control command etc data entry will be automatically initiated when the user holds down the mouse button This interface will allow you to create an interface whereby users can single click or double click on cells and initiate data entry without requiring the defined keyboard modifier The following example has data entry configured as control double click however it will also be activated when the user has held down the mouse button in an enterable cell for one second 60 ticks as configured in AL_SetInterface AL_Setinterface cList 1 1 1 1 60 initiate data entry after one second of holding AL_SetEntryOpts eList 7 0 Entry Cell Border AreaList Pro uses the native cell border when performing data entry Native system commands are used on both platforms to draw a focus rectangle around the edited text A V2 OTE 8 EE SS ERNE HTS R AreaList Prd MacOS R IRA ETIT anaa CT R AreaList Pro Windows 9 AreaList Pro MacOS AREALIST PRO CELL BORDER Filters Click and Hold Data Entry Initiation Entry Cell Border 168 Enterability Popups As an alternative to typed data entry you can specify that a column use popup menus by using the popupArray parameter of AL_SetEnterable In this parameter an array is passed to AreaList Pro with wh
151. e of a specific cell range of cells or list of cells To specify a single cell If firstCellCol and firstCellRow are greater than 0 and lastCellCol or lastCellRow are less than or equal to 0 then only firstCellCol firstCellRow will be set To specify a range of cells If firstCellCol and firstCellRow are greater than 0 and lastCellCol and lastCellRow are greater than 0 then the range of cells from firstCellCol firstCellRow to lastCellCol lastCellRow will be set To specify discontiguous cells If firstCellCol or firstCellRow are less than or equal to 0 then the cells in cellArray will be set cellArray Two dimensional long integer array The first dimension must be two The first array is for the column indices and the second array is for the row indices The second dimension must be the same as the number of cells that are to be selected See the following illustration cellArra Cell 1 EX Cell 2 2 Cell n G Column Row EL lee AL_SetCellStyle 122 Configuring AreaList Pro Using Commands styleNum This parameter is used to set the style for the specified cells The values shown below can be added together to combine styles Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 If a cell style has been previously set the style may be removed by setting styleNum to 1 The cell style may be left unchanged by setting styleNum t
152. e of the font used size integer Size of the font styleNum integer Style of the font AL_GetFtrStyle returns the formatting options set using the AL_SetFtrStyle routine For complete information on the values which are returned please refer to the AL_SetFtrStyle routine for parameter descriptions The following example will retrieve the information set using the AL_SetFtrStyle routine C_LONGINT fontSize fontStyle C_TEXT fontName AL_GetFtrStyle cList 1 fontName fontSize fontStyle AL_SetFtrStyle AL_GetFtrStyle 83 Configuring AreaList Pro Using Commands AL SetStyle areaRef L columnNumber fontName S size l styleNum Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column for which to set the style fontName string Name of the font to use gt size integer Size of the font styleNum integer Style of the font AL_SetStyle is used to control the appearance of the AreaList Pro columns The columns can be controlled individually or as a group columnNumber This parameter specifies what column to apply the style to Use a value of zero 0 to apply the parameters to all columns fontName Use this parameter to specify the font for the specified columnNumber If not called or the specified fontName is not found the column s will be displayed with the default font See AL _SetDefaultStyle If the font specified by fontName is not
153. e second before automatically initiating data entry allowPartialRow 0 Don t display partial row area will be resized vertically to only show full rows Use new date and time popups entryControls Don t use inline controls for date and time data entry use plain text instead areaRef AreaList Pro area reference or 1 for global setting You can use this routine to provide global configuration for all AreaList Pro areas in your database by passing an area reference of 1 as the first parameter This does not affect already created areas appearance Instructs AreaList Pro to use the defined appearance setting regardless of the current OS platform Constant Value Description AL Default Interface 0 Default platform appearance AL Platinium Interface 1 Platinum Mac OS9 appearance AL Force OSX Interface 2 Force Mac OSX appearance AL Force XP Interface 3 Force Windows XP appearance AL Force Vista Interface 4 Force Vista appearance This parameter will be ignored if the useModernLook parameter of AL_SetMiscOpts is set to a value of 0 sortIndicator Determines the location of the sort icon 0 sort icon in header OSX XP only 1 sort icon above scrollbar useEllipsis Determines if auto ellipsis is used 0 don t use ellipsis in header and column data 1 use ellipsis in header and column data in the center for right aligned text 2 use ellipsis in
154. e the method has completed its execution This is the secure and least problematic place where to place the code A limitation is that some events do not trigger the object method or project method execution Another limitation is that no arguments parameters can be passed from or to the method Event Callbacks Area callbacks event entry and exit are executed immediately after the event is received often before this event is fully processed They can receive parameters and modify AreaList Pro behavior However when the the callback is executed 4D and AreaList Pro may be still processing the event and some AreaList Pro and 4D commands are ignored This is a more advanced feature and the developer should understand what is he doing You need to watch carefully any modification of the data that is displayed by AreaList Pro We try to ensure that at least AreaList Pro does not crash if the developer does something he should not but some careless code can still get AreaList Pro into an undefined state A good example is deleting row s if AreaList Pro has begun to process an event for a row and that row is then deleted in the callback method once the execution returns from callback to AreaList Pro code AreaList Pro proceeds with event processing even though the row no longer exists This may lead to an odd behavior Determining the User s Action on an Arealist Pro Object Event Callback vs Object Method 205 User Action Comma
155. e to complete data entry for the cell The data is invalid Copy the old data from the zero element to the array element corresponding to the cell Set 0 True to complete data entry for the cell For example aFname vRow aFname 0 reset the cell contents to their original state 0 True The data is invalid Inform the user that the data is invalid Set 0 False to force the user to remain in the cell and enter another value The data is invalid Inform the user that the data is invalid Modify the cell contents call AL_GotoCell to go to the current cell and set 0 True This achieves the same effect as rejecting the entry but allows the cell contents to be modified Examples aFname vRow aFname 0 reset the cell contents to their original state AL_GotoCell eList vColumn vRow go to the same cell 0 True Don t install an entry started method do install an entry finished method AL_SetCallbacks eList EntryDoneMethod See also Compatibility Note AL ExitCell and AL Cell deselect action become AL ExitCell and AL Cell Validate AL_SetEventCalliback areaRef L callbackMethod S flag L resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt callbackMethod string A valid 4 Dimension method which will be called during AreaList Pro event execution gt flag integer Handling flag AL_SetEventCallback provides an alternate method for dealing wit
156. e used with data entry Please read the section Using Callback Methods During Data Entry for more information entryStartedMethod This project method will be called whenever data entry is started in a cell or when a popup menu is clicked If this is the null empty string then no method will be called The entryStartedMethod is passed two parameters The first parameter is a longint that corresponds to the AreaList Pro object on the layout The second parameter is a longint that reports what action mode caused data entry to be started in the cell AL_SetMainCalls AL_SetCallbacks 149 Using the Callback Methods For a list of the possible values of the second parameter see the table below Constant Value Entry Mode AL Click action 1 Click in Cell AL Tab key action 2 Tab AL Shift_Tab key action 3 Shift Tab AL Return key action 4 Return AL Shift Return key action 5 Shift Return AL GotoCell action 6 AL GotoCell 7 Not used 8 Not used AL SkipCell action 9 AL SkipCell AL Other cell popup action 10 Click on cell popup when cursor not already in cell AL Active cell popup action 11 Click on cell popup when cursor already in cell entryFinishedMethod This project method will be called whenever data entry is finished in a cell or when a popup menu is released in a cell for which typed data entry has not been established This method must be a function It must return True for the value entered in
157. e user and perform your own sort action 3 Enable the user sort buttons for indexed fields only If the field in the column is not indexed the sort button will highlight when clicked but no sort will be performed If the field in the column is indexed the fields will be sorted based on the values in the column which was clicked The AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable If arrays not fields are displayed in the object then all of the sort buttons will be enabled AL_SetSortOpts 103 Configuring AreaList Pro Using Commands In the following situations the column header will highlight but no sort will occur no event callback method will be called and the method for the AreaList Pro area form will not run if the value of userSort is 1 2 or 3 and the column contains a picture column if the value of userSort is 1 or 3 and the column contains a field from a related one table If the value of userSort is 2 and the column contains a field from a related one table the column header will highlight but no sort will occur the event callback method will be called if defined and or the method for the AreaList Pro area form will run When the user sort is bypassed by setting userSort to 2 AL_GetSort is still used to get the column header that was clicked on allowSortEditor 1 the user can ctrl
158. e user can drop an item as a row as a column or as a cell If the destination is a cell an outline will be shown inside the cell that the cursor is over to indicate where the item will be dropped See Dragging Commands for more information Drag and Drop 27 The AreaList Pro User Interface Enterability Initiating Data Entry Data entry using typed characters may be initiated on an AreaList Pro object by several programmable methods all of which require clicking in the cell with or without a modifier key For example data entry on a given cell could be initiated upon a single click in that cell a double click or a double click along with the option alt ctrl command shift or control key Click and Hold AreaList Pro also provides the ability to initiate data entry by clicking and holding the mouse button down in the cell where you wish to perform data entry Using this interface users are still able to select rows via single click and double click If you wish to initiate data entry using this method use the AL_SetEntryOpts routine as follows AL_Setinterface cList 1 1 1 1 60 initiate data entry after 1 sec 60 ticks parameter 6 of holding AL_SetEntryOpts clist 7 0 initiate data entry via control double click Data Entry will be initiated whenever any modifier click action is defined as the data entry initiator value 2 7 If the user moves the mouse during the click and hold action AreaList Pro may interpre
159. eList 1 4 vColumn1 vColumn2 vColumn3 vColumn4 get the current widths Prefs Col1 vColumn 1 Prefs Col2 vColumn2 Prefs Col3 vColumn3 Prefs Col4 vColumn4 SAVE RECORD Prefs save widths in a preferences file for future use End case AL_GetWidths 207 User Action Commands AL_GetSort areaRef L column1 1 columnN Parameter Type Description areaRef longint Reference of AreaList Pro object on layout column columnN integer Columns that sort was performed upon AL_GetSort is used to return the current sort order column columnN These parameters return the column or columns that the user sorted A column greater than 0 means that the column is sorted in ascending order while a column less than 0 means that the column is sorted in descending order If a column is 0 then all subsequent columns should be ignored When the user sort is bypassed by setting the userSort option of AL SetSortOpts to 2 AL_GetSort is still used to get the column header that was clicked on You can set the sort order using AL_SetSort Examples Event callback method C_LONGINT 0 object method and form method will not be executed if 0 C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4 column last clicked columnNote C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C STRING 255 7 tip string C STRING 255
160. eaList Pro area based on field references from a parent and related table AL_SetHeaders AL_GetHeaders 69 Configuring AreaList Pro Using Commands AL_SetHeaders cList 1 1 First Name AL_SetHeaders cList 2 1 Last Name Then well use the AL_GetHeaders routine to extract the header names ARRAY TEXT atAL_HeaderList 0 ret AL_GetHeaders eList atAlL_HeaderList When the routine is complete the array will have two elements atAL_HeaderList 1 contains First Name atAL_HeaderList 2 contains Last Name AL SetHeadericon areaRef L columnNumber iconAlignment picture P horPosition vertPosition 1 offset 1 scaling Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to set the header icon iconAlignment integer Position of icon picture picture Icon or picture to use horPosition integer Horizontal position vertPosition integer Vertical position offset integer Pixel offset gt scaling integer Scaling AL_SetHeaderlcon provides the ability to procedurally place icons in column headers One or two icons may be used left and right columnNumber Desired header column number iconAlignment Position of icon a header can contain up to two icons 0 places icon on left of header 1 places icon on right of header picture 4D picture object containing the icon due to limitations of icons dra
161. ected by the user when the multi rows option is enabled result ode longint Result code AL_GetSelect is used to determine which items were selected by the user when the multiRows option of AL_SetRowOpts is enabled and they have selected multiple rows Each element of the array contains a row number that the user selected when the list was displayed The array must be an long integer array so be sure to use the ARRAY LONGINT command prior to calling AL_GetSelect resultCode This value is equal to one 1 if enough memory was available to resize array If enough memory was not available you should react accordingly AL_GetClickedRow AL_GetSelect 211 User Action Commands You can use AL _SetSelect to highlight rows Example multi rows option is enabled the list is displayed and the user selects rows 2 4 5 6 10 11 15 17 E L Area layout s form method Case of Form event On Load result AL_SetArraysNam clist 1 3 aLN aFN aCompany display the list AL_SetRowOpts cList 1 0 0 0 0 turn on multi rows option 2nd parameter result AL_SetEventCallback eList AL_EventCallback 0 do not execute area object or form method update 4D variables End case AL_EventCallback Event callback method C_LONGINT 0 object method and form method will not be executed if O C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4
162. ection parameters AL_SetEntryOpts eList 3 0 0 set double click to enter data entry mode AL_SetEnterable clist 1 0 set column 1 to be non enterable AL_SetCallbacks eList ExitCallback set exit callback to project method ExitCallback DEMO_DefauIt eList wi vitem Form event On Plug in Area respond to user action Case of AL_GetLastEvent cList 1 did user single click on a row ARRAY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user vitem For i 1 Size of array aRows look at each row selected by user vitem vitem aCity aRows i aState aRows i plug values in vitem End for End case Al_GetLastEvent eList End case In the callback method we must find out from AreaList Pro if the cell was actually modified and if so which cell it was AL_GetCellMod returns a boolean value indicating whether the cell was modified and AL_GetCurrCell returns its column and row position Note that the callback method is actually a function AreaList Pro expects a return value which will indicate whether or not the newly entered data is accepted Example 7 Validating Data Entry 232 Examples The code for the callback project method ExitCallback is Project method ExitCallback C_BOOLEAN 0 data valid return value True or False C_LONGINT 1 Arealist Pro object reference C_LONGINT 2 action terminating data entry for this cell C_LONGINT
163. ed on column header automatic sort won t be executed 1 11 2 gt Control click on column header 1 12 2 gt Click on column footer 1 0 No event 2 gt unchanged Else 2 gt Unknown event End case If 1 0 Let s add the event code 2 gt 2 gt String 1 End if Our eList object method On Plug in Area case updates the left area event text value Case of Form event Cn Load initialize the AreaList Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam Self gt 1 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders Self gt 1 2 City State specify the values for the column headers AL_SetRowOpts Self gt AL Multiple row selection AL Allow single or no row 2 1 set multi rows mode allow no selection drag out drag in DEMO_Default Self gt vLeftEventText Form event On Plug in Area call from any of the two areas AlpEventText AL_GetLastEvent Self gt gt vLeftEventText End case The eListDest object method performs a similar update with vRightEventText Example 11 Getting the Last Event in each Area 246 Examples Here is how the layout will look after a couple of events Example 11 This is Example 11 from the Reference Manual which was built to illustrate the use
164. ed when an AreaList Pro object has been set to allow cell selection using AL_SetCellOpts Copying rows to the clipboard will not be allowed when displaying fields The Copy menu item will be disabled when fields are displayed See Field and Record Commands for more information about displaying fields AL_SetEditMenuCallback will install a callback method which will be called when any Edit menu action occurs You have the option of overriding an 4D edit action for a given AreaList Pro area providing an extensive customization interface when using Edit menu See Edit menu callbacks Selection Clipboard 53 Configuring AreaList Pro Using Commands Picture Columns AreaList Pro supports the display of picture columns The format parameter of AL_SetFormat will cause the picture to be displayed in one of several ways truncated and justified to the upper left of the cell truncated and centered in the cell scaled to fit the cell scaled proportionally to fit the cell The usePictHeight parameter of this command will tell AreaList Pro whether to use a picture s original height which is stored with the picture when calculating the row height for the AreaList Pro area If you choose not to use the picture s height in the row height calculation and additional space is needed to display the picture the numRowLines parameter of AL_SetHeight should be used to increase the row height Scroll Bars Changing Displayed Form If an AreaList P
165. ee 145 Compatibility Note AL ExitCell and AL Cell deselect action become AL ExitCell and AL Cell Validate 145 Event Callback leet 146 Edit Menu Callback e 146 Calculated Col mm Callback ode eisereen esas sw geed E 147 Command E 148 AL_SetMainCalls areaRef L areaEnteredMethod S areatvitecdMethod 7 148 AL_SetCallbacks areaRef L entryStartedMethod S ent inshedMetbod E 149 AL_SetEventCallback areaRef L callbackMethod S flag L gt resuitCode L 151 AL_SetEditMenuCallback areaRef L callbackMethod S resuhtCodel nnn 153 AL_SetCalcCall areaRef L columnNumber GaleCallback eee eee 155 Field and Record Commands 156 Using the Field Display Capability eeschte egene regeert 156 Temporary u U 156 Arrays and WEE 156 Compatibility Note Field Display and Callbacks ccc accssescseng asia tenet Seale tbeisdeoenadeundat seed cea redone 157 Setting a Calculated ColuM EE 157 Setting the Callback Method EE 158 Table of contents Syl elen R E E 158 Time Data E 158 Displaying 4D Field EH 159 Fields from Related One le 159 Redrawand Scrolling E 159 Kuele DEE 159 Copy ROWS 10 the Clpboard EE 159 Enter sane aeee E Ee ee 159 Dragging EEN 159 eel TT 159 Maximum Number of Records Displayed serere OaS a ae ae E eeN 160 Performance Issues When Displaying Felda see sees essere 160 IEA ipo EE 160 AL_SetFile areaRef L tableNum l gt resultCode L sse 160 AL_SetFields areaRef L tableNum 1 columnNumber numFields
166. eight in pixels to give to each row Default is 0 numFooterLines The number of lines to give to the footer Default is 1 footerHeightPad The extra height in pixels to give to the footer Default is 2 Examples AL_SetHeight cList 1 4 1 2 1 4 pad the header by 4 pixels the rows by 2 the footers by 4 AL_SetHeight clist 2 5 2 0 2 0 set header lines to 2 pad to 5 pixels set row lines to 2 no padding set footer lines to 2 no padding AL_SetHeight 136 Configuring AreaList Pro Using Commands AL_SetMinRowHeight areaRef L minRowHeight L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout minRowHeight longint Minimum row height AL_SetMinRowHeight provides the ability to set the minimum row height for AreaList Pro rows This is different than row padding as it will allow you to set individual rows to appear with extra white space regardless of the amount of data minRowHeight Minimum row height The following example will set the minimum row height to two rows regardless of the amount of data displayed AL_SetMinRowHeight cList 2 AL _ SetPictureEscape areaRef L escapeChar S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout escapeChar string Escape character AL_SetPictureEscape will set the current escape character used to inform AreaList Pro where icon references exist in your cell data or headers You
167. ems selected 177 total items e r T First Name Last Name Salary amp Arval Male City State s Country Title Iw S pid Mike Erickson 1 000 00 3 10 PM amp QO Tapei Ta 94065 ROC Vice President 05 18 19 4 Barbara Anderson 68 484 36 716AM amp Tulsa gt OK 95014 USA Vice President 05 06 197 Samir Arora 63 847 98 7 02AM ff Jersulaem 95014 Israel Programmer 11 14 19 Mike Bailey 83 410 74 7 59PM ff Brooklyn NY 94086 USA Manager 11 29 19 Sharon Jones 90 019 86 812AaM amp Baghdad 43220 Iraq Stenographer R 06 11 19 Rick Barron 59 908 38 810AM amp Tulsa OK 80302 USA Sales Rep 05 27 19 Jim Bartimo 21 418 88 12 59PM ff Dallas 95190 Iraq Manager 07 28 19 Randy Battat 26 898 06 852 AMR S London MI 95014 USA System Anal 12 17 19 4 Lofty Becker 85 627 50 12 07 PM amp Los Angeles CA 7 06105 USA Manager 04 13 19 lt i gt lt gt Action None Display Arrays Of Column List Configuration Options Configuration Options Columns Disable Row Highlighting Selection Mode a 2 2 D S Resort in During Phase Y aa 2 W ER oR Multiple Lines iB Enable Sort Editor L Display 15 77 Schad a Enable Line Dragging Scroll Bars Order S Enable Column Dragging Allow No Lines in Single Line S Vertical Scroll Bars S Resizable Columns D Horizontal Scroll Bars Appearance Appearance Man 21 vw Alternate Row Background Show Focus Platform Default B C Sort Icon Above Scrollbar
168. ence based on AD field references see AL_SetFields tableArray A valid Ai Dimension longint array which will contain the list of table numbers fieldArray A valid 4 Dimension longint array which will contain the list of field numbers result Returns one of the following results 50 Parameter error array of wrong type must be longint arrays 1 Wrong mode see AL_GetMode AL_GetTable AL_GetFields 163 Field and Record Commands The following example will build an AreaList Pro area based on field references from a parent and related table ret AL_SetFields eList Table gt People 1 2 Field gt People FirstName Field gt People LastName ret AL_SetFields cList Table gt Companies 3 Field gt Companies Company Name ret AL_SetFields cList Table gt People 4 1 Field gt People Salary Then we ll use the AL_GetFields routine to return arrays of table and field numbers ARRAY LONGINT ciAL_TableNo 0 ARRAY LONGINT aiAL_FieldNo 0 ret AL_GetFields elist aiAL_TableNo aiAL_FieldNo aiAL_TableNo and aiAL_FieldNo will contain 3 entries each AL _InsertFields areaRef L tableNum l columnNumber numFields 1 fieldNum1 1 field NumN resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout tableNum integer Number of 4D table columnNumber integer Column at which to set the first field
169. encing Format Each time a command or section is mentioned a cross reference is given through hyperlinks to let you quickly find the definition for the command Command List The alphabetical list includes the parameters for each command and the page number link to the command definition Using the AreaList Pro Manual Cross Referencing Format Command List 15 About AreaList Pro Constant List A full list of AreaList Pro constants is also available organized by theme with each constants actual value Command Descriptions and Syntax Each AreaList Pro command or routine has a syntax or rules that describe how to use the command in your 4D database For each command the name of the command is followed by the commande parameters The parameters are enclosed in parenthesis and separated by semicolons Following the command syntax description an explanation of the command s parameters is provided For each parameter the type of the parameter and a description is shown Examples are provided for each of the commands showing the syntax as well as how the various commands are used together The first parameter for most commands is the long integer reference of the AreaList Pro object on the layout This parameter is required to allow the commands to operate on the correct object Some routines are actually functions which return a long integer result value Unless otherwise indicated the value is 0 when no error occurred or 50
170. equires that you recompile your applications and you must make sure you have matching versions across Mac Windows clients if you are using multi platform deployments AreaList Pro 8 3 is NOT drop in compatible if you drop in AreaList Pro 8 3 or greater into an existing compiled application you will receive the following error dialog 1 Error 9939 AreaList Pro Pkg Bundle Error The plug in method cannot be executed ERROR WHEN MISMATCH VERSIONS EXIST Installation Plug In bundle MacOS amp Windows Backwards Compatibility 17 Configuring AreaList Pro The AreaList Pro User Interface Configuring AreaList Pro AreaList Pro is comprised of a suite of plug in routines and A Dimension methods designed to extend the existing A Dimension command set providing a variety of miscellaneous utility routines AreaList Pro Plug In routines are routines that exist in the AreaList Pro plug in and do not require an addition installation or configuration actions outside of standard plug in installation Just make sure you have successfully registered your copy of AreaList Pro by calling the plug in s registration routines please see AL_Register for more information ret AL_Register registrationKey The AreaList Pro User Interface AreaList Pro displays a scrolling area on 4D layouts as shown below e098 AreaList Pro Configuration Options Demo AreaList Pro 7 9 Feature Demonstration Version 7 9 1 al 0 of 177 it
171. er modifying the arrays and before any other setup commands sorting formatting etc updateMethod This parameter tells AreaList Pro how to update the AreaList Pro object areaRef Constant Value Description When to Use AL Recalculate 2 Rescan all arrays and recalculate all If column or row resizing is arrays applicable heights widths and other necessary or you have added or removed related values The scroll position and elements to any of the displayed arrays row or cell selection will be reset Also if you show or hide either scroll bar the headers or footers or add or remove arrays AL Refresh and 1 Refresh the AreaList Pro object but The AreaList Pro object needs to be update arrays don t recalculate any values updated because of changes to an array element s contents or formatting changes to colors styles etc This value should only be used when no column or row resizing is necessary since formatting styles or an element s new contents could affect a column width or row height You may only pass a value of 1 for updateMethod when calling AL_UpdateArrays from a callback method other than the event callback 2 can be used in event callback methods Please read the section Using Callback Methods During Data Entry for more information AL_RemoveArrays AL_UpdateArrays 67 Configuring AreaList Pro Using Commands Examples Any action which modifies an array element value or ch
172. erSort integer Allow user to sort allowSortEditor integer Allow user to sort with editor sortEditorPrompt string Set the prompt of the Sort Editor showSortOrder integer Show the current sort order in the Sort Editor showSortDirlndicator integer Show the current sort direction in upper right corner AL_SetSortOpts is used to control several AreaList Pro options pertaining to sorting automaticSort 1 whenever an array or field command is called while the area is displayed the columns will be automatically sorted based upon the current sort order 0 no sorting will be done automatically default userSort 0 Disable the user sort buttons in the column headers 1 Enable the user sort buttons in the column headers default The sort buttons will highlight when clicked and the columns will be sorted based on the values in the column which was clicked The AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable 2 Bypass the user sort buttons in the column headers The sort buttons will highlight when clicked but no sort will be performed The AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable This allows you to procedurally check for a click of a sort button by th
173. erer oer 25 Ee EE 26 Copy to Clipboard and Edit E UE 26 Ree EE Drop cesena a oie nati on met AEE aa ems aaron 26 MO DAG a ROW EE 26 TO Drag a CONAN EE 27 Dragging toa EE 27 Dragging toa ell LEE 27 KARTEN 27 Table of contents Dragging Kee 27 By Ee TT banaue cesaesoustecoras ess vececece s teqsep 2eneusseest ceenesenesaae ses enneseesere 28 Initiating Data Eeer rr E re TD EE 28 CLICK ANG Ol Gist E 28 Data Selection and Edit Menu Commands E 28 Entenng d EE 28 Data Entry USING POPUPS sisietes cases eccdusscvcesen cies senavateesechacacea a sett cicsesstatvever a henescsees 29 Data Enty USing Is e cT ee eR Se keer Le 30 M ving the Curent Er eege 30 Exiting Data EE 30 ACoA VSS es acc aa E A E estes 30 Resizable Windows with AreaList Pro 31 Creating an AreaList Pro object on a form 31 To configure a variable object as an AreaList Pro oblect nnn nnn nnmnnn 31 Arealist Pro aleze d gle lel scrisa aa er eae ae EEEE EEEIEE E EES 32 Creating an Drop Area on a un essiensa ieia a E Ra a E 32 Usingthe AreaList Pro Commands E 32 Command Descriptions and Zeene 33 Causing an AreaList Pro Callback Method to Execute see eee 33 Developer E 33 Configuring AreaList Pro Using the Advanced Properties Dialog 34 To Display the Advanced Properties Dialogs mrrsniriniseniiiii iain ioe awe 34 setting the Data to ARTE VE 35 Reie Pa UT 35 Displaying Me 36 Col mm Snn 21 Te T peasant Orinda tinea ibaa E A E E laos 37 Default e D 37 General
174. ern look will be used default When useModernLook is set to a value of 1 the appearance of the AreaList Pro object will be set according to the current OS or to the appearance parameter of AL_SetInterface AL_SetMiscOpts can be used in the On load phase or in another phase form event Examples Don t hide the headers show the area selected in 3D frame use the default postKey don t show footers use modern appearance AL_SetMiscOpts eList 0 1 0 1 Hide the headers don t show the area selected cue use open bracket for the postKey show footers use traditional appearance AL_SetMiscOpfts eList 1 0 1 0 See also the example provided for AL_Setlnterface to illustrate the combination of this command with AL_SetMiscOpts and AL_GetMiscOpts AL _GetMiscOpts areaRef L hideHeaders areaSelected postKey S showFooters 1 useModernLook 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout hideHeaders integer Hide the column headers areaSelected integer Visual cue that the plug in area is selected postKey string String character to post to execute method showFooters integer Show the column footers useModernLook integer Modern or traditional appearance AL_GetMiscOpts will return the current settings configured using AL_SetMiscOpts For complete details about return values see the AL_SetMiscOpts routine for possible configuration settings AL_S
175. ers 1 and 2 passed to this callback method are areaRef and columnNumber Therefore if desired the same callback can be used for more than one AreaList Pro object and for many columns in an object For information on how to write a calculated column callback see the section Calculated Column Callback Example Set calculated callback method for column 3 AL_SetCalcCall eList 3 CalcColCallback AL_SetCalcCall 155 Field and Record Commands Field and Record Commands AreaList Pro uses the SELECTION RANGE TO ARRAY command in 4D to get the records for display Up to 512 fields columns can be displayed in an AreaList Pro object You can use the Advanced Properties Dialog to configure the fields to display in an AreaList Pro object Please read the section Configuring AreaList Pro Using the Advanced Properties Dialog for more information Using the Field Display Capability Temporary Arrays AreaList Pro internally uses interprocess 4D arrays to get the record data from 4 Dimension These arrays must be declared in 4D A text file has been included that contains these declarations Simply create a 4D global method named Compiler_ALP and copy these declarations into it There is no need to call this method from your 4D code AreaList Pro will call it for you This method must exist whether your database is interpreted or compiled Do not access the data within these temporary arrays These arrays are for AreaList Pro s in
176. erties Dialog AreaList Pro includes a point and click interface for configuring a AreaList Pro object from within the Design environment This dialog provides access to configure nearly every feature available via AreaList Pro commands and is very easy to use The Advanced Properties dialog lets you specify the names of the arrays to be displayed and nearly all options There is a preview tab to instantly view the options that you ve selected Once you click the OK button to complete the configuration the settings will be saved by 4D within the plug in area object on your layout Whenever this layout is opened in the User Runtime environments the settings made here will be applied to your AreaList Pro object before the form method or any object methods are executed Essentially you are replacing the default settings provided by AreaList Pro with new values of your choosing You can use commands in combination with the Advanced Properties Dialog In this case AreaList Pro first reads the settings specified in the dialog then uses the settings specified by commands To Display the Advanced Properties Dialog 1 Double click a AreaList Pro object in the Layout Editor 4D will display the Object Properties palette CH Property List Variablel Y Objects Type AreaListPro Object Name Variable Advanced Properties Edit Variable Name eDemoALP Object Method Edit Help Message lt None gt Draggable Droppable y Coordina
177. es 1 rowHeightPad numFooterLines 1 footerHeightPad 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout numHeaderLines integer Number of text lines in the header headerHeightPad integer Extra height for the header numRowLines integer Number of text lines in each row rowHeightPad integer Extra height for each row numFooterLines integer Number of text lines in the footer footerHeightPad integer Extra height for the footer AL_SetHeight is used to set the number of lines of text along with additional height padding in the header in the rows and in the footer Only text and string columns can wrap to more than one line If numRowLines is set to 2 or more text and string elements will be able to wrap into the number of lines specified for each row Note that all rows will be given the same number of lines regardless of the actual number of lines used by a specific text or string element Additional padding may be set using rowHeightPad to allow more space between rows Text will be centered vertically in the header or row Note that the padding applies to the entire row and not on a line by line basis within the row numHeaderLines The number of lines in the header Default is 1 headerHeightPad The extra height in pixels to give to the header Default is 2 numRowLines The number of lines to give to each row Default is 1 rowHeightPad The extra h
178. etCellValue areaRef L cellRow L cellColumn 1 alphanumericData T pictData P Parameter Type Description areaRef longint Reference of AreaList Pro object on layout cellRow longint Desired row cellColumn longint Desired column alphanumericData text Non picture data pictData picture Picture data AL_GetCellValue will return the displayed value using the supplied row and column AL_GetCellMod AL_GetCellValue 179 Enterability If the value contained in the cell is a picture object it will be returned in the picture data parameter otherwise the value will be returned in the non picture data parameter cellRow Desired row cellColumn Desired column alphanumericData Any non picture data will be returned in this parameter using any formatting values if supplied see AL_SetFormat pictData Any picture data will be returned in this parameter The following example will extract the cell data for the 3 row 2 column The information returned will be either text or picture C TEXT iData C_PICTURE pData AL_GetCellValue cList 3 2 tData pData AL_SetCellHigh areaRef L startPosition endPosition Parameter Type Description areaRef longint Reference of AreaList Pro object on layout startPosition integer First character of cell text to highlight endPosition integer Last character of cell text to highlight AL_SetCellHigh will highlight a range of character
179. etMiscOpts AL_GetMiscOpts 99 Configuring AreaList Pro Using Commands AL SetMiscColor areaRef L selector 1 alpColor S 4dColor Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt selector integer Select which part to apply the color to alpColor string Color from AreaList Pro s palette AdColor integer Color from 4D s palette AL_SetMiscColor is used to set the color of miscellaneous parts of an AreaList Pro object AreaList Pro has its own palette with the following colors white black blue green yellow magenta red cyan gray light gray selector 0 The background color of the area in the header above the vertical scrollbar This area only exists if the header and the vertical scrollbar are shown 1 The background color of the area in the footer below the vertical scrollbar This area only exists if the footer and the vertical scrollbar are shown 2 The background color of the area to the left of the horizontal scrollbar This area only exists if the horizontal scrollbar is shown and at least one column is locked 3 The background color of the area to the right of the horizontal scrollbar This area only exists if the horizontal scrollbar and the vertical scrollbar are shown alpColor Name of the color in AreaList Pro s palette This will be the color for the part specified by selector If the name is not in AreaList Pro s palette
180. etails Whenever a cell is enterable with typing the entryControls parameter of AL_SetInterface sets if the entry is performed using plain text of inline controls See Data Entry Using Inline Controls for more details These settings can be restricted but not expanded with AL_SetCellEnter AL SetFilter areaRef L columNumber 1 entryFilter S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column where to apply filter entryFilter string Filter for input data AL_SetFilter is used to set the entry filter for a column columnNumber This parameter specifies the column to act on If columnNumber is 0 then all columns will be affected entryFilter This parameter specifies the filter to use Entry filters will function as they do in A Dimension except that they will not handle placeholders Predefined styles may not be used Please read the section Filters for more information Examples AL_SetFilter eList 3 amp 9 column 3 allow numbers AL_SetFilter elist 6 a column 6 allow lower and uppercase make all uppercase CapsFilter Char 34 A Z a z 0 9 0 amp Char 34 AL_SetFilter eList 4 CapsFilter column 4 allow multiple groups and several individual characters AL_SetEnterable AL_SetFilter 173 Enterability AL SetEntryOpts areaRef L entryMode 1 allowReturn 1 displaySeconds 1 moveWithArr
181. eter Type Description areaRef longint Reference of AreaList Pro object on layout rowNumber longint Number of row styleNum integer Style of the font fontName string Name of the font AL_SetRowStyle is used to set the type style and font for a particular row It will override the style and font settings for all columns in that row The size settings of each column will still apply rowNumber The row for which to set the style Use a value of zero 0 for rowNumber to apply the parameters to all rows styleNum This parameter is used to set the style for the row The different values in the table below can be added together to produce combinations of styles For example bold italic has a value of 3 Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 If a row style has been previously set it may be removed by setting styleNum to 1 This may also be applied to all rows by passing a zero 0 for the row number This will have no effect on rows that have not been previously set The row style may be left unchanged by setting styleNum to 256 fontName This parameter specifies the font for a row If a row font has been previously set it may be removed by setting fontName to 1 Note that the value is a string not a number This may also be applied to all rows by passing a zero 0 for the row number This will have no effect on r
182. ets you display arrays or fields Because AreaList Pro is a plug in area it is very fast and provides capabilities not available to you using native 4D commands and objects such as horizontal scrolling user resizable columns automatic column sizing and formatting copy to the clipboard drag and drop interfaces and more The contents of a list can even be altered directly by entering data into the AreaList Pro area using typed characters and popup menus with full control over data entry Operation is extremely fast and control objects scroll bars buttons etc follow the MacOS and Windows interface AreaList Pro supports the interface standards introduced with MacOS X WinXP and 4D 2004 Data is passed to AreaList Pro using 4D arrays or field numbers If only two columns need to be displayed create two arrays or specify two fields and pass them as parameters to AreaList Pro No string parsing or other contortions are needed AreaList Pro can be used with just one command no special formatting is required A powerful Advanced Properties Dialog lets you configure an AreaList Pro object by simply pointing and clicking For those cases when more control is needed several optional commands give you complete control over the appearance of the area Special tools are implemented if you wish to customize the appearance and configuration of AreaList Pro allowing the customization to be implemented rapidly Compatibility Information
183. f the destination and source areas are in different processes then you will need to use the 4D command CALL PROCESS and the form event On Outside call and interprocess variables to communicate between the two processes destDataType Indicates what type of data was the destination of the last drag 1 row 2 column 3 cell AL_GetDrgArea AL_GetDrgDstTyp 198 Dragging Commands Example Event callback method C_LONGINT 0 object method and form method will not be executed if 0 C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4 column last clicked column C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C_STRING 255 7 tip string C STRING 255 8 area name C_LONGINT vDstArea vDestID vDstlype vRow Case of 2 5 user dragged a row AL_GetDrgSrcRow 1 vRow AL_GetDrgArea 1 vDstArea vDstID If vDstArea 1 if dragged within the same area AL_GetDrgDstTyp 1 vDstType get the type of data that was destination of the drag If vDstTlyp 1 if dragged into a row AL_GetDrgDstRow 1 vRow get the row number End if Else dragged to a different area vDstArea vDstArea store in interprocess variable CALL PROCESS vDstID End if End case Destination AreaList Pro eDstALP area layout s form method C_LONGINT vRow vDstlype Case of Form event On Outside call outside call via CALL PR
184. f the icon You can use the AL_SetHeight routine to increase the size of an AreaList Pro header based on your requirements The default escape character used in the call before the icon resource ID can be modified with AL_SetPictureEscape and retrieved using AL_GetPictureEscape Similarly if you wish to display icons in cell data you would use the same technique when building the arrays for which you are using in the AreaList Pro area Header Cell Icon Support 58 Configuring AreaList Pro Using Commands Using Picture Library Items with Escape Sentences If you would like to use an item from the 4D Picture Library you would reference the picture ID as Use PicRef N where N is the reference number of a picture from the Design environment Picture Library Use PicRef is a 4D constant See the 4th Dimension Language Reference regarding the SET LIST ITEM PROPERTIES command which uses the same icon syntax OH D Picture Library Picture View Tools ALP_OSS_Checked ALP_O59_Unchecked ALP_OSX_Checked ALP_OSX_Unchecked ALP Wm Checked ALP_Win_Unchecked B83 1 Button 2000 Add Re B7e Button 2000 Cancel 870 Button 2000 Delete 861 Button 2000 Done By Fee Button 2000 First Re IZ 22 Burton 2000 Last Re 865 Button 2000 Next F a75 l Button 2000 Next R 864 Button 2000 OK 862 Button 2000 Order By B51 Button 2000 Previou 876k Button 2000 Previau 863 Button 2000 Query B547 ut
185. fer to a given column particularly when using any of the multitude of configuration commands may change as columns are inserted or deleted In later attempts to configure this column the new number must be used No columns arrays should be added or deleted in a callback method See Using the Callback Methods If new arrays of different sizes are to be displayed then the old arrays must first be removed using AL_RemoveArrays then the new arrays added with AL_InsArrayNam or AL_SetArraysNam The AL_GetArrayNames routine will return an array of array names You can only use this routine when configuring arrays via AL_SetArraysNam Modifying Array Elements Procedurally When the arrays are initially specified via the AL_SetArraysNam or AL_InsArrayNam command the number of array elements is established for the area To change the number of elements displayed in the existing arrays new elements should be added or deleted and the command AL_UpdateArrays called with updateMethod set to 2 If the value or any attribute of an array element is changed or if the number of elements is changed but the specified arrays are the same you should instruct AreaList Pro to refresh the area with AL_UpdateArrays Specifying the Fields to Display AreaList Pro uses the SELECTION RANGE TO ARRAY command in 4D to get the records for display See Field and Record Commands for the details on fields display Inserting and Deleting Arrays Modifying
186. g ALPDrag PartNum etc Avoid using the strings TEXT or PICT Pass an empty string to disable dragging The code should be the same as what is passed into a potential drag partner The drag partner will be the source sender of the drag The source area can be the same AreaList Pro area a different AreaList Pro area or another plug in object AL_SetDrgSre AL_SetDrgDst 192 Dragging Commands AreaList Pro performs the following logic during the actual drag when the drag takes place the destination codes that were given in dstCodel dstCode2 etc are compared to the source codes communicated by the sender of the drag If any of the codes match the drag is enabled See Technical Details of the Dragging Implementation When AreaList Pro is placed on a page in a multi page layout be sure to disable dragging using this command when that page is not the currently shown page Please read the section AreaList Pro on Multi Page Layouts for more information Example Enable dragging a row within this area vSelfStr String eList creates a unique code that only allows dragging within this area AL_SetDrgDst cList 1 vSelfStr row type for destination AL_SetDrgOpts areaRef L dragRowWithOptKey 1 scrollAreaSize 1 multiRowDrag 1 dragOntoRow Parameter Type Description areaRef longint Reference of AreaList Pro object on layout dragRowWithOptKey integer Drag row using the option alt key
187. g Commands Displaying the sort indicator requires the header and the vertical scrollbar to be displayed Please read the section AL_SetScroll for more information AL_SetHeaderOptions provides the ability to customize the interface over the scrollbars sort area You can customize the icon which is displayed using a cicn or PICT resource or an item from the 4D Picture Library When the user clicks the sort direction indicator the sort direction of the primary sort level will be reversed and the list will be re sorted The AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable the same as if a sort button in the header was clicked AL_SetSortOpts can be used in the On load phase or in another phase form event Examples Don t automatically sort allow user to sort with buttons allow user to invoke Sort Editor display the default Sort Editor prompt don t show the current sort order in the Sort Editor show the sort direction indicator AL_SetSortOpts cList 0 1 1 0 1 Automatically sort don t allow user to sort with buttons allow user to invoke Sort Editor change the Sort Editor prompt show the current sort order in the Sort Editor don t show the sort direction indicator AL_SetSortOpts cList 1 0 1 People Sort Order 1 0 AL SetSortEditorParams areaRef L windowTitle
188. gn other layout objects which appear adjacent to the AreaList Pro object Displayed next to the object s name is the width and the height of the object as it is drawn on the layout These values include the entire area displayed by AreaList Pro including the header and scroll bars and they will be updated whenever the object is resized See AreaList Pro Height for additional information about controlling the height of an AreaList Pro object Creating an Drop Area on a Form To create AreaList Pro s Drop Area plug in area follow the same method as is used to create an AreaList Pro area only select AL_DropArea from 4D s object Property List popup No text other than the area name will appear inside the AL_DropArea object Using the AreaList Pro Commands The AreaList Pro Commands are used in the same way that a 4D command is used Parameters are separated by the semicolon character You can access the AreaList Pro commands in the method editor list Near the bottom of the list below the area which contains the project methods there are several AreaList Pro command topics as shown below eco Object Method ePL_PrintArea Ez OM ePL_PrintArea SS os 2 LM 8 12 04 7 9 3 4 Case of 5 Form event On Load 6 7 C_TEXT format fontName 8 C_LONGINT mode ret mainTableNo size 9 C_LONGINT colJust head ust footust usePictHelght 10 C_LONGINT fontSize fontStyle 11 12 main
189. h all the events which can be triggered when working with AreaList Pro areas The historical event triggering system AL_GetLastEvent command formerly ALProEvt variable still works but the callback method provides a more generic developer control for precise event handling Note that some 4D commands can only be called with the On Plug in Area method and AL_GetLastEvent command formerly ALProEvt variable See User Action Commands AL_SetCallbacks AL_SetEventCallback 15 Using the Callback Methods callbackMethod A valid 4 Dimension method which will be called during AreaList Pro event execution flag Compatibility flag that defines how and when the area object method is executed 0 compatible mode the area object method and the form method are executed in AreaList Pro 7 9 and above the same way as in earlier versions 1 the area object method and the form method are executed except for events that require posting cmd single click and scroll events 2 the area object method and the form method are not executed at all use the event callback Control click events are reported to the event method immediately when the mouse is still down The following example installs an event callback method which is executed during any AreaList Pro event err AL_SetEventCallback areaRef CallbackMethod 2 The callbackMethod is a 4D project method with the following declarations C_LONGINT 0 object method and
190. h display off and disables the button default 1 column headers display the width in pixels of each column and are updated after the user resizes the column When pixel widths are displayed in the headers of the AreaList Pro area the cursor will change to display a pixel count when it is over the AreaList Pro area If the cursor is moved over one of the rows in the area and clicked the count shown in the pointer will be updated This value is the necessary height of the AreaList Pro object to allow the row clicked on to be the bottom one displayed This feature is disabled whenever the column widths are not displayed Please read the section Column Widths for more information AL_SetColOpts 90 Configuring AreaList Pro Using Commands dragColumn This parameter controls if and how columns may be dragged See Drag and Drop and Dragging Commands 0 do not allow a column to be dragged default 1 allow a column to be dragged within but not out of the AreaList Pro object 2 allow a column to be dragged out of but not within the AreaList Pro object 3 allow a column to be dragged both within and out of the AreaList Pro object If the userSort option of AL_SetSortOpts is disabled column dragging will begin immediately after the user clicks in the column header and an outline of the column will appear If user sorting is enabled the drag begins when the pointer is moved 20 pixels outside of the column to the left
191. h the new rows End if End case 0 0 event handled Example 10 Drag and Drop Between Areas 242 Examples Handling Drag Action The evtRowsDragged project method is called by the event callback method It performs the following operations remove the selected rows from the source area the aRows array has been populated by the callback add them at the top of the destination area same order redraw both areas select the new rows in the destination area evtRowsDragged updates both areas after a row s drag C_LONGINT 1 source AreaList Pro area C_POINTER 2 3 gt source city array gt source state array C_POINTER 4 5 gt destination city array gt source state array INSERT ELEMENT 4 gt 1 Size of array aRows insert rows at the beginning of destination arrays INSERT ELEMENT 5 gt 1 Size of array aRows ARRAY LONGINT aRowsloSelect 0 deselect dragged rows in source area AL_SetSelect 1 aRowsToSelect deselect source rows ARRAY LONGINT aRowsloSelect Size of array aRows select dragged rows in destination area For i Size of array aRows 1 1 look backwards at each row selected by user aRows populated by event callback 4 gt i 2 gt aRows i city 5 gt i 3 gt aRows i state DELETE ELEMENT 2 gt aRows i delete source city DELETE ELEMENT 3 gt aRows i delete source state aRowsToSelect i i End for AL_U
192. h the new value that was entered by the user Using Callback Methods During Data Entry 143 Using the Callback Methods Thus the zero element which contains the old data and the element representing the current cell can both be used to determine data validity Among the possible situations and responses that may occur are the following The data is valid Set 0 True to complete data entry for the cell The data is invalid Copy the old data from the zero element to the array element corresponding to the cell Set 0 True to complete data entry for the cell For example aFname vRow aFname 0 reset the cell contents to their original state 0 True The data is invalid Inform the user that the data is invalid Set 0 False to force the user to remain in the cell and enter another value The data is invalid Inform the user that the data is invalid Modify the cell contents call AL_GotoCell to go to the current cell and set 0 True This achieves the same effect as rejecting the entry but allows the cell contents to be modified For example aFname vRow aFname 0 reset the cell contents to their original state AL_GotoCell eList vColumn vRow go to the same cell 0 True When using an exit callback method AreaList Pro requires the existence of a result value C_BOOLEAN and failure to have the callback method incorrectly declared will produce an error in compiled applications Runtime Error A runtime error occ
193. hanged Column Enterability Default Column 37 Configuring AreaList Pro Using the Advanced Properties Dialog General Options AreaList Pro Advanced Properties AreaList Pro Area AreaList Pro vB 5611 1990 2011 Beckware LLC All Rights Reserved Area Name feListDest Area Defined Name Column Setup General Options Enterability Advanced Dragging Preview Selection Selection mode Single row C Allow no selection single row mode Disable row highlight See also Entry and Selection Mode on the Enterability Options panel Columns Allow column resize Display pixel width Resize when data changes IW Allow column lock Lock 0 columns Hide last 0 columns Miscellaneous F Use modern look Show focus 3D Frame 1 Hide headers Show footers S Move row style amp color settings with data M Move cell style amp color settings with data Command key for running object metho Sorting Sort on data change Clicks on header Sort on Click KZ Show sort direction indicator Show current sort order in sort editor Enable user sort editor Sort editor prompt Select the columns to sort GENERAL OPTIONS Enterability AreaList Pro Advanced Properties AreaList Pro Area AreaList Pro v8 5b11 1990 2011 Beckware LLC All Rights Reserved Area Name jeListDest Area Defined Name Advanced Dragging
194. hat table is the main table from which to display records This command is only necessary if the field to be displayed in column one is not from the main table but from a related one table AL_SetFile must be called before any fields have been set otherwise it will be ignored If this command is not called then AreaList Pro will use the table of the field displayed in column one as the main table Displaying 4D Fields AL_SetFile 160 Field and Record Commands resultCode The possible values are Value Result Code Action 0 No error 1 Not a table Check to make sure that the table represented by tableNum does exist Example result AL_SetFile eList Table gt People AL SetFields areaRef L tableNum l columnNumber numFields 1 fieldNum1 fieldNumN 1 resultCode L Parameter areaRef tableNum columnNumber numFields gt fieldNum lt resultCode Type longint integer integer integer integer longint Description Reference of AreaList Pro object on layout Number of 4D table Column at which to set the first field Number of fields to set up to 15 Number of 4D field Result code AL_SetFields tells AreaList Pro what fields to display Up to fifteen fields can be set at a time Any 4D field type can be used except sub tables Fields from related one tables may also be displayed see AL_SetFile A separate call to AL_SetFields mus
195. he column lock using AL_GetColLock Event Callback vs Object Method Selection Sort Order Column Widths Column Information 206 User Action Commands Commands AL_GetWidths areaRef L columnNumber numWidths width 1 widthN Parameter Type areaRef longint columnNumber integer numWidths integer width widthN integer Description Reference of AreaList Pro object on layout First column to get the width of Number of widths to get up to 15 Pixel width of column AL_GetWidths is used to get the widths of the columns to allow any user changes to the column widths to be saved for future use Up to fifteen widths can be retrieved at a time Use AL_SetWidths to override the automatic column width sizing and set the widths of a column columnNumber This parameter specifies the first column to get the width of numWidths This parameter specifies the number of widths to get This value should be equal to the number of variables passed for the width parameters width1 widthN These parameters return the pixel widths of the columns specified by columnNumber and numWidths Example Case of Form event On Load SEARCH Prefs Prefs User Current user error AL_SetArraysNam cList 1 4 a1 a2 a3 a4 display the list AL_SetWidths cList 4 Prefs Col1 Prets Col2 Prefs Col3 Prefs Col4 get previous widths Form event Cn Validate AL_GetWidths
196. he insertion point from cell to cell Exiting Data Entry The user may exit data entry mode by using the mouse to click on another layout object an AreaList Pro control or header or a non enterable column in the AreaList Pro area However if the data that was entered was invalid the cell cannot be exited until valid data is entered This is determined by the entry finished callback method See Using Callback Methods During Data Entry Enterability for Fields Columns containing fields from a related one table will not be enterable either by typing or by using popups Enterability 30 Creating an AreaList Pro Object on a Form Resizable Windows with AreaList Pro You can configure an AreaList Pro object to be resizable on a resizable window When placed in the lower right portion of a window AreaList Pro will draw a size box in the lower right hand corner of the window Click on this box and drag to resize the AreaList Pro object and its window Creating an AreaList Pro Object on a Form Implementing AreaList Pro in your 4D databases is very easy in fact displaying data in a AreaList Pro area can be accomplished with only one plug in command The AreaList Pro object is drawn on a 4D layout using the plug in area tool PLUG IN AREA TOOL 4D opens the Property List for the object which is where the object is named and configured The name variable will be used as the areaRef parameter for the AreaList Pro commands Be ca
197. he results of any configuration changes you make using this feature The Copy Commands for Current Configuration to Clipboard button creates 4D code and AreaList Pro commands equivalent to the current settings in the dialog and copies it to the clipboard This code can then be pasted into a 4D method AreaList Pro Advanced Properties AreaList Pro Ares Area Name leList AreaList Pro vB 5b11 1990 2011 Beckware LLC All Rights Reserved Area Defined Name Column Setup General Options Enterability Advanced Dragging Preview This AreaList Pro object uses the configuration options you ve selected in this dialog The data displayed is obviously not realistic so for final appearances test this form in the Custom menus environment City State Row 1 Row 1 D Row 2 Row 2 Row 3 Row 3 Row 4 Row 4 Row 5 Row S Row 6 Row 6 Row 7 Row 7 Row 8 Row 8 Row 9 Row 9 Row 10 Row 10 Row 11 Row 12 Row 13 Row 14 Row 15 Row 16 Row 17 Row 18 Row 19 Row 20 Row 21 Row 22 Row 11 Row 12 Row 13 Row 14 Row 15 Row 16 Row 17 Row 18 Row 19 Row 20 Row 21 Row 22 Row 23 Row 24 Row 25 Row 26 Row 23 Row 24 Row 25 Row 26 Copy Current Configuration to Clipboard PREVIEW Preview A0 Configuring AreaList Pro Using Commands Configuring AreaList Pro Using Commands An AreaList Pro object is initialized in the On load phase as the layout is about to be displ
198. hlight Example eist AreaList Pro object method Case of Form event Cn Load ARRAY LONGINT aRows 2 create an long integer array with 2 elements aRows 1 1 set row 1 to be highlighted aRows 2 3 and row 3 to be highlighted error AL_SetArraysNam cList 1 2 aFN alN specify arrays to display AL_SetSelect eList aRows specify the rows to highlight End case AL_SetLine AL_SetSelect 133 Configuring AreaList Pro Using Commands AL SetScroll areaRef L verticalScroll L horizontalScroll Parameter Type areaRef longint gt verticalScroll longint horizontalScroll integer Description Reference of AreaList Pro object on layout Vertical position element to scroll to Horizontal position column to scroll to AL_SetScroll is used to set the position of the thumb in the vertical and horizontal scrollbars verticalScroll This parameter represents the element number to display at the top of the AreaList Pro display horizontalScroll This parameter represents the column number to display at the left of the AreaList Pro display The value passed to horizontalScroll represents the actual column number including any columns which might be currently locked For example if the two left columns are locked and you want to scroll the list one column to the left so that the fourth column is adjacent to the second locked column then the value to pass is four AL_SetScroll can al
199. hod and form method DEMO_Default 1 Now our eList object method looks like this Case of Form event On Load initialize the AreaList Pro object ALL RECORDS Cities load all records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object dragAreaSetup Self gt vitem End case The right area s object method does the same but with empty arrays to begin with Case of Form event On Load initialize the AreaList Pro object ARRAY TEXT aCityDest 0 ARRAY TEXT aStateDest 0 errorcode AL_SetArraysNam cList 1 2 aCityDest aStateDest empty arrays in this area dragAreaSetup Self gt vitemDest End case Example 10 Drag and Drop Between Areas 239 Examples Updating Area Entry and Exit Callback Methods We need to update our area entry and exit callbacks to make them compatible with both areas using AL_GetArrayNames Project method EntryCallback C_LONGINT 1 Arealist Pro object reference C_LONGINT 2 entry cause passed by AreaList Pro C_LONGINT 3 only useful when fields are being displayed C_LONGINT vCurrCol vCurrRow AL_GetCurrCell 1 vCurrCol vCurrRow ARRAY TEXT cArrayNames 0 errorcode AL_GetArrayNames 1 aArrayNames 0 ptrloStateArray Get pointer aArrayNames 2 pointer to second col array state
200. ially set the arrays to be displayed Since AreaList Pro can display up to 512 arrays this command may have to be used more than once However it is not mandatory to set any arrays in the On load phase in that case the area on the layout where AreaList Pro is defined will be blank You can pass process arrays and interprocess arrays to AreaList Pro but not local arrays a local array has a name that starts with a character an interprocess array has a name that starts with a 9 character on MacOS and the lt gt characters on Windows One dimension of a two dimensional array may be passed in the array arrayN parameters For example my2DArray 1 may be passed as array areaRef AreaList Pro area reference columnNumber This parameter specifies the column number to insert the first array being passed by this call of AL_InsArrayNam numArrays This parameter specifies the number of columns being set with this call to AL_InsArrayNam resultCode The possible values are Constant Value Action AL No error in arrays 0 AL Not an array error 1 Check to make sure all arrays are correctly typed AL Wrong type array error 2 Pointer and two dimensional arrays are not allowed AL Wrong number rows error 3 Make sure that all arrays have the same number of elements AL Max arrays exceeded error 4 512 arrays is the maximum AL Low memory array error 5 Increase 4D s RAM partition or change
201. ich AreaList Pro will build a popup menu No array needs be passed to AreaList Pro for a time or date column which uses a popup menu AreaList Pro provides specialized menus for these data types The presence of a popup menu in a cell does not prohibit the user from entering typed data the enterability parameter of AL_SetEnterable allows you to control whether either one or both of these data entry methods are allowed The popup menu array must be of the same data type as the data in the column It is important that the array used for a popup not be disposed of until it is no longer needed AL_SetEnterable must be called when any changes are made to a popupArray You can optionally disable meta characters in AreaList Pro enterable popup controls enabling you to use special characters such as or TO in menu items There are two different methods for disabling meta characters The first method will be using a new parameter in AL Setinterface routine while the second method will be using new options in the AL_SetEnterable routine Moving the Current Entry Cell The action of the Carriage Return key is determined by the programmer using the allowReturn parameter of AL_SetEntryOpts depending upon the data entry requirements of the database The user s ability to control movement while in data entry can also be established with the use of the moveWithArrows and mapEnterKey parameters of this command The moveWithArrows parameter will
202. ides the ability to set the minimum row height for AreaList Pro rows This is different than row padding as it will allow you to set individual rows to appear with extra white space regardless of the amount of data Arealist Pro Height Column Locking Row Height 47 Configuring AreaList Pro Using Commands Color Column Header and Footer Colors Foreground and background colors can be specified for an AreaList Pro object using AL_SetForeColor AL_SetForeRGBColor AL_SetBackColor and AL_SetBackRGBColor The foreground and background colors can be specified for each column column header and column footer Row Specific Colors AL_SetRowColor and AL_SetRowRGBColor are used to set the foreground and background colors of a specified row and will override any column specification You can revert to the original column settings with AL_SetRowColor by setting the alpRowForeColor or alpRowBackColor parameter to the empty string and the 4dRowForeColor or 4dRowBackColor parameter to 1 Use this command to override all row specific color settings by passing 0 for the rowNumber parameter By default the row color will move with a row if the columns are sorted or a row is dragged This can be overridden using the moveWithData parameter of AL_SetRowOpts Alternate Row Colors AreaList Pro provides the ability to display default row color without any additional programming such as callback routines Using AL_SetAltRowColor or AL_
203. ight integer Disable highlighting of selected rows AL_SetRowOpts is used to control several AreaList Pro options pertaining to rows multiRows 0 allow only one row to be selected default 1 allow the user to ctrl command click shift click or drag to select multiple rows In multi rows mode no rows are initially selected unless AL_SetSelect is used In single row mode the first row is selected unless AL_SetLine is used allowNoSelection 0 the user can not deselect a row default 1 the user can ctrl command click to deselect a row in single row mode Regardless of the value of allowNoSelection AL_SetLine can be used with the rowNumber parameter set to 0 to set the selection to no rows dragRow This parameter controls dragging of the area rows See Drag and Drop and Dragging Commands 0 do not allow a row to be dragged default Values 1 2 and 3 enable a row to be dragged while the option alt key is pressed 1 allow a row to be dragged within but not out of the AreaList Pro object 2 allow a row to be dragged out of but not within the AreaList Pro object 3 allow a row to be dragged both within and out of the AreaList Pro object Values 4 5 and 6 enable a row to be dragged without any modifier key 4 allow a row to be dragged within but not out of the AreaList Pro object 5 allow a row to be dragged out of but not within the AreaList Pro object 6 allow a row to be dragged both
204. in the header list area and footer AreaList Pro has its own palette with the following colors white black blue green yellow magenta red cyan gray light gray columnNumber The column for which to set the background color Use a value of zero 0 for columnNumber to apply the parameters to all columns alpHdrBackColor Name of the color in AreaList Pro s palette This will be the background color for the column header If the name is not in AreaList Pro s palette or it is a null string then 4dHdrBackColor will be used AdHdrBackColor 1 to 256 The color at this position in 4D s palette will be used for the background color for the column header alpListBackColor Name of the color in AreaList Pro s palette This will be the background color for the column If the name is not in AreaList Pro s palette or it is a null string then AdListBackColor will be used AL_SetForeRGBColor AL_SetBackColor 110 Configuring AreaList Pro Using Commands AdListBackColor 1 to 256 The color at this position in 4D s palette will be used for the background color for the column alpFtrBackColor Name of the color in AreaList Pro s palette This will be the background color for the column footer If the name is not in AreaList Pro s palette or it is a null string then 4dFtrBackColor will be used AdFtrBackColor 1 to 256 The color at this position in 4D s palette will be used for the background color
205. ines you can configure AreaList Pro to automatically display custom row colors including shading rows which do not contain any information First Name Last Mame Salary ES Arrival Sex City MacOS X DEFAULT Row COLORING First Name Last N Salary a E Arrival Sex WINXP DEFAULT Row COLORING Rows with Multiple Lines of Text Color 22 The AreaList Pro User Interface Styles AreaList Pro supports all standard styles used by the Operating System including Bold Italic Underline Outline Shadow Condensed or Extended or any combination of these These styles may be applied to columns headers footers individual rows or cells in an AreaList Pro area Sorting The list can be sorted in ascending A to Z order by clicking a column header and sorted in descending order by option alt clicking the column header Sorting the list actually sorts the 4D columns displayed in the list If a column contains a picture clicking its column header will cause it to highlight but no sorting will occur AreaList Pro includes a sort direction indicator which can be displayed in the upper right area This indicator can be clicked to change the sort order of the primary sort column Alternately you can create your own icon using the AL_SetHeaderOptions routine to override the sort direction indicator In addition to clicking a column header to sort there is a Sort Editor available to allow sorting on multiple columns such as L
206. integer Column for which to set the header style fontName string Name of the font to use size integer Size of the font styleNum integer Style of the font AL_SetHadrStyle is used to control the appearance of the AreaList Pro column headers The columns can be controlled individually or as a group columnNumber This parameter specifies what column header to apply the style to Use a value of zero 0 to apply the parameters to all columns fontName Use this parameter to specify the font for the specified columnNumber If not called or the specified fontName is not found the header s will be displayed with the default font See AL _SetDefaultStyle If the font specified by fontName is not installed then the default font will be used size Use this parameter to specify the font size for the specified columnNumber If not called the headers will be displayed in the default size See AL_SetDefaultStyle styleNum The styleNum is a font style code By adding the codes together you can combine styles The numeric codes for styleNum are shown below Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 AL_SetHadrStyle can be used in the On load phase or in another phase form event AL _SetDefaultStyle can be used to set the default values for the list data the headers and the footers of all AreaList Pro areas Examples A
207. ion option of AL_SetCellOpts to specify a cell selection mode prior to using this command AL_GetCellRGBColor AL_SetCellSel 129 Configuring AreaList Pro Using Commands To select a single cell If firstCellCol and firstCellRow are greater than 0 and lastCellCol or lastCellRow are less than or equal to 0 then only firstCellCol firstCellRow will be selected To select a range of cells If firstCellCol and firstCellRow are greater than 0 and lastCellCol and lastCellRow are greater than 0 then the range of cells from firstCellCol firstCellRow to lastCellCol lastCellRow will be selected To select discontiguous cells If firstCellCol or firstCellRow are less than or equal to 0 then the cells in cellArray will be selected cellArray Two dimensional long integer array The first dimension must be two The first array is for the column indices and the second array is for the row indices The second dimension must be the same as the number of cells that are to be selected See the following illustration cellArra Cell 1 1 Cell 2 gI Column Row BE GDR Examples AL_SetCellSel cList 1 3 0 0 select cell at column 1 row 3 AL_SetCellSel cList 2 2 5 5 select cells from column 2 row 2 to column 5 row 5 ARRAY LONGINT aCellSelect 2 4 aCellSelect 1 1 1 column 1 aCellSelect 2 1 1 row 1 aCellSelect 1 2 1 column 1 aCellSelect 2 2 2 row 2 aCellSelect 1 3 2 column 2 aCellSelect 2 3
208. iption areaRef longint Reference of AreaList Pro object on layout destCol integer Column number in area that was dragged to If the destination of the last drag was a column or a cell See AL_GetDrgDstTyp use this command to determine which column or cell was the destination of the last drag The areaRef parameter should be the destination receiver area of a drag If the destination and source areas are actually the same area or different areas within the same process i e they reside on the same layout this command may be called from the source area s object or form method or event callback If the destination and source areas are in different processes then you will need to use the 4D command CALL PROCESS and the form event On Outside call and interprocess variables to communicate between the two processes destCol This parameter returns the column number of the destination area which received the drag AL_GetDrgDstRow AL_GetDrgDstCol 200 Dragging Commands Example Event callback method C_LONGINT 0 object method and form method will not be executed if O C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4 column last clicked column C_LONGINT 5 row last clicked row C_LONGINT 6 modifiers C STRING 255 7 tip string C STRING 255 8 area name C_LONGINT vDstArea vDestID vDstType vCol Case of 2 7
209. ist Pro Constant List Value 253 AreaList Pro Constant List AL Area right horz scroll bar AL No column dividers AL No row dividers AL Disable object resize AL Enable object resize ALP Cell commands Constant AL Row selection AL Single cell selection AL Multiple cell selection AL Move cell info off AL Move cell info on AL Cell optimization default AL Remove cell style AL Cell style no change AL Cell style not set AL Remove cell font AL Cell font no change AL Cell font not set AL Cell fore color not set AL Cell back color not set AL Remove cell entry AL Cell entry off AL Cell entry on AL Cell entry not set AL Get cell select low memory AL Get cell select succeeded PZ EZ Ca Eer E Type Fool diet fie ES SS I Ca Er E Ta RSS AE i ie ee EZ AE en AreaList Pro Constant List 254 AreaList Pro Constant List ALP Drag commands Constant AL Drag row data type AL Drag column data type AL Drag cell data type AL Drag row with no key AL Drag row with option key AL Scroll area size default AL Single row dragging AL Multiple row dragging AL Drag between rows AL Drag onto row ALP Field commands Constant AL No error in fields AL Not a file error AL Not a field error AL Wrong type field error AL Max fields exceeded error AL Wrong 4D vers for fields AL Low memory field error AL Refresh fields AL Refresh and update fields AL Recalculate fields ALP Appearance Constants Constan
210. l be disabled when fields are displayed Enterability Columns containing fields from a related one table will not be enterable either by typing or by using popups Dragging When displaying arrays AreaList Pro will rearrange the rows automatically when the user drags a row within the list When displaying fields AreaList Pro will not rearrange the rows automatically when the user drags a row within the list Thus the moveWithData option of AL_SetRowOpts and the moveWithData of AL_SetCellOpts do not apply when fields are displayed and the user drags a row within the list Sorting indexed fields will be bold in the Sort Editor fields from related one tables will be dimmed in the Sort Editor columns containing fields from a related one table will not be sorted when their column header is clicked upon When fields are displayed the moveWithData of AL_SetRowOpts will be ignored when sorting The row style and color information will not move with the row when the AreaList Pro object is sorted When fields are displayed the moveWithData of AL_SetCellOpts will be ignored when sorting Displaying 4D Fields 159 Field and Record Commands The cell style and color information will not move with the cell when the AreaList Pro object is sorted When the userSort option of AL_SetSortOpts is set to 3 and fields are being displayed only columns containing indexed fields may be sorted by clicking on their column header AreaList Pr
211. l not be displayed When hideHeaders is 1 the allowColumnResize parameter of AL_SetColOpts is set to 0 internally by AreaList Pro areaSelected This parameter controls how the AreaList Pro object is displayed when it is selected i e the active layout object 0 no indication will be given to the user that the plug in area is selected default 1 a 2 pixel wide border will be drawn around the plug in area when it is selected 2 a selection rectangle will be drawn around the plug in area when it is selected 3 a 3D frame will be drawn around the object when it is selected postKey One character string AreaList Pro causes the method of an AreaList Pro plug in area and the form method to run by posting a keyboard event to 4D s event queue This parameter is used to specify what character to post The default is the backslash character Please read the section AreaList Pro s PostKey for more information This can be ignored since 4D 2004 showFooters This parameter controls whether footers are displayed for the AreaList Pro object areaRef Footers are displayed using AL_SetFooters 0 footers will not be displayed default 1 footers will be displayed below each column See Footers AL_SetFooters and AL SetFtrStyle for more information about footers AL_SetMiscOpts 98 Configuring AreaList Pro Using Commands useModernLook 0 the traditional look will be used 1 a mod
212. l records in the Cities table SELECTION TO ARRAY Cities City aCity Cities State aState copy field values into arrays errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers AL_SetRowOpts cList 1 1 0 0 set multirrows mode and allow no selection parameters AL_SetEntryOpts eList 3 0 0 set double click to enter data entry mode DEMO_DefauIt eList vitem Example 4 Selecting Multiple Rows Example 5 Allowing Data Entry 229 Examples Form event Qn Plug in Area respond to user action Case of AL_GetLastEvent cList 1 did user single click on a row ARRAY LONGINT aRows 0 OK AL_GetSelect eList aRows get the rows selected by user vitem For i 1 Size of array aRows look at each row selected by user vitem vitem aCity aRows i aState aRows i plug values in vitem End for End case AL_GetLastEvent End case The layout now looks like this after double clicking on the first cell with AR in it e080 Example 5 Example 5 This is Example 5 from the Reference Manual which was set up as in Example 4 In addition double click was selected to initiate data entry using AL_SetEntryOpts Ci State CC CSNC dCN Mobile AL 0 Fayetteville AR Little Rock AR Phoenix AZ Tuscon AZ L Petaluma CA A Los Angeles CA AA
213. lCharForWin Character to be interpreted as the decimal point Only the first character of decimalCharForWin is used for the decimal point any other characters will be ignored The default is the US decimal point decimalCharForWin applies only to AreaList Pro running under 4D for Windows On MacOS when a real number is entered into a cell during data entry MacOS converts the text entered into a real number after exiting the cell MacOS takes into account the decimal point set in the International preferences This feature is not available under all versions of Windows useNewPopuplcon 0 or 1 0 all popup icons will have the old black and white look default 1 all popup icons will have a 3D look Examples Initiate data entry with a double click single click selection don t allow carriage return characters to be entered into text arrays don t display seconds in time arrays during data entry map the Enter key to act like the Tab key modern popups AL_SetEntryOpts eList 3 0 0 0 1 1 Initiate data entry with a single click no selection allow carriage return characters to be entered into text arrays display seconds in time arrays during data entry use Arrows to navigate between cells black and white popups AL_SetEntryOpts eList 2 1 1 1 0 0 AL_SetEntryOpts 175 Enterability AL SetEntryCtls areaRef L columnNumber controlType Parameter areaRef columnNumber c
214. lColumn 1 cellRow L cellForeRed L cellForeGreen L cellForeBlue L cellBackRed L cellBackGreen L cel ackDlue 129 AL_SetCellSel areaRef L firstCellCol firstCellRow L lastCellCol lastCellRow L cellArray X 129 AL_SetSort areaRef L columni1 l column see eee eee eee 131 AL_SetCellValue areaRef L row L column albhaNumericData S pictData P AN 132 AL_SetLine areaRef L rowNumber L cccccccecccesseeecesseecessaeeeeseeecessecesssseecsseeeessseeseseaeecesseeeeesseseeeaes 132 AL_SetSelect areaRef L rowesloGelectxi e 133 AL_SetScroll areaRef L verticalScroll L horizontaiScrollh 134 AL SetColbock areaRef L col mns E 135 AL_SetHeight areaRef L numHeaderLines 1 headerHeightPad numRowLines 1 rowHeightPad 1 n mFooterLines i betreie eege 136 AL_SetMinRowHeight areaRef L minRowHeignt U sss sese eee eee ee eee eee 137 AL SetPictursEscape areaRef L escaneLChar Bl eee 137 AL_GetPictureEscape areaRef L gt escapechart eee eee 138 Using the Callback Methods 139 SUMMA ee eto Pee emcee A Tm ee 139 NVA PANS gedeelt 140 Executing a Callback Upon Eniering aN Ais E 140 Executing a Callback Upon Exiting an Area sese sees 141 Using Callback Methods During Data ENUY issssisss isesi 141 Exe ting a Callback Upon Entering a Cell rsson een deeg 141 Exec ting a Callback Upon Leaving Cell eegene 142 Compatibility Note New Menu Architecture sss sese sees sees e ereer ee ereenn ne
215. layed data AL Empty Area Double click 4 Double click in an empty part of the area without displayed data AL Single Control Click 5 Control click or right mouse click AL Empty Area Control Click 6 Control click or right mouse click in an empty part of the area without displayed data AL Vertical Scroll Event 7 Vertical scroll AL Mouse moved event 18 Mouse moved see note below AL Sort button event 1 Sort button AL Select all event 2 Edit menu Select All AL Column resize event 3 Column resized AL Column lock event 4 Column lock changed AL Row drag event 5 Row dragged AL Sort editor event 6 Sort editor AL Column drag event 7 Column dragged AL Cell drag event 8 Cell dragged AL Object resize event 9 Object and window resized AL Column click event 10 User clicked on column header automatic sort won t be executed AL Column control click event 11 Control click on column header see note below AL Footer click event 12 Click on column footer Example Typically you will use the If End if or Case of End case commands to check the value of 2 AL_GetLastEvent command formerly ALProEvt variable If you had configured an AreaList Pro object to respond to both single and double clicks you might use a method like this in the event callback Case of 2 1 Single click 2 2 Double click 2 3 Single click in an empty part of the area without displayed d
216. layout gt callbackMethod string 4D project method called when the Edit menu is used resultCode longint Result code AL_SetEditMenuCallback provides an interface of overriding the default behavior when working with the 4D edit menu callbackMethod Desired Edit menu callback method to use for the given area The edit menu callback method will receive the area reference parameter 1 and the edit event parameter 2 Edit events are received in the longint 2 parameter using bitwise operators to extract subevents When you wish to act on several edit menu items the value is the result of a bitwise operation For more information on working with bitwise values please refer to the 4 Dimension Command Reference Edit menu constant Value Description Bit position constant Value AL Edit Menu Setup Mask 65536 AreaList Pro is setting up edit menu before AL Edit Menu Setup Bit menu is displayed AL Edit Menu Entry Mask 32768 AreaList Pro cell editing is in progress AL Edit menu Entry Bit AL Edit Menu All Items Mask 127 AreaList Pro is using all possible edit menu items AL Edit Menu Select All Mask 64 Reference to Edit menu select all menu item AL Edit Menu Select All Bit AL Edit Menu Clear Mask 32 Reference to Edit menu clear menu item AL Edit Menu Clear Bit AL Edit Menu Paste Mask 16 Reference to Edit menu paste menu item AL Edit Menu Paste Bit AL Edit Menu Copy Mask 8 Reference to Edit menu
217. le objects is not obvious for users so AreaList Pro until version 7 8 did not handle the two events differently With versions 7 9 and above it has to as 4D sends the soft deselect to AreaList Pro before it sends edit menu commands Soft deselect is passed to the exit callback method with the entryFinishedMode parameter set to the value 8 AL Cell validate action When the cell exit callback method is called with this value it means that editing will not be finished This allows validation of the cell value The developers can always force the former behavior no discrimination between deselects by using the AL_SetEntryOpts call Compatibility Note AL ExitCell and AL Cell deselect action become AL ExitCell and AL Cell Validate In versions of AreaList Pro previous to 7 9 there were two constants AL ExitCell action and AL Cell Deselect action It appears that AL ExitCell action was triggered when cell editing had to end while AL Cell Deselect action would mean that the callback method can refuse the end of editing but this was not implemented consistently and AreaList Pro manual did not clearly state the difference between the events either The manual stated that returning False from exit callback meant that the area refused to end editing but AreaList Pro often ignored the return value Since version 7 9 AreaList Pro has changed the meaning and handling of these events as follows AL ExitCell action mode 7 means that som
218. les are provided showing the syntax as well as how the various commands are used together The first parameter for each command is the reference name of the AreaList Pro object on the layout This parameter is a long integer and is required to allow the commands to operate on the correct object Causing an AreaList Pro Callback Method to Execute Eight callback method types are available so that the developer can react accordingly to user actions See Using the Callback Methods With AreaList Pro versions prior to 7 9 the events could only be managed through the object method or form method called when the user takes an action on the area such as clicking to select a row A new Event Callback Interface is available since version 7 9 to respond accordingly to user events See Event Callback Interface and Event Callback vs Object Method Developer Alert If the first parameter passed to any AreaList Pro command is not the object reference an alert box will appear informing you of the syntax error AL_SetArraysNam was passed an incorrect first a parameter Se INCORRECT PARAMETER ALERT If this object reference is a PrintList Pro area or another plug in area AreaList Pro will also pass this information to you Command Descriptions and Syntax Causing an AreaList Pro Callback Method to Execute Developer Alert 33 Configuring AreaList Pro Using the Advanced Properties Dialog Configuring AreaList Pro Using the Advanced Prop
219. ll contain this cell and lastCellCol lastCellRow will both be 0 If more than one cell is selected and all are contiguous then firstCellCol firstCellRow and lastCellCol lastCellRow will contain the starting and ending points of this range If more than one cell is selected but all are not contiguous then firstCellCol firstCellRow and lastCellCol lastCellRow will all be 0 and cellArray will contain the selected cells cellArray Two dimensional long integer array The first dimension must be two The first array is for the column indices and the second array is for the row indices The second dimension will be set by AreaList Pro to be the same as the number of cells that are selected See the following illustration cellArra Cell 1 1 Cell 2 celina bi Column Row BE GD resultCode This value is equal to one 1 if enough memory was available to resize cellArray If enough memory was not available you should react accordingly Example ARRAY LONGINT aCellSelect 2 0 AL_GetCellSel cList vFirstCol vFirstRow vLastCol vLastRow aCellSelect AL_GetCellSel 213 User Action Commands AL GetScroll areaRef L verticalScroll L horizontalScroll Parameter Type Description areaRef longint Reference of AreaList Pro object on layout verticalScroll longint Vertical position element list is scrolled to horizontalScroll integer Horizontal position column list is scrolled to AL_GetScro
220. ll returns the current position of the thumb in the vertical and horizontal scrollbars verticalScroll This parameter represents the element number visible at the top of the AreaList Pro display horizontalScroll This parameter represents the column number visible at the left of the AreaList Pro display The value returned in horizontalScroll represents the actual column number including any columns which might be currently locked For example if the two left columns are locked and the list is scrolled one column to the left so that the fourth column is adjacent to the 2 locked column then the value returned is four You can set the scroll position using AL_SetScroll Example AL_GetScroll eList vVert vHoriz AL GetColLock areaRef L gt columns Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columns integer Number of columns that are locked AL_GetColLock returns the number of columns currently locked columns This parameter returns the number of columns currently locked You can set the lock position using AL_SetColLock Example lockcolumn AL_GetColLock cList AL_GetCellScroll AL_GetColLock 214 User Action Commands AL GetLine areaRef L gt selectedRow L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout selectedRow longint Number of currently selected row AL_GetLine returns the number of the currentl
221. ll wrap the fields fieldWrapper will be especially useful on Windows because programs such as Excel or Works expect text to be pasted in with commas separating and quotes wrapping the fields AL_SetCopyOpts can be used used in the On load phase or in another phase form event Examples Include hidden columns in Edit menu Copy use the default Field and Record delimiters for Edit menu Copy AL_SetCopyOpts eList ue Don t include hidden columns in Edit menu Copy use different Field and Record delimiters for Edit menu Copy AL_SetCopyOpts cList 0 Char 24 1 Char 2421 AL _GetCopyOpts areaRef L includeHiddenCols 1 fieldDelimiter S recordDelimiter S fieldWrapper S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout includeHiddenCols integer Include hidden columns fieldDelimiter string Field separator for Edit menu copy recordDelimiter string Record separator for Edit menu copy fieldWrapper string Field wrapper for Edit menu copy AL_GetCopyOpts will return the current values as defined by AL_SetCopyOpts AL_SetCopyOpts AL_GetCopyOpts 102 Configuring AreaList Pro Using Commands AL SetSortOpts areaRef L automaticSort userSort allowSortEditor sortEditorPrompt S showSortOrder showSortDirlndicator 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout automaticSort integer Automatically sort us
222. llRow L c llArray X SIM e EE 176 AL_GetCellEnter areaRef L cellColumni l cellRow L enterability cccscccccssecessssesssseseeesseeeeesees 178 AL_GetCellMod areaRef L gt resultCode L sse 179 AL_GetCellValue areaRef L cellRow L cellColumn l alphanumericData T pictData P A 179 AL_SetCellHigh areaRef L startPosition l endPosition I sse sees ee eee 180 AL_GetCellHigh areaRef L startPosition l endbosrtionlh seene 181 AL_SetCelllcon areaRef L cellColumn l cellRow L pictRef P iconAlignment l horPosition ventPosition k ofsetk e RE 181 AL_GotoCell areaRef L cellColumn l cellb owl sees 184 AL_GetCurrCell areaRef L cellColumn l cellb owl sse eee 185 AL_GetPrevCell areaRef L cellColumn l celibRow LUD sese 185 AL SKI oll AR SPR E 186 AL EXitC ll arsa Ref E 187 Dragging Commands 188 SIL ele EE 188 Technical Details of the Dragging implementati ER 188 WN are access codes ee 188 PATTING EE 189 Arealist Pro on leede 190 Multiple Rows Dragging EE 190 Droe ett eer e a a EE e a hehe eweneee 191 DFO RE 191 Command S serosa pian eens EE E E E ea Cues rede eneuieneeae td nantes dee 191 AL_SetDrgSrc areaRef L sourceDataType l srcCode1 S SrcCode0 S nenne 191 AL_SetDrgDst areaRef L destDataType l dstCode1 S detCodei0 B n 192 AL_SetDrgOpts areaRef L dragRowWithOptKey 1 scroll AreaSize 1 multiRowDrag dragOntoRow 193 AL GetDrgsrceRow areaRef L sourceRow L
223. llback Framework The callback method should include the following framework parameter declaration Each parameter must be declared in every callback method and a result value must be returned Failure to properly declare variables or return the result variable will produce a compiler error when using database in compiled mode 0 result O AreaList Pro will handle event default gt 0 callback handled event 1 AreaList Pro area reference 2 AreaList Pro Edit event 3 Undo unused but required internally C_LONGINT 0 AL_Result C_LONGINT 1 AL_Area C_LONGINT 2 AL_Event C_TEXT 3 AL_Undo AL_Result 0 default result AreaList Pro will handle event AL_Area 1 AL_Event 2 AL_Undo 3 Case of End case 0 AL_Result AL_SetEditMenuCallback 154 Using the Callback Methods AL SetCalcCall areaRef L columnNumber calcCallback S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column number calcCallback string 4D method called ot fill row s of a calculated column AL_SetCalcCall is used to set a callback method for a calculated column columnNumber This parameter specifies the column on which to attach the calcCallback method calcCallback This method will be called whenever row s need to be filled in a calculated column If this is an empty string then no method will be called The first two paramet
224. llbackMethod parameter of AL_SetEventCallback actions on the Edit menu while in an AreaList Pro area callbackMethod parameter of AL_SetEditMenuCallback calculated columns calcCallback parameter of AL_SetCalcCall clic on a column header callbackMethod parameter of AL_SetHeaderOptions Summary 139 Using the Callback Methods Warnings Callback methods called during cell editing cell enter cell exit and edit menu must not modify underlying data arrays or records i e must not resize or rebuild the arrays array display or change the current 4D selection field display AL_UpdateArrays can only be called with updateMethod equal to 1 from a callback method other than an event callback Please read the section Modifying Array Elements Procedurally for more information AL_UpdateFields can only be called with updateMethod equal to 0 or 1 from a callback method other than an event callback The call will be ignored if parameter 2 is used in other callbacks You should not call any AreaList Pro commands which change the number of displayed columns their position in the area or their sorted order All callbacks receive the area long integer reference as their first parameter 1 You must use the following declaration in your callback method C_LONGINT 1 Since the long integer 1 parameter contains 4D s representation of the AreaList Pro object it can be used as the first parameter of any AreaList Pro
225. llowing Data ENUY sissors t esiseinas aaea aeaa aera EEEE KAEA EEEREN EA E A EN A E D E 229 Example 6 Restricting Data Ertrag 231 Example 7 Validating Data Entry serrera a aeaa aaia a aa 232 Example 8 Prohibiting Data Entry to a Specific Cell sese eee eee 234 Example 9 Using the Event Callback Interface essere eee ee eee eee eee 236 Example 10 Drag and Drop Between Areas AA 237 Enabling Drag and T ess 238 Introducing Generic Programming a cscs secu scacatan secs dus duce cnn eedincxs xcsanaenaae aad adeoscanaecnacendacane hesstacueanatanseeaee 238 Updating Area Entry and Exit Callback Methods seet eieiei 240 Event e EE 241 Handling A PATON E 243 Example 11 Getting the Last Event in each Area sss essen 244 AreaList Pro Constant List 248 AUP e ele eege eege ee dE 248 EE e E 248 AIP EVENS ee ee EE Ee eege dE eege 248 ALP Entry callback Le E 249 ALP Aea enl Ee ET 250 TE Sel ea ue ut 250 AUP Golum commands ET 251 ALP ee een un Te 251 LP ee COMMANA Sarnin on dernier earn adie rion en A ela EA edule aaa 252 Teen E Te Le 253 ALP Cell Command ET 254 ACP Drag OVINE E 255 AlsP Ee Be Tun ue 255 ALP EE Constants ee et Eeer 255 ALP Edit Menu Constants seie irin a aee aE a ETa a ari O RA EA 256 ALP Formav Style Constans EE 256 AreaList Pro Command Reference Alphabetical 257 About AreaList Pro About AreaList Pro AreaList Pro is an easy to use tool for implementing scrolling lists on 4 Dimension layouts It l
226. ls and AL_SetHeaderOptions which provides the ability to customize the interface over the scrollbars sort area AL_GetHeaderOptions returns the current setting for the area These routines include an iconRef parameter which is one of the following N where N is the resource ID of Mac OS based cicn resource Use PICT resource N where N is the the resource ID of a Mac OS based PICT resource Use PicRef N where N is the reference number of a picture from the Design environment Picture Library pass zero 0 if you do not want any icon for the header or the cell Picture Objects in Headers In addition AL_SetHeaderlcon provides the ability to procedurally place icons in column headers using AD picture objects fields or variables Header Cell Icon Support 60 Configuring AreaList Pro Using Commands Commands AL_Register registrationKey S gt resultCode L Parameter Type Description gt registrationKey string Registration key resultCode longint Result code AL_Register is used to register the AreaList Pro plug in for standalone or server use You must call AL_Register with a valid registration key otherwise AreaList Pro will operate in demonstration mode Without a valid registration key AreaList Pro will operate in demonstration mode during 20 minutes Like all e Node plug ins AreaList Pro offers six different license types There are no such things as MacOS vs Windows or Development vs Deploy
227. lt interface 1 display custom icon and execute callbackMethod on mouseUp 2 display custom icon and execute callbackMethod on mouseDown iconRef Reference of the icon or picture to use Both cicn and PICT resources can be used as well as items from the Picture Library AL_SetHeaderlcon AL_SetHeaderOptions 72 Configuring AreaList Pro Using Commands To associate an icon to the header pass one of the following numeric values in iconRef Use PICT resource and Use PicRef are 4D constants N where N is the resource ID of Mac OS based cicn resource Use PICT resource N where N is the the resource ID of a Mac OS based PICT resource Use PicRef N where N is the reference number of a picture from the Design environment Picture Library pass zero 0 if you do not want any icon for the header See Header Cell Icon Support for examples See also the 4 Dimension Language Reference regarding the SET LIST ITEM PROPERTIES command which uses the same icon syntax callbackMethod Desired callback method which is executed when the icon is clicked if you have passed an option value of 1 the callback will be executed when the user releases the mouse button if you have passed an option value of 2 the callback will be executed immediately when user clicks the icon The icon clicked callback method is passed one parameter by AreaList Pro This parameter is a long integer that corresponds to the name of the
228. ly null time and date values can be set to display a blank by appending a dash character to the format string parameter The defaults for the different column types are Column Type Format Integer HH AAO Long Integer HAAR AHO Real HERR 40 00 Boolean True False Date 0 Picture o These values are initialized at startup from the STR 15023 resource In European versions this resource has been modified as follows Column Type Format Integer HH 0 Long Integer H HRH HO Real 44 0 00 In addition the French version of AreaList Pro initializes the boolean format as Vrai Faux See AL_SetDefaultFormat which can be used to modify the default formats for all AreaList Pro areas AL_SetFormat 76 Configuring AreaList Pro Using Commands format for string arrays Any formatting characters supported for 4D are allowed Pre defined styles i e those saved in the Design environment are not allowed format for text arrays Not supported format for numeric arrays See the 4D command String in the 4D Language Reference for the pos sible values Any valid 4D numeric format may be used format for boolean arrays The string contains two formats one for the True value the other for the False value separated by a semicolon Examples Male Female and MacOS Windows format for date arra
229. ly affects interpreted mode Compiled applications using an obsolete license will never expire Unlimited OEM This license allows development interpreted mode or deployment inter preted or compiled mode on as many 4D Server of any umber of users 4D Standalone Run time or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obsolete license will never expire A 4D database used to retrieve your 4D serial information is available from the following link http www e node net ftp GetSeriallnfo AL_Register 6l Configuring AreaList Pro Using Commands The registration system has been modified in version 8 3 Only one registration key is now required registrationKey Pass the registration key to register your copy of AreaList Pro Only one registration key is required The key is either linked to the 4D or 4D Server serial number individual licenses or to the name of the company developer unlimited annual licenses Multiple calls to AL_Register are allowed The plug in will be activated if at least one valid key is used resultCode This will return a value of 1 if the registration key is valid and a value of 0 if the registration key is invalid You should verify the correctness of the registration key by tracing over the call to AL_Register and examining resultCode Exampl
230. m can be used for headers and individual cells If any text cell header etc contains an escape sentence an icon is drawn instead of the sentence Based on the number it may be a cicn resource a PICT resource or a Picture Library object Borders and Frames Header Cell Icon Support 57 Configuring AreaList Pro Using Commands Using Icons with Escape Sentences To display an icon in the header reference the icon resource as nnnHeader where nnn is the desired cicn resource ID AL_SetHeaders area 1 1 150Header To display the icon at the end of the text reference the icon resource as Header nnn where nnn is the desired cicn resource ID alp rsrc 26 cicn Color Icon Resources aAreaList Pro popup XP AreaList Pro popup small Vista AreaList Pro popup Vista CS_Date_Pop Time Pop DateTime Pop Select All Reverse Changed None CELL DATA ICON EXAMPLE BOOLEAN FIELD If you want to use PICT resources instead of cicn add the 4D constant Use PICT resource to the resource ID AL_SetHeaders area 1 1 4 String Use PICT resource 150 Header See the 4th Dimension Language Reference regarding the SET LIST ITEM PROPERTIES command which uses the same icon syntax When displaying icons in headers it may be necessary to adjust the header height to accommodate the height o
231. ment Single user license This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Standalone or Runtime Since the registration key is linked to a specific 4D license you need to provide the number returned by the 4D command GET SERIAL INFORMATION first parameter A new license will be supplied for free at any time if you change your 4D version and or get a new 4D registration key provided that your previous licenses match the current public version at the exchange time Small server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server up to 10 users The registration key is linked to your 4D Server license just as above Medium server This license allows development interpreted mode or deployment inter preted or compiled mode on 4D Server up with 11 to 20 users The registration key is linked to your 4D Server license just as above Large server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server over 20 users The registration key is linked to your 4D Server license just as above Unlimited Single User This license allows development interpreted mode or deployment interpreted or compiled mode on as many 4D Standalone Runtime or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration on
232. method called In addition some callback methods receive other parameters which need to be declared as well as documented below Callback methods must not add or delete any columns Executing a Callback Upon Entering an Area An area entered callback method is a 4 Dimension project method called whenever the AreaList Pro object is entered The area entered callback method is specified by passing the method name in the areaEnteredMethod parameter of AL_SetMainCalls If this parameter is a null string then no method will be called The area entered callback method is passed one parameter by AreaList Pro This parameter is a long integer that corresponds to the AreaList Pro object on the layout You must use the following declaration in your callback method C_LONGINT 1 You can call AL_GotoCell from the area entered callback to initiate data entry when the object is entered Warnings Executing a Callback Upon Entering an Area 140 Using the Callback Methods Executing a Callback Upon Exiting an Area An area exited callback method is a 4 Dimension project method called whenever the AreaList Pro object is exited The area exited callback method is specified by passing the method name in the areaExitedMethod parameter of AL_SetMainCalls If this parameter is a null string then no method will be called The area exited callback method is passed one parameter by AreaList Pro This parameter is a long integer that co
233. n also be used to set the insertion point between two characters After the user ends data entry on a particular array element AL_GetCellMod can be used to determine if the data has been altered AL_GetCellMod and AL_GetCellHigh can only be used within an entry finished callback method See Using Callback Methods During Data Entry Other programmable data entry specifications include the use of the Return key for movement during data entry or insertion of a carriage return character into the text data being entered This is controlled using the allowReturn parameter of AL SetEntryOpts Please read the section Moving the Current Entry Cell for more information You can also specify that seconds be displayed hh mm ss when the user is entering time data through the use of the displaySeconds parameter of AL_SetEntryOpts For boolean data type arrays two data entry methods can be specified a checkbox or radio buttons AL _SetEntryCtls is used to specify which of these controls is used and to which column it applies Initiating Data Entry Entering Data 167 Enterability Filters In order to use data entry filters AL_SetFilter must be used on a per column basis Standard 4D filter strings can be used except that placeholders are not supported and will be ignored Pre defined styles may not be used for data entry filters Click and Hold Data Entry Initiation Cell entry will be initiated when the user clicks and holds down th
234. n lists are the same See Multiple Rows Dragging for more information dragOntoRow 1 a row will be highlighted to receive the drag 0 an insertion arrow will be displayed between rows default When dragging a row onto a row there will be no automatic updating of arrays even if the source and the destination lists are the same Example Drag row without the option key scroll in 10 pixel area drag multiple rows drag between rows AL_SetDrgOpts cList 0 10 1 0 AL_SetDrgOpts 194 Dragging Commands AL_GetDrgSrcRow areaRef L sourceRow L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout 4 sourceRow longint Row that was dragged Use AL_GetDrgSrcRow to determine which row or cell was dragged after a drag has completed The areaRef parameter should be the source sender area of a drag This command is called from the source area s object method when an event code of 5 user dragged row or 8 user dragged cell is returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable See Determining the Users Action on an AreaList Pro Object sourceRow This parameter returns the row that was dragged Example Event callback method C_LONGINT 0 object method and form method will not be executed if O C_LONGINT 1 Arealist Pro area C_LONGINT 2 Arealist Pro event C_LONGINT 3 event modifier C_LONGINT 4 column
235. nds Using Both Methods Event callback methods and object form methods can be combined in specific cases Communication between these code sets can be performed by saving the parameters passed to the event callback to 4D variables in the callback method and then retrieve the values from these process variables in the area object method and or the layout form method Selection You can determine what row or rows are selected using AL_GetLine if in single row selection mode and AL_GetSelect if in multiple rows selection mode If you are in cell selection mode you can use AL_GetCellSel to determine the selected cells AL_GetClickedRow returns the last row that was clicked which is different from AL_GetLine returns selected row Sort Order The user can change the sort order using the sort button the column headers or the Sort Editor You can determine this sort order using AL_GetSort Column Widths The user is able to resize the columns by clicking and dragging the dividing lines between columns You can use AL_GetWidths to get the width of each column in pixels Column Information AL_GetColumn is available to determine the column where a click occurred when selecting a row AreaList Pro allows one or more columns to be locked for horizontal scrolling If the allowColumnLock parameter of AL_SetColOpts is set the user can change the column locked see Column Locking You can determine the position of t
236. nherited from Form _ Fill Pattern Border Line Style Transparent Example 1 A Simple One Column List 223 Examples We ll use the On Plug in Area AL_GetLastEvent command formerly ALProEvt variable system to configure our AreaList Pro area s response to user events Here is the eList object method Case of Form event On Load initialize the AreaList Pro object LIST TO ARRAY City State aCityState copy the list into an array errorcode AL_SetArraysNam cList 1 1 aCityState display array in AreaList Pro object DEMO_DefauIt eList vitem aCityState 1 Form event Qn Plug in Area respond to user action If AL_GetLastEvent eList 1 did user single click on a row row AL_GetLine cList get the row the user selected vitem aCityState row get the value in that element of the array End if AL_GetLastEvent eList 1 End case The DEMO_Default project method sets up the area s appearance according to the current platform C_LONGINT 1 AL_Area If Count parameters gt AL_Area 1 AL_SetMiscOpts AlL_Area 0 3 0 1 If Is Windows 1 Windows AL_SetHdrStyle AL_Area 0 Tahoma 1 1 0 AL_SetStyle Al_Area 0 Tahoma 1 1 0 Else MacOS AL_SetStyle Al_Area 0 Lucida Grande 1 1 0 AL_SetHdrStyle Al_Area 0 Lucida Grande 1 1 0 End if AL_SetHeight Al_Area 1 1 1 3 1 1 End if Example 1 A Simple One Column List 224 Examples The sWindows pr
237. nk rows to fill the entire area with a consistent interface You may optionally display the alternate background row color for odd and or even rows including empty rows those below the last row red Desired red component in RGB color pattern green Desired green component in RGB color pattern blue Desired blue component in RGB color pattern options Additionally formatting options bitwise operator 1 display alternate background color in odd rows 2 display alternate background color in even rows AL_SetRowRGBColor AL_SetAltRowColor 120 Configuring AreaList Pro Using Commands The following example will tell AreaList Pro to draw the alternate rows using a color scheme standard for OSX AL_SetAltRowColor cl ist 237 243 254 1 This example will set the background color for odd rows to grey AL_SetAltRowColor cList 209 209 209 1 This example will set the background color for even rows to grey AL_SetAltRowColor cList 209 209 209 2 This example will set the background color for odd rows to white AL_SetAltRowColor eList 255 255 255 1 AL_SetAltRowClr areaRef L alpoRowBackColor S 4dRowBackColor options L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout alpRowBackColor string Alternate row background color from Arealist Pro s palette AdRowBackColor integer Alternate row background color from 4D s palette options longint Options
238. numFields integer Number of fields to set up to 15 gt fieldNum1 fieldNumN integer Number of 4D field s resultCode longint Result code AL_InsertFields functions the same as AL_SetFields except that the fields are inserted before columnNumber All subsequent columns will maintain their settings In other words any header text column styles etc will stay with their corresponding field Example Add a column to display the first name result AL_InsertFields eList Table gt People 4 Field gt People First Name AL_GetFields AL_InsertFields 164 Field and Record Commands AL RemoveFields areaRef L columnNumber numFields 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to remove the first field numFields integer Number of fields to remove up to 512 AL_RemoveFields is used to remove fields from AreaList Pro numFields beginning at columnNumber will be removed from the list All subsequent columns will maintain their settings In other words any header text column styles etc will stay with their corresponding field Example Remove two columns beginning at column 4 AL_RemoveFields cList 4 2 AL_UpdateFields areaRef L updateMethod Parameter Type Description areaRef longint Reference of AreaList Pro object on layout updateMethod integer Method to use to update the AreaLi
239. o 256 fontName If a cell font has been previously set it may be removed by setting fontName to 1 Note that the value is a string not a number The cell font may be left unchanged by setting fontName to the empty string See the moveWithData option of AL_SetCellsOpts This controls whether cell styles and fonts stay with their cells whenever sorting row dragging or column dragging occurs Example Set the currently highlighted cell s to be bold ARRAY LONGINT aCellArray 2 0 Result AL_GetCellSel eList vCol1 vRow vCol2 vRow2 aCellArray If Result 1 AL_SetCell Style eList vCol vRow 1 vCol2 vRow2 aCellArray 1 AL_UpdateArrays cList 1 End if AL_SetCellStyle 123 Configuring AreaList Pro Using Commands AL GetCellStyle areaRef L cellColumn 1 cellRow L styleNum 1 fontName S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt cellColumn integer Cell column cellRow longint Cell row styleNum integer Style of the font fontName string Name of the font AL_GetCellStyle is used to get the font and or style of a particular cell It will not get the column or row font and or style cellColumn Column of cell where to get the style cellRow Row of cell where to get the style styleNum This parameter returns the style number for the cell The number can be a sum of several individual styles For example bold italic ha
240. o an Arrow key or type ahead scrolling A user double click will not cause a call to the event callback method if the AreaList Pro object is configured to be enterable and the selected data entry method is via a double click If some of the columns are not enterable a double click on them will result in a single click event Please read the section Initiating Data Entry for more information Determining the User Action on an AreaList Pro Object 204 User Action Commands Ctri command click in the Column Header Event The following actions will trigger a 11 event report without displaying the AreaList Pro Sort Editor Windows right click MacOS ctrl click MacOS right click Windows ctrl click and MacOS command click won t report any event but will trigger the display of the AreaList Pro Sort Editor if the value of allowSortEditor is set to 1 in AL_SetSortOpts See the section about this parameter Event Callback vs Object Method The flag parameter in AL_SetEventCallback and the 0 result returned by the event callback project method determine if the object method and form method should be executed Object Methods or Project Methods On Plug in Area Event When 4D executes an area object method of form method neither 4D nor AreaList Pro is executing which means that all AreaList Pro commands all 4D commands and variables are available The developer may do whatever he wishes 4D will redraw the AreaList Pro area onc
241. o uses 4 Dimensions sorting routines when sorting fields 4D only uses indexes when performing a single level sort Indexes are ignored when performing a multiple level sort Therefore when fields are being displayed it would be a good idea to restrict access to the AreaList Pro sort editor when the selection contains several thousand records Maximum Number of Records Displayed AreaList Pro supports a maximum of 2 billion exactly 2 147 483 647 records displayed in an AreaList Pro object You can also display a selection with any desired number of records up to this limit using AL_SetSubSelect to specify what record range within the current selection you wish to display Performance Issues When Displaying Fields When AreaList Pro displays fields the automatic column sizing algorithm uses only the first 20 records or less if the selection contains less than 20 records in the selection These records are always read regardless of whether the columns are automatically or manually sized Therefore there is no performance penalty using the automatic column sizing algorithm when displaying fields See Performance Issues with Formatting Commands for more information Commands AL SetFile areaRef L tableNum gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout tableNum integer Number of 4D table resultCode longint Result code AL_SetFile tells AreaList Pro w
242. oO co ch 250 ALP Column commands Constant AL Apply to all columns AL Auto width AL Truncated upper left AL Truncated centered AL Scaled to fit AL Scaled proportional AL Just default AL Just left AL Just center AL Just right AL Use picture height off AL Use picture height on AL Allow column resize off AL Allow column resize on AL Resize in during off AL Resize in during on AL Allow column lock off AL Allow column lock on AL Display pixel width off AL Display pixel width on AL Use PICT Resource AL Use PicRef ALP Row commands Constant AL Apply to all rows AL Single row selection AL Multiple row selection AL Allow single row only AL Allow single or no row AL Move row info off AL Move row info on AL Enable row highlight E PB O orf EI eh Onm CH Lu C I EH 4 Fb T CO OO 65536 131072 E ZER e e dE A RR aE e eer ES Ee E ab dE Ver Ae E oO Value E E EE PE EE AE ees oO O eh So sch EN sch EN 25 AL Disable row highlight AL Remove row style AL Row style no change AL Remove row font AL Row font no change AL Get row select low memory AL Get row select succeeded ALP Entry commands Constant AL Column entry off AL Column entry typed only AL Column entry popup only AL Column entry both AL Disable spell check AL Enable spell check AL Entry_none select_sg AL Entry_none select_both AL Entry_sgl select_none AL Entry_dbl select_sgl AL Entry_cmd_dbl select
243. od for On Area Entry 4D Method for On Area Exit ADVANCED OPTIONS Dragging You can configure the dragging for an AreaList Pro object using this pane Please read the section Column line pattern No line 3 Column line color Row line pattern No line Z Row line color Clipboard _ Include hidden columns Field delimiter ASCII 009 Header padding 2 Row padding 0 Footer padding Record delimiter ASCII 013 Field wrapper ASCII NULL Cell Custom Formatting Optimization Favor Q Favor RAM Performance Dragging Commands for more information AreaList Pro Advanced Properties AreaList Pro Area AreaList Pro v8 5b11 1990 2011 Beckware LLC All Rights Reserved Area Name jeListDest Area Defined Name Column Setup General Options Enterability Advanced T Dragging Preview Please refer to the AreaList Pro manual for information on configuring the dragging features Options Row drag only with Option key Scroll area soe 30 Row dragging Drag between rows i i Columns DRAGGING Advanced Options Dragging 39 Configuring AreaList Pro Using the Advanced Properties Dialog Preview The Preview tab allows you to preview most of the options available in the dialog Sample alphanumeric data is used to fill in each of the columns you ve created in the Column Setup tab You can quickly see t
244. of the AL_GetLastEvent command Fayetteville Little Rock Phoenix Tuscon Petaluma Los Angeles Palm Springs San Diego Hartford Washington Wilmington Ft Lauderdale Miami Orlando Atlanta al ur Last event left Vertical scroll 7 Albuquerque Annapolis Atlanta Atlantic City Auburn Bangor Baton Rouge Boston Burlington Butte Canton Chicago Cincinnatti Columbia Dallas Last event right Sort button 1 Last event global Sort button 1 Example 11 Getting the Last Event in each Area 247 AreaList Pro Constant List AreaList Pro Constant List ALP Colors Constant AL White AL Black AL Magenta AL Red AL Cyan AL Green AL Blue AL Yellow AL Gray AL Light gray AL Use 4D palette color ALP Patterns Constant AL White pattern AL Black pattern AL Gray pattern AL Light gray pattern AL Dark gray pattern ALP Events Constant AL Null event AL Single click event AL Double click event AL Empty Area Single click AL Empty Area Double click Type Lo Lo Lo Lo Lon Lo Lo Lo Lon Lon Le Type Lo Lo Lo Lo Lo Type Ie es ES a Value white black magenta red cyan green blue yellow gray light gray Value white black gray light gray dark gray Value AA Go Nc AreaList Pro Constant List 248 AreaList Pro Constant List AL Single Control Click AL Empty Area Control Click AL Vertical Scroll Event AL Mouse moved event AL Sort but
245. ogic during the actual drag when the drag takes place the source codes that were given in srcCodel srcCode2 etc will be communicated to the receiver of the drag If any of the codes match the drag is enabled See What are access codes Example Enable dragging a row within this area vSelfStr String eList creates a unique code that only allows dragging within this area AL_SetDrgSrec cList 1 vSelfStr row data type for source AL_SetDrgDst cList vSelfStr row data type for destination AL _SetDrgDst areaRef L destDataType dstCode1 S dstCode10 S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout destDataType integer Data type to be received dstCodel dstCodel0 sting Access code s to be received AL_SetDrgDst is used to enable dragging into the destination area by setting the access codes Please read the section What are access codes for more information This command must be called before a drag has occurred The areaRef parameter must be the destination receiver area of a drag destDataType Possible values are 1 row 2 column 3 cell For the data type specified by destDataType either row column or cell you must specify at least one dstCode to enable receiving of that type dstCode 15 characters The dstCode can be any value other than an empty string such as Row Drag ColDra
246. oject method merely returns True if the current platform is Windows C_LONGINT 0 platform system machine PLATFORM PROPERTIES platform system machine 0 Num platform Windows The layout will appear like this in the User or Runtime environment OO Example 1 Example 1 This is Example 1 from the Reference Manual loading an array from a 4D List and displaying it using the AL_SetArraysNam command Ft Lauderdale FL Ft Worth TX Hartford CT Houston TX Little Rock AR Los Angeles CA Miami FL New York NY Orlando FL Phoenix AZ Pittsburgh PA New York NY Notice that the column header displays the default value of A In the next example we ll modify the display to have a more meaningful header Example 1 A Simple One Column List 225 Examples Example 2 Displaying Headers on the List Modify the previous example to display City State as the header for the list column The modified object method for the AreaList Pro object is Case of Form event Cn Load initialize the AreaList Pro object LIST TO ARRAY City State aCityState copy the list into an array errorcode AL_SetArraysNam cList 1 1 aCityState display array in AreaList Pro object AL_SetHeaders cList 1 1 City State specify the values for the column header DEMO_DefauIlt eList vitem aCityState 1 Form event On Plug in Area respond to user action If AL_GetLastEvent cList 1
247. olumn When entering other types of data as in 4 Dimension data entry may be restricted to specific requirements via the use of filters Enterability 28 The AreaList Pro User Interface Data Entry Using Popups AreaList Pro also has the ability to perform data entry using popup menus for column data types other than picture or boolean Popup menus will appear as small buttons on the right side of the cell which will be labeled with a downward pointing triangle The items contained in the popup menu represent the possible values for that cell which are determined by you However for time or date information a special popup menu will allow the user to choose appropriate values for these data types The presence of a popup menu in a cell does not necessarily prohibit the ability to enter typed characters Time and date popups can be displayed either as the old mode or as the new mode which uses more modern fonts AL _SetEnterable sets if the column is enterable by typing popup or both These settings can be restricted but not expanded with AL_SetCellEnter If the cell is enterable with popup AL_SetInterface sets what kind of popup will be used old or new The time menu is shown below To select a time the user should begin on the left side of the popup first selecting AM or PM then the hour then the minutes This menu will appear slightly different depending on your system settings for the time format using a
248. olumns cannot be sorted they will appear in the list of columns However the item s for the picture column s will be disabled and cannot be dragged into the sort order list 2 Click the Sort button When displaying fields the following features are present indexed fields will be bold in the Sort Editor fields from related one tables will be dimmed in the Sort Editor Sorting 24 The AreaList Pro User Interface Scrolling The list can be scrolled in the following ways Clicking the arrows and other scroll controls Using the keyboard Arrow keys Each press of the Arrow key will scroll the list one row or column in the direction corresponding to that key Option alt Arrow will scroll the list to the top bottom far left or far right AreaList Pro also has a scrolling option available when using the up down arrows during multi rows selections Using the AL_SetCellOpts routine you can activate the scrolling options when multiple rows are selected Typing on the keyboard As characters are typed the current sort column will be used to vertically scroll the list If there is a pause between typed characters then the scrolling action will reset The pause time is equal to the double click time set in the System settings This feature is disabled when displaying fields See Specifying the Fields to Display for more information Clicking the list area and dragging the mouse arrow outside of the list area This action will
249. on dragRow 1 acceptDrag 1 moveWithData 1 disableRowHighlight Parameter Type Description areaRef longint Reference of AreaList Pro object on layout multiRows integer Single or multiple rows selection allowNoSelection string Allow no rows to be selected in single row mode dragRow integer Drag a row to this or another object acceptDrag integer Accept drag from another AreaList Pro object moveWithData integer Move row style and color with row disableRowHighlight integer Disable highlighting of selected rows AL_GetRowOpts will return the current settings configured using AL_SetRowOpts For complete details about return values please see the AL_SetRowOpts routine for possible configuration settings AL SetColOpts areaRef L allowColumnResize automaticResize allowColumnLock hideLastColumns displayPixelWidth 1 dragColumn 1 acceptDrag Parameter Type Description areaRef longint Reference of AreaList Pro object on layout allowColumnResize integer User resizable columns automaticResize integer Automatically resize columns when events occur in the area allowColumnLock integer Allow user to lock columns hideLastColumns integer Number of columns from the right to hide displayPixelWidth integer Display column widths dragColumn integer Drag a column to this or another object acceptDrag integer Accept drag from another AreaList Pro object AL_SetColOpts is used to c
250. ontrol several AreaList Pro options pertaining to columns allowColumnResize This parameter controls whether the user can resize column by clicking on the dividing line between column headers 0 do not allow the user to resize columns 1 allow the user to resize columns default When the hideHeaders parameter of AL_SetMiscOpts is set to 1 headers are hidden allowColumnResize is set to 0 internally by AreaList Pro AL_GetRowOpts AL_SetColOpts 89 Configuring AreaList Pro Using Commands The 2 event code returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable will be set to 3 if the user resizes a column see Determining the User s Action on an Areal at Pro Object You can get the column widths using AL_GetWidths automaticResize 0 No columns will be resized default 1 Whenever an array or field command is called while the area is displayed the columns will be resized to the last widths passed using AL_SetWidths If any column widths are O then AreaList Pro will automatically calculate the width based upon the contents of the column allowColumnLock 0 disables the column lock area which prevents the user from modifying the number of locked columns 1 enables the column lock area of the AreaList Pro object allowing the user to modify the number of locked columns default The 2 event code returned to the callback method or AL_GetLastEvent command formerly ALProEvt
251. ontrollype Type Description longint Reference of AreaList Pro object on layout integer Column in which control appears integer Type of control AL_SetEntryCtls is used to specify which type of control will be used for data entry in a column displaying a boolean array If the column contains any other type of array this command will be ignored columnNumber This parameter specifies the column to act on controlType 0 or 1 0 checkbox without title default 1 checkbox with title the title is the True label specified in AL SetFormat AL_SetCellEnter areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X enterability 1 Parameter areaRef gt firstCellCol firstCellRow lastCellCol lastCellRow cellArray enterability Type longint integer longint integer longint two dimensional longint array integer Description Reference of AreaList Pro object on layout First cell column First cell row Last cell column Last cell row Discontiguous cells Enterability AL_SetCellEnter is used to set the enterability of a specific cell range of cells or list of cells To specify a single cell If firstCellCol and firstCellRow are greater than 0 and lastCellCol or lastCellRow are less than or equal to 0 then only firstCellCol firstCellRow will be set To specify a range of cells If firstCellCol and firstCellRow are greater than 0 and las
252. or it is a null empty string then 4dColor will be used AdColor 1 to 256 The color at this position in 4D s palette will be used for the color for the part specified by selector Examples Light gray for the area in the header above the vertical scrollbar AL_SetMiscColor cList 0 Light Gray 0 13th color from 4D s palette for the area to the left of the horizontal scrollbar AL_SetMiscColor cList 2 13 AL_SetMiscColor 100 Configuring AreaList Pro Using Commands AL SetMiscRGBColor areaRef L selector L red L green L blue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout selector longint Select which part to apply the color to red longint Red green longint Green blue longint Blue AL_SetMiscRGBColor provides the ability to define miscellaneous color attributes using the associated RGB values This routine is similar to AL_SetMiscColor red Desired red component in RGB color pattern green Desired green component in RGB color pattern blue Desired blue component in RGB color pattern AL _SetCopyOpts areaRef L includeHiddenCols 1 fieldDelimiter S recordDelimiter S fieldWrapper S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout includeHiddenCols integer Include hidden columns fieldDelimiter string Field separator for Edit menu copy recordDelimiter string
253. ound blue component in RGB color pattern AL_SetCellRGBColor 128 Configuring AreaList Pro Using Commands AL _GetCeliIRGBColor areaRef L cellColumn cellRow L cellForeRed L cellForeGreen L cellForeBlue L cellBackRed L cellBackGreen L cellBackBlue L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout cellColumn integer Cell column cellRow longint Cell row cellForeRed longint Foreground red cellForeGreen longint Foreground green cellForeBlue longint Foreground blue cellBackRed longint Background red cellBackGreen longint Background green cellBackBlue longint Background blue AL_GetCelIRGBColor is used to get the foreground and or background color of a specific cell This routine works in the same manner as AL_GetCellColor except it allows you to get the color information using standard RGB values See AL_SetCellRGBColor for details about the parameters AL_SetCellSel areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt firstCellCol integer First cell column firstCellRow longint First cell row gt lastCellCol integer Last cell column lastCellRow longint Last cell row gt cellArray two dimensional longint array Discontiguous cells AL_SetCellSel is used to set the cell selection Use the cellSelect
254. ous cells AL_GetCellStyle is used to determine any cell specific formats for a particular cell Use the moveWithData option of AL_SetCellOpts to keep the cell specific information with a cell when a row or column is dragged to a new location or the list is sorted AL_GetCellOpts will return the current settings configured using AL_SetCellOpts Styles 50 Configuring AreaList Pro Using Commands Dividing Lines You can display dividing lines between rows and column and specify their pattern and color using AL_SetDividers and AL_SetRGBDividers commands Sorting Sort Buttons User sorting of the columns via the column header sort buttons is enabled via the userSort parameter of AL_SetSortOpts Sort Direction Indicator You can use the showSortDirlndicator parameter of AL_SetSortOpts to display a sort direction indicator in the upper right corner above the vertical scroll bar This option requires the header and the vertical scroll bar to be displayed When the user clicks the sort direction indicator the sort direction of the primary sort level will be reversed and the list will be sorted The AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable the same as if a sort button in the header was clicked see Using the Callback Methods Sort Editor The user can be presented with the AreaList P
255. ow as a result of a click or any other action You can set the selected cells using AL_SetCellSel When an AreaList Pro object is in cell selection mode mouse clicks are used to highlight cells rather than rows If multiple cells selection is enabled using AL_SetCellOpts then the user can shift click and ctrl command click to select multiple cells Discontiguous non adjoining selections are allowed When an AreaList Pro object is in cell selection mode it is always possible that no cells are selected AL_SetCellSel is used to select cells procedurally and can select a single cell a range of cells or a list of cells You can determine the selected cells using AL_GetCellSel When the user scrolls an AreaList Pro object that is in cell selection mode using the Arrow keys or keyboard type ahead the list will scroll but the cell selection will not change Row dragging is disabled when an AreaList Pro object is in cell selection mode The enterability options set with AL_SetEntryOpts are fully supported when an AreaList Pro object is in cell selection mode If an AreaList Pro object is in multi cell selection mode the Edit menu Select All command is enabled Clipboard The data copied to the clipboard can be formatted using AL_SetCopyOpts This command allows you to specify the field and record delimiters copied with the data and whether any hidden column data should be copied to the clipboard The Edit menu Copy command is disabl
256. ows 1 mapEnterKey 1 decimalCharForWin S useNewPopuplcon Parameter Type Description areaRef longint Reference of AreaList Pro object on layout entryMode integer Mode to initiate entry allowReturn string Allow entry of carriage returns into text arrays displaySeconds integer Display seconds in time arrays during data entry moveWithArrows integer Move enterable cell using the Arrow keys mapEnterKey integer Map the Enter key to function as another key decimalCharForWin sting Decimal character under 4D for Windows useNewPopuplcon integer Display modern popup icon AL_SetEntryOpts is used to control several AreaList Pro options pertaining to data entry Please read the section Moving the Current Entry Cell for more information entryMode 0 to 7 8 to 15 to ignore soft deselect This option determines the mode that the user can use to initiate data entry and select rows with the mouse The table below describes the possible values The default is 1 Value Entry Selection 0 None Single click 1 None Single and double click 2 Single click None 3 Double click Single click 4 lt ctrl command gt Double click Single and double click 5 lt shift gt Double click Single and double click 6 lt option alt gt Double click Single and double click 7 lt control gt Double click Single and double click To ignore soft deselect events e g clicking on non focus
257. ows that have not been previously set The row font may be left unchanged by setting fontName to the empty string See the moveWithData option of AL_SetRowOpts This controls whether row styles stay with their rows whenever sorting or dragging occurs AL_SetRowStyle 117 Configuring AreaList Pro Using Commands Examples AL_SetRowStyle cist 10 2 set row 10 to be italic AL_SetRowStyle cList 0 1 Helvetica set all rows to be bold Helvetica AL_SetRowStyle cList 0 1 1 reset all row styles column settings will be used Set the 12th row to display the Times font in bold italic style AL_SetRowStyle cist 12 3 Times AL_UpdateArrays eList 1 AL SetRowColor areaRef L rowNumber L alpRowForeColor S 4dRowForeColor L alpRowBackColor S AdRowBackColor L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout rowNumber longint Number of row alpRowForeColor string Row foreground color from Arealist Pro s palette AdRowForeColor longint Row foreground color from 4D s palette alpRowBackColor string Row background color from Arealist Pro s palette AdRowBackColor longint Row background color from 4D s palette AL_SetRowColor is used to specify the foreground and background colors for a row It will override the foreground and background color settings for all columns in that row AreaList Pro has its own palette with the following colors
258. panded with AL_SetCellEnter If the cell is enterable by typing AL SetInterface sets if AreaList Pro uses plain text editing where user can type in his date time string or inline date time control Note that the cell widths and height may need to be increased to fit the inline control interface Moving the Current Entry Cell AreaList Pro speeds data entry by making it easy to move to other enterable cells once data entry is initiated Since enterability is determined on a column by column basis the cells adjacent to the current data entry cell may not be enterable AreaList Pro handles this situation by using the Tab key to move to the next enterable cell to the right A shift Tab combination will move data entry to the next enterable cell to the left If there isn t an enterable cell on the same row these key combinations will move the data entry cursor to the next or previous row respectively The Return key can be used in two ways during data entry Normally when the Return key or shift Return key is used data entry will be moved to the next or previous row in the same column as the current data entry cell However in some cases the Return key may be used to enter a carriage return character into a text cell As a default the Return key moves the data entry position You may choose to configure the Enter key to function the same as either the Return key or the Tab key and also have the option of causing the Arrow keys to move t
259. part of an area using AL SetHdrStyle AL SetFtrStyle and AL SetStyle selector indicates the area part for which to set the default appearance Constant Value Area Part AL Style Header 1 Header AL Style List 2 List data AL Style Footer 3 Footer fontName Use this parameter to specify the font for the area part specified by selector size Use this parameter to specify the font size for the area part specified by selector styleNum The styleNum is a font style code By adding the codes together you can combine styles The numeric codes for styleNum are shown below Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 AL_SetDefaultStyle 85 Configuring AreaList Pro Using Commands The defaults for the different area parts depend on the plaform used MacOS defaults are Selector Font Size Style AL Style Header Lucida Grande 13 0 AL Style List Lucida Grande 11 0 AL Style Footer Lucida Grande 11 0 Windows defaults are Selector Font Size Style AL Style Header Tahoma 13 0 AL Style List Tahoma 11 0 AL Style Footer Tahoma 11 0 These values are initialized at startup from the STR 15024 resource AreaList Pro versions prior to 8 1 used the following defaults Geneva 12 0 Geneva 10 0 Geneva 10 0 Example Modify the default style for heade
260. pdateArrays 1 AL Recalculate arrays update source area AL_GetDrgArea 1 eDestination 0 destination area AL_UpdateArrays eDestination AL Recalculate arrays update destination area AL_SetSelect eDestination aRowsToSelect select new rows OK AL_GetSelect eDestination aRows get the rows for evtUpdateText evtUpdateText is then called by the callback method to update the variable Example 10 Drag and Drop Between Areas 243 Examples Example 11 Getting the Last Event in each Area This example will demonstrate the use of AL_GetLastEvent in two different AreaList Pro areas Each area s last event is kept track of and displayed below the area In addition a text area on the bottom of the layout displays the last detected event in any area formerly ALProEvt Example 11 This is Example 11 from the Reference Manual which was built to illustrate the use of the AL_GetLastEvent command 50 100 50 100 eList w 155 h 190 eListDest w 155 h 190 AreaList Pro v8 5 AreaList Pro v8 5 1990 2011 Beckware LLC 1990 2011 Beckware LLC All Rights Reserved All Rights Reserved Last event left Last event right eftEventText ightEventText Last event global vGlobaleventl ext ___ Done Our layout method takes care of the Last event global text last event detected in any AreaList Pro area Case of Form event On Load vGlobalEventText Form event On Plug in Area call from
261. pies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obsolete license will never expire A 4D database used to retrieve your 4D serial information is available from the following link http www e node net ftp GetSeriallnfo Registration License types 14 About AreaList Pro Using the AreaList Pro Manual General information about the AreaList Pro user interface is discussed in The AreaList Pro User Interface An overview of the AreaList Pro commands and usage is covered in the following sections Configuring AreaList Pro Using Commands Field and Record Commands Enterability Dragging Commands User Action Commands Utility Commands Commands are organized by topic into individual chapters Each chapter begins with an overview of the topic and how to use the different commands Each command is then covered in detail and examples provided Commands and parameters that are new in AreaList Pro version 8 are displayed in green characters Items that are new or modified in AreaList Pro versions 8 1 8 3 are displayed in pink magenta characters Items that are new or modified in AreaList Pro version 8 5 are displayed in orange characters If you are unable to resolve a problem using this manual you can contact our Technical Support Department See Technical Support Cross Refer
262. r that the drag has occurred You are responsible for manipulating any arrays or other data structures When an AreaList Pro area is the destination of a drag the following information is available to you the type of data that was the recipient of the drag row column or cell the row column or cell that was dragged to Background 189 Dragging Commands You must use AL_GetDrgDstTyp to determine if the destination of the drag was a row column or cell if the destination was a row AL_GetDrgDstRow may be used to determine the destination row if the destination was a column AL_GetDrgDstCol may be used to determine the destination column if the destination was a cell then both AL_GetDrgDstRow and AL_GetDrgDstCol are used to determine the destination cell If the destination of the drag is an area on another window then you must use 4D s CALL PROCESS command to communicate to the other process AreaList Pro will update the arrays and refresh the area if the drag is within the same area row to row or column to column Row dragging is disabled when an AreaList Pro object is in cell selection mode Use the moveWithData option of AL_SetCellOpts to keep the cell specific information with a cell when a row or column is dragged to a new location or the list is sorted When dragging cells there will be no automatic updating of arrays even if the source and the destination lists are the same AreaList Pro on Multi Page
263. r Type areaRef longint cellColumn integer gt cellRow longint iconRef longint iconAlignment integer horPosition integer vertPosition integer offset integer gt scaling integer Description Reference of AreaList Pro object on layout Column at which to set the icon Row at which to set the icon Reference of the icon or picture to use Position of icon Horizontal position Vertical position Pixel offset Scaling AL_GetCellHigh AL_SetCelllcon 181 Enterability AL_SetCelllcon provides the ability to procedurally place icons in individual cells One or two icons may be used left and right You can customize the icon s using cicn or PICT resources or items from the 4D Picture Library see details below This call supersedes Escape sentence icons placed in cells see Header Cell Icon Support cellColumn Desired cell column number cellRow Desired cell row number iconRef Reference of the icon or picture to use Both cicn and PICT resources can be used as well as items from the Picture Library To associate an icon to the cell pass one of the following numeric values Use PICT resource and Use PicRef are 4D constants N where N is the resource ID of Mac OS based cicn resource Use PICT resource N where N is the the resource ID of a Mac OS based PICT resource Use PicRef N where N is the reference number of a picture from the Design
264. r each column These data structures are allocated on a per column basis and AL_SetArraysNam for a given column or AL_InsArrayNam must be executed before the appearance enterability style or any other property of that column can be specified Using Defined Constants with AreaList Pro Specifying the Arrays to Display 4 Configuring AreaList Pro Using Commands If the AL_SetArraysNam or AL_InsArrayNam command is incorrectly used an error code indicating the problem will be returned Constant Value Action AL No error in arrays 0 ch AL Not an array error Check to make sure all arrays are correctly typed AL Wrong type array error Pointer and two dimensional arrays are not allowed AL Wrong number rows error Make sure that all arrays have the same number of elements AL Max arrays exceeded error 512 arrays is the maximum Or BR Md A AL Low memory array error Increase 4D s RAM partition or change your approach to use fewer or smaller arrays ARRAY SETUP ERROR CODES Up to 512 arrays can be displayed by AreaList Pro with up to fifteen columns specified in each call to AL_SetArraysNam or AL_InsArrayNam The position of the first array columnNumber and the number of arrays numArrays are also specified in these commands All array types except for pointer and two dimensional arrays are allowed and all arrays must have the same number of elements The maximum number of rows is 2 000 00
265. r footer justification AL_SetFormat eContacts 2 0 0 2 0 Format a boolean column 4th column right column justification and left header justification AL_SetFormat eList 4 Male Female 3 1 0 0 Format style 3 for a date column default justification 5th column default column header and footer justification AL_SetFormat cList 5 3 AL_SetFormat 78 Configuring AreaList Pro Using Commands Format style 2 for a time column right justification for header and column 7th column AL_SetFormat cList 7 amp 2 3 3 0 0 Custom format style default justification for column center header 5th column AL_SetFormat cList 5 Dollars 0 2 0 0 Scale picture column to fit proportionally 1st column use default header and footer justification and use picture size in row height calculation AL_SetFormat cList 1 3 0 0 0 1 See also Header Cell Icon Support for information about the use of AL_SetFormat to display icons in cell data using picture data contained in the cicn or PICT resources or items stored in the 4 Dimension Picture Library AL SetDefaultFormat selector L format S Parameter Type Description selector longint Selector data type for which to modify the default format string Desired format AL_SetDefaultFormat sets the default format for the specified type to apply to all AreaList Pro areas to be created Existing areas are not affected The forma
266. rTop Draw top border borderRight Draw right border borderBottom Draw bottom border offset Offset from cell boundary in pixels 0 if the border should be drawn at cell boundary default width Width of line Although this parameter is a real value only integer widths will be drawn Fractional widths like 0 25 pixels are used for compatibility with PrintList Pro s harline printing features redColor RGB red component used for the border greenColor RGB green component used for the border blueColor RGB blue component used for the border AL_SetCellBorder 114 Configuring AreaList Pro Using Commands AL SetCellFrame areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L offset width F redLightColor greenLightColor 1 blueLightColor redDarkColor 1 greenDarkColor blueDarkColor clearAllBorders 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt firstCellCol integer First cell column firstCellRow longint First cell row gt lastCellCol integer Last cell column gt lastCellRow longint Last cell row offset integer Offset from cell boundary in pixels width real Width of line redLightColor integer Red light color greenLightColor integer Green light color gt blueLightColor integer Blue light color redDarkColor integer Red dark color greenDarkColor integer Green dark color
267. rag when the drag takes place the destination codes that were given in det ode dstCode2 etc are compared to the source codes communicated by the sender of the drag If any of the codes match the drag is enabled Please read the section Technical Details of the Dragging Implementation for more information When a Drop Area is placed on a page in a multi page layout be sure to disable dragging for that area by calling this command with null string for the dstCode parameters Please read the section Drop Area Objects on a Multi Page Layout for more information Example Enable dragging a row to this area vStr String eDrop creates a unique code that only allows dragging within this area AL_SetDropDst cList vStr row type for destination AL_DropArea AL_SetDropDst 219 Utility Commands AL ShowSortEd areaRef L gt sortDone Parameter Type Description areaRef longint Reference of AreaList Pro object on layout sortDone integer User clicked the Sort button AL_ShowSortEd will display the AreaList Pro Sort Editor The prompt may be set with the sortEditorPrompt parameter of AL_SetSortOpts The Editor will display the header values currently specified for the AreaList Pro object The headers for picture columns will appear but will be disabled Use AL_GetSort to determine what columns the user sorted on sortDone This parameter returns what action the user made after the Sort Editor was displayed
268. raysNam AL_SetArraysNam not AL_InsertArrays AL_RemoveArrays areaRef L columnNumber numArrays Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Column at which to remove the first array numArrays integer Number of arrays to remove up to 512 AL_RemoveArrays is used to remove arrays from AreaList Pro numArrays beginning at columnNumber will be removed from the list AL_GetArrayNames AL_RemoveArrays 66 Configuring AreaList Pro Using Commands All subsequent columns will maintain their settings In other words any header text column styles etc will stay with their corresponding array Examples AL_RemoveArrays clist 8 4 starting at column 8 remove 4 arrays AL_RemoveArrays cList 1 20 remove all 20 arrays AL_UpdateArrays areaRef L updateMethod 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout updateMethod integer Method to use to update the AreaList Pro object AL_UpdateArrays is used to update AreaList Pro Use this command whenever any elements of the arrays being displayed are changed elements added deleted or modified but the arrays themselves remain the same Warning in an enterable area the row containing the currently edited data must not be deleted AL_ExitCell must be called before the row array element is deleted AL_UpdateArrays must be called aft
269. reaList Pro s automatic column sizing as a good starting reference The displayPixelWidth parameter of AL_SetColOpts should be set to 1 to enable this feature which allows you to toggle between the header text and the column width by clicking on the check box that appears in the bottom right corner of the AreaList Pro object Additionally the columns can be resized in the Runtime environment and the column width values are updated immediately When using this feature you should be sure to enable the display of headers by passing 0 in the hideHeaders parameter of AL_SetMiscOpts AL_GetWidths will return displayed column widths AL_GetColOpts will return the current settings configured using AL_SetCo Opts AreaList Pro Height Complete Rows Display Whenever an array or field command is called AreaList Pro performs calculations necessary to size the plug in area based on the size of the object as drawn on the layout AreaList Pro will always ensure that only complete rows are displayed in the AreaList Pro area However this means that the actual height of the plug in area as displayed in the User or Runtime environment may be slightly less than the height in the Layout Editor This can be a hindrance when you are attempting to align other layout objects with the AreaList Pro object To ensure that the AreaList Pro object does not change its size when displayed in the Runtime environment a tool is available to tell you what size to make
270. reaList Pro copy location Drop Area Sort Editor Area Name Plug in information 218 Utility Commands Commands AL DropArea AL_DropArea is the command used to identify the plug in area to which an AreaList Pro row or column can be dragged but which does not display anything When a row or column is dragged over this area the area will invert This command will appear in the 4D Object Types popup on a layout Property List It is only used in the object definition for an AL_DropArea object and should never be used as a command in a 4D method AL _SetDropDst dropAreaRef L dstCode1 S dstCodeN S Parameter Type Description dropAreaRef longint Reference of Drop Area object on layout dstCodel dstCodeN string String access code s to be received AL_SetDropDst is used to set the access codes for the destination of a drag and should be called before a drag Please read the section What are access codes for more information dstCode1 dstCodeN 15 characters The dstCode can be any value other than an empty string such as RowDrag ColDrag ALPDrag PartNum etc Avoid using the strings TEXT or PICT The code should be the same as what is passed into a potential drag partner The drag partner will be the source sender of the drag The source area can be an AreaList Pro area or another object The Drop Area performs the following logic during the actual d
271. reaRef longint Reference of AreaList Pro object on layout firstRecord longint First record to display numRecords longint Number of records to display AL_SetSubSelect is used to tell AreaList Pro to display a different subselection of records from the current selection This command will have the same effect on the AreaList Pro object as calling AL_UpdateFields with updateMethod set to 2 in addition to changing the subselection of records to be displayed Thus if this command is called there is no need to also call AL_UpdateFields firstRecord This parameter is used to set the first record in the selection to be displayed in the AreaList Pro object If firstRecord is greater than or equal to the number of records in the selection then it will be set to the last record in the selection The default is 1 numRecords This parameter is used to set the number of records in the selection to be displayed in the AreaList Pro object The possible values are Value Description gt 0 Display this number of records 1 Display the number of records from firstRecord until the end of the selection If numRecords is greater than the number of records from firstRecord until the end of the selection then numRecords will be set to the number of records from firstRecord until the end of the selection If this command is not called then firstRecord will be set to 1 and numRecords will be set to the number of records in
272. reful to never have two AreaList Pro objects with the same name on a 4D layout To Configure a Variable Object as an AreaList Pro Object 1 Create a variable object on a layout and display the variable Property List 2 Select the AreaListPro object type 3 Name the variable This name will be used as the first parameter to many of the AreaList Pro commands Note this variable must be a process variable not an interprocess variable i e the name cannot begin with lt gt or 0 4 The AreaList Pro object is drawn in the Layout Editor The first line of text contains the name of the object and its pixel dimensions and the remaining lines are the copyright notice If the object is small the horizontal and vertical scroll bars are not displayed in the Layout Editor but everything will function correctly The display of the object name pixel dimensions copyright notice and scroll bars is an indication that the object has been properly created and named Resizable Windows with AreaList Pro To Configure a Variable Object as an AreaList Pro Object 31 Creating an AreaList Pro Object on a Form AreaList Pro Object Dimensions AreaList Pro provides information to allow you to properly size the AreaList Pro area and to align it with other objects on the layout in the 4 Dimension Design environment A scale at the top of the plug in area indicates the pixel width of the AreaList Pro object This may be used to ali
273. ring AreaList Pro Using the Advanced Properties Dialog Column Enterability You can specify the enterability of each column If you specify a popup array for a column the array must be declared and loaded before the window is opened in the Runtime environment For example the following code must be executed before the Open Window function is called ARRAY STRING 20 aPopupFirstName 0 SELECTION TO ARRAY People First Name aPopupFirstName See Enterability below and the Enterability section for more information about enterability configuration and options Default Column Columns EI 0 Default Use the Default column to set the properties for all 1 First Name columns Then if you wish to have different 2 Last Name settings for a particular column select that column 3 City in the list and set it 4 State 5 Zip Code You will need to specify the field or array header 6 Country and format for each column 7 Title 8 Birthdate Column Width Autosize TT Use PICT size for row height DEFAULT COLUMN You can use the default column to setup the attributes for new columns you include by clicking the Add button New columns that are added are assigned the settings in the default column This behavior is true at any time not just the first time that the Advanced Properties dialog is configured If you change the settings for the default column any new columns you add will get the settings but existing columns will not be c
274. ro Sort Editor by calling AL_ShowSortEd The window title and the prompt at the top of the window can be customized using the prompt option of AL_SetSortEditorParams AL_SetSortEditorParams also provides the ability to customize the appearance of available sort items when displaying the AreaList Pro Sort Editor The current sort order of the AreaList Pro area can be displayed when the Sort Editor dialog is presented by setting the showSortOrder parameter of AL_SetSortOpts If the allowSortEditor option of AL_SetSortOpts is enabled the user can invoke the Sort Editor by ctrl command clicking a column header AL_GetSortEditorParams provides the ability to retrieve the current properties of the AreaList Pro Sort Editor If you have not previously customized the display properties the default settings will be returned AL_SetSortedCols provides the ability to customize the default list of sorted columns AL_GetSortedCols returns the current sort columns as displayed in the Sort Editor You should use this routine after displaying the AreaList Pro Sort Editor The AreaList Pro default Sort Editor is displayed as a resizable window Dividing Lines Sorting 5 Configuring AreaList Pro Using Commands Procedural Sorting Multilevel sorting can be performed procedurally on the AreaList Pro columns by using AL_SetSort This command will sort all of the columns in an AreaList Pro area using up to 15 of them as sort criteria for the m
275. ro object is displayed on a form in a window and another form is going to be displayed in the window with DIALOG ADD RECORD or MODIFY RECORD commands you must inform the AreaList Pro object that another form will be displayed Overview This is done by calling the following command whenever another form is about to be displayed AL_SetScroll eList 0 0 inform AreaList Pro object that another form will be displayed where eList is the name of the AreaList Pro object on the original form If this is not done the AreaList Pro object s scroll bars may be active on the other form Scrollbars will be set back to visible next time the AreaList Pro area is redrawn so the call above should the be last command sent to the AreaList Pro area before the new form is displayed AL_SetScroll eList 0 0 hides the scrollbars until the next update of the area content To prevent the scrollbars to appear again use SET VISIBLE together with AL_SetScroll AreaList Pro areas that are not visible will not receive any update request that may be sent to them Details Disabling an AreaList Pro Area The following only applies to AL_SetScroll eList 0 0 Other parameters like 2 and 3 may hide the scrollbars but do not have the same effect AL_SetScroll eList 0 0 not only hides the scrollbars but disables any interaction with the system event handling for the given area Keep in mind that the next area update event received from 4D or the system will
276. ro version 8 AL_GetVersion returns the currrent AreaList Pro s version Example vers AL_GetVersion returns the current plug in version AL_GetPluginPath path s Parameter Type Description path string Full plug in pathname AL_GetPluginPath returns the currently active AreaList Pro copy location on the hard drive wherever it is located including nested in the project folder of bundle in the Plugins folder Example path AL_GetPluginPath returns the active plug in path AL_GetAreaName AL_GetVersion AL_GetPluginPath 221 Obsolete Commands Obsolete Commands Several commands are obsolete in AreaList Pro s current version but are still supported for compatibility You should not use these commands for new projects This chapter provides a simple list for these commands and their syntax AL_SetArrays areaRef L columnNumber numArrays array1 X arrayN X gt resultCode L AL_InsertArrays areaRef L columnNumber numArrays l array1 X arrayN X gt resultCode L AL_SetForeClr areaRef L columnNumber alpHdrForeColor S 4dHdrForeColor alpListForeColor S AdListForeColor alpFtrForeColor S 4dFtrForeColor AL_SetBackClr areaRef L columnNumber alpHdrBackColor S 4dHdrBackColor 1 alpListBackColor S AdListBackColor alpFtrBackColor S 4dFtrBackColor 1 AL_DragMgrAvail isDragMgrPresent AL_GetDragLine areaRef L oldRowNumber L newRowNumber L destAreaName L AL_Get
277. roll and horizontalScroll if another form is going to be displayed in the window with DIALOG ADD RECORD or MODIFY RECORD commands This is required to inform the AreaList Pro object that another form will be displayed Neither AL_UpdateArrays nor AL_UpdateFields should be called in this specific case See Scroll bars Changing Displayed Form AL_SetScroll can be used in the On load phase or in another phase form event Examples Set an AreaList Pro object to display the 15th element the object is named eList AL_SetScroll eList 15 1 Configure the AreaList Pro object not to display the vertical scrollbar If Form event Qn Load do any desired setup then hide the vertical scrollbar AL_SetScroll eList 1 1 End if AL SetColLock areaRef L columns Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columns integer Number of columns to lock AL_SetColLock is used to set the number of columns to lock AreaList Pro will not allow more columns to be locked than the number of displayed columns minus two columns This parameter is used to specify the number of columns to lock AL_SetColLock can be used in the On load phase or in another phase form event Example AL_SetColLock eList 2 lock the first two columns AL_SetScroll AL_SetColLock 135 Configuring AreaList Pro Using Commands AL_SetHeight areaRef L numHeaderLines 1 headerHeightPad 1 numRowLin
278. rresponds to the AreaList Pro object on the layout You must use the following declaration in your callback method C_LONGINT 1 Using Callback Methods During Data Entry AreaList Pro lets you make use of callbacks when entering and exiting a cell and when a popup menu is clicked or released This feature provides you with considerable control over user actions allowing you to do such things as reject an entry provide a choice list or simply skip a particular cell AL_UpdateArrays can only be called with updateMethod equal to 1 and AL_UpdateFields can only becalled with updateMethod equal to 0 or 1 from a callback method other than an event callback In addition to altering the array content you can change color and style reject or accept entered data and change the current data entry cell using the AreaList Pro commands listed above You should not call any command which changes the number of displayed arrays their position in the area or their sorted order See Event Callback vs Object Method Executing a Callback Upon Entering a Cell An entry started callback method is a 4 Dimension method called when data entry begins for a cell or an AreaList Pro popup menu is clicked and is specified by passing the method name in the entryStartedMethod parameter of AL_SetCallbacks If this parameter is a null string then no method will be called AreaList Pro will pass the entryStartedMethod callback method two parameters
279. rride the default Sort Editor prompt and use the default window title ARRAY TEXT aiCollist 2 ARRAY LONGINT aiCollist 2 atColList 1 First atColList 2 aiColList aiCollList 2 3 third column ret AL_SetSortEditorParams eList Select Column atColList aiColList Third 1 1 first column AL GetSortEditorParams areaRef L windowTitle S prompt S headerList X sortList X resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout windowTitle string Window title prompt string Editor prompt labelList text array Sort column labels columnNumberlList longint array Sort column numbers resultCode longint Result code AL_GetSortEditorParams provides the ability to retrieve the current properties of the AreaList Pro Sort Editor If you have not previously customized the display properties the default settings will be returned See AL_SetSortEditorParams for information on setting the Sort Editor attributes AL_SetSortEditorParams AL_GetSortEditorParams 106 Configuring AreaList Pro Using Commands The following example will assume you have not previously called the AL_SetSortEditorParams routine and will return all the default settings C_TEXT sAL_WindowTitle C_TEXT sAL_SortEditorPrompt ARRAY TEXT atAL_SortNames 0 ARRAY LONGINT ciAL_SortColumnOrder 0 ret AL_GetSortEditorParams cList sAL_WindowTitle sAL_SortEditorPrompt at
280. rs on Windows Tahoma 13 0 to Arial 12 bold AL_SetDefaultStyle AL Style Header Arial 12 1 AL _GetStyle areaRef L columnNumber fontName S size l styleNum 1 Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber integer Desired list column fontName string Name of the font used size integer Size of the font styleNum integer Style of the font AL_GetStyle returns the formatting options set using the AL_SetStyle routine For complete information on the values which are returned please refer to the AL_SetStyle routine for parameter descriptions The following example will retrieve the information set using the AL_SetStyle routine C_LONGINT fontSize fontStyle C_TEXT fontName AL_GetStyle cList 1 fontName fontSize fontStyle AL_SetDefaultStyle AL_GetStyle 86 Configuring AreaList Pro Using Commands AL SetRowOpts areaRef L multiRows 1 allowNoSelection dragRow 1 acceptDrag 1 moveWithData 1 disableRowHighlight I Parameter Type Description areaRef longint Reference of AreaList Pro object on layout multiRows integer Single or multiple rows selection allowNoSelection integer Allow no rows to be selected in single row mode dragRow integer Drag a row to this or another object acceptDrag integer Accept drag from another AreaList Pro object moveWithData integer Move row style and color with row disableRowHighl
281. s format Returns the defined column format string There are many formatting options which can be used to customize the appearance of a given AreaList Pro column For a complete list of formatting options please refer to the AL_SetFormat routine columnJust Returns the defined column justification value headerJust Returns the defined header justification value footerJust Returns the defined footer justification value usePictHeight Returns the usePictHeight property The following example will set the formatting attributes for a given AreaList Pro area cell Format a real column 3rd column default column justification center header justification and default footer justification AL_SetFormat clist 3 00 0 2 0 0 Then we ll use the AL_GetFormat routine to extract the formatting values C_STRING 32 sFormat C_LONGINT colJust headerJust footerJust usePictHeight AL_GetFormat cList 3 sFormat colust headerJust footerJust usePictHeight When the routine has completed the following values will be returned sFormat contains 00 colJust contains O headerJust contains 2 footerJust contains O usePictHeight contains O AL_GetFormat 80 Configuring AreaList Pro Using Commands AL SetHdrStyle areaRef L columnNumber fontName S size l styleNum Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber
282. s areaRef L allowColumnResize automaticResize 1 allowColumnLock 1 hideLastColumns 1 displayPixelWidth 1 dragColumn 1 acceptDrag AL SetCopyOpts areaRef L includeHiddenCols fieldDelimiter S recordDelimiter S fieldWrapper S AL_SetDefaultFormat selector L format S AL_SetDefaultStyle selector L fontName S size L styleNum L AL_SetDividers areaRef L colDividerPattern S alpColDividerColor S 4dColDividerColor rowDividerPattern S alpRowDividerColor S 4dRowDividerColor 1 AL SetDrgDst areaRef L destDataType l dstCode1 S dstCode10 S AL SetDrgOpts areaRef L dragRowWithOptKey 1 scrollAreaSize multiRowDrag 1 dragOntoRow AL SetDrgSrc areaRef L sourceDataType srcCode1 S srcCode10 S AL_SetDropDst dropAreaRef L detC ode 5 dstCodeN 5 AL_SetEditMenuCallback areaRef L callbackMethod S gt resultCode L AL_SetEnterable areaRef L columNumber 1 enterability popupArray X menuPackRef L AL_SetEntryCtls areaRef L columnNumber control Type l AL_SetEntryOpts areaRef L entryMode 1 allowReturn 1 displaySeconds moveWithArrows 1 mapEnterKey 1 decimalCharForWin S useNewPopuplcon AL _SetEventCallback areaRef L callbackMethod S flag L gt resultCode L AL SetFields areaRef L tableNum l columnNumber numFields 1 fieldNum1 fieldNumN 1 gt resultCode L AL_SetFile areaRef L tableNum gt resultCode L AL SetFilter areaRef L columNumber
283. s the first one from a related table error AL_SetFile cList Table gt People set the main table since the field to be set in column one is not from the main table but from a related one table error AL_SetFields eList Table gt Companies 1 1 Field gt Companies Company Namel error AL_SetFields cList Table gt People 2 3 Field gt People First Name Field gt People Last Name Field gt People Salary AL_GetMode areaRef L gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout resultCode longint Result code AL_GetMode will return the type of display method you are using for the supplied AreaList Pro areaRef area result Returns one of the following results 0 a value of zero will be returned if you are displaying arrays 1 a value of one will be returned if you are displaying fields The following will build an AreaList Pro area based on field references from a parent and related table ret AL_SetFields eList Table gt People 1 2 Field gt People FirstName Field gt People LastName ret AL_SetFields cList Table gt Companies 3 Field gt Companies Company Name ret AL_SetFields cList Table gt People 4 1 Field gt People Salary Then we ll use the AL_GetMode routine to determine the type of objects we are using to build the list ret AL_GetMode clist a value of 1 will be ret
284. s you had to use interprocess buttons or variables and call REDRAW WINDOW or CALL PROCESS 1 to update them This is not needed with 4D 2004 and above Disabling buttons or other variables that pertain to the AreaList Pro object from the areaExitedMethod With 4D 2003 and earlier versions you had to use interprocess buttons or variables and call REDRAW WINDOW or CALL PROCESS 1 to update them This is not needed with 4D 2004 and above Call AL_GotoCell from the areaEnteredMethod to initiate data entry when the object is entered AL_SetMainCalls 148 Using the Callback Methods Example Set up area entered and area exited callbacks AL_SetMainCalls eList AreaEnteredMethod AreaExitedMethod AreaEnteredMethod area entered callback method C_LONGINT 1 AL_GotoCell 1 1 1 initiate data entry on the first cell in the first column ENABLE BUTTON bChangeSub ENABLE BUTTON bAltRowBkd CALL PROCESS 1 AreaExitedMethod area exited callback method C_LONGINT 1 DISABLE BUTTON bChangeSub DISABLE BUTTON bAltRowBkd CALL PROCESS 1 AL _SetCallbacks areaRef L entryStartedMethod S entryFinishedMethod S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout entryStartedMethod string AD method called when entry in cell started entryFinishedMethod string 4D method called when entry in cell finished AL_SetCallbacks is used to set callback methods that ar
285. s a value of 3 Style Number Plain 0 Bold 1 Italic 2 Underline 4 Outline 8 Shadow 16 Condensed 32 Extended 64 If a cell style has not been previously set the value of styleNum will be 1 fontName If a cell font has not been previously set the value of fontName will be 1 Note that the value is a string not a number Example Get the style of the cell in the third column first row AL_GetCellStyle eList 3 1 vStyle vFont AL_GetCellStyle 124 Configuring AreaList Pro Using Commands AL SetCellColor areaRef L firstCellCol 1 firstCellRow L lastCellCol 1 lastCellRow L cellArray X alpForeColor S 4dForeColor alpBackColor S 4dBackColor Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt firstCellCol integer First cell column firstCellRow longint First cell row gt lastCellCol integer Last cell column lastCellRow longint Last cell row gt cellArray two dimensional longint array Discontiguous cells alpForeColor string Foreground color from AreaList Pro s palette AdForeColor integer Foreground color from 4D s palette alpBackColor string Background color from AreaList Pro s palette AdBackColor integer Background color from 4D s palette AL_SetCellColor is used to set the foreground color and or background color of a specific cell range of cells or list of cells To specify
286. s into arrays errorcode AL_SetArraysNam cList 2 aCity aState display arrays in AreaList Pro object AL_SetHeaders cList 1 2 City State specify the values for the column headers DEMO_DefauIt eList vitem aCity 1 aState 1 Form event OQn Plug in Area respond to user action If AL_GetLastEvent cList 1 did user single click on a row row AL_GetLine cList get the row the user selected vitem aCity row aState row get the value in that element of the arrays End if AL_GetLastEvent eList 1 End case Our layout now looks like this to the user OO OH Example 3 _Example 3 This is Example 3 from the Reference Manual loading an array from a 4D datafile using SELECTION TO ARRAY and displaying it using the AL_SetArraysNam command The header has been set using the AL_SetHeaders command Phoenix AZ 0 Tuscon AZ Petaluma CA Los Angeles CA Palm Springs CA San Diego CA a Fi Los Angeles CA Example 3 Displaying Data from a Table 227 Examples Example 4 Selecting Multiple Rows In the previous examples we ve used the default single row selection mode which allows only one row to be selected or highlighted at any time AreaList Pro can be configured to allow multiple rows to be selected and commands are available to highlight rows procedurally as well as determine what rows have been selected by the user Let s modify the previous ex
287. s within a cell from startPosition to endPosition 1 When startPosition endPosition then the insertion point will be positioned prior to the character indicated in startPosition and none of the characters in the cell will be highlighted Example Entry finished callback If Not vDataValid AL_SetCellHigh cList vStart vEnd highlight the cell contents to indicate error End if AL_GetCellValue AL_SetCellHigh 180 Enterability AL_GetCellHigh areaRef L startPosition endPosition Parameter Type areaRef longint startPosition integer endPosition integer Description Reference of AreaList Pro object on layout First character of highlighted cell text Last character of highlighted cell text AL_GetCellHigh will obtain the highlighted range of characters within a cell This command may be used to provide user feedback after performing error checking on entered data and can be used in the entry finished callback method Please read the section Executing a Callback Upon Leaving a Cell for more information See AL _SetCellHigh AL_GetCellHigh and AL_SetCellHigh also work during data entry cell editing startPosition This parameter indicates the first highlighted character endPosition This parameter indicates the last highlighted character AL SetCellicon areaRef L cellColumn 1 cellRow L pictRef P iconAlignment horPosition 1 vertPosition 1 offset I scaling Paramete
288. sNam numArrays This parameter specifies the number of columns being set with this call to AL_SetArraysNam AL_SetArraysNam 63 Configuring AreaList Pro Using Commands resultCode The possible values are Constant Value Action AL No error in arrays 0 ch AL Not an array error Check to make sure all arrays are correctly typed AL Wrong type array error Pointer and two dimensional arrays are not allowed AL Wrong number rows error Make sure that all arrays have the same number of elements AL Max arrays exceeded error 512 arrays is the maximum G1 BB WwW A AL Low memory array error Increase 4D s RAM partition or change your approach to use fewer or smaller arrays Examples Case of Form event On Load SELECTION TO ARRAY Contacts FN aFN Contacts LN aLN Contacts City aCity Contacts State aState load the arrays error AL_SetArraysNam cList 1 4 aFN aLN aCity aState starting at column 1 set 4 arrays End case Set up the elist AreaList Pro object with 25 arrays two calls must be made since only 15 arrays can be passed each time error AL_SetArraysNam cList 1 15 array1 array2 array3 array4 array5 array6 array7 array8 array9 array10 array11 array12 array13 array14 array15 error AL_SetArraysNam cList 16 10 array16 array17 array18 array19 array20 array21 array22 array23 array24 array
289. scribed below AL_GetColOpts AL_SetCellOpts 92 Configuring AreaList Pro Using Commands Up Down Arrow Keys When AreaList Pro has been configured to allow multiple rows selection and the user presses the up or down Arrow keys the following conditions apply when the up Arrow key is pressed the row prior to the first highlighted row will be selected and will be the new active row when the down Arrow key is pressed the row after the last highlighted row will be selected and will be the new active row This interface is off by default for backwards compatibility with previous versions and may be activated using the cellSelection parameter of AL_SetCellOpts The following parameter will activate the keyboard scrolling options when using the multi rows selection option AL_SetCellOpts cList 3 turn on enhanced Arrow key support When cellSelection is set to a value other than 0 row dragging is disabled moveWithData This parameter is used with various formatting commands such as AL _SetCellEnter AL SetRowStyle AL SetRowColor AL SetRowRGBColor AL _SetCellStyle AL_SetCellColor and AL_SetCellRGBColor 0 cell attributes will not move 1 cell attributes not including cell selection will move with the cell after sorting row dragging or column dragging default This parameter is ignored when displaying fields See Drag and Drop and Dragging Commands for more information optimization The default is
290. se or updated in the callback method If you will be displaying many large columns you can reduce the display time by turning off the automaticSort option using AL_SetSortOpts Drag and Drop Changing Form Pages Using ALP on a Resizable Window Performance Issues with Formatting Commands 56 Configuring AreaList Pro Using Commands Borders and Frames AL _SetCellBorder provides the ability to set the border style for a cell AL_SetCellFrame draws a frame around a range of cells Both commands use RGB colors Header Cell Icon Support The Escape Sentence System AreaList Pro provides the ability to display icons in AreaList Pro headers AL_SetHeaders and cell data AL_SetFormat using picture data contained in the cicn or PICT resources or items stored in the 4 Dimension Picture Library For example when creating the arrays or header values you can instruct AreaList Pro to display any picture type data using the following formatting options First Name ES Arrival Mike Erickson 1 000 00 3 10PN amp A Tapei Don Clark 19 822 46 1 25AM W Denver Roger Buoy 19 830 30 1 19PM B M Telluride John Markoff 20 416 34 1 23PM 8 M Phoenix Russ Havard 20 953 38 11 07AM mM Redmond Dan Shafer 21 181 72 8 46AM B M Ft Worth Mike Kramer 21 437 54 6 47AM D wf San Francisco Jim Dart mo 7141888 12 59PM BL sw Dallas CELL DATA PicTURE EXAMPLE BOOLEAN FIELD An escape sentence syste
291. set using the AL_SetStyle routine AL_GetHadrStyle returns the formatting options set using the AL_SetHdrStyle routine AL _GetFtrStyle returns the formatting options set using the AL_SetFtrStyle routine In addition AL_SetDefaultStyle can be used to set the default values for the list data the headers and the footers of all AreaList Pro areas Row Specific Styles AL _SetRowStyle is used to set the font and style of a specified row and will override any column specification You can revert to the original column settings by setting the styleNum parameter to 1 Use this command to override all row specific style settings by passing 0 for the rowNumber parameter By default the row style will move with a row if the columns are sorted or a row is dragged This can be overridden using the moveWithData parameter of AL_SetRowOpts AL_GetRowOpts will return the current settings configured using AL_SetRowOpts Cell Specific Styles Individual column elements called cells can be assigned a unique font and style This capability can be used to provide special formatting to show the current selected or enterable cell and design more attractive and useful lists These attributes can be set in the On load phase and either of the AreaList Pro callback methods see Using the Callback Methods You can use AL_SetCellStyle to set the font and style configuration for an individual cell a range of cells or a selection of discontigu
292. sing AL_GetSort Examples AL_SetSort clist 3 4 7 sort on columns 3 4 and 7 all ascending AL_SetSort cList 1 3 2 sort on columns 1 descending 3 ascending and 2 descending AL_SetSort eList 0 don t sort and don t display any sort indicator AL_SetSort elist 2 2 don t sort but do display sort indicator in the header for column 2 AL_SetSort 13 Configuring AreaList Pro Using Commands AL SetCellValue areaRef L row L column 1 alphaNumericData S pictData P Parameter Type Description areaRef longint Reference of AreaList Pro object on layout gt cellRow longint Row number cellColumn integer Column number alphaNumericData string Alphanumeric value pictData picture Picture data AL_SetCellValue provides the ability to update the contents of a given cell You can set either alphanumeric or picture data cellRow Cell row number cellColumn Cell column number alphaNumericData Alphanumeric non picture data you wish to use as new value pictData Picture data you wish to use as new value See AL_GetClickedRow for an example of using AL_SetCell Value AL SetLine areaRef L rowNumber L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout rowNumber longint Row number to select highlight AL_SetLine is used to set the row to be highlighted This command is used in the On load phase to set up the initial displ
293. sing the AL_GetHeaders and AL_GetFooters routines followed by calling 4D native clipboard routines You can also trap information pasted to an AreaList Pro area providing an interface which might take column row data copied from Excel and paste into AreaList Pro area updating existing data inserting or removing rows as necessary AL_SetCellText will set the currently highlighted cell text which can be obtained during Edit menu callback AL_GetCellText will return the currently highlighted cell text which can be obtained during Edit menu callback Using Callback Methods During Data Entry Event Callback Interface Edit Menu Callback 146 Using the Callback Methods Calculated Column Callback A AD callback may be attached to a specific column When information is needed for this column AreaList Pro will execute the callback to allow you to fill the column with data This allows the display of data calculated from one or more fields as well as any ad hoc data that is desired Parameter Description 1 Reference of AreaList Pro object on layout 2 Column number 3 Type of data in this column 4 Pointer to temporary 4D array 5 First record for which to calculate cell 6 Number of cells to calculate in column The first three parameters are not absolutely necessary to determine how to fill the column They are provided to give you more flexibility in the implementation of the callback method The first parameter is the are
294. so be used to hide or show the vertical and horizontal scrollbars The possible values to use to hide or show the scrollbars are shown in the table below The default is that both scrollbars are shown Value VertScroll HorizScroll gt 0 Vertical scroll position Horizontal scroll position 0 Hide when displaying another form required Hide when displaying another form required 1 Hide if shown Show if hidden Hide if shown Show if hidden 2 Show 3 Hide Show Hide When using AL_SetScroll to hide or show the scrollbars either AL UpdateArrays with updateMethod set to 2 or AL UpdateFields with updateMethod set to 2 must be called AL_SetScroll can still be used to set the scroll position even with the scrollbar s hidden AreaList Pro automatically hides the horizontal scrollbar if allowColumnResize in AL_SetColOpts is set to 0 and all of the displayed columns fit within the width of the list area AreaList Pro automatically shows the horizontal scrollbar if allowColumnResize in AL_SetColOpts is set to 1 or all of the displayed columns do not fit within the width of the list area AL_SetScroll 134 Configuring AreaList Pro Using Commands If the horizontal scrollbar is shown or hidden manually by passing 1 2 or 3 in the horizontalScroll parameter of AL_SetScroll then this behavior will be permanently disabled for the AreaList Pro object Pass values of zero for verticalSc
295. splay a calculated solumn of type Real pass Is Real 1 in the fieldNum parameter Compatibility Note Field Display and Callbacks Setting a Calculated Column 157 Field and Record Commands Setting the Callback Method Use the AL_SetCalcCall command to set the callback method for a column AreaList Pro will dimension the temporary array before invoking the calculated column callback There is no need to do it in the callback itself The following is an example of a calculated callback method It merely calculates an employee s one year anniversary by adding 365 to their hire date this obviously does not take into account leap years but is sufficient as an example CalcColCallback 1 Area reference AreaList Pro longint reference 2 Column number 3 Type of data in this column 4 Pointer to temporary 4D array 5 First record for which to calculate cell Ze Number of cells to calculate in column Declare the parameters C_LONGINT 1 2 3 5 6 these must be declared C_POINTER 4 this must be declared C_LONGINT i ARRAY DATE aHireDate 0 SELECTION RANGE TO ARRAY 5 5 6 1 Employee Hire Date aHireDate For i 1 6 4 gt i aHireDate i 365 End for Sorting Calculated columns will not be sorted when their column header is clicked upon However if the usersort option of AL SetSortOpts command is set to 2 Bypass the user sort buttons and the column header
296. sponds to the AreaList Pro object on the layout The second parameter is a long integer that reports what action mode caused data entry to end in the cell You must use the following declarations in your entry finished callback method C_BOOLEAN 0 allow cell exit C_LONGINT 1 2 Using Callback Methods During Data Entry 142 Using the Callback Methods As stated above the second parameter passed to the callback routine the long integer 2 contains the mode by which data entry ended according to the following table Constant Value Exit Mode AL Click action 1 Click outside cell on object AL Tab key action 2 Tab AL Shift_Tab key action 3 Shift Tab AL Return key action 4 Return AL Shift_Return key action 5 Shift Return AL GotoCell action 6 AL _GotoCell AL ExitCell action 7 AL ExitCell or hard deselect AL Cell validate action 8 Deselect the cell soft deselect 9 Not used AL Other cell popup action 10 Cell popup released when cursor not already in cell AL Active cell popup action 11 Cell popup released when cursor already in cell See the sections Compatibility Note New Menu Architecture and Compatibility Note AL ExitCell and AL Cell deselect action become AL ExitCell and AL Cell Validate below for details about hard deselect mode 7 and soft deselect mode 8 The entryFinishedMethod callback method is actually a function It must return True for
297. st Pro object AL_UpdateFields is used to update AreaList Pro Use this command whenever any records of the fields being displayed are changed records added deleted or modified but the fields themselves remain the same AL_UpdateFields must be called after modifying the fields and before any other setup commands sorting formatting etc updateMethod This parameter tells AreaList Pro how to update the AreaList Pro object areaRef The possible values are Constant Value Description When to Use AL Refresh fields 0 Refresh the AreaList Pro object but When changes are made to formatting don t update any records and don t color styles etc recalculate any values AL Refresh and 1 Refresh the AreaList Pro object and When changes are made to the contents update fields update the visible records but don t of the records shown in the visible rows recalculate any values AL Recalculate 2 Rescan all visible rows and recalculate If column or row resizing is necessary fields all applicable heights widths and other or you have added or deleted records related values The scroll position and pertaining to the displayed fields Also row or cell selection will be reset if you show or hide either scrollbar the headers or footers AL_RemoveFields AL_UpdateFields 165 Field and Record Commands AL SetSubSelect areaRef L firstRecord L numRecords L Parameter Type Description a
298. t AL Default Interface AL Platinium Interface AL Force OSX Interface AL Force XP Interface AL Force Vista Interface Value 30 E CF EP E AE P Ess oO O W N OD h CH Type Value It ees wieselt Nie iis apa as N OO On mn E au H CH Type Value Fa ZE ai dE WwW N A AreaList Pro Constant List 255 AreaList Pro Constant List ALP Edit Menu Constants Constant AL Edit Menu Undo Bit AL Edit Menu Redo Bit AL Edit Menu Cut Bit AL Edit Menu Copy Bit AL Edit Menu Paste Bit AL Edit Menu Clear Bit AL Edit Menu Select All Bit AL Edit Menu Entry Bit AL Edit Menu Setup Bit AL Edit Menu Handled Bit AL Edit Menu Undo Mask AL Edit Menu Redo Mask AL Edit Menu Cut Mask AL Edit Menu Copy Mask AL Edit Menu Paste Mask AL Edit Menu Clear Mask AL Edit Menu Select All Mask AL Edit Menu All Items Mask AL Edit Menu Entry Mask AL Edit Menu Setup Mask AL Edit Menu Handled Mask ALP Format Style Constants Constant AL Format Integer AL Format Longint AL Format Real AL Format Boolean AL Format Date AL Format Picture AL Style Header AL Style List AL Style Footer 8 16 32 64 127 32768 65536 131072 ES d E E EE dee e e E ME e Ver cok oO i Type Value ha ee es ie eS ie has A i LA N wD Ln BP WN AreaList Pro Constant List 256 AreaList Pro Command Reference Alphabetical AreaList Pro Command Reference Alphabetical Ee Fes cece ccs ons ANT
299. t that as a drag action when AreaList Pro dragging actions are active Once typed data entry is initiated standard editing functions can be performed on the selected cell including the Edit menu commands Cut Copy Paste Clear Select All and Undo This is true for cells containing pictures also except Select All Alphanumeric data being edited will always appear left justified regardless of the columns display justification The Beam pointer can be dragged across the data in the cell to select a portion or all of the data Data Selection and Edit Menu Commands In addition the AL_SetEditMenuCallback routine provides the developer with a complete hook to working with the Edit menu Entering Data If string data is entered the system beep will sound for every character typed past the maximum string length and the typed character will be ignored there are special programming considerations concerning this feature If a string which exceeds the maximum string length is pasted into a cell it will appear in the cell in its entirety but will be truncated to the maximum string length when the insertion point leaves that cell Boolean data is represented during data entry by either radio buttons or a checkbox This data may be entered via several methods including using the space bar using the key combinations t f T F y n Y N or the first letters upper and lower case of values specified in the format for the boolean data entry c
300. t 3 i 0 0 aCellArray Red 0 0 if so then show it in red End if End for AL_UpdateArrays eList 1 AL_SetCellColor 126 Configuring AreaList Pro Using Commands AL GetCellColor areaRef L cellColumn 1 cellRow L 4dForeColor 4dBackColor Parameter Type areaRef longint cellColumn integer cellRow longint AdForeColor integer AdBackColor integer Description Reference of AreaList Pro object on layout Cell column Cell row Foreground color from 4D s palette Background color from 4D s palette AL_GetCellColor is used to get the foreground color and or background color of a specific cell It will not get the column or row foreground color and or background color For this command to function correctly the cell foreground and background colors must have been set from 4D s palette In other words the 4dForeColor and 4dBackColor parameters must have been used in the command AL_SetCellColor cellColumn Column of cell where to get the color cellRow Row of cell where to get the color AdForeColor 1 to 256 Foreground color number for the cell from 4D s palette If a cell foreground color has not been previously set the value of 4dForeColor will be 1 AdBackColor 1 to 256 Background color number for the cell from 4D s palette If a cell background color has not been previously set the value of 4dBackColor will be 1 AL_GetCellColor 127 Configuring
301. t Callback vAppearance AL_GetLine 1 1 get the row that was selected minus 1 constant value AL_Setinterface 1 vAppearance 1 1 1 1 1 set the interface according to the selected appearance do nothing to the other parameters 0 0 return zero do not execute object method and form method Here is the result on Mac OSX with an interface set to XP the areaSelected parameter of AL_SetMiscOpts set to 2 and useModernLook to 1 Constant Value Description AL Default Interface U Default Platform Appearance AL Platinium Interface Platinum Mac 059 Appearance AL Force 05 Interface Force Mac 0S Appearance 1 Z AL Force P Interface E Force Windows P Appearance 4 AL Force ista Interface Force Yista Appearance AL_SetlInterface 97 Configuring AreaList Pro Using Commands AL _SetMiscOpts areaRef L hideHeaders 1 areaSelected postKey S showFooters 1 useModernLook Parameter Type Description areaRef longint Reference of AreaList Pro object on layout hideHeaders integer Hide the column headers areaSelected integer Visual cue that the plug in area is selected postKey string String character to post to execute method showFooters integer Show the column footers useModernLook integer Modern or traditional appearance AL_SetMiscOpts is used to control several AreaList Pro options hideHeaders 0 the column headers will be displayed default 1 the column headers wil
302. t be made to set these fields To display a related one field pass the table number of the related one table in the tableNum parameter resultCode The possible values are Constant Value Action AL No error in fields 0 AL Not a file error LU Check to make sure that the table represented by tableNum does exist AL Not a field error 2 Check to make sure that the field represented by fieldNum does exist AL Wrong type field error 3 Sub tables are not allowed AL Max fields exceeded error 4 512 fields is the maximum AL Wrong 4D vers for fields 5 obsolete AL Low memory field error 6 Increase 4D s RAM partition AL_SetFile AL_SetFields 16 Field and Record Commands Examples Set up the elist AreaList Pro object with 5 fields all from the same table error AL_SetFields eList Table gt People 1 5 Field gt People First Name Field gt People Last Name Field gt People Salary Field gt People Arrival Field gt People Male Set up the elist AreaList Pro object with 4 fields the third one from a related table error AL_SetFields eList Table gt People 1 2 Field gt People First Name Field gt People Last Name error AL_SetFields cList Table gt Companies 3 Field gt Companies Company Namel error AL_SetFields eList Table gt People 4 1 Field gt People Salary Set up the elist AreaList Pro object with 4 field
303. t can eventually be modified for any column of any area using AL_SetFormat selector indicates the data type for which to set the default format Constant Value Data Type AL Format Integer Il Integer AL Format Longint 2 Long Integer AL Format Real 3 Real AL Format Boolean 4 Boolean AL Format Date 5 Date AL Format Picture 6 Picture format Format to use for the data type specified by selector The format is specified as a string See AL_SetFormat Example Modify the default format for pictures DOT truncated if necessary and justified to the upper left to 2 scaled to fit the cell AL_SetDefaultFormat AL Format Picture 2 AL_SetFormat AL_SetDefaultFormat 79 Configuring AreaList Pro Using Commands AL GetFormat areaRef L columnNumber format S columnJust headerJust footerJust l usePictHeight Parameter Type Description areaRef longint Reference of AreaList Pro object on layout columnNumber longint Desired list column format string Format used columnJust integer Justification for column list items headerJust integer Justification for column header footerJust integer Justification for column footer usePictHeight integer Use the picture height in the row height calculation AL_GetFormat will return the formatting attributes for the supplied column number see AL_SetFormat for information on setting column display attribute
304. tCellCol and lastCellRow are greater than 0 then the range of cells from firstCellCol firstCellRow to flastCellCol lastCellRow will be set To specify discontiguous cells If firstCellCol or firstCellRow are less than or equal to 0 then the cells in cellArray will be set AL_SetEntryCtls AL_SetCellEnter 176 Enterability cellArray Two dimensional long integer array The first dimension must be two The first array is for the column indices and the second array is for the row indices The second dimension must be the same as the number of cells that are to be selected See the following illustration cellArra BETI Zeit Cell 1 1 Cel 2 cent bel Column Row enterability 0 1 2 3 or 1 0 the cell is not enterable 1 the cell is enterable by typing or popup according to the enterability parameter of AL SetEnterable for the column 2 the cell is enterable by popup only if the enterability parameter of AL_SetEnterable for the column is set accordingly 3 the cell is enterable by typing only if the enterability parameter of AL_SetEnterable for the column is set accordingly 1 remove any cell specific enterability which has been set for the cells The moveWithData option of AL_SetCellOpts controls whether cell enterability stays with a cell whenever sorting row dragging or column dragging occurs Regarding enterability by popup the popup is displayed in the cell if the column property is set
305. tan JAAN Thr All 252 7i f New y Delete Pe N d N JEJA if 2 KO 16 16 PICTURE LIBRARY CONTAINING CUSTOM CHECKBOXES For example if you would like to configure boolean columns to display custom checkbox icons instead of the traditional text True False you can use the AL_SetFormat routine to provide references to icon resources contained in the 4D Picture Library iconStr 4 String Use PicRef 880 4 String Use PicRef 881 AL_SetFormat cList 1 iconStr Header Cell Icon Support 59 Configuring AreaList Pro Using Commands All Members PEF general domain com All Non Members Board of Directors boardt dorn ain com City Managers Committee Conference nareGidormain cor Executive Committee Finance Officers Committee finance mydomain com General Liability Attorneys Guest guest domain conm JPA Staff Liability Trust Fund Newsletter Potential Members Ths E IL EI ite cE E i E IR ES B LS EI Kach raining Certificate Letter ve BI CUSTOMIZED BOOLEAN COLUMN USING CHECKBOX ICONS FROM 4D PICTURE LIBRARY The default escape character used in the call before the icon Picture Library ID can be modified with AL _SetPictureEscape and retrieved using AL_GetPictureEscape Longint Reference System Resources and Picture Library items are also used by AL _SetCelllcon which places icons into individual cel
306. ternal use only and their contents may change at any time Only 30 arrays of each of the 9 data types that AreaList Pro supports are declared If you will be displaying more than 30 fields of a certain type then you must add more declarations within the Compiler_ALP project method Conversely you may remove some of these declarations if you never display fields or display very few fields of a certain type Be very careful when adding or removing declarations to follow exactly the syntax of the existing declarations Arrays and Fields To change the display from arrays to fields first call AL_RemoveArrays to remove all of the arrays before calling any field commands To change the display from fields to arrays first call AL_RemoveFields to remove all of the fields before calling any array commands Arrays and fields may not be displayed together in the same AreaList Pro object If arrays are displayed in an object then the field commands will be ignored Conversely if fields are displayed in an object then the array commands will be ignored Using the Field Display Capability 156 Field and Record Commands Compatibility Note Field Display and Callbacks With AreaList Pro 7 9 and above if you are using AreaList Pro to display fields and are performing custom actions via AreaList Pro s exit callback see AL_SetCallbacks you should no longer be executing code which will change the current selection as AreaList Pro now
307. tes amp Sizing Left 6 Top 197 Right 635 Bottom 381 Width 629 Height 184 Horizontal Sizing Grow Vertical Sizing Grow Y v Events On Load E Show Themes OBJECT PROPERTIES PALETTE 2 Click the Advanced Properties button The Advanced Properties Dialog will be dis played The dialog has several panes accessed via the tabs at the top which provide access to the various configuration options To Display the Advanced Properties Dialog 34 Configuring AreaList Pro Using the Advanced Properties Dialog AreaList Pro Advanced Properties AreaList Pro Area Area Name jeListDest AreaList Pro vB Sb11 1990 2011 Beckware LLC All Rights Reserved Area Defined Name f Column Setul General Options Enterability Advanced Dragging Preview Display Arrays KS Columns DE Enterability jo Default Use the Default column to set the properties Entry allowed via Keyboard ont EZ ony OS for all columns Then if you wish to have different settings for a particular column Entry Filter select that column in the list and set it Popup array You will need to specify the held or array Check column with Spell Checker header and format for each column Boolean data display Checkbox without title EZ Column Width Autosize Use PICT size for row height Area Callback Method Edit menu Callback Method List Header Footer Font _Geneva EZ Size
308. th of 85 pixels where the text will be drawn If however the total width icon text exceeds the column width the text will be drawn over the picture This allows background pictures behind the text AL_SetHeaderlcon D Configuring AreaList Pro Using Commands The following example will use the same icon as AL_SetCelllcon but it will first load the icon into a 4D picture object C PICTURE pici C_INTEGER col iconAlign horPos verPos offset scaling col 3 place icon in 3rd column iconAlign 0 draw on left horPos 0 default verPos 2 align center offset 5 scaling 0 GET PICTURE FROM LIBRARY 1717 pict AL_SetHeaderlcon eAl_Output col iconAlign pict horPos verPos offset scaling AL _SetHeaderOptions areaRef L options L iconRef L callbackMethod S Parameter Type Description areaRef longint Reference of AreaList Pro object on layout options longint Options attribute iconRef longint Reference of the icon or picture to use callbackMethod string Header callback method AL_SetHeaderOptions provides the ability to customize the interface over the scrollbars sort area You can customize the icon which is displayed using a cicn or PICT resource or an item from the AD Picture Library see details below For optimal results the icon size should be 13w x 12h options Desired options for overriding the sort icon 0 no options use defau
309. the selection Example Set up the elist AreaList Pro object to display 10 000 records beginning at record 5001 AL_SetSubSelect eList 500 1 10000 AL_SetSubSelect 166 Enterability Enterability Initiating Data Entry The method for initiating entry to a cell and for selecting rows is set with the entryMode parameter of AL_SetEntryOpts Initiating entry can be done in any one of eight different ways each of which also determines the method for selecting rows See AL_SetEntryOpts for complete information Enterability for a column is set using AL_SetEnterable Entering Data The capability to edit data during typed data entry is initiated automatically and no programming is necessary to invoke these functions When data entry is initiated on an AreaList Pro cell the array contents for the element corresponding to that cell are copied to the zero element of the same array Since this element is usually never used it makes a convenient storage place for the data in case you wish to revert to the old value however you should take care not to use this zero array element elsewhere in your code while data entry is in progress When fields are displayed you are responsible for saving the contents of the field Two commands AL _SetCellHigh and AL_GetCellHigh can be used to set the highlighted range of characters in the data entry cell or get the range of characters highlighted by the user respectively AL_SetCellHigh ca
310. ties Dialog You should usually populate the arrays in the On Load phase of the form Then call AL_UpdateArrays Example Case of Form event On Load SELECTION TO ARRAY Table 1 First Name aFirstName AL_UpdateArrays clList 2 End case Columns A Default First Name Last Name City State Zip Code Country Title Birthdate D d GO AWN O ARRAY SETTINGS Array Name aFirstName Header Text First Name Format Footer Text Column Width Autosize T Use PICT size for row height Displaying Records You can use the Advanced Properties Dialog to display records from the database The current selection for the Main table will be displayed at runtime You are responsible for establishing the selection using standard 4D commands such as SEARCH ALL RECORDS etc The project method Compiler_ALP must be present in the database Please read the section Temporary Arrays for more information Columns Default First Name Last Name City State Zip Code Country Title Birthdate D d GO A WM O RECORDS SETTINGS Use the Default column to set the properties for all columns Then if you wish to have different settings for a particular column select that column in the list and set it You will need to specify the field or array header and format for each column Column Width Autosize a Use PICT size for row height Displaying Arrays Displaying Records 36 Configu
311. tion about the use of AL_SetHeaders to display icons in column headers using picture data contained in the cicn or PICT resources or items stored in the 4 Dimension Picture Library AreaList Pro also includes modern column headers including direct platform detection See Headers Vista specific behavior if AreaList Pro does not have enough space at least 13 pixels to display the header it will be automatically resized to fit In addition when using AreaList Pro with Vista the sort arrow is centered above the column header thus you need to take care to make sure that the header is high enough AL GetHeaders areaRef L headerList X options L gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout headerList array text or string Result header list options longint Return options resultCode longint Result code AL_GetHeaders will return an array of all headers for the defined AreaList Pro area You may optionally return only visible headers using the options parameter headerList A valid 4 Dimension array text or string which will contain a list of all area headers options When extracting the list of headers names you may optionally return only visible headers 0 no options returns all headers default 1 returns only visible headers resultCode Returns an error code or 0 is no error occurred The following will build an Ar
312. to be shorter than that which was drawn in the form causing some user interface inconsistencies ila eeepc E TA TE Erickson Erickson Erickson Erickson d dE dk dk ab Trevor AREALIST PRO AREA AUTO SIZED SEE GAP AT BOTTOM AreaList Pro Height 46 Configuring AreaList Pro Using Commands This interface can be controlled using the allowPartialRow parameter in AL_SetInterface Last Name Erickson Erickson Erickson Erickson Erickson gt k A Y a v Ea EN k AREALIST PRO DRAWN IN ACTUAL SIZE OF FORM OBJECT Column Locking You can set the lock position using AL_SetColLock AL_GetColLock returns the current position of the column lock You can also disable the column lock control by using the allowColumnLock parameter of AL_SetColOpts AL_GetColOpts will return the current settings configured using AL_SetCo Opts Row Height Row height is determined by a combination of the height of the text line or picture the number of lines multiple lines of text and any additional padded space The height of each line of text is determined by the font and point size selected which are set with AL SetStyle The number of text lines and the amount of padding are set with the numRowLines and rowHeightPad parameters of AL_SetHeight Padded space is the amount of space above and below the text block half of the amount above half below All rows will be of the same height AL_SetMinRowHeight prov
313. to the cell to be accepted and False for the value to be rejected If this is the null empty string then no method will be called The entryFinishedMethod is passed two parameters The first parameter is a longint that corresponds to the AreaList Pro object on the layout The second parameter is a longint that reports what action mode caused data entry to be finished in the cell For a list of the possible values of the second parameter see the table below Constant Value Exit Mode AL Click action 1 Click outside cell on object AL Tab key action 2 Tab AL Shift_Tab key action 3 Shift Tab AL Return key action 4 Return AL Shift Return key action 5 Shift Return AL GotoCell action 6 AL GotoCell AL ExitCell action 7 AL ExitCell or hard deselect AL Cell validate action 8 Deselect the cell soft deselect 9 Not used AL Other cell popup action 10 Cell popup released when cursor not already in cell AL Active cell popup action 11 Cell popup released when cursor already in cell When a cell is entered the data will be copied into the zero element of the array being displayed in the column When the entryFinishedMethod is executed the array element corresponding to the cell will already be updated with the new value that was entered AL_SetCallbacks 150 Using the Callback Methods Among the possible situations and responses that may occur are the following The data is valid Set 0 Tru
314. ton event AL Select all event AL Column resize event AL Column lock event AL Row drag event AL Sort editor event AL Column drag event AL Cell drag event AL Object resize event AL Column click event AL Column control click event AL Footer click event ALP Entry callback actions Constant AL Click action AL Tab key action AL Shift_Tab key action AL Return key action AL Shift_Return key action AL GotoCell action AL ExitCell action AL Cell validate action AL SkipCell action AL Other cell popup action AL Active cell popup action Ou Ts Sih sis a Uae EA ES AE ES ses SI i ZE Type Fee a aie dis lie RX hes Tie JE AreaList Pro Constant List Value O O0 NOA RA UUN ech pech 249 ALP Array commands Constant AL No error in arrays AL Not an array error AL Wrong type array error AL Wrong number rows error AL Max arrays exceeded error AL Low memory array error AL Recalculate arrays AL Refresh and update arrays ALP Sort commands Constant AL Sort in during off AL Sort in during on AL User sort off AL User sort on AL User sort bypass AL User sort index only AL Allow Sort editor off AL Allow Sort editor on AL Show Sort order off AL Show Sort order on AL Show Sort direction off AL Show Sort direction on AL Sort editor other process AL Sort editor cancelled AL Sort editor accepted E CFE E AE JP ai oO Value I ch CFE Ie I A EF ise oO oO a O k OWN
315. ulti level sort If a column that contains a picture column is passed as one of the sort criteria that column and all subsequent columns will be ignored AL_GetSort can be used to retrieve the current sort order of the area regardless of whether this sort order was established by the user or procedurally Sorting When Displaying Fields Columns containing fields from a related one table will not be sorted when their column header is clicked upon However if the userSort option of AL_SetSortOpts is set to 2 Bypass the user sort buttons and the column header of a column containing a field from a related one table is clicked upon the AreaList Pro event callback or area form method will run with a 2 event code of 1 returned to the callback method or AL_GetLastEvent command formerly ALProEvt variable See Using the Callback Methods Before AreaList Pro sorts fields using A Dimension s sorting routines it turns messages off If messages were on previously then AreaList Pro will turn them back on after sorting Scrolling The current scroll position can be set and retrieved using AL_SetScroll and AL_GetScroll respectively You can hide either the horizontal or vertical scroll bar or both using AL_SetScroll This allows you to construct a grid of cells providing a different interface from a standard scrolling list When a scroll bar is hidden the user is still able to scroll using the Arrow keys or by dragging
316. ure in Excel When the column lock position is adjusted the list will automatically scroll to the full left position to provide feedback to the user Calculated Columns when Displaying Fields The user interface when calculated columns are displayed is essentially the same as with fields The few minor differences are explained below Sorting Column headers of calculated columns will be dimmed in the Sort Editor Enterability Calculated columns will not be enterable either by typing or by using popups Column Locking Calculated Columns when Displaying Fields 21 The AreaList Pro User Interface Rows with Multiple Lines of Text AreaList Pro allows individual rows in the list area to contain more than one line of text however all rows in the area will be of the same height Color AreaList Pro allows the entire range of 256 colors in the 4D palette or the 10 colors of the built in AreaList Pro palette AreaList Pro also provides the ability to set the foreground and background colors using standard RGB colors AreaList Pro foreground colors can be applied to columns individual rows cells headers and footers Background colors can be applied to the list area individual rows cells the header area and the footer area In addition AreaList Pro provides the ability to display default row color without having to use AreaList Pro callback to procedurally set row colors Using AL_SetAltRowColor or AL_SetAltRowClr rout
317. urned as we are using fields AL_SetFields AL_GetMode 162 Field and Record Commands AL GetTable areaRef L gt tableNumber L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout tableNumber longint Primary table number AL_GetTable will return the primary table number you are using for the supplied AreaList Pro reference This is the table number supplied by AL SetFields AL _InsertFields or AL SetFile tableNumber Returns the primary table number The following will build an AreaList Pro area based on field references from a parent and related table ret AL_SetFields clist Table gt People 1 2 Field gt People FirstName Field gt People LastName ret AL_SetFields cList Table gt Companies 3 1 Field gt Companies Company Name ret AL_SetFields cList Table gt People 4 1 Field gt People Salary Then we ll use the AL_GetTable routine to determine the primary table ret AL_GetTable eList the table number associated to People table will be returned AL_GetFields areaRef L tableArray X fieldArray X gt resultCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout tableArray longint array List of table numbers fieldArray longint array List of field numbers resultCode longint Result code AL_GetFields will return an array of table and field numbers used to build the list refer
318. urred at line number When executing the method lt Unknown gt Invalid parameters in an Execute command COMPILED RUNTIME ERROR WHEN 0 NOT DECLARED Your callback method should be declared as C_BOOLEAN 0 required c LONGINT 1 c LONGINT 2 Using Callback Methods During Data Entry 144 Using the Callback Methods Compatibility Note New Menu Architecture Since version 7 9 it is no longer required to customize the cell exit callback when enterability is active with the New Menu Architecture active You no longer need to trap and conditionally respond to AL Cell validate action mode 8 AreaList Pro handles correctly Edit menu events if the new Edit menu behavior is set However this may break compatibility with existing code If the number 8 is added to the first parameter of AL_SetEntryOpts call AreaList Pro will switch to its previous behavior The difference between the two behaviors is as follows 4D sends two kinds of deselect events to the plug in area real hard deselect and validating soft deselect The first mode AL ExitCell action means that the user clicked on another focusable object like an edit field and the focus is going to pass from the AreaList Pro area to the new object The second mode AL Cell validate action means that the user clicked on some non focusable object and the focus will stay on the AreaList Pro area However the difference between focusable and non focusab
319. variable will be set to 4 if the user changes the column lock position see see Determining the User s Action on an AreaList Pro Object You can determine the current column lock position using AL_GetColLock hideLastColumns This parameter specifies the number of columns from the right to not display 0 forces the display of all columns default 1 to number of columns 1 number of columns to hide This parameter is used when an ID column is needed for SEARCH purposes after the list is displayed but you don t want to clutter the display with the ID values You would pass the ID array as the last array to AL_SetArraysNam and hide the last column using this parameter with a value of one Any pre sort or user sort will include the hidden column s to keep the values in all the columns lined up If the number of columns passed to AreaList Pro is less than or equal to the value specified by hideLastColumns then only the first column will be displayed displayPixelWidth Used during development to allow you to easily determine what pixel width looks best for each column Which this option is enabled a button in the lower right area of the AreaList Pro object is enabled to toggle the headers between displaying pixel widths and the actual header values When AreaList Pro is initially displayed the column headers are shown Click on the button to toggle the headers to display the pixel width 0 turns the pixel widt
320. white black blue green yellow magenta red cyan gray light gray rowNumber The row for which to set the foreground color Use a value of zero 0 for rowNumber to apply the parameters to all rows alpRowForeColor Name of the color in AreaList Pro s palette This will be the foreground color for the row If the name is not in AreaList Pro s palette or it is a null string then 4dRowForeColor will be used AdRowForeColor 1 to 256 Foreground color number for the row from 4D s palette If a row color has been previously set it may be removed by setting alpRowForeColor to an empty string and AdRowForeColor to 1 This may also be applied to all rows by passing a zero 0 for the rowNumber This will have no effect on rows that have not been previously set The row foreground color may be left unchanged by setting alpRowForeColor to the empty string and 4dRowForeColor to 0 alpRowBackColor Name of the color in AreaList Pro s palette This will be the background color for the row If the name is not in AreaList Pro s palette or it is the empty string then 4dRowBackColor will be used AL_SetRowStyle AL_SetRowColor 118 Configuring AreaList Pro Using Commands AdRowBackColor 1 to 256 Background color number for the row from 4D s palette H a row background color has been previously set it may be removed by setting alpRowBackColor to the empty string and 4dRowBackColor to 1 This may
321. wing in headers you must first load the desired icon into a 4D picture object horPosition One the following options 0 default left for left icon right for right icon 1 align left 2 align center 3 align right AL_GetHeaders AL_SetHeaderlcon 70 Configuring AreaList Pro Using Commands vertPosition One the following options 0 default top 1 align top 2 align center 3 align bottom offset Offset of the icon guide The horizontal position is relative to this position If the horizontal alignment is center the icon is centered between the guide and corresponding side of cell left for left icon right for right icon The picture below illustrates the icon guide and its offset juide offset ICON GUIDE AND OFFSET In the picture below the left icon is aligned right to the icon guide and the right icon is aligned left to the icon guide LEFT ICON ALIGNED RIGHT RIGHT ICON ALIGNED LEFT In the picture below the left icon is centered between the left border and the icon guide and no right icon is used E LEFT ICON CENTERED scaling One the following options 0 truncated 1 scaled The cell content text is drawn into the space that is left once the icon is drawn If the icon is larger than the remaining available space the text is drawn over the icon For example if the column width is 100 pixels and you draw a 15 pixel icon there is remaining wid
322. wing line is called in the On Load phase result AL_SetEditMenuCallback area EditCallback The EditCallback project method is as follows C_LONGINT 1 area reference C_LONGINT 2 event C_TEXT 3 AL_Undo unused text 456 AL_SetCellText 1 text 1 1 replace selected text only The user enters an editable cell 123784 Then a group of three characters is selected highlighted 123789 123456 AL_GetCellText areaRef L text T flag L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout r text text Returns current cell highlight text gt flag longint Flag AL_GetCellText will return the currently highlighted cell text which can be obtained during Edit menu callback This routine will only work correctly during Edit menu callback text Returns current highlight text based on flags flags Formatting flags 0 get whole cell text 1 get selected text only AL_SetCellText AL_GetCellText 216 User Action Commands The following line is called in the On Load phase result AL_SetEditMenuCallback area EditCallback The EditCallback project method is as follows C_LONGINT 1 area reference C_LONGINT 2 event C_TEXT 3 AL_Undo unused C_TEXT text AL_GetCellText 1 text 1 1 get selected text only The user enters an editable cell Example Then a group of three characters is selected highlighted E
323. within and out of the AreaList Pro object AL_SetRowOpts 87 Configuring AreaList Pro Using Commands If a row is dragged without any modifier key dragging to select multiple rows will not work If the row is dragged to another position within the list AreaList Pro will automatically rearrange the whole list If the row is dragged out of the list to another AreaList Pro object it is up to you to remove and insert row s as necessary acceptDrag 0 this AreaList Pro object will not accept a row default 1 this AreaList Pro object will accept a row dragged from another AreaList Pro object moveWithData This parameter is used with various formatting commands such as AL_SetCellEnter AL _SetRowStyle AL _SetRowColor AL SetRowRGBColor AL SetCellStyle AL _SetCellColor and AL_SetCellRGBColor 0 the row style and color information will not move with the row 1 the row style and color information will move with the row whenever the AreaList Pro object is sorted or a row is dragged within the list default This parameter is ignored when displaying fields See Drag and Drop and Dragging Commands for more information disableRowHighlight 0 all selected rows will be highlighted when selected default 1 no rows will be highlighted when selected When disableRowHighlight is set to 1 no rows will be highlighted if the user selects them or if they are selected by calling the commands AL_SetLine or AL_SetSelect Are
324. xample The callback method is called at this moment with text containing the selected substring Expression Value E Stext amp AL GetLastEvent areaRef L eventCode L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout optional eventCode longint Event code AL_GetLastEvent will return the last event that occurred in the specified AreaList Pro area If no parameter is used this command will return the last event that occurred in the last AreaList Pro area where an event occurred in the current process it basically returns the old ALProEvt variable in this case Note that 18 mouse moved event is only available in the Event Callback Interface It is NOT available through AL_GetLastEvent This command replaces the deprecated ALProEvt variable existing projects using this variable will still work but AL_GetLastEvent should be used instead in new projects or in case of issues with ALProEvt In addition AL_GetLastEvent offers a better control of event management compared to ALProEvt as it allows tracking of the last event in each AreaList Pro area Please refer to Example 11 AL_GetCellText AL_GetLastEvent 217 Utility Commands Utility Commands AreaList Pro includes several commands to assist in managing the operation of an AreaList Pro area Drop Area AreaList Pro includes a simple plug in area which functions as a drop area for rows columns or items
325. y selected row in the area specified by areaRef AL_GetLine should only be used with an AreaList Pro object in single row mode If the object is in mul ti rows mode you should use AL_GetSelect This command should not be confused with AL_GetClickedRow AL_GetClickedRow returns the last row that was clicked while AL_GetLine returns the currently selected row as a result of a click or any other action selectedRow This parameter returns the number of the currently selected row You can set the selected row using AL SetLine Example Modify button object method does a MODIFY RECORD on the record corresponding to the currently selected row in the Arealist Pro object eList uses an ID array previously loaded from an ID field to load the correct record row AL_GetLine cList SEARCH Company Company ID alD row MODIFY RECORD Company AL_SetCellText areaRef L text T flag L Parameter Type Description areaRef longint Reference of AreaList Pro object on layout text text Text you wish to set gt flag longint Flag AL_SetCellText will set the currently highlighted cell text which can be obtained during Edit menu callback This routine will only work correctly during Edit menu callback AL_GetLine AL_SetCellText 215 User Action Commands text Sets the current cell text based on flags flags Formatting flags 0 replace whole cell text 1 replace selected text only The follo
326. you can override the default setting configured by AL_Setinterface for a given area Therefore if you wish to configure AreaList Pro to globally disable meta characters for popup controls you can do so using AL_SetInterface then enable for a given column using AL_SetEnterable popupArray Array integer longint real string or text This array will be displayed in the popup menu and must be the same type as the array or field displayed in columnNumber Exiting Data Entry AL_SetEnterable 17 Enterability If it is not the same type or if it has no elements then a menu containing a single disabled menu item with the text No items in this menu will be displayed An array is not needed to display a time or date popup menu built in menus are provided Columns containing boolean or picture arrays can not contain popup menus Do not dispose of the array in 4D until the popup is no longer needed menuPackRef This parameter passes the reference obtained from the MenuPack PopupPack plug in Please refer to the Using PopupPack Popup Control with AreaList Pro and Using PopupPack Offscreen Popup Control with AreaList Pro sections in the MenuPack Developer Reference manual If this parameter is not passed then the values in popupArray will be displayed in an AreaList Pro popup When the user selects an item from the MenuPack menu the entry finished callback method is run In this callback the appropriate MenuPack comm
327. ys See the 4D String command in the 4D Language Reference for the possible values Any valid 4D date format may be used Examples 0 or 3 are valid formats Format Example 0 09 20 07 default 9 20 07 Thu Sep 20 2007 Thursday September 20 2007 09 20 07 or 09 20 1997 September 20 2007 Sep 20 2007 DlujyRl wlrm A format for time arrays See the 4D String command in the 4D Language Reference and the AD Design Reference discussion of formatting for the possible values There are no time arrays in 4D as such they are in reality long integer arrays These arrays are displayed as time AL_SetFormat values by using the proper format The format is the two character sequence amp followed by the number given in the discussion of the String command For example one proper format for a time array would be amp 2 Format Example 01 02 03 01 02 1 hour 2 minutes 3 seconds 1 hour 2 minutes 1 02 AM Oi Rwy format for picture arrays 0 the picture will be truncated if necessary and justified to the upper left default 1 the picture will be truncated if necessary and centered in the cell 2 the picture will be scaled to fit the cell 3 the picture will be scaled to fit the cell and remain proportional to its original size AL_SetFormat 77 Configuring AreaList Pro Using Commands columnJust headerJust and

Download Pdf Manuals

image

Related Search

Related Contents

Descargar PDF  Norcent Technologies LT-3222 User's Manual  Aloe Sunscreen - Forever Living  SpeakerCraft ASM/ELT01300 AV receiver  Operating Instructions Car Radio    Pioneer XS-950 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file