1. RE: Lable covering up Text Box Mystery
- Posted by Brian Broker <bkb at cnw.com> Jan 08, 2004
- 391 views
Here's some advice: 1. Typically controls should only be created once, so just define them as constants. 2. Avoid making controls overlap each other. In your example, lablen=60 makes the label control overlap your edit box. 30 should be the max given the location of your SleText. 3. Never ever create controls in a paint event. You will create hundreds of overlapping controls if you happen to drag another window over yours. 4. Make sure you are both using the same version of Win32Lib. (double check that you are using what you *think* you are using by checking constant Win32LibVersion)... I only mention this because SleText is deprecated and now called an EditText. 5. What would you like to accomplish with the background color? Here's how I might write your demo: without warning include win32lib.ew integer flag,lablen flag=0 -- I don't think 10 is a valid flag and I would avoid using it -- see WS_ constants for valid flags lablen=30 -- avoid overlapping controls constant Win = create(Window,"Test",0,Center,Center,500,500,0), Tabs = create( TabControl, "", Win,0, 0, 500,500, 0 ), Tab1 = create( TabItem, "Patient",Tabs,0,0,0,0,0 ), OldFont = setCreateFont("Courier New",11,Normal,Black), Lbl11 = create(LText,"Age",Tab1,30,50,lablen,25,flag), Age = create(EditText,"", Tab1,60,50,30,25,0) procedure init( integer self, integer event, sequence params) -- initialization things should go in w32HOpen event -- but why do this? Tab control is covering blue window anyway setWindowBackColor(Win,SkyBlue) end procedure setHandler(Win, w32HOpen, routine_id( "init" )) WinMain(Win,Normal) Ron Austin wrote: > > > 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? >
2. RE: Lable covering up Text Box Mystery
- Posted by Ron Austin <ronaustin at alltel.net> Jan 09, 2004
- 398 views
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.
3. RE: Lable covering up Text Box Mystery
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Jan 09, 2004
- 395 views
> -----Original Message----- > From: Ron Austin [mailto:ronaustin at alltel.net] > Subject: RE: Lable covering up Text Box Mystery > > [snip] >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. Ok, well in that case, I don't know. -- Derek