Author | Topic: Buggy XbpStatic:SetCaption() | |
---|---|---|
Itai Ben-Artzi | Buggy XbpStatic:SetCaption() on Fri, 13 Feb 2015 23:02:08 -0800 I’d like to report the following bug: If a XbpStatic() object is a child of another XbpStatic() object then the method SetCaption() does not clear the previous caption. This works: oXbp := XbpStatic():new( oDrawingArea, , {100,100}, {100,16} ) oXbp:caption := "First round description" oXbp:create() oXbp:SetCaption(‘Second round caption’) But this does not work oXbp := XbpStatic():new( oDrawingArea, , {100,100}, {100,24} ) oXbp:create() oXbp:SetCaption(‘Second round caption’) oXbp2 := XbpStatic():new( oXbp, , {2,10}, {80,16} ) oXbp2:caption := "First round description" oXbp2:create() oXbp2:SetCaption(‘Second round caption’) -Itai | |
Andreas Gehrs-Pahl | Re: Buggy XbpStatic:SetCaption() on Sat, 14 Feb 2015 05:05:24 -0500 Itai, >Iʼd like to report the following bug: I don't see any bug here at all. >If a XbpStatic() object is a child of another XbpStatic() object then the >method SetCaption() does not clear the previous caption. Sure it does. But it obviously doesn't clear the Caption of the parent's XbpStatic(). There are lots of ways to fix your display problem, though: 1) Just add the following line of code after your last line of code to clear the caption of your parent static: oXbp:SetCaption(""). 2) Don't use an XbpStatic() of :Type "XBPSTATIC_TYPE_TEXT" as the parent. 3) Don't assign a :Caption to the parent XbpStatic() in the first place. 4) Make the Child (oXbp2) the exact same size as the parent (oXbp) and position it at the parent's lower left corner {0, 0}, so it covers the parent static completely. Either of those options will work. Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas.GP@Charter.net web: http://www.Aerospace-History.net | |
Itai Ben-Artzi | Re: Buggy XbpStatic:SetCaption() on Sun, 15 Feb 2015 00:28:58 -0800 Andreas, only the child is set with a caption, but the re-painting is badly done and the child must be reconfigured in order to change a caption. Try it and see what happens when the caption is changed (the first time caption is OK, but changing the caption is ill-performed). It is a bug that did not exist in 1.9. -Itai | |
Andreas Gehrs-Pahl | Re: Buggy XbpStatic:SetCaption() on Sun, 15 Feb 2015 04:31:04 -0500 Itai, >only the child is set with a caption, but the re-painting is badly done and >the child must be reconfigured in order to change a caption. In your example code snippet, you used a Static with the caption of "Second round caption" as the parent for a second Static with the caption of "First round description". In addition, your parent is 100 pixels long and 24 pixels high, while our child is positioned 2 pixels to the right and 10 pixels up on the parent, and is 80 pixels long/wide and only 16 pixels high. That means that to the left, 2 pixels and on the bottom 10 pixels of the original "Second round caption" text will always be visible. You then change the caption of the child (also) to "Second round caption", which makes it look like there is a shadow. Additionally, the Statics are both too short to hold the entire caption text, so they show an ellipsis (...) at the end. You have the text "ʽSecond round captionʼ" actually in invalid single quote characters, that would cause a runtime error in Xbase++, if actually used. >Try it and see what happens when the caption is changed (the first time >caption is OK, but changing the caption is ill-performed). I can change the caption as often as I want, and it always looks exactly as I expect it. To make this look good, you can chose any of the four options that I mentioned in my previous post. >It is a bug that did not exist in 1.9. I can't see any difference between 1.9.355 and 2.0.570 behavior for this. Please post a small, compilable, demo program, as well as screen shots of what you get when you run that program compiled with 1.9 and 2.0, and maybe even some info about your environment (Windows version, etc.) Without this, there is no way that anyone can really help you. And when you create this test program, you might even find what the actual problem is -- and that it isn't an Xbase++ bug. Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas.GP@Charter.net web: http://www.Aerospace-History.net | |
Thomas Braun | Re: Buggy XbpStatic:SetCaption() on Mon, 16 Feb 2015 10:33:03 +0100 Andreas Gehrs-Pahl wrote: > Without this, there is no way that anyone can really help you. And when you > create this test program, you might even find what the actual problem is -- > and that it isn't an Xbase++ bug. sigh I have been throught this process so many times and discovered a lot of apparent Xbase++ bugs that actually where my own fault Thomas |