> > 5.
> > If -style need to be deprecated, i don't think it's a good idea to
> > a add -forcestyle.
> > We keep -style without deprecated warning message.
> > Or, we remove it and force people to use registered class for fix
> > a default style.
> >
> > For me, -style don't need to be deprecated.
> > It's a programmer choice (and supposed know what he's doing ;o).
> > -popstyle/-pushstyle for set/reset a specific control style.
> > -style are usefull for set a fixed style.
>
> There is also -addstyle and -remstyle, so really -style isn't that
> necessary.
It's do same job :
-addstyle == -pushstyle
-popstyle == -remstyle == -notstyle == -negstyle
from GUI_Options :
} else if(strcmp(option, "-style") == 0) {
next_i = i + 1;
perlcs->cs.style = (DWORD) SvIV(ST(next_i));
if(PL_dowarn) {
warn("Win32::GUI: the -style option is deprecated!");
}
} else if(strcmp(option, "-pushstyle") == 0
|| strcmp(option, "-addstyle") == 0) {
next_i = i + 1;
perlcs->cs.style |= (DWORD) SvIV(ST(next_i));
} else if(strcmp(option, "-popstyle") == 0
|| strcmp(option, "-remstyle") == 0
|| strcmp(option, "-notstyle") == 0
|| strcmp(option, "-negstyle") == 0) {
next_i = i + 1;
perlcs->cs.style ^= (DWORD) SvIV(ST(next_i));
I think we have a bug on -remstyle like options.
If you remove a style not set, you push it !!!!
#perl
# remstyle on a set style
$var = 1;
$var ^= 1;
print "$var\n"; # print 0 OK
# remstyle on a not set style
$var = 2;
$var ^= 1;
print "$var\n"; # print 3 Wrong !!!
# correct remstyle
$var = 3;
$var &= $var ^ 1;
print "$var\n"; # print 2 OK
So if we correct this, and use a -remstyle => 0xFFFFFFFF and a -addstyle
this work like -style option.
$W->AddLabel(
-text => 'Hello, world',
-name => 'Hello',
-left => 25,
-top => 25,
-remstyle => 0xFFFFFFFF,
-addstyle => WS_VISIBLE | WS_CHILD | SS_CENTER;
);
I don't know if it's possible to have an order parse options problem.
But, it's not very nice. -style option is better.
-style option have is avantage than others -*style options haven't (and
reverse is true).
It's why i think it's not need to be deprecated (actually warm message and
probably remove in futur version).
So, keep both and use as appropriate ;o)
Laurent.