** END HEADER -- do not remove this line // // Generated on 01/09/2020 // parameter bModal local f f = new customControlsForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class customControlsForm of FORM set procedure to :DT_custom:MyControls.cc additive with (this) metric = 6 // Pixels height = 511.0 left = 468.0 top = 122.0 width = 706.0 text = "" endwith this.MYTEXT = new TEXT(this) with (this.MYTEXT) height = 22.0 left = 14.0 top = 55.0 width = 84.0 text = "MyText" borderStyle = 10 // Etched Out endwith this.MYENTRYFIELD1 = new MYENTRYFIELD(this) with (this.MYENTRYFIELD1) height = 22.0 left = 126.0 top = 11.0 width = 56.0 endwith this.MYTEXTLABEL = new TEXTLABEL(this) with (this.MYTEXTLABEL) height = 22.0 left = 21.0 top = 88.0 width = 84.0 transparent = true text = "MyTextLabel" fontBold = true alignHorizontal = 2 // Right endwith this.MYPUSHBUTTON = new PUSHBUTTON(this) with (this.MYPUSHBUTTON) height = 24.0 left = 35.0 top = 4.0 width = 62.0 text = "MyPushButton" endwith this.MYSPINBOX = new SPINBOX(this) with (this.MYSPINBOX) onGotFocus = class::MYSPINBOX_ONGOTFOCUS height = 22.0 left = 60.0 top = 202.0 width = 56.0 picture = "99999" colorHighLight = "WindowText/0x80ffff" rangeMax = 100 rangeMin = 1 value = 1 endwith this.MYCOMBOBOX = new COMBOBOX(this) with (this.MYCOMBOBOX) onGotFocus = class::MYCOMBOBOX_ONGOTFOCUS onChange = class::MYCOMBOBOX_ONCHANGE height = 22.0 left = 75.0 top = 250.0 width = 84.0 colorHighLight = "WindowText/0x80ffff" style = 2 // DropDownList dropDownHeight = 132.0 endwith this.MYRADIOBUTTON = new RADIOBUTTON(this) with (this.MYRADIOBUTTON) transparent = true height = 24.0 left = 217.0 top = 22.0 width = 110.0 text = "Radiobutton" endwith this.MYCONTAINER = new CONTAINER(this) with (this.MYCONTAINER) transparent = true left = 432.0 top = 42.0 width = 184.0 height = 101.0 borderStyle = 4 // Single endwith this.MYGRID = new GRID(this) with (this.MYGRID) colorHighLight = "WindowText/0x80ffff" cellHeight = 22.0 rowSelect = true allowEditing = false allowAddRows = false height = 88.0 left = 434.0 top = 208.0 width = 182.0 endwith this.MYTABBOX = new TABBOX(this) with (this.MYTABBOX) onSelChange = class::TABBOX_ONSELCHANGE onOpen = class::MYTABBOX_ONOPEN id = 110 height = 22.0 left = 0.0 top = 487.0 width = 704.0 colorHighLight = "WindowText/0x80ffff" dataSource = 'ARRAY {"Individual Record","Find Record"}' endwith this.MYIMAGE = new IMAGE(this) with (this.MYIMAGE) height = 88.0 left = 209.0 top = 80.0 width = 99.0 alignment = 3 // Keep Aspect Stretch endwith this.MYEDITOR = new EDITOR(this) with (this.MYEDITOR) key = class::MYEDITOR_KEY height = 88.0 left = 196.0 top = 187.0 width = 221.0 value = "" colorHighLight = "WindowText/0x80ffff" evalTags = false popupEnable = false endwith this.DISABLEDENTRY = new MYENTRYFIELD(this) with (this.DISABLEDENTRY) 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 this.MYTITLETEXT = new MYTEXT(this) with (this.MYTITLETEXT) 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 this.MYTOOLBAR = new MYCONTAINER(this) with (this.MYTOOLBAR) onOpen = class::MYTOOLBAR_ONOPEN left = 182.0 top = 363.0 width = 429.0 height = 37.0 endwith this.MYTOOLBAR.PBNEW = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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.MYTOOLBAR.PBEDIT = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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.MYTOOLBAR.PBSAVE = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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.MYTOOLBAR.PBABANDON = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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.MYTOOLBAR.PBDELETE = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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.MYTOOLBAR.PBNEXT = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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.MYTOOLBAR.PBPREVIOUS = new MYPUSHBUTTON(this.MYTOOLBAR) with (this.MYTOOLBAR.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 DISABLEDENTRY_when(bOpen) return false 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 function MYCOMBOBOX_onGotFocus() this.savedValue = this.value return 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 function MYENTRYFIELD_onGotFocus() this.keyboard( "{Home}" ) 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 MYSPINBOX_onGotFocus() this.keyboard( "{Home}" ) return function MYTABBOX_onOpen() this.curSel := 1 form.pageNo := 1 return function resetToolbar() this.pbabandon.enabled=true this.pbsave.enabled=true this.pbdelete.enabled=true this.pbnext.enabled=true this.pbprevious.enabled=true this.pbedit.enabled=true this.pbadd.enabled=true return function MYTOOLBAR_onOpen() this.pbabandon.enabled=true this.pbsave.enabled=true this.pbdelete.enabled=true this.pbnext.enabled=true this.pbprevious.enabled=true this.pbedit.enabled=true this.pbnew.enabled=true return function PBABANDON_onClick() if form.rowset.modified if msgbox( "Abandon changes to this row?", "Abandon changes?", 36 ) == 6 form.rowset.abandon() endif else form.rowset.abandon() endif return function PBDELETE_onClick() if msgbox( "Delete this row?", "Delete Row?", 36 ) == 6 form.rowset.delete() endif return function PBEDIT_onClick() form.rowset.edit() return function PBNEW_onClick() this.parent.pbnext.enabled=false this.parent.pbprevious.enabled=false form.rowset.beginAppend() 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() return function TABBOX_onSelChange() form.pageNo := this.curSel return endclass