1. [WIN] Who wants a tough question?

Heya all!

Okay, this is a hard one for me...

Firstly, its great how things have changed in making windows. Its
really confusing now :-\

Secondly, how would I make a window with WS_DLGFRAME
functionality, but still shows up on the taskbar? (If at all possible?)

TIA,

--"LEVIATHAN"

new topic     » topic index » view message » categorize

2. Re: [WIN] Who wants a tough question?

Levi,

1.  Using which *version* of Win32Lib?
2.  With WS_DLGFRAME in *addition* to any default, or *all by itself*, or in
replacement for default and with others?

Dan Moyer

----- Original Message -----
From: "LEVIATHAN" <leviathan at USWEST.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, November 18, 2000 5:58 AM
Subject: [WIN] Who wants a tough question?


> Heya all!
>
> Okay, this is a hard one for me...
>
> Firstly, its great how things have changed in making windows. Its
> really confusing now :-\
>
> Secondly, how would I make a window with WS_DLGFRAME
> functionality, but still shows up on the taskbar? (If at all possible?)
>
> TIA,
>
> --"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

3. Re: [WIN] Who wants a tough question?

Heya Dan :)

> Levi,
>
> 1.  Using which *version* of Win32Lib?

*searches docs* I believe its .54 Bleeding Edge i've got :)

> 2.  With WS_DLGFRAME in *addition* to any default, or *all by itself*,
> or in replacement for default and with others?

I'd have to assume WS_DLGFRAME in addition to another default
(to get it to show up on the taskbar... for example, WS_DLGFRAME
and WS_CAPTION don't work together to make a WS_DLGFRAME
with the ability to show up on the taskbar, it looks like it makes a
standard WS_OVERLAPPEDWINDOW)...

I noted that all the window styles are hex... I assume there'd be
some way to combine these hex numbers together to come up with
my own window style (Such as getting a WS_DLGFRAME and
getting the window to show up on the taskbar)... is there an article
on MSDN on how to do this? if so, whats the URL?

TIA,

--"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

4. Re: [WIN] Who wants a tough question?

Hi Levi, :)

The reason I asked about what *version* of Win32Lib you were using is that
recent versions don't handle setting styles for windows quite like it used
to.  The new versions effectively "add" user selected styles *to* the
default, instead of replacing the default.  I think Derek should change it
back like it was, where *just* whatever you set as style flags for a window
was what you got, personally.

 In v0.50 you could just say "constant aWindow = create( Window, "This is a
Window", TheWindow, 50, 80, 400, 200, or_all({WS_DLGFRAME, WS_SYSMENU})  )",
and you would get *just* those two styles, together;  however, in v0.54,
there is a DEFAULT set which is *not* REPLACED by the user specified styles
as had previously been the case, but now the user specified styles are
"added" to the default by an or_all, unless they conflict, I guess, in which
case I'm guessing that the default OVERRIDES any conflicting user specified
style(s).

In v 0.54, the reason WS_DLGFRAME and WS_CAPTION don't work together to make
a WS_DLGFRAME with the ability to show up on the taskbar, but rather one
that looks like a standard WS_OVERLAPPEDWINDOW is because
WS_OVERLAPPEDWINDOW is what is set as the (non-replaceable) default, and it
already has WS_THICKFRAME as part of it, which overrides WS_DLGFRAME, I
think.

I think in versions *later* than 54 there are some specific commands for
changing the styles of a window, which doesn't help you, or you could use v
0.50, or you could change a couple of lines in 0.54 so it would behave
better.

Here's what I suggested a few posts back, and while Matthew says it's not
sufficient, I've tested it & it works ok as far as I can see:

in Win32Lib, v0.54,
in "procedure createWindow",
after "if flags!=0 then"
find "lFlags=or_bits(flags,lFlags)",
and change it to:
"lFlags= flags --or_bits(flags,lFlags)";

that will allow whatever *you* set as flags to be accepted and created,
without regard for the default setting. Of course, this *doesn't* help if
you want to distribute your program.


Regarding the fact that the styles are numbers in hex, that's not exactly
why you (could) combine the styles to your own desire, it's because the
numbers are treated as binary, with each bit having a meaning, and you could
previously "or" the numbers together, so each bit in every number would
contribute to the result.

