|
Home > Archive > Programming with dBASE > October 2005 > Refreshing form objects
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Refreshing form objects
|
|
| Mark.I 2005-10-17, 1:26 pm |
| Hi all,
I attach below an example to test. Using Plus2.6 on XP Pro and 2000, but
works for the checkbox's value and text properties when using Plus2.5
The form has an entry field and a checbox, and when you click "Go" the
pushbutton_onclick event fires up.
The OnClick event has four loop statements and uses loop counter variable i
and j. Each loop executes 30000 times.
The checkbox1 value and text properties are updated with new values after
the first loop, but only the text property is updated and refreshed.
The Entryfield1 value and fontbold properties are updated with new values
after the second loop, but only the value property is updated and
refresshed.
After the third and fourth loop, the checkbox1's value and the entryfield1's
fontbold properties are updated and refreshed, possibly after exiting the
onClick event.
Is it a WAD or a BUG or MY CODE?
Thanks
Mark.I
As usal, copy/paste code shown below.
** END HEADER -- do not remove this line
//
// Generated on 15/10/2005
//
parameter bModal
local f
f = new test999Form()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class test999Form of FORM
with (this)
height = 9.0455
left = 53.0
top = 0.0
width = 37.8571
text = ""
endwith
this.CHECKBOX1 = new CHECKBOX(this)
with (this.CHECKBOX1)
height = 0.8636
left = 3.8571
top = 1.5
width = 13.4286
text = "Checkbox1"
fontName = "MS Sans Serif"
fontSize = 8.0
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
height = 1.0
left = 20.7143
top = 1.4091
width = 13.4286
fontName = "MS Sans Serif"
fontSize = 8.0
value = "Entryfield1"
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_O
NCLICK
height = 0.8636
left = 12.7143
top = 7.3636
width = 12.4286
text = "Go"
fontName = "MS Sans Serif"
fontSize = 8.0
endwith
this.NI = new ENTRYFIELD(this)
with (this.NI)
height = 1.0
left = 3.4286
top = 4.6364
width = 13.4286
fontName = "MS Sans Serif"
fontSize = 8.0
value = 0
endwith
this.NJ = new ENTRYFIELD(this)
with (this.NJ)
height = 1.0
left = 20.5714
top = 4.5909
width = 13.4286
fontName = "MS Sans Serif"
fontSize = 8.0
value = 0
endwith
this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 1.0
left = 20.5714
top = 3.6364
width = 12.0
text = "Loop J"
fontName = "MS Sans Serif"
fontSize = 8.0
fontBold = true
endwith
this.TEXTLABEL2 = new TEXTLABEL(this)
with (this.TEXTLABEL2)
height = 1.0
left = 3.4286
top = 3.5909
width = 12.0
text = "Loop I"
fontName = "MS Sans Serif"
fontSize = 8.0
fontBold = true
endwith
function PUSHBUTTON1_onClick
local i, j
for i = 1 to 30000
// do some processing
++form.ni.value
next i
form.checkBox1.text := "Done!"
form.checkBox1.value := true
for j = 1 to 30000
// do some processing
++form.nj.value
next j
form.entryField1.value := "Done!"
form.entryField1.fontbold := true
for i = 1 to 30000
// do some processing
++form.ni.value
next i
for j = 1 to 30000
// do some processing
++form.nj.value
next j
return
endclass
| |
| Ronnie MacGregor 2005-10-17, 1:26 pm |
| In article <TbqbBmj0FHA.1232@news-server>, nospam@thisaddress.com
says...
Hi Mark
> Is it a WAD or a BUG or MY CODE?
So the problem is that the EntryField doesn't bold until the function
has completed ?
In a tight loop the processor is tied up in the loop and any other event
is sitting in a queue waiting for it's turn to happen. The instruction
to repaint the control with fontbold = true has been issued, but is
still waiting to happen. Sometimes you have to force the issue.
Since you have 2.6 the quickest way to empty your window's message queue
is :
> function PUSHBUTTON1_onClick
> local i, j
> for i = 1 to 30000
> // do some processing
> ++form.ni.value
> next i
> form.checkBox1.text := "Done!"
> form.checkBox1.value := true
> for j = 1 to 30000
> // do some processing
> ++form.nj.value
> next j
> form.entryField1.value := "Done!"
> form.entryField1.fontbold := true
_app.ExecuteMessages() // Plus 2.5 onwards
> for i = 1 to 30000
> // do some processing
> ++form.ni.value
> next i
>
> for j = 1 to 30000
> // do some processing
> ++form.nj.value
> next j
> return
--
Ronnie MacGregor
Scotland
www.dBASEdeveloper.co.uk
| |
| Mark.I 2005-10-17, 1:26 pm |
| Thanks
I'll give it ago.
Regards
Mark
"Ronnie MacGregor" <no@spam.thanks> wrote in message
news:MPG. 1dbc4065a2fde7bd9896
cb@news.dbase.com...
> In article <TbqbBmj0FHA.1232@news-server>, nospam@thisaddress.com
> says...
>
> Hi Mark
>
>
> So the problem is that the EntryField doesn't bold until the function
> has completed ?
>
> In a tight loop the processor is tied up in the loop and any other event
> is sitting in a queue waiting for it's turn to happen. The instruction
> to repaint the control with fontbold = true has been issued, but is
> still waiting to happen. Sometimes you have to force the issue.
>
> Since you have 2.6 the quickest way to empty your window's message queue
> is :
>
>
> _app.ExecuteMessages() // Plus 2.5 onwards
>
>
> --
> Ronnie MacGregor
> Scotland
>
> www.dBASEdeveloper.co.uk
|
|
|
|
|