Table of Contents

preface xvii

introduction xix

author online xxi

acknowledgements xxii

contributors xxiii

1   PFC step by step 1

1.1   Axioms 1

1.2   Setting up your application manager 2

1.3   Setting up the application object 5

1.4   Configuring your application manager 6

Datawindow caching 6, Error handling 7, Transaction registration 7, Debug 7, Security 7, Finishing the application manager 7

1.5   Associate SQLCA to n_tr 7

1.6   Final setup issues 8

1.7   Extending the PFC 9

Inheritance 10, Where to put changes 10

1.8   Layering the PFC 11

The PFC layer 12, The third party library layer 12, The corporate layer 13, The PFE layer 13, The departmental layer 13, The application layer 14

2   Applications 15

2.1   The application object 15

of_about 18, of_getAppIniFile 18, of_getAppKey 19, of_getCopyright 19, of_getFrame 19, of_getHelpFile 20, of_getLogo 20, of_getMicrohelp 20, of_getUserID 20, of_getUserIniFile 21, of_getUserKey 21, of_getVersion 21, of_isRegistryAvailable 21, of_logonDlg 22, of_setAppIniFile 22, of_setAppKey 23, of_setCopyright 23, of_setDebug 23, of_setDwCache 23, of_setError 24, of_setFrame 24, of_setHelpFile 24, of_setLogo 24, of_setMicrohelp 25, of_setTrRegistration 25, of_setUserID 25, of_setUserIniFile 25, of_setUserKey 26, of_setVersion 26, of_splash 26

2.2   The About window 26

2.3   Conversion service 27

of_boolean 28, Boolean to integer 28, String to boolean 29

2.4   DateTime object 29

of_dayOfWeek(date) 30, of_days(long) 31, of_firstDayOfMonth(date) 31, of_gregorian(long) 31, of_hours(long) 32, of_isLeapYear(date) 32, of_isValid(date) (dateTime) 32, of_isWeekday(date) 33, of_isWeekend(date) 33, of_julian(date) 33, of_julianDayNumber(date) 33, of_lastDayOfMonth(date) 34, of_milliSecAfter(time,time) 34, of_monthsAfter(date,date) 34, of_relativeDateTime (dateTime,dateTime) 34, of_relativeMonth(date,long) 35, of_relativeYear(date,long) 35, of_secondsAfter(dateTime, dateTime) 35, of_wait(dateTime) 36, of_weekNumber(date) 36, of_weeksAfter(date,date) 36, of_yearsAfter(date,date) 36

2.5   Debug services 37

2.6   The file service 37

of_assemblePath 40, of_changeDirectory 41, of_createDirectory 41, of_directoryExists 41, of_dirList 41, of_fileRename 42, of_getAltFileName 42, of_getCreationDateTime 43, of_getCurrentDirectory 43, of_getDiskSpace 43, of_getDriveType 43, of_getFileAttributes 44, of_getFileSize 44, of_getLastAccessDate 45, of_getLastWriteDateTime 45, of_getLongFileName 45, of_removeDirectory 45, of_setCreationDateTime 46, of_setFileAttributes 46, of_setAccessDateTime 46, of_setLastWriteDateTime 46

2.7   The Ini services 47

of_delete 47, of_getKeys 48, of_getSections 48

2.8   Most recently used service 49

Mechanics 49

2.9   Numerical object 49

of_binary 50, of_bitwiseAnd 50, of_bitwiseNot 51, of_bitwiseOr 51, of_bitwiseXor 51, of_decimal 51, of_getBit 52

2.10   Platform service 52

2.11   Security 52

2.12   SQL inspect 53

Starting the SQLSpy object 53, Starting the log file 53, The SQLSpy popup window 53, The SQLSpy inspector window 53

2.13   The string object 54

of_arrayToString 55, of_countOccurrences 56, of_getKeyValue 56, of_getToken 57, of_globalReplace 57, of_isAlpha 57, of_isAlphaNum 58, of_isArithmeticOperator 58, of_isComparisonOperator 58, of_isEmpty 59, of_isFormat 59, of_isLower 59, of_isPrintable 59, of_isPunctuation 60, of_isSpace 60, of_isUpper 60, of_isWhiteSpace 60, of_lastPos 61, of_leftTrim 61, of_padLeft 62, of_padRight 62, of_parseToArray 62, of_quote 63, of_removeNonprint 63, of_removeWhiteSpace 63, of_rightTrim 63, of_wordCap 64

3   Datawindow services 65

3.1   Base services 65

of_describe 66, of_dwArguments 67, of_getColumnNameSource 68, of_getDisplayItem 68, of_getDisplayUnits 68, of_getHeaderName 68, of_getHeight 69, of_getItem 69, of_getItemAny 70, of_getObjects 72, of_getWidth 72, of_modify 73, of_refreshDDDWs 74, of_setColumnNameSource 74, of_setItem 74

3.2   Datawindow caching 75

3.3   Drop-down searching 75

3.4   Datawindow object attributes object 75

3.5   Datawindow resize service 76

3.6   Enhancements in version 6 76

Datawindow linkage services 76, Datawindow drop-down calendar service 77, Datawindow drop-down calculator service 77, Datawindow properties service 77

4   Service descriptions, an overview 79

4.1   Application services 79

Datawindow caching 79, Debugging 80, Error 80, Security 80, Transaction registration 81

4.2   The conversion service 81

4.3   The DateTime service 81

4.4   The debug service 82

4.5   The error service 82

4.6   The file service 83

4.7   The Ini service 83

4.8   The numerical service 83

4.9   The security service 83

4.10   The string handling service 83

of_arrayToString 84, of_occurrences 85, of_getKeyValue 85, of_getToken 86, of_globalReplace 86, of_isAlpha 87, of_isAlphaNum 87, of_isArithmeticOperator 87, of_isComparisonOperator 88, of_isEmpty 88, of_isFormat 88, of_isLower 88, of_isPrintable 89, of_isPunctuation 89, of_isSpace 89, of_isUpper 89, of_isWhiteSpace 90, of_lastPos 90, of_leftTrim 90, of_padLeft 90, of_padRight 91, of_parseToArray 91, of_quote 91, of_removeNonPrint 91, of_removeWhiteSpace 92, of_rightTrim 92, of_setKeyValue 92, of_trim 92, of_wordCap 92

4.11   The transaction registration service 93

4.12   The window services 93

Basic window services 93, Preferences 94, Sheet management 95, of_getCurrentState 95, of_getSheetCount 95, of_getSheets 95, of_getSheetsByClass 96, of_getSheetsByTitle 96, of_setCurrentState 96, of_setRequestor 96, Status bar service 97

4.13   Resize service 97

Mechanics 97

5   Standard objects 99

5.1   Calculator (u_calculator) 102

Mechanics 102

5.2   Calendar (u_calendar) 102

Mechanics 103, Suggestion 104

5.3   Command Button (u_cb) 104

Instance variables 105, User object functions 105, Events 105

5.4   Check Box (u_cbx) 105

Instance variables 105, User object functions 105, Events 106

5.5   Drop-down list box (u_ddlb) 106

Instance variables 107, User object functions 107, Events 107

5.6   Drop-down picture list box (u_ddplb) 108

Instance variables 109, User object functions 109, Events 109

5.7   Datawindow (u_dw) 110

Instance variables 110, User object functions 111, Events 116

5.8   Editmask (u_em) 128

Instance variables 128, User object functions 128, Events 129

5.9   Group box (u_gb) 130

Instance variables 130, User object functions 131, Events 131

5.10   Horizontal Scroll Bar (u_hsb) 131

Instance variables 131, User object functions 131, Events 132

5.11   List box (u_lb) 132

Instance variables 132, User object functions 133, Events 133

5.12   Listview (u_lv) 134

Instance variables 134, User object functions 135, Events 140

5.13   Multi Line Edit (u_mle) 141

Instance variables 141, User object functions 141, Events 142

5.14   OLE container object (u_oc) 143

Instance variables 143, User object functions 144, Events 144

5.15   Picture object (u_p) 147

Instance variables 147, User object functions 147, Events 148

5.16   Picture button (u_pb) 148

Instance variables 148, User object functions 148, Events 148

5.17   PictureListBox (u_plb) 149

Instance variables 149, User object functions 149, Events 150

5.18   Progress bar (u_progressBar) 151

Mechanics 151

5.19   Radio button (u_rb) 152

Instance variables 152, User object functions 152, Events 153

5.20   Rich text edit (u_rte) 153

Instance variables 153, User object functions 154, Events 160

5.21   Single line edit (u_sle) 166

Instance variables 166, User object functions 167, Events 167

5.22   Static text (u_st) 169

Instance variables 169, User object functions 169, Events 170

5.23   Tab control (u_tab) 170

Instance variables 171, User object functions 171, Events 171

5.24   Tab page (u_tabpg) 172

Instance variables 172, User object functions 172, Events 173

5.25   Tree view (u_tv) 173

Structures 173, Instance variables 174, User object functions 174, Events 178

5.26   Vertical scroll bar (u_vb) 179

Instance variables 180, User object functions 180, Events 180

5.27   Conclusion 181

6   Menus 183

6.1   PFC menus 186

6.2   Using the menus 186

6.3   Extending the menus 187

6.4   Event processing 189

appendix A The Ini files 193

How does PFC decide Ini/Registry? 194

Extended PFC Ini file support 196

Summary 196

appendix B Using the datawindow services 197

Using basic datawindow services 198

Datawindow sort service 207

Datawindow filter service 211

Datawindow linkage service 212

Datawindow linkage service example 218

Datawindow multitable service 220

Datawindow query mode service 222

Row selection service 225

Drop-down datawindow search service 226

appendix C Tabpage toolbars 229

Picture buttons 230

Code for the button 234

Code for the picture 235

Code for the static text 235

Saving the button 236

Small Buttons 236

Big buttons 238

The toolbar 238

appendix D PFC security 241

Build the PFC security scanner application 243

PFC security database requirements 244

Scanning your application windows 245

Maintaining application Templates 246

Adding users and groups 247

Assigning users and groups to controls 248

Adding application required code 249

appendix E The file service 251

The code 254

appendix F The SQLSpy service 259

Getting started 260

Batch mode 261

Debugging embedded SQL 262

appendix G Transaction registration 263

Benefits 264

Service setup 264

Service methods 265

appendix H Datawindow row manager service 267

appendix I The tab object 273

appendix J Pfc_w_master 277

Why understand pfc_w_master? 278

From which of the six window type descendants of pfc_w_master do I inherit? 279

Would I ever customize my pfc_w_master? 280

Would I ever customize my w_master? 280

Two big pictures of pfc_w_master 282

What does pfc_w_master contain? 283

pfc_w_master's instance variables 285

pfc_w_master's functions 290

pfc_w_master's Key Events 294

Tell me a little about pfc_w_master's PFC descendants 313

And what about the changes to pfc_w_master in the PFC 6.0 release? 316

Summary 321

appendix K Datawindow cache 323

Datawindow caching with the PFC 323

glossary 327

index 335