Dan

----- Original Message -----
From: "LEVIATHAN" <leviathan at USWEST.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, November 18, 2000 7:06 PM
Subject: Re: [WIN] Who wants a tough question?


> Heya Dan :)
>
> > Levi,
> >
> > 1.  Using which *version* of Win32Lib?
>
> *searches docs* I believe its .54 Bleeding Edge i've got :)
>
> > 2.  With WS_DLGFRAME in *addition* to any default, or *all by itself*,
> > or in replacement for default and with others?
>
> I'd have to assume WS_DLGFRAME in addition to another default
> (to get it to show up on the taskbar... for example, WS_DLGFRAME
> and WS_CAPTION don't work together to make a WS_DLGFRAME
> with the ability to show up on the taskbar, it looks like it makes a
> standard WS_OVERLAPPEDWINDOW)...
>
> I noted that all the window styles are hex... I assume there'd be
> some way to combine these hex numbers together to come up with
> my own window style (Such as getting a WS_DLGFRAME and
> getting the window to show up on the taskbar)... is there an article
> on MSDN on how to do this? if so, whats the URL?
>
> TIA,
>
> --"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

5. Re: [WIN] Who wants a tough question?

Levi,

I just read an earlier post from Derek, and what he said there suggests that
I should mention that I don't know if the Win32Lib hack I suggested might
interfere with proper action of *other* control's styles or not.  And he
gives some suggestions which relate to what you want, though I still would
rather just be able to include the user specified styles simply & directly
in the windows create statement and have them *replace* the defaults.


Derek said:
Hi Brian,
I've been away on business, so sorry for the slow response.

>
> Question: Does 'create' still process flags?

Yes it does. In fact it works the same for all control types now. The
previous versions treated create() flags one way for Window controls and
another for other types. For Window, it used to replace the default flags
with any you might have specified, for others, it combined supplied flags
with the defaults. Now, Window works like the other controls.

> This works on version .50:
>
> constant
>   NoSizeWin = or_all( {WS_DLGFRAME,
>                        WS_SYSMENU,
>                        WS_MINIMIZEBOX} )
>
> constant
>   Win = create( Window, "Win", 0, 0, 0, 640, 480, NoSizeWin )
>
> -- Win is a Window that cannot be resized
>
> This no longer works in the latest release.  I don't have time to track it
> down because there have been so many changes lately...
>

To allow people complete flexibility when dealing with more complex flag
combinations, a new function, classDefaults() was set up. This function
allows you to set the default flags for a given control type. This can set
both the normal style flags and the extended style flags.

Given your example above, there are two basic ways to achieve what you want
to do.

1) --------------------
  sequence oldFlags
  atom NoSizeWin

  NoSizeWin = or_all( {WS_DLGFRAME,
                          WS_SYSMENU,
                          WS_MINIMIZEBOX} )
  -- Set default flags for Window to NoSizeWin
  oldflags = classDefaults(Window, {{CCflags, NoSizeWin} })

  -- Create a window using the (new) defaults
  Win = create( Window, "Win", 0, 0, 0, 640, 48, 0)

2) -------------------
  sequence oldFlags
  atom NoSizeWin

  NoSizeWin = or_all( {WS_DLGFRAME,
                          WS_SYSMENU,
                          WS_MINIMIZEBOX} )
  -- Set defaults for Window to zero (no flags at all)
  oldflags = classDefaults(Window, {{CCflags, 0}} )

  -- Create a window combining defaults (zero) with NoSizeWin
  Win = create( Window, "Win", 0, 0, 0, 640, 480, NoSizeWin)


To make this commonly used functionality easier to use, I'm packaging some
of the more useful Window flag combinations into reserved Win32Lib words.

David Cuny wants me to use these new words as Control Types but I would
rather them being used as Style Flags. So I'm very tempted to do both,
unless persuaded otherwise.

David's method:
   Win = create(NoSizeWindow, "Win", 0, 0, 0, 640, 480, 0)

Derek's method:
   Win = create(Window, "Win", 0, 0, 0, 640, 480, w32NoSizeWin)

