From: Glenn L. <pe...@ne...> - 2004-10-07 22:15:32
|
On approximately 10/7/2004 2:23 PM, came the following characters from the keyboard of Laurent ROCHER: > Hi Blair, > > Fix and commit on CVS. > > Problem come from BS_CENTER style is BS_LEFT | BS_RIGHT so SwitchBit > order it's important. > > I rewrite like this : > > if(strcmp(option, "-align") == 0) { > // BS_CENTER is BS_LEFT | BS_RIGHT > if(strcmp(SvPV_nolen(value), "left") == 0) { > SwitchBit(perlcs->cs.style, BS_RIGHT, 0); > SwitchBit(perlcs->cs.style, BS_LEFT, 1); > } else if(strcmp(SvPV_nolen(value), "center") == 0) { > SwitchBit(perlcs->cs.style, BS_CENTER, 1); Shouldn't this be SwitchBit(perlcs->cs.style, BS_CENTER, 3); or alternately (to expose that BS_CENTER is BS_LEFT | BS_RIGHT) SwitchBit(perlcs->cs.style, BS_RIGHT, 1); SwitchBit(perlcs->cs.style, BS_LEFT, 1); > } else if(strcmp(SvPV_nolen(value), "right") == 0) { > SwitchBit(perlcs->cs.style, BS_LEFT, 0); > SwitchBit(perlcs->cs.style, BS_RIGHT, 1); > } else { > if(PL_dowarn) warn("Win32::GUI: Invalid value for -align!"); > } > } > > Thank for bug report. > > Laurent. > > > >>I've noticed that the button attribute "align" breaks if you specify >>"center", if empty it works (i.e. default). >> >><pre> >>use Win32::GUI; >>my $W = new GUI::Window(-height=>100,-width=>100); >>my $B = $W->AddButton(-text=>'Test', -width=>'100', -align=>'center'); >>$W->Center(); >>$W->Show(); >>Win32::GUI::Dialog; >></pre> >> >>If one replaces "center" with "right" it works as expected. The error is >>not apparent in Button.xs and I've happens on XPsp2 and W2Ksp4. >> >>Blair >> > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Perl-Win32-GUI-Hackers mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers > > > -- Glenn -- http://nevcal.com/ =========================== The best part about procrastination is that you are never bored, because you have all kinds of things that you should be doing. |