Re: Win32Lib bug?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Nov 17, 2000
- 457 views
Matt, Sorry to disagree, but I *tested* my suggestion, and it *did* work. A program with the following style (the modal example in Win32Lib): "constant aModalWindow = create( Window, "This is a Modal Window", TheWindow, 50, 80, 400, 200, or_all({WS_DLGFRAME, WS_SYSMENU}) )", used to create a window which was not resizeable, but with recent version of Win32Lib it *is* resizeable; with my suggested alteration it is now again *not* resizeable. I don't have any idea whether this is a *good* way to do it or not, just that it does work; it allows the programmers selected window styles to in fact be applied, just them, and *not* be "added" to the default styles, but rather *replaces* them for a single window. Dan ----- Original Message ----- From: "Matthew Lewis" <MatthewL at KAPCOUSA.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, November 17, 2000 9:14 AM Subject: Re: Win32Lib bug? > > From: Dan B Moyer > > > in "procedure createWindow", > > after "if flags!=0 then" > > find "lFlags=or_bits(flags,lFlags)", > > and change it to: > > "lFlags= flags --or_bits(flags,lFlags)"; > > The code that's there shouldn't stop the user specified styles from taking > effect. The problem is that the default style for a window is > WS_OVERLAPPEDWINDOW, which contains the WS_SIZEBOX/THICKFRAM style, allowing > sizing. You need to use classDefaults() to modify this: > > --begin code > include win32lib.ew > constant > NoSizeWin = or_all( {WS_DLGFRAME, > WS_SYSMENU, > WS_MINIMIZEBOX} ) > junk = classDefaults(Window, { {CCflags, {NoSizeWin}}, {}}) > constant > MyNoSizeWin = create( Window, "No Size Window", 0, 20, 20, 200, 200, 0) > > WinMain( MyNoSizeWin, Normal) > -- end code > > > Maybe there's a better way, but that's all I could find. > > Hopefully Derek > > will CHANGE THIS BACK, so the programmer can specify window > > styles easily?? > > You could also use removeStyle() and addStyle() after window creation, but > classDefaults() seems a bit cleaner. Since classDefaults() returns the old > setting, you can easily reset the defaults: > > junk = classDefaults(Window, junk ) > > right after you create the window. Unfortunately, I don't see an easy way > around this type of conflict. I think it's just part of the learning curve > with windows. No matter how many different window classes are created, > someone will find a new combination that doesn't work (although it would be > simpler in many cases). > > Matt Lewis > http://www.realftp.com/matthewlewis