My reasoning is that the first create() parameter describes a basic
behaviour, whereas the flags parameter describes a basic interface. Also,
having a "new" control type is adds more complexity in the library that I
don't think is justified for things that are essentially the same. For
example, there are many places in the library that does this sort of thing
...

  if window_type[id] = Window then ....

this might have to be changed to ...

  if find(window_type[id], {Window, NoSizeWindow, ...}) != 0 then ....

or maybe ...

  if and_bits(classAttr[window_type[id]], w32IsWindow) != 0 then ...


however, if we use these new words as predefined Window styles, the current
code is unchanged except in the create() function, with something like ...

   if equal(styleflag, w32NoSizeWin) then
       flags = or_bits(....)
   elsif ...
   else
       flags = or_bits(defaultflags, styleflags)
   end if

What does anybody else think?

------
Derek Parnell
Melbourne, Australia
(Vote [1] The Cheshire Cat for Internet Mascot)


----- Original Message -----
From: "LEVIATHAN" <leviathan at USWEST.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, November 18, 2000 7:06 PM
Subject: Re: [WIN] Who wants a tough question?


> Heya Dan :)
>
> > Levi,
> >
> > 1.  Using which *version* of Win32Lib?
>
> *searches docs* I believe its .54 Bleeding Edge i've got :)
>
> > 2.  With WS_DLGFRAME in *addition* to any default, or *all by itself*,
> > or in replacement for default and with others?
>
> I'd have to assume WS_DLGFRAME in addition to another default
> (to get it to show up on the taskbar... for example, WS_DLGFRAME
> and WS_CAPTION don't work together to make a WS_DLGFRAME
> with the ability to show up on the taskbar, it looks like it makes a
> standard WS_OVERLAPPEDWINDOW)...
>
> I noted that all the window styles are hex... I assume there'd be
> some way to combine these hex numbers together to come up with
> my own window style (Such as getting a WS_DLGFRAME and
> getting the window to show up on the taskbar)... is there an article
> on MSDN on how to do this? if so, whats the URL?
>
> TIA,
>
> --"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

6. Re: [WIN] Who wants a tough question?

----- Original Message -----
From: "Dan B Moyer" <DANMOYER at PRODIGY.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Sunday, November 19, 2000 4:54 PM
Subject: Re: [WIN] Who wants a tough question?


> Levi,

Hi Dan and others,
if you really insist on the old behaviour, the closest you can get to it is
this...

Put the following lines just after the include for win32lib.ew ...

   object whocares
   whocares = classDefaults(Window, {{CCflags,0}})

The rest of your code remains unchanged except for create(Window, ..., 0).
Any of these, you should change to

   win = create(Window, ..., WS_OVERLAPPEDWINDOW)


>
> I just read an earlier post from Derek, and what he said there suggests
that
> I should mention that I don't know if the Win32Lib hack I suggested might
> interfere with proper action of *other* control's styles or not.

Yes it will.

>  And he
> gives some suggestions which relate to what you want, though I still would
> rather just be able to include the user specified styles simply & directly
> in the windows create statement and have them *replace* the defaults.

And I'd rather the function had consistent behaviour with all controls.

And yet another idea to get around this idealogical impass, how about having
two functions like create(), one that behaves in the manner you are
describing, and the other just using the default flags.

   win = createStyledControl(<controltype>,
                       <caption>,
                       <parent>,
                       <left>,<top>,<width>,<height>,
                       {<styleflags, extendedstyleflags}>
                       )

   win = createControl(<controltype>,
                       <caption>,
                       <parent>,
                       <left>,<top>,<width>,<height>
                       )


------
Derek Parnell
Melbourne, Australia
(Vote [1] The Cheshire Cat for Internet Mascot)

new topic     » goto parent     » topic index » view message » categorize

7. Re: [WIN] Who wants a tough question?

> Hi Levi, :)
>
> The reason I asked about what *version* of Win32Lib you were using is
> that recent versions don't handle setting styles for windows quite
> like it used to.  The new versions effectively "add" user selected
> styles *to* the default, instead of replacing the default.  I think
> Derek should change it back like it was, where *just* whatever you set
> as style flags for a window was what you got, personally.

Agreed! I was getting quite used to being able to set the styles in the
create() statement, and I had to mess around with my code because
I had a whole bunch of global constants together, and now I've gotta
separate the Window create() constants from all the others :-\ But
hey, i'm a very flexible person, so I've got a hang of the
classDefault() deal.

Okay, what happend was that I has something going like this...

fmj_junk_000 = classDefaults(Window, {{CCflags,
WS_DLGFRAME, WS_SYSMENU}})

Now, with WS_DLGFRAME by itself, it gave me a WS_DLGFRAME
window. However, I add anything else to it, and it resorted to the
default WS_OVERLAPPEDWINDOW.

But shortly after I sent the email off, I figured out I could put in a
or_all()'d sequence to the sequence already there. (Which would
be... duh... [1][1][2] where the style resides... I shoulda figured this
out with what I've been doing forever in the create() function :)) This
came out looking like this:

fmj_junk_000 = classDefaults(Window, {{CCflags, or_all
({WS_DLGFRAME, WS_SYSMENU})}})

I mean, this still doesn't produce the desired result, but hey! I
learned something new! :)

So, my next best question would be: I have a WS_SYSMENU
window... how can I disable the close button in the upper right hand
corner? (I could use removeStyle()... but I don't see a declaration in
win32lib to add a close button, so I guess there isn't a way to
remove it... my next best plan would be, I suppose, to capture the
close signal off the button and point it to a blank procedure? Or send
a disable message to the button altogether?)

And as I sit here typing this, i'm trying to bang out these questions
with another programmer, and he found CS_NOCLOSE... I'd have to
define it in the window class before I go and create the window...
sooo... I know I've got classDefaults here, but its doing me no good
(Can only be used to change styles?)... So it looks like I'm gonna
get a lil gritty with this one :)

TIA,

--"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

8. Re: [WIN] Who wants a tough question?

Levi,

I'm a little confused :)

Didn't you want a WS_DLGFRAME window that would appear in the taskbar?  By
using the classDefault() deal (which I *haven't* got the hang of yet!),
don't
you get that??  You do when you use just WS_DLGFRAME in v0.50.

And when you say "I have a WS_SYSMENU  window... how can I disable the close
button in the upper right hand  corner? ", when you use the classDefault()
deal, doesn't that just *give* you the window with the close button
disabled?
It does with v0.50.  And is this a *new* window, or an *alternative* to the
WS_DLGFRAME one?

I'm not really clear any longer as to what kind of window your are trying to
make; if you haven't already solved your problem, can you enlighten me?

Dan


----- Original Message -----
From: "LEVIATHAN" <leviathan at USWEST.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Sunday, November 19, 2000 1:05 PM
Subject: Re: [WIN] Who wants a tough question?


> > Hi Levi, :)
> >
> > The reason I asked about what *version* of Win32Lib you were using is
> > that recent versions don't handle setting styles for windows quite
> > like it used to.  The new versions effectively "add" user selected
> > styles *to* the default, instead of replacing the default.  I think
> > Derek should change it back like it was, where *just* whatever you set
> > as style flags for a window was what you got, personally.
>
> Agreed! I was getting quite used to being able to set the styles in the
> create() statement, and I had to mess around with my code because
> I had a whole bunch of global constants together, and now I've gotta
> separate the Window create() constants from all the others :-\ But
> hey, i'm a very flexible person, so I've got a hang of the
> classDefault() deal.
>
> Okay, what happend was that I has something going like this...
>
> fmj_junk_000 = classDefaults(Window, {{CCflags,
> WS_DLGFRAME, WS_SYSMENU}})
>
> Now, with WS_DLGFRAME by itself, it gave me a WS_DLGFRAME
> window. However, I add anything else to it, and it resorted to the
> default WS_OVERLAPPEDWINDOW.
>
> But shortly after I sent the email off, I figured out I could put in a
> or_all()'d sequence to the sequence already there. (Which would
> be... duh... [1][1][2] where the style resides... I shoulda figured this
> out with what I've been doing forever in the create() function :)) This
> came out looking like this:
>
> fmj_junk_000 = classDefaults(Window, {{CCflags, or_all
> ({WS_DLGFRAME, WS_SYSMENU})}})
>
> I mean, this still doesn't produce the desired result, but hey! I
> learned something new! :)
>
> So, my next best question would be: I have a WS_SYSMENU
> window... how can I disable the close button in the upper right hand
> corner? (I could use removeStyle()... but I don't see a declaration in
> win32lib to add a close button, so I guess there isn't a way to
> remove it... my next best plan would be, I suppose, to capture the
> close signal off the button and point it to a blank procedure? Or send
> a disable message to the button altogether?)
>
> And as I sit here typing this, i'm trying to bang out these questions
> with another programmer, and he found CS_NOCLOSE... I'd have to
> define it in the window class before I go and create the window...
> sooo... I know I've got classDefaults here, but its doing me no good
> (Can only be used to change styles?)... So it looks like I'm gonna
> get a lil gritty with this one :)
>
> TIA,
>
> --"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

