Well, I am almost always defining my windows in 'zones'.
I'll try to explain with some snippets of the real code.
At startup, after an OpenWindow(), I am creating the main zone, called A with the array ImA() containing the ImageNumber, ImageGadget and X,Y,W,H attributes:
Code: Select all
Dim ImA.i(5)
zBaseImage(ImA(),0,_BAR,_WW,_WH)
zGradient(ImA(),3,0,0,_WW,_WH,$1F364E,$1F364E)
Then, I create another zone D over the zone A:
Code: Select all
Dim ImD.i(5); zone for image's info
ImAx=ImA(2)+910:ImAy=ImA(3)+20+450+20
zBaseImage(ImD(),ImAx,ImAy,450,450)
zGradient(ImD(),1,0,0,450,160,$70B5AB,$70B5AB)
zGradient(ImD(),1,0,160,450,290,$70B5AB,$1F364E)
Dim InfoGad(5)
InfoGad(0)=TextGadget(#PB_Any,ImAx+10,ImAy+8,150,20,"")
InfoGad(1)=TextGadget(#PB_Any,ImAx+300,ImAy+8,150,20,"")
InfoGad(2)=TextGadget(#PB_Any,ImAx+10,ImAy+40,440,20,"")
InfoGad(3)=TextGadget(#PB_Any,ImAx+10,ImAy+60,440,20,"")
InfoGad(4)=TextGadget(#PB_Any,ImAx+10,ImAy+80,440,20,"")
InfoGad(5)=TextGadget(#PB_Any,ImAx+10,ImAy+100,440,220,"")
For i=0 To 5
SetGadgetFont(InfoGad(i),FontID(_F01))
SetGadgetColor(InfoGad(i),#PB_Gadget_BackColor,$70B5AB)
SetGadgetColor(InfoGad(i),#PB_Gadget_FrontColor,$000000)
Next
The zone D has some TextGadgets().
And when needed, the program calls a procedure that fills up the TextGadgets():
Code: Select all
; Info
SetGadgetText(InfoGad(0),zStringGetItem(Rec,3,#SEP,1)):InvalidateRect_(GadgetID(InfoGad(0)),0,1)
SetGadgetText(InfoGad(1),"#"+Mid(Key,1,6)):InvalidateRect_(GadgetID(InfoGad(1)),0,1)
zLine(ImD(),0,30,450,30,$000000)
SetGadgetText(InfoGad(2),zStringGetItem(Rec,2,#SEP,1)):InvalidateRect_(GadgetID(InfoGad(2)),0,1)
SetGadgetText(InfoGad(3),zStringGetItem(Rec,4,#SEP,1)):InvalidateRect_(GadgetID(InfoGad(3)),0,1)
SetGadgetText(InfoGad(4),zStringGetItem(Rec,5,#SEP,1)):InvalidateRect_(GadgetID(InfoGad(4)),0,1)
SetGadgetText(InfoGad(5),zStringGetItem(Rec,6,#SEP,1)):InvalidateRect_(GadgetID(InfoGad(5)),0,1)
The function zBaseImage() creates an empty image, which is then filled with a gradient.
This is done twice (zone A and then zone D on zone A) before the TextGadget() is placed. And the zone D is then left untouched. I really do not see why I need InvalidateRect_(), as there is also a zone P with the same kind of TextGadget(), where I do not need InvalidateRect_(), hence my frustration for the zone D. The only difference is that the TextGadget() in the zone P prints a value upon creation.
There is no other gadget on top nor inside the TextGadget() in zone D.
Would it be possible that a text on image2 on image1 might cause problems?