RE: Lable covering up Text Box Mystery

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> 
> 
> ----- Original Message ----- 
> From: "Ron Austin" <ronaustin at alltel.net>
> To: <EUforum at topica.com>
> Subject: Lable covering up Text Box Mystery
> 
> 
> > My brother and I are working on a project.  He recently sent me his 
> > latest version which was missing three or four text boxes.  I called him 
> > 
> > and he said he could see them just fine.  We are both using WinXP Home 
> > and both have 1024 X 768 display.  Here's  a test program I made to 
> > illustrate the problem:
> > 
> > without warning
> > include win32lib.ew
> > integer  Lbl11,Tabs,Tab1,flag,Age,lablen
> > 
> > flag=0 -- flag=10 allows win color to bleed through?
> > lablen=60 -- this setting covers causes the lable to cover up the Age 
> > control.  Change it to 30 and try it
> > 
> > constant win=createEx (Window,"Test",0,Center,Center,500,500,0,0)
> > setWindowBackColor(win,SkyBlue)
> > Tabs  = create  ( TabControl, "", win,0, 0, 500,500, 0 )
> > Tab1  = create( TabItem, "Patient",            Tabs,0,0,0,0,0)
> > procedure print_it( integer self, integer event, sequence params)
> > sequence OldFont
> > 
> > OldFont = setCreateFont("Courier New",11,Normal,Black)
> > Lbl11     = create(LText,"Age",               Tab1,30, 
> > 50,lablen,25,flag)
> > Age = create(SleText,"",                      Tab1,60,50,30,25,0) 
> > end procedure
> > setHandler(win, w32HPaint, routine_id( "print_it" ))
> > WinMain(win,Normal)
> > 
> > With lablen set to 60 the label is covering up the text box.  If I 
> > change it to 30 than I can see the text box.
> > 
> > My brother discovered that if he sets flag=10 it allows the main window 
> > color to show through the tab.  When he did that it shows the blue color 
> > 
> > on both sides of the text box, but the box is still visable.  When I try 
> > 
> > it the entire text box is covered up with the blue.  Can someone please 
> > explain what is happening here?  Could it have something to do with our 
> > respective video cards?
> > 
> 
> You are doing a few unorthodox things here. I think that what you are 
> Trying to do is give the label a blue background. Here is some code that 
> does this better. The length of the label, when set to 60 means that it 
> would overlay the edit box, so its not suprising that you can't see the 
> editbox which is underneath the label. Note, the label is NOT 
> transparent. 
> 
> Creating controls within a paint handler will cause problems later on. 
> It is not recommended.
> 
> -------------
> 
> without warning
> include win32lib.ew
> integer  win, Lbl11,Tabs,Tab1,flag,Age,lablen,labhgt
> 
> -- flag=10 allows win color to bleed through?
> -- Yes it does. This flags defines the label under user control, meaning 
> you have to
> -- explictly draw what you want to see.
> flag=SS_USERITEM --10
> 
> lablen=90 -- I've changed to to 90 to show you the effect better.
> labhgt=35 
> 
> -- Create the controls ONCE, not every time the window gets repainted.
> win=createEx (Window,"Test",0,Center,Center,500,500,0,0)
> Tabs  = create  ( TabControl, "", win,0, 0, 500,500, 0 )
> Tab1  = create( TabItem, "Patient",            Tabs,0,0,0,0,0)
> Lbl11 = create(LText,"",               Tab1,30, 45,lablen,labhgt,flag)
> Age = create(SleText,"",                      Tab1,60, 50,30,25,0) 
> 
> -- Change the font for just the controls you want, not all controls.
> setFont(Lbl11,"Courier New",11,Normal)
> setFont(Age,"Courier New",11,Normal)
> 
> -- Ensure 'Age' is on top of its label.
> moveZOrder(Age, HWND_TOP) 
> 
> 
> procedure print_it( integer self, integer event, sequence params)
>     sequence lExtent
>     sequence lTextSize
> 
>     -- Get the current size of the label.
>     lExtent = getCtlSize( Lbl11)
<snip>

This isn't the original program.  The original has 8 tabbed pages.  The 
first tabbed page has 30 text boxes and 4 combo boxes on it.  I just 
wrote the test program with one label and one text box to illustrate the 
problem -- which is:  Even though the label overlaps the text box, on 
his computer my brother can see the text box.  On my computer, I can't 
see the text box.  That's the whole question.  Why does he see the text 
box and I don't?  He accidently discovered that by setting the flag to 
10 the label would appear in color and he could see that it was 
overlapping the text box.  He has since decreased the label lengths so 
the text boxes are no longer covered up and has set the flag back to 0.  
I have the very latest download of Winlib32.  He tried the latest 
version and had some problem so he went to the previous version.  Maybe 
that's why his works differently than mine.

As far as using SleText, I didn't know it had been replaced.  Thanks for 
telling me.  I'll change the programs accordingly. 

Pete, you're right.  We are interested in writting something that will 
work on different machines, including 1024 X 768 and 800 X 600 
resolution.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu