Re: Win32Lib bug?

new topic     » goto parent     » topic index » view thread      » older message » newer message

> 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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu