home *** CD-ROM | disk | FTP | other *** search
- class HTMLGet(parentObj, name) of CONTAINER(parentObj, name) custom
- with (this)
- left = 85
- top = 70
- width = 368
- height = 218
- metric = 6
- colorNormal = "BtnFace"
- borderStyle = 1
- transparent = true
- pageno = 0
- endwith
-
- this.MASK = new RECTANGLE(this)
- with (this.MASK)
- top = 146
- width = 367
- height = 70
- border = false
- borderStyle = 3
- endwith
-
- this.TEXT16 = new TEXT(this)
- with (this.TEXT16)
- height = 14
- left = 1
- top = 0
- width = 364
- metric = 6
- colorNormal = "BtnText/BtnFace"
- fontSize = 8
- borderstyle = 3
- text = "Text"
- wrap = false
- pageno = 0
- endwith
-
- this.EDITOR1 = new EDITOR(this)
- with (this.EDITOR1)
- height = 76
- left = 0
- top = 14
- width = 366
- metric = 6
- value = ""
- fontSize = 8
- cuaTab = true
- pageno = 0
- borderStyle = 2
- endwith
-
-
- this.Display = new Text(this)
- with (this.DISPLAY)
- height = 56
- left = 0
- top = 90
- width = 366
- metric = 6
- text = "This is a sample of the text..."
- ColorNormal = 'N'
- fontSize = 10
- pageno = 0
- borderStyle = 2
- transparent = true
- wrap = false
- endwith
-
-
- this.RECTANGLE3 = new RECTANGLE(this)
- with (this.RECTANGLE3)
- left = 228
- top = 148
- width = 132
- height = 60
- metric = 6
- text = "Font"
- fontSize = 8
- pageno = 0
- endwith
-
-
- this.RECTANGLE2 = new RECTANGLE(this)
- with (this.RECTANGLE2)
- left = 110
- top = 148
- width = 113
- height = 60
- metric = 6
- text = "Text Color"
- fontSize = 8
- pageno = 0
- endwith
-
-
- this.RECTANGLE1 = new RECTANGLE(this)
- with (this.RECTANGLE1)
- left = 5
- top = 148
- width = 99
- height = 60
- metric = 6
- text = "Alignment"
- fontSize = 8
- pageno = 0
- endwith
-
-
- this.ALIGNLEFTRADIO = new RADIOBUTTON(this)
- with (this.ALIGNLEFTRADIO)
- onChange = class::ALIGNLEFTRADIO_ONCHANGE
- height = 16
- left = 11
- top = 163
- width = 47
- text = "Left"
- metric = 6
- fontSize = 8
- colornormal = "BtnText/BtnFace"
- value = true
- group = true
- pageno = 0
- endwith
-
-
- this.ALIGNCENTERRADIO = new RADIOBUTTON(this)
- with (this.ALIGNCENTERRADIO)
- onChange = class::ALIGNCENTERRADIO_ONCHANGE
- colorNormal = 'BtnText/BtnFace'
- height = 19
- left = 11
- top = 182
- width = 50
- text = "Center"
- metric = 6
- fontSize = 8
- value = false
- group = false
- pageno = 0
- endwith
-
-
- this.COLORFIELD = new ENTRYFIELD(this)
- with (this.COLORFIELD)
- height = 19
- left = 120
- top = 163
- width = 64
- metric = 6
- fontSize = 8
- value = "0x000000"
- pageno = 0
- borderStyle = 7
- endwith
-
-
- this.COLORBUTTON = new PUSHBUTTON(this)
- with (this.COLORBUTTON)
- onClick = class::COLORBUTTON_ONCLICK
- height = 19
- left = 188
- top = 163
- width = 25
- text = ""
- metric = 6
- upBitmap = "RESOURCE #148"
- fontSize = 8
- group = true
- pageno = 0
- endwith
-
-
- this.FONTCOMBO = new COMBOBOX(this)
- with (this.FONTCOMBO)
- onChange = class::FONTCOMBO_ONCHANGE
- onOpen = class::FONTCOMBO_ONOPEN
- height = 19
- left = 271
- top = 161
- width = 83
- metric = 6
- fontSize = 8
- dataSource = 'array {"Normal","Header 1","Header 2","Header 3","Header 4","Header 5"}'
- pageno = 0
- style = 1
- dropDownHeight = 114
- endwith
-
-
- this.ATTRIBCOMBO = new COMBOBOX(this)
- with (this.ATTRIBCOMBO)
- onChange = class::ATTRIBCOMBO_ONCHANGE
- onOpen = class::ATTRIBCOMBO_ONOPEN
- height = 19
- left = 271
- top = 184
- width = 83
- metric = 6
- fontSize = 8
- dataSource = 'array {"Normal","Bold","Italic","Bold Italic","Underline","Bold Underline"}'
- pageno = 0
- style = 1
- dropDownHeight = 114
- endwith
-
-
- this.TEXT3 = new TEXT(this)
- with (this.TEXT3)
- height = 13
- left = 236
- top =164
- width = 27
- metric = 6
- colorNormal = "BtnText"
- fontSize = 8
- text = "Tag"
- pageno = 0
- endwith
-
-
- this.TEXT4 = new TEXT(this)
- with (this.TEXT4)
- height = 19
- left = 236
- top = 186
- width = 27
- metric = 6
- colorNormal = "BtnText"
- fontSize = 8
- text = "Style"
- pageno = 0
- endwith
-
- // {Linked Method} form.firstpagetitle.attribcombo.onOpen
- function AttribCombo_onOpen
- if this.value = 'Combo'
- this.value = 'Normal'
- endif
- return
-
-
- // {Linked Method} form.firstpagetitle.colorbutton.onClick
- function COLORBUTTON_onClick
- cColor = GetColor()
- if len(trim(cColor)) > 0
-
- // set control value and redisplay the result
- this.parent.colorfield.value = class::ColorToHex(cColor)
-
- class::UpdateDisplay(this.parent.display.text)
-
-
- endif
-
- return
-
-
- // {Linked Method} form.firstpagetitle.fontcombo.onOpen
- function FONTCOMBO_onOpen
- if this.value = 'Combo'
- this.value = 'Normal'
- endif
- return
-
-
- // Method: ColorToHex ////// converts RGB values to Hex color
- /////////////////////////////////// Param cColor RGB Color (225,225,044)
-
- function ColorToHex(cColor)
- local cColor3,cColor2,cColor1
-
- // parse out RGB strings as Hex
- // Note that VdB 7 use BGR, not RGB,
- // so first and last colors must be
- // reversed when used in Browser.
-
- cColor1 = class::FixZero(itoh(val(substr(cColor,1,at(',',cColor)-1))))
- cColor = substr(cColor,at(',',cColor)+1)
-
- cColor2 = class::FixZero(itoh(val(substr(cColor,1,at(',',cColor)-1))))
- cColor = substr(cColor,at(',',cColor)+1)
-
- cColor3 = class::FixZero(itoh(val(substr(cColor,1))))
-
-
- //Note: Please note strange order of colors. Colors in VdB
- // are reversed to BGR instead of RGB and use 0x to indicate
- // hexidecimal values.
- return '0x'+cColor3+cColor2+cColor1
-
- // Method: FixZero = add "0" for single-char Hex (0) to create
- // HEX pair (00) for color string.
- function FixZero(cNum)
- return iif(len(cNum) = 1,'0'+cNum,cNum)
-
-
- // {Linked Method} form.firstpagetitle.fontcombo.onChange
- function FONTCOMBO_onChange
- class::UpdateDisplay(this.parent.display.text)
- return
-
-
- // Method: UpdateDisplay ///////////////////////////////////////////
- // Purpose: To Call BuildHTMLString for Web Wizard display controls
- // In response to changes in attribute settings
- function UpdateDisplay( cStr )
- // call BuildHMTLString function for this particular
- // control's text value
-
- if type('this.parent.display') = 'O' // text object must be
- // instantiated for display
-
- // replace text with updated HTML values according to
- // control values in this container
- this.parent.display.text = ;
- class::BuildHTMLString( (cStr) )
-
- endif
-
- return true
-
-
-
-
- // {Linked Method} form.firstpagetitle.aligncenterradio.onChange
- function ALIGNCENTERRADIO_onChange
- class::UpdateDisplay(this.parent.display.text)
- return
-
- // {Linked Method} form.firstpagetitle.alignleftradio.onChange
- function ALIGNLEFTRADIO_onChange
- class::UpdateDisplay(this.parent.display.text)
- return
-
- // {Linked Method} form.firstpagetitle.attribcombo.onChange
- function ATTRIBCOMBO_onChange
- class::UpdateDisplay(this.parent.display.text)
- return
-
- /* Method: BuildHTMString ////////////////////////////////////////
- Purpose: Rebuilds attributes of test string to display selections
- Made in GetHTML container text formatting controls
- Params: cStr - the string to format with HTML tags
- oParent - the GetHTML container in which attributes are set
- for this particular string
-
- Note: This method was "genericized" using the oParent object
- reference so that it could be reused in the streaming
- engine of this Web Wizard - AAK
- */
-
- function BuildHTMLString(cStr)
-
-
- /* before you build HTML tagged string, remove any tags
- that may already exist
-
- */
-
-
- // first, strip off endtags (if any)
- if at('</',cStr) > 0
-
- cStr = substr(cStr,1,at('</',cStr)-1)
-
- endif
-
- // Now, get rid of starting tags
- do while at('>',cStr) > 0
-
- cStr = substr(cStr,at('>',cStr)+1)
-
- enddo
-
-
- // Next, build string from "inside-out"
-
- // Attributes first
-
-
-
- if at('Underline',this.parent.AttribCombo.value) > 0
- cStr = '<U>'+cStr+'</U>'
- endif
- if at('Bold',this.parent.AttribCombo.value) > 0
- cStr = '<B>'+cStr+'</B>'
- endif
- if at('Italic',this.parent.AttribCombo.value) > 0
- cStr = '<I>'+cStr+'</I>'
- endif
-
-
-
-
- // Then, color and alignment
- //+o
- cStr = '<Font color="0x'+this.parent.ColorField.value+'">'+cStr+'</Font>'
-
-
-
- // Then, text style
-
- if at('Header',this.parent.FontCombo.value) > 0
- cStr = '<H'+ substr(this.parent.FontCombo.value,8,1)+;
- ' align='+iif(this.parent.AlignLeftRadio.value,'left','center')+;
- '>'+cStr+'</H'+substr(this.parent.FontCombo.value,8,1)+'>'
-
- else
- // Paragraph,alignment:
- cStr = '<P '+'align='+iif(this.parent.AlignLeftRadio.value,;
- "left", "center")+'>'+cStr+'</P>'
- endif
-
- return cStr
-
- endclass
-