Re: [perl-win32-gui] -style definitely deprecated
Aldo Calpini wrote: Ludvig af Klinteberg wrote: Why doesn't -visible = 1/0 use -addstyle or -remstyle instead? That would avoid a bug that could be hard to track for anyone who doesn't know about this. Or maybe I'm completely off track now? chances are that you're off track ;-) I don't understand what you mean here: -visible = 1/0 really uses internally the same method as -addstyle/-remstyle. Hmm... I don't really understand what I was thinking there... Forget it. I blame temporary mental unstability. -Ludde
Re: [perl-win32-gui] -style definitely deprecated
Ludvig af Klinteberg wrote: Why doesn't -visible = 1/0 use -addstyle or -remstyle instead? That would avoid a bug that could be hard to track for anyone who doesn't know about this. Or maybe I'm completely off track now? chances are that you're off track ;-) I don't understand what you mean here: -visible = 1/0 really uses internally the same method as -addstyle/-remstyle. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;
Re: [perl-win32-gui] -style definitely deprecated
[EMAIL PROTECTED] wrote: Aldo, Quick comment. I have a window that I defined with -style = WS_OVERLAPPED. This produced a window with a titlebar with no minimzie/maximize/close buttons on it. Now that I use -addstyle = WS_OVERLAPPED I will get a window with minimize/maximize/close buttons. Is this a bug? no, no and no. the *real* *deal* here is that, ideally, you should never have to mess with style constants, but rather stick with the provided options. I say 'ideally' because implementing ALL of them is a fairly huge task, and in fact there are a number of things that can be achieved only by mangling the style. still, the word of wisdom is (pardon the caps): IF YOU ARE WORKING WITH STYLE CONSTANTS, YOU ARE EXPECTED TO HAVE A GOOD UNDERSTANDING OF WHAT'S HAPPENING BEHIND THE SCENES (eg. have a copy of the MSDN library handy), OTHERWISE PLEASE DON'T MESS AT ALL!!! in your case what's happening is: a Window is by default created with the WS_OVERLAPPEDWINDOW style, which is a combination of the following styles: WS_OVERLAPPED WS_SYSMENU WS_THICKFRAME WS_MINIMIZEBOX WS_MAXIMIZEBOX by using -style, you are negating everything except WS_OVERLAPPED, which is what you want to have. by using -addstyle instead you are adding WS_OVERLAPPED to WS_OVERLAPPEDWINDOW, which already contains it, so in practice you're changing nothing. I didn't say that you should blindly s/-style/-addstyle/, but that most of the times -addstyle is more convenient for you; and that in any case where you're using styles, you're swimming in undocumented, unimplemented, unreliable water. I can't stress this enough: all the -style stuff is provided as a low level access for who has the guts to play with the internals of the Windows APIs, it's not intended to be a commonly useable feature. BTW, in v0.0.490 I've added the following options to the Window and DialogBox classes: -topmost = 1/0 -minimizebox = 1/0 -maximizebox = 1/0 -sizable = 1/0 -menubox = 1/0 it's highly recommended to use these, instead of anything that has to do with style. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;
[perl-win32-gui] -style definitely deprecated
Hello perl-win32-gui, please take note that in latest version (v0.0.490) I've added the following options which are available to all window types: -addstyle (synonim: -pushstyle) -remstyle (synonims: -popstyle/-notstyle/-negstyle) along with their 'ex' counterparts for dwExStyle: -addexstyle (synonim: -pushexstyle) -remexstyle (synonims: -popexstyle/-notexstyle/-negexstyle) that said, you should ALWAYS use them and NEVER MORE use -style, which is *absolutely* deprecated (unless you are prepared to accept the consequences ;-). to clarify the question: several options are internally converted to bits of styles; for example, adding the option -visible = 1 really means, to the underlying Win32 APIs, to turn on the WS_VISIBLE bit in a DWORD that holds all the style information. by using -style you are explicitly giving the *whole* value for this DWORD, so you are mangling the rest of the options you're giving, as well as estabilished default styles for various window types. also note that options are processed in order of appearance, so this snippet: -visible = 1, -style = WS_BORDER | WS_DISABLED, gives the (probably undesired) result of the window not being visible, because the style (which has been added the WS_VISIBLE flag) is then replaced by WS_BORDER | WS_DISABLED, thus WS_VISIBLE is gone away. everything is perfectly fine if you use instead: -visible = 1, -addstyle = WS_BORDER | WS_DISABLED, which produces the (probably ;-) expected result. I hope all this makes some sense: if it does not for you, please forget all the ranting about WS_* and DWORDs and simply NEVER, NEVER EVER use -style in your scripts. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;
Re: [perl-win32-gui] -style definitely deprecated
Aldo Calpini wrote: to clarify the question: several options are internally converted to bits of styles; for example, adding the option -visible = 1 really means, to the underlying Win32 APIs, to turn on the WS_VISIBLE bit in a DWORD that holds all the style information. by using -style you are explicitly giving the *whole* value for this DWORD, so you are mangling the rest of the options you're giving, as well as estabilished default styles for various window types. Why doesn't -visible = 1/0 use -addstyle or -remstyle instead? That would avoid a bug that could be hard to track for anyone who doesn't know about this. Or maybe I'm completely off track now? -Ludde
Re: [perl-win32-gui] -style definitely deprecated
Aldo, Quick comment. I have a window that I defined with -style = WS_OVERLAPPED. This produced a window with a titlebar with no minimzie/maximize/close buttons on it. Now that I use -addstyle = WS_OVERLAPPED I will get a window with minimize/maximize/close buttons. Is this a bug? Thanks, Felice Aldo Calpini [EMAIL PROTECTED] on 11/14/2000 08:47:27 AM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Felice Vittoria/Aut/Schneider) Subject: [perl-win32-gui] -style definitely deprecated Hello perl-win32-gui, please take note that in latest version (v0.0.490) I've added the following options which are available to all window types: -addstyle (synonim: -pushstyle) -remstyle (synonims: -popstyle/-notstyle/-negstyle) along with their 'ex' counterparts for dwExStyle: -addexstyle (synonim: -pushexstyle) -remexstyle (synonims: -popexstyle/-notexstyle/-negexstyle) that said, you should ALWAYS use them and NEVER MORE use -style, which is *absolutely* deprecated (unless you are prepared to accept the consequences ;-). to clarify the question: several options are internally converted to bits of styles; for example, adding the option -visible = 1 really means, to the underlying Win32 APIs, to turn on the WS_VISIBLE bit in a DWORD that holds all the style information. by using -style you are explicitly giving the *whole* value for this DWORD, so you are mangling the rest of the options you're giving, as well as estabilished default styles for various window types. also note that options are processed in order of appearance, so this snippet: -visible = 1, -style = WS_BORDER | WS_DISABLED, gives the (probably undesired) result of the window not being visible, because the style (which has been added the WS_VISIBLE flag) is then replaced by WS_BORDER | WS_DISABLED, thus WS_VISIBLE is gone away. everything is perfectly fine if you use instead: -visible = 1, -addstyle = WS_BORDER | WS_DISABLED, which produces the (probably ;-) expected result. I hope all this makes some sense: if it does not for you, please forget all the ranting about WS_* and DWORDs and simply NEVER, NEVER EVER use -style in your scripts. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;