| Subject |
Re: SpeedTip followup |
| From |
Lee Grant <camilee@nospam.comcast.net> |
| Date |
Wed, 22 Feb 2023 03:34:29 -0500 |
| Newsgroups |
dbase.getting-started |
Tom,
After I ran it initially just to see what was supposed to be what, I
then went in and checked the code, and realized your colors weren't
switching because you didn't capitalize the "G" in the second color of
the IIF() function. When you have to supply characters strings that are
supposed to be a certain capitalization, you must supply that or it
doesn't know what you want.
This is what you had at line 73(notice lowercase 'g' in the second color
choice. That's why it never switched again, it wasn't equal the first
spelling:
this.parent.colorNormal := iif( this.parent.colorNormal =
"LightGrey","Fuchsia","Lightgrey")
This at line 73 fixes the lack of toggle (watch wrap):
this.parent.colorNormal := iif( this.parent.colorNormal =
"LightGrey","Fuchsia","LightGrey")
Lee
On 2/21/2023 5:40 PM, Tom wrote:
> Hi all,
>
> Confounded by the form included.
>
> 1) Speedtip never appears
>
> 2) Form color change works once, not every time textlabel is 'clicked'
>
> Your help and guidance appreciated. If the code looks familiar, probably
> is but I do not remember from whom I stole it. Mind the wrap.
>
> Thanks,
> Tom
> *
> ** END HEADER -- do not remove this line
> //
> // Generated on 02/21/2023
> //
> parameter bModal
> local f
> f = new ImageClicked2Form()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class ImageClicked2Form of FORM
> with (this)
> doubleBuffered = true
> metric = 6 // Pixels
> colorNormal = "LightGrey"
> height = 352.0
> left = 1004.0
> top = 0.0
> width = 280.0
> text = ""
> showSpeedTip = true
> endwith
>
> this.GETENTRY1 = new ENTRYFIELD(this)
> with (this.GETENTRY1)
> onOpen = class::ENTRYFIELD_ONOPEN
> height = 24.0
> left = 76.0
> top = 163.0
> width = 125.0
> fontSize = 11.0
> speedTip = "Assist"
> value = ""
> endwith
>
>
>
> Function ENTRYFIELD_ONOPEN
> * ------------------------------------------ *
> oThis = this // reference the entryfield control
> this.TL1 = new TEXTLABEL( oThis.parent ) // oThis.parent == the
> FORM !!!
> this.TL1.top := oThis.top + 1
> this.TL1.width := 22.0
> this.TL1.height := 22.0
> this.TL1.left := (oThis.left + oThis.width) - (this.TL1.width + 1)
> this.TL1.text := "6"
> this.TL1.colorNormal := "Red/Window"
> this.TL1.fontName := "Webdings"
> this.TL1.fontSize := 14.0
> this.TL1.borderStyle := 3 // None
> this.TL1.alignVertical := 1 // Middle
> this.TL1.alignHorizontal := 1 // Center
> this.TL1.speedTip := "Calendar ..."
> this.TL1.onLeftMouseDown := class::TL1_ONLEFTMOUSEDOWN
> *
> return
> *
>
> Function TL1_onLeftMouseDown(flags, col, row)
> * ------------------------------------------------------------- *
> // 'click' it ...
> this.borderStyle = 2
> _app.executeMessages( )
> sleep .35
> this.borderStyle = 3
> _app.executeMessages( )
> *
> this.parent.colorNormal := iif( this.parent.colorNormal =
> "LightGrey","Fuchsia","Lightgrey")
> *
> return
> *
>
> endclass
>
> *
|
|