The text of a manual · part 2 of 18
Qlarity-Based Terminal Programmer's Reference Manual: Contents, pages 5 to 8
Pages 5 to 8 of 134, from Qlarity-Based Terminal Programmer's Reference Manual
The original document is the PDF (1.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the QSI Corp QTERM-G70
Page 5
CONTENTS
CHAPTER 1. QLARITY-BASED TERMINAL SOFTWARE FUNDAMENTALS .................................................................................................... 1 1.1 Qlarity-based Terminal Software ................................................................................................................................ 1 1.1.1 System Software (Firmware)............................................................................................................................. 1 1.1.2 User Application................................................................................................................................................ 1 1.2 Qlarity Programming Language .................................................................................................................................. 1 1.2.1 Object Templates............................................................................................................................................... 2 1.2.1.1 Defining a New Object Template......................................................................................................... 2 1.2.1.2 Creating Instances of an Object............................................................................................................ 2 1.2.2 Object Types...................................................................................................................................................... 2 1.2.2.1 Non-Drawable Objects ......................................................................................................................... 2 1.2.2.2 Area Objects ......................................................................................................................................... 3 1.2.2.3 Container Objects ................................................................................................................................. 3 1.3 Event Processing.......................................................................................................................................................... 4 1.4 Z-Order ........................................................................................................................................................................ 4 1.5 Message Handling System........................................................................................................................................... 4 1.5.1 Broadcast Messages .......................................................................................................................................... 5 1.5.2 Area Messages................................................................................................................................................... 5 1.5.3 Draw Messages.................................................................................................................................................. 5 1.5.4 Registered Messages ......................................................................................................................................... 5 1.5.5 User Messages ................................................................................................................................................... 5 1.5.6 Direct Messages ................................................................................................................................................ 5 1.5.7 Tool Messages ................................................................................................................................................... 5 1.5.8 Handling Events ................................................................................................................................................ 6 CHAPTER 2. QLARITY LANGUAGE SYNTAX ................................................................................................................................................. 7 2.1 Qlarity Statements ....................................................................................................................................................... 7 2.2 White Space ................................................................................................................................................................. 7 2.3 Comments .................................................................................................................................................................... 7 2.4 Naming of Identifiers................................................................................................................................................... 7 2.5 Built-In Data Types ..................................................................................................................................................... 8 2.6 User-Defined Data Types ............................................................................................................................................ 8 2.6.1 Constants ........................................................................................................................................................... 8 2.6.2 Enumerations..................................................................................................................................................... 8 2.6.3 Start Type .......................................................................................................................................................... 9 2.7 Variables ...................................................................................................................................................................... 9 2.7.1 Declaration ........................................................................................................................................................ 9 2.7.2 Variable Initialization...................................................................................................................................... 10 2.7.3 Private and Protected Variables ...................................................................................................................... 10 2.8 Object References ...................................................................................................................................................... 10 2.8.1 Untyped Object References............................................................................................................................. 10 2.8.2 Typed Object References ................................................................................................................................ 11 2.8.3 Special Object References............................................................................................................................... 11 2.9 Arrays ........................................................................................................................................................................ 11 2.10 Operators ................................................................................................................................................................. 12 2.10.1 Arithmetic Operators ..................................................................................................................................... 12
QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770
Page 6
ii
QSI Qlarity-based Terminal Programmer’s Reference
2.10.4 Dereference Operator .................................................................................................................................... 12 2.10.5 Miscellaneous Operators ............................................................................................................................... 12 2.11 Casting ..................................................................................................................................................................... 13 2.12 Functions ................................................................................................................................................................. 13 2.12.1 Calling a Function ......................................................................................................................................... 14 2.12.2 Private, Protected, and Fixed Functions ........................................................................................................ 14 2.12.3 Validation Methods ....................................................................................................................................... 14 2.12.4 Array Validation Functions ........................................................................................................................... 15 2.12.5 Array Element Validation Functions............................................................................................................. 15 2.12.6 Reference Parameters .................................................................................................................................... 15 2.13 Conditionals (if Statement)...................................................................................................................................... 16 2.14 Looping and Leaping............................................................................................................................................... 16 2.14.1 For/Next loops ............................................................................................................................................... 16 2.14.2 While Loops .................................................................................................................................................. 16 2.14.3 Do/While Loops ............................................................................................................................................ 17 2.14.4 Goto/Label..................................................................................................................................................... 17 2.15 Exception Handling ................................................................................................................................................. 17 2.16 Defining Objects...................................................................................................................................................... 17 2.17 Declaring Object Instances ...................................................................................................................................... 18 2.18 Level ........................................................................................................................................................................ 18 2.19 Including Files and Resources................................................................................................................................. 18 2.20 Libraries................................................................................................................................................................... 19 2.21 Precompile Directives.............................................................................................................................................. 19 2.21.1 #if/#else/#endif.............................................................................................................................................. 19 2.21.2 #option........................................................................................................................................................... 19 2.21.3 #Toolimage.................................................................................................................................................... 20 2.21.4 #Hidden ......................................................................................................................................................... 20 2.21.5 #Setfile........................................................................................................................................................... 20 2.21.6 #Visible ......................................................................................................................................................... 20 2.21.7 #Lock............................................................................................................................................................. 20 2.21.8 #STPBuilderApp ........................................................................................................................................... 20 2.21.9 #endfile.......................................................................................................................................................... 20 CHAPTER 3. MESSAGES AND MESSAGE HANDLER PROTOTYPES ............................................................................................................. 21 3.1 Broadcast Messages................................................................................................................................................... 21 3.2 Area Messages ........................................................................................................................................................... 21 3.3 Draw Messages.......................................................................................................................................................... 23 3.4 Registered Messages.................................................................................................................................................. 23 3.5 User Messages ........................................................................................................................................................... 27 3.5.1 Defining User Messages.................................................................................................................................. 27 3.5.2 Sending User Messages................................................................................................................................... 27 3.5.3 Handlers for User Messages............................................................................................................................ 27 3.6 Direct Messages......................................................................................................................................................... 28 3.7 Tool Messages ........................................................................................................................................................... 29 3.8 Special Messages ....................................................................................................................................................... 33 CHAPTER 4. QLARITY API FUNCTION REFERENCE .................................................................................................................................. 35 4.1 Communications Interface......................................................................................................................................... 35 4.1.1 Send ................................................................................................................................................................. 35
QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770
Page 7
QSI Qlarity-based Terminal Programmer’s Reference iii
4.1.2 Transmit........................................................................................................................................................... 35 4.1.3 SetBreak .......................................................................................................................................................... 35 4.1.4 GetComMessageSource .................................................................................................................................. 36 4.1.5 NetOpen........................................................................................................................................................... 36 4.1.6 NetServerOpen ................................................................................................................................................ 37 4.1.7 NetClose .......................................................................................................................................................... 37 4.1.8 NetServerClose................................................................................................................................................ 37 4.1.9 ChangePort ...................................................................................................................................................... 38 4.1.10 TransmitUrgent ............................................................................................................................................. 38 4.1.11 GetNetChannelInfo ....................................................................................................................................... 38 4.1.12 SetSerialRecvSize ......................................................................................................................................... 38 4.1.13 SetSerialTimeout ........................................................................................................................................... 39 4.1.14 SetCTS........................................................................................................................................................... 39 4.1.15 ReadRTS ....................................................................................................................................................... 39 4.1.16 SetDSR .......................................................................................................................................................... 39 4.1.17 ReadDTR....................................................................................................................................................... 39 4.1.18 Read DCD ..................................................................................................................................................... 40 4.1.19 NetSendDatagram ......................................................................................................................................... 40 4.2 Registering for Messages........................................................................................................................................... 40 4.2.1 RegisterMsgHandler........................................................................................................................................ 40 4.2.2 UnregisterMsgHandler .................................................................................................................................... 40 4.2.3 RegisterKey ..................................................................................................................................................... 41 4.3 Manipulating Objects ................................................................................................................................................ 41 4.3.1 GetObjref......................................................................................................................................................... 41 4.3.2 GetObjProp...................................................................................................................................................... 41 4.3.3 SetObjProp ...................................................................................................................................................... 41 4.3.4 Enable .............................................................................................................................................................. 41 4.3.5 GetContainer ................................................................................................................................................... 42 4.3.6 GetChildren ..................................................................................................................................................... 42 4.3.7 GetEnableInfo ................................................................................................................................................. 42 4.3.8 GetPosInfo....................................................................................................................................................... 42 4.3.9 SetOrigin ......................................................................................................................................................... 43 4.4 Manipulating Z-Order................................................................................................................................................ 43 4.4.1 Attach .............................................................................................................................................................. 43 4.4.2 SendtoFront ..................................................................................................................................................... 43 4.4.3 SendtoBack...................................................................................................................................................... 43 4.4.4 Raise ................................................................................................................................................................ 44 4.4.5 Lower............................................................................................................................................................... 44 4.5 Redrawing Portions of the Display............................................................................................................................ 44 4.5.1 Rerender .......................................................................................................................................................... 44 4.5.2 Resize .............................................................................................................................................................. 44 4.5.3 Relocate ........................................................................................................................................................... 44 4.6 Painting to the Display .............................................................................................................................................. 44 4.6.1 SetTransparent................................................................................................................................................. 45 4.6.2 UseTransparent................................................................................................................................................ 45 4.6.3 SetFgColor....................................................................................................................................................... 45 4.6.4 SetBgColor ...................................................................................................................................................... 45 4.6.5 RGB................................................................................................................................................................. 45 4.6.6 SetPixel............................................................................................................................................................ 46 4.6.7 DrawLine......................................................................................................................................................... 46 4.6.8 DrawBitmap .................................................................................................................................................... 46
QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770
Page 8
iv
QSI Qlarity-based Terminal Programmer’s Reference
4.6.9 DrawBitmapRegion......................................................................................................................................... 46 4.6.10 GetObjPixmap ............................................................................................................................................... 47 4.6.11 DrawPixmap.................................................................................................................................................. 47 4.6.12 DrawPixmapRegion ...................................................................................................................................... 47 4.6.13 GetBitmapSize............................................................................................................................................... 48 4.6.14 DrawBox ....................................................................................................................................................... 48 4.6.15 DrawPolygon................................................................................................................................................. 48 4.6.16 DrawEllipse ................................................................................................................................................... 49 4.6.17 GetEllipseSize ............................................................................................................................................... 50 4.6.18 GetScreenPixmap .......................................................................................................................................... 51 4.6.19 UseDrawCache .............................................................................................................................................. 51 4.6.20 IgnoreDrawCache.......................................................................................................................................... 51 4.6.21 DrawBorder ................................................................................................................................................... 52 4.6.22 GetObjPixmapRegion ................................................................................................................................... 52 4.7 Rendering Text on the Display .................................................................................................................................. 53 4.7.1 GetBdfTextSize ............................................................................................................................................... 53 4.7.2 GetBDFTextFit................................................................................................................................................ 54 4.7.3 GetBdfFontMetrics.......................................................................................................................................... 56 4.7.4 DrawBdfText................................................................................................................................................... 57 4.7.5 DrawBDFTextFit............................................................................................................................................. 57 4.7.6 GetTTFTextSize.............................................................................................................................................. 59 4.7.7 GetTTFFontMetrics......................................................................................................................................... 59 4.7.8 DrawTTFText.................................................................................................................................................. 60 4.7.9 SetTTFAngle ................................................................................................................................................... 60 4.7.10 GetSysFontCharacters ................................................................................................................................... 61 4.7.11 GetSysTextSize ............................................................................................................................................. 61 4.7.12 GetSysTextFit................................................................................................................................................ 62 4.7.13 GetSysFontMetrics ........................................................................................................................................ 63 4.7.14 DrawSysText ................................................................................................................................................. 63 4.7.15 DrawSysTextFit............................................................................................................................................. 64 4.8 Controlling the Speaker ............................................................................................................................................. 65 4.8.1 PlayNote .......................................................................................................................................................... 65 4.8.2 PlayNoteNotify................................................................................................................................................ 67 4.8.3 PlaySound........................................................................................................................................................ 67 4.8.4 PlaySoundNotify ............................................................................................................................................. 67 4.8.5 StopSpkr .......................................................................................................................................................... 67 4.8.6 SetVolume ....................................................................................................................................................... 67 4.9 Array and String Functions........................................................................................................................................ 68 4.9.1 Len................................................................................................................................................................... 68 4.9.2 Left .................................................................................................................................................................. 68 4.9.3 Right ................................................................................................................................................................ 68 4.9.4 Mid .................................................................................................................................................................. 68 4.9.5 Trim ................................................................................................................................................................. 68 4.9.6 Find.................................................................................................................................................................. 69 4.9.7 Concat.............................................................................................................................................................. 69 4.9.8 Redim .............................................................................................................................................................. 69 4.9.9 ArrayOperation................................................................................................................................................ 69 4.9.10 FreeArrayHandle ........................................................................................................................................... 70 4.9.11 ReadArrayHandle.......................................................................................................................................... 70 4.9.12 AllocateArrayHandle..................................................................................................................................... 70 4.9.13 ReverseFind................................................................................................................................................... 70
QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770