9. Re: [WIN] Who wants a tough question?

Hi Derek,

Ok, I understand your desire to make things "consistent", I'm just not sure
it's more important than keeping things *simple*, like they were; maybe it
is, I dunno.

But your second suggestion, having  two functions like create(), one that
allows user specified styles to be used *in place of defaults*,  and the
other just using the default flags (& presumably allowing *addition* of user
styles with the default?), seems to me to be a very good idea, I'm glad you
thought of it.

I'd vote to do that, but I'd suggest that you retain the use of "create" for
your "default only" one, and use "createSt" or "createStyled" for the "user
styles predominate" one, just to make typing easier.

Dan



----- Original Message -----
From: "Derek Parnell"


> <snip>
> And yet another idea to get around this idealogical impass, how about
having
> two functions like create(), one that behaves in the manner you are
> describing, and the other just using the default flags.
>
>    win = createStyledControl(<controltype>,
>                        <caption>,
>                        <parent>,
>                        <left>,<top>,<width>,<height>,
>                        {<styleflags, extendedstyleflags}>
>                        )
>
>    win = createControl(<controltype>,
>                        <caption>,
>                        <parent>,
>                        <left>,<top>,<width>,<height>
>                        )
>
>
> ------
> Derek Parnell
> Melbourne, Australia
> (Vote [1] The Cheshire Cat for Internet Mascot)

new topic     » goto parent     » topic index » view message » categorize

10. Re: [WIN] Who wants a tough question?

Heya Dan :)

> Levi,
>
> I'm a little confused :)

I tell ya, I really should practice my conversational skills :)

> Didn't you want a WS_DLGFRAME window that would appear in the taskbar?

Yep :)

>  By using the classDefault() deal (which I *haven't* got the hang of
> yet!), don't you get that??  You do when you use just WS_DLGFRAME in
> v0.50.

Really? in v0.51 a WS_DLGFRAME window doesn't come up on the
taskbar...

in 0.54 with classDefault(), I still don't get a WS_DLGFRAME
window to come up on the taskbar...

> And when you say "I have a WS_SYSMENU  window... how can I disable the
> close button in the upper right hand  corner? ", when you use the
> classDefault() deal, doesn't that just *give* you the window with the
> close button disabled?

In neither 0.51 or 0.54 have I got a WS_SYSMENU window with the
close button disabled...

> It does with v0.50.  And is this a *new*
> window, or an *alternative* to the WS_DLGFRAME one?

An alternative... sorry, I should've pointed that out :)

> I'm not really clear any longer as to what kind of window your are
> trying to make; if you haven't already solved your problem, can you
> enlighten me?

I'm sorry i've confused ya so much here, Dan, but I've been playing
around with things trying to get a WS_SYSMENU window
(Characteristics: non-resizable frame, comes up on the taskbar, has
a close box enabled on the upper-right side) and trying to disable
the close button, but still keep the rest of its characteristics. A
WS_DLGFRAME window, however, doesn't come up on the taskbar,
has a thin (non-resizable) frame, and doesn't close...

Anyway, I'm not sure if the close button has anything to do with the
_window style_ anymore, and I'm wondering if its part of the _class_
of a window. So, now I wonder, how do I get to play with the CS_*
flags to a control?

TIA,

--"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu