class MYENTRYFIELD(parentObj) of ENTRYFIELD(parentObj) custom with (this) onGotFocus = class::MYENTRYFIELD_ONGOTFOCUS height = 22.0 left = 62.0 top = 102.0 width = 56.0 metric = 6 // Pixels colorHighLight = "WindowText/0x80ffff" value = "MyEntryfield" endwith function MYENTRYFIELD_onGotFocus() this.keyboard( "{Home}" ) return endclass class MYTEXT(parentObj) of TEXT(parentObj) custom with (this) height = 22.0 left = 14.0 top = 55.0 width = 84.0 metric = 6 // Pixels text = "MyText" borderStyle = 10 // Etched Out endwith endclass class MYTEXTLABEL(parentObj) of TEXTLABEL(parentObj) custom with (this) height = 22.0 left = 53.0 top = 107.0 width = 84.0 metric = 6 // Pixels transparent = true text = "MyTextLabel" fontBold = true alignHorizontal = 2 // Right alignVertical = 1 // Middle endwith endclass class MYSPINBOX(parentObj) of SPINBOX(parentObj) custom with (this) onGotFocus = class::MYSPINBOX_ONGOTFOCUS height = 22.0 left = 60.0 top = 202.0 width = 56.0 metric = 6 // Pixels picture = "99999" colorHighLight = "WindowText/0x80ffff" rangeMax = 100 rangeMin = 1 value = 1 endwith function MYSPINBOX_onGotFocus() this.keyboard( "{Home}" ) return endclass class MYCOMBOBOX(parentObj) of COMBOBOX(parentObj) custom with (this) onGotFocus = class::MYCOMBOBOX_ONGOTFOCUS onChange = class::MYCOMBOBOX_ONCHANGE height = 22.0 left = 75.0 top = 250.0 width = 84.0 metric = 6 // Pixels colorHighLight = "WindowText/0x80ffff" style = 2 // DropDownList dropDownHeight = 132.0 endwith function MYCOMBOBOX_onGotFocus() this.savedValue = this.value return function MYCOMBOBOX_onChange() // this = combobox // datalink = field // parent = field array // parent = rowset if this.datalink.parent.parent.state == 1 this.value = this.savedValue this.datalink.parent.parent.modified = false this.datalink.parent.parent.abandon() endif return endclass class MYRADIOBUTTON(parentObj) of RADIOBUTTON(parentObj) custom with (this) transparent = true height = 24.0 left = 217.0 top = 22.0 width = 110.0 text = "Radiobutton" metric = 6 // Pixels endwith endclass class MYCONTAINER(parentObj) of CONTAINER(parentObj) custom with (this) transparent = true left = 432.0 top = 42.0 width = 184.0 height = 101.0 metric = 6 // Pixels borderStyle = 4 // Single endwith endclass class MYGRID(parentObj) of GRID(parentObj) custom with (this) colorHighLight = "WindowText/0x80ffff" cellHeight = 22.0 rowSelect = true allowEditing = false allowAddRows = false height = 88.0 left = 434.0 top = 208.0 width = 182.0 metric = 6 // Pixels bgcolor="White" endwith endclass class MYTABBOX(parentObj) of TABBOX(parentObj) custom with (this) onSelChange = class::TABBOX_ONSELCHANGE onOpen = class::MYTABBOX_ONOPEN id = 110 height = 22.0 left = 0.0 top = 316.0 width = 644.0 metric = 6 // Pixels colorHighLight = "WindowText/0x80ffff" dataSource = 'ARRAY {"Individual Record","Find Record"}' endwith function TABBOX_onSelChange() form.pageNo := this.curSel return function MYTABBOX_onOpen() this.curSel := 1 form.pageNo := 1 return endclass class MYIMAGE(parentObj) of IMAGE(parentObj) custom with (this) height = 88.0 left = 209.0 top = 80.0 width = 99.0 metric = 6 // Pixels alignment = 3 // Keep Aspect Stretch endwith endclass class MYEDITOR(parentObj) of EDITOR(parentObj) custom with (this) key = class::MYEDITOR_KEY height = 88.0 left = 196.0 top = 187.0 width = 221.0 metric = 6 // Pixels value = "" colorHighLight = "WindowText/0x80ffff" evalTags = false popupEnable = false endwith function MYEDITOR_key(nChar, nPosition,bShift,bControl) /* This code by Gary White is provided to get around a problem with rowsets that have the autoEdit property set to false, and editors. The editor seems to be immune to this property once you make a change in it -- if you then save or abandon, you can actually edit the contents of the editor object ... */ // this = editor // dataLink = field // parent = fieldArray // parent = rowset if type( "this.datalink.parent.parent" ) # "U" r = this.datalink.parent.parent if r.autoEdit == false and ; ( r.state # 2 and r.state # 3 ) return 0 endif endif return endclass class DISABLEDENTRY(parentObj) of MYENTRYFIELD(parentObj) custom with (this) when = class::DISABLEDENTRY_WHEN height = 22.0 left = 71.0 top = 324.0 width = 56.0 colorNormal = "White/Maroon" value = "DisabledEntry" mousePointer = 12 // No endwith function DISABLEDENTRY_when(bOpen) return false endclass class MYPUSHBUTTON(parentObj) of PUSHBUTTON(parentObj) custom with (this) height = 24.0 left = 35.0 top = 4.0 width = 62.0 text = "MyPushButton" metric = 6 // Pixels endwith endclass class MYTITLETEXT(parentObj) of MYTEXT(parentObj) custom with (this) height = 28.0 left = 247.0 top = 324.0 width = 84.0 colorNormal = "Blue/BtnFace" alignHorizontal = 1 // Center fontSize = 14.0 text = "MyTitle" borderStyle = 1 // Raised speedTip = "Form Title" endwith endclass class MYTOOLBAR(parentObj, name) of MYCONTAINER(parentObj, name) custom with (this) left = 182.0 top = 363.0 width = 429.0 height = 37.0 endwith this.PBNEW = new MYPUSHBUTTON(this) with (this.PBNEW) onClick = class::PBNEW_ONCLICK height = 24.0 left = 7.0 top = 6.0 width = 64.0 text = "&New" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\favourites_16.png" fontSize = 8.0 speedTip = "Add new record" pageno = 0 endwith this.PBEDIT = new MYPUSHBUTTON(this) with (this.PBEDIT) onClick = class::PBEDIT_ONCLICK height = 24.0 left = 69.0 top = 6.0 width = 62.0 text = "&Edit" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\document_open_16.png" fontSize = 8.0 speedTip = "Edit current record" pageno = 0 endwith this.PBSAVE = new MYPUSHBUTTON(this) with (this.PBSAVE) onClick = class::PBSAVE_ONCLICK height = 24.0 left = 125.0 top = 6.0 width = 62.0 text = "&Save" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\save_16.png" fontSize = 8.0 speedTip = "Save current record" pageno = 0 endwith this.PBABANDON = new MYPUSHBUTTON(this) with (this.PBABANDON) onClick = class::PBABANDON_ONCLICK height = 24.0 left = 181.0 top = 6.0 width = 62.0 text = "&Cancel" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\stop_16.png" fontSize = 8.0 speedTip = "Cancel Changes" pageno = 0 endwith this.PBDELETE = new MYPUSHBUTTON(this) with (this.PBDELETE) onClick = class::PBDELETE_ONCLICK height = 24.0 left = 241.0 top = 6.0 width = 62.0 text = "&Delete" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\delete_16.png" fontSize = 8.0 speedTip = "Delete current record" pageno = 0 endwith this.PBNEXT = new MYPUSHBUTTON(this) with (this.PBNEXT) onClick = class::PBNEXT_ONCLICK height = 24.0 left = 360.0 top = 6.0 width = 62.0 text = "&Next" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\arrow_right_16.png" fontSize = 8.0 speedTip = "Next record" pageno = 0 endwith this.PBPREVIOUS = new MYPUSHBUTTON(this) with (this.PBPREVIOUS) onClick = class::PBPREVIOUS_ONCLICK height = 24.0 left = 300.0 top = 6.0 width = 62.0 text = "&Previous" upBitmap = "filename :Glyfx:\Aero\CE\Dbase Aero\PNG\16x16\arrow_left_16.png" fontSize = 8.0 speedTip = "Previous record" pageno = 0 endwith function PBDELETE_onClick() if msgbox( "Delete this row?", "Delete Row?", 36 ) == 6 form.rowset.delete() this.parent.resettoolbar() endif return function PBABANDON_onClick() if form.rowset.modified if msgbox( "Abandon changes to this row?", "Abandon changes?", 36 ) == 6 form.rowset.abandon() this.parent.resettoolbar() endif else form.rowset.abandon() endif return function PBPREVIOUS_onClick() if ( not form.rowset.next(-1) ) form.rowset.next() msgbox( "At beginning of rowset", "Can't Navigate", 64 ) endif return function PBSAVE_onClick() form.rowset.save() this.parent.resettoolbar() return function PBNEW_onClick() this.parent.pbnext.enabled=false this.parent.pbprevious.enabled=false form.rowset.beginAppend() return function PBNEXT_onClick() if ( not form.rowset.next() ) form.rowset.next( -1 ) msgbox( "At end of rowset", "Can't Navigate", 64 ) endif return function PBEDIT_onClick() form.rowset.edit() return function resetToolbar this.PBNEXT.enabled=true this.PBprevious.enabled=true endclass