[vwnc] floating/palette window in VW?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] floating/palette window in VW?

Mark Plas

Hello,

 

I would like to create a window in VW that floats on top of another, linked, window (the so called ‘master’). A bit like a palette window in painting applications. I know there exists a window type #reserved in VW that can turn a window into one that always floats on top of every other window. It also reduces the title bar height a bit which gives it a nice look.

 

There are however a few problems with it:

 

First, it is called #reserved so it may not be a long term solution.

 

Second: the window floats on top of every window on your computer. Not only the master window, not only VW windows, but every window (also outlook, word, explorer). I would like to have it floating above the master window only, not the other ones.

 

Third problem: I want to display a list of items in the window and offer a menu to do some things with it. When I open a menu in this window, it appears underneath the floating window which makes it useless.

 

Do you have some ideas about how to accomplish this?

 

On top of this: people around here would like to see this window with ‘rounded corners’, a bit like modern UIs such as used in the Vista look of MSN messenger, not the windows 95 look. How could I do that?

 

The ideal solution may be to just have a window that doesn’t draw anything itself and on which I can draw whatever I want and that floats on top of another master window. If I could specify its shape that would a plus, but if it could only have ‘rounded corners’ (whatever that may be) it would also be ok.

 

I already found some windows API calls (in James Robertson’s Twitter application) that allow me to make a specific color of a window completely transparent and act as a hole (when you click on it, the window below receives the click), so this can be used to achieve the round corners effect, at the expense of not using that color anywhere else in the window.

 

Thanks,

Mark


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

[vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

Mark Plas
This is a continuation of my first email about 'floating/palette window in VM'.

Runar Jordahl already gave me a tip to look at the Epigent packages in the public repository which put me on track right away. Thanks again Runar.

Then I did some experiments and I'm getting close to what I want. There is however a problem with transparant windows. To reproduce it, load the " Epigent Application Window Styles" package from the public repository and then do this:


        |applicationWindow|
        applicationWindow := ApplicationWindow new.
        applicationWindow open.
        applicationWindow makeTransparent: 0.2.


Next do this:

        Rectangle fromUser.


When you do the 2nd statement, the transparent window disappears, only to reappear a first time (very briefly) when you select the top left corner of the rectangle, and then reappearing completely when the entire rectangle is selected.

So I've looked in the VM source to see what could cause this. The #fromUser method calls two primitives that are handled by "ntanim.c" (primDragShape & primResizeRectangle). I think the cause for this problem has to do with 'createHiddenFullScreenWindow();' both of them perform. This is the function:

static void
createHiddenFullScreenWindow()
{
        ignoreRepaintEvents = TRUE;
    if (!hiddenTopWindow)
        hiddenTopWindow = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW,
                                         kHIDDEN_WINDOW_CLASS_NAME,
                                         AppName,
#if !defined(WS_EX_TRANSPARENT)
# define WS_EX_TRANSPARENT 0
#endif
                                         WS_POPUP|WS_VISIBLE|WS_EX_TRANSPARENT,
                                         screenOriginX,
                                         screenOriginY,
                                         screenCornerX - screenOriginX,
                                         screenCornerY - screenOriginY,
                                         NULL,
                                         NULL,
                                         gblhInstance,
                                         NULL);
}


It creates a full screen window that's transparent and top_most. I'm not very sure what the reason for this window is, but I suspect it to be the cause for the disappearing window. At first I thought the reason for this window was to be able to draw anything onto the screen, but then I found this primitive:

private oop
primDisplayShape(oop receiver, oop shapeOop, oop lineWidthOop,
                 oop xOop, oop yOop, oop millisecondsOop)

...which does something similar as the aforementioned primitives, but doesn't call createHiddenFullScreenWindow() and the problem doesn't occur when I call this primitive.

Does anyone have an idea what might be the reason why the window temporarily disappears and what I can do about it?

Thanks in advance,
Mark

-----Original Message-----
From: Runar Jordahl [mailto:[hidden email]]
Sent: woensdag 15 oktober 2008 12:58
To: Mark Plas
Subject: Re: [vwnc] floating/palette window in VW?

You might want to look at
http://www.cincomsmalltalk.com/publicRepository/Epigent%20Application%20Window%20Styles.html

2008/10/15 Mark Plas <[hidden email]>:

> Hello,
>
>
>
> I would like to create a window in VW that floats on top of another, linked,
> window (the so called 'master'). A bit like a palette window in painting
> applications. I know there exists a window type #reserved in VW that can
> turn a window into one that always floats on top of every other window. It
> also reduces the title bar height a bit which gives it a nice look.
>
>
>
> There are however a few problems with it:
>
>
>
> First, it is called #reserved so it may not be a long term solution.
>
>
>
> Second: the window floats on top of every window on your computer. Not only
> the master window, not only VW windows, but every window (also outlook,
> word, explorer). I would like to have it floating above the master window
> only, not the other ones.
>
>
>
> Third problem: I want to display a list of items in the window and offer a
> menu to do some things with it. When I open a menu in this window, it
> appears underneath the floating window which makes it useless.
>
>
>
> Do you have some ideas about how to accomplish this?
>
>
>
> On top of this: people around here would like to see this window with
> 'rounded corners', a bit like modern UIs such as used in the Vista look of
> MSN messenger, not the windows 95 look. How could I do that?
>
>
>
> The ideal solution may be to just have a window that doesn't draw anything
> itself and on which I can draw whatever I want and that floats on top of
> another master window. If I could specify its shape that would a plus, but
> if it could only have 'rounded corners' (whatever that may be) it would also
> be ok.
>
>
>
> I already found some windows API calls (in James Robertson's Twitter
> application) that allow me to make a specific color of a window completely
> transparent and act as a hole (when you click on it, the window below
> receives the click), so this can be used to achieve the round corners
> effect, at the expense of not using that color anywhere else in the window.
>
>
>
> Thanks,
>
> Mark
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

Steven Kelly
[vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem
I've not looked at the latest VM code for Rectangle>>fromUser, so what I say is based on earlier VMs. The full screen window was to be able to fake drawing outside of VW bounds (which the VM can't do). Instead, it created a new window, the size of the whole screen, and drew to that. It used to copy the whole contents of the screen and display it in the new window, which was a real performance hog on some graphics cards if the content was big (large screen, high colour depth). If it now uses transparency, that's an improvement.
 
Transparent windows can however cause more flickering on open in my experience. With the TransparentWindows (?) package it's best to make windows transparent by hooking in to an event that occurs during opening, rather than after open:
 
postBuildWith: aBuilder
 | w |
 super postBuildWith: aBuilder.
 w := aBuilder window.
 w when: #opening send: #makeTransparent to: w.
 
That might help you at the #open stage of your example, but probably not at the #fromUser stage.
 
Steve


From: [hidden email] on behalf of Mark Plas
Sent: Thu 10/16/2008 10:21
To: [hidden email]
Subject: [vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

This is a continuation of my first email about 'floating/palette window in VM'.

Runar Jordahl already gave me a tip to look at the Epigent packages in the public repository which put me on track right away. Thanks again Runar.

Then I did some experiments and I'm getting close to what I want. There is however a problem with transparant windows. To reproduce it, load the " Epigent Application Window Styles" package from the public repository and then do this:


        |applicationWindow|
        applicationWindow := ApplicationWindow new.
        applicationWindow open.
        applicationWindow makeTransparent: 0.2.


Next do this:

        Rectangle fromUser.


When you do the 2nd statement, the transparent window disappears, only to reappear a first time (very briefly) when you select the top left corner of the rectangle, and then reappearing completely when the entire rectangle is selected.

So I've looked in the VM source to see what could cause this. The #fromUser method calls two primitives that are handled by "ntanim.c" (primDragShape & primResizeRectangle). I think the cause for this problem has to do with 'createHiddenFullScreenWindow();' both of them perform. This is the function:

static void
createHiddenFullScreenWindow()
{
        ignoreRepaintEvents = TRUE;
    if (!hiddenTopWindow)
        hiddenTopWindow = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW,
                                         kHIDDEN_WINDOW_CLASS_NAME,
                                         AppName,
#if !defined(WS_EX_TRANSPARENT)
# define WS_EX_TRANSPARENT 0
#endif
                                         WS_POPUP|WS_VISIBLE|WS_EX_TRANSPARENT,
                                         screenOriginX,
                                         screenOriginY,
                                         screenCornerX - screenOriginX,
                                         screenCornerY - screenOriginY,
                                         NULL,
                                         NULL,
                                         gblhInstance,
                                         NULL);
}


It creates a full screen window that's transparent and top_most. I'm not very sure what the reason for this window is, but I suspect it to be the cause for the disappearing window. At first I thought the reason for this window was to be able to draw anything onto the screen, but then I found this primitive:

private oop
primDisplayShape(oop receiver, oop shapeOop, oop lineWidthOop,
                 oop xOop, oop yOop, oop millisecondsOop)

...which does something similar as the aforementioned primitives, but doesn't call createHiddenFullScreenWindow() and the problem doesn't occur when I call this primitive.

Does anyone have an idea what might be the reason why the window temporarily disappears and what I can do about it?

Thanks in advance,
Mark

-----Original Message-----
From: Runar Jordahl [[hidden email]]
Sent: woensdag 15 oktober 2008 12:58
To: Mark Plas
Subject: Re: [vwnc] floating/palette window in VW?

You might want to look at
http://www.cincomsmalltalk.com/publicRepository/Epigent%20Application%20Window%20Styles.html

2008/10/15 Mark Plas <[hidden email]>:


> Hello,
>
>
>
> I would like to create a window in VW that floats on top of another, linked,
> window (the so called 'master'). A bit like a palette window in painting
> applications. I know there exists a window type #reserved in VW that can
> turn a window into one that always floats on top of every other window. It
> also reduces the title bar height a bit which gives it a nice look.
>
>
>
> There are however a few problems with it:
>
>
>
> First, it is called #reserved so it may not be a long term solution.
>
>
>
> Second: the window floats on top of every window on your computer. Not only
> the master window, not only VW windows, but every window (also outlook,
> word, explorer). I would like to have it floating above the master window
> only, not the other ones.
>
>
>
> Third problem: I want to display a list of items in the window and offer a
> menu to do some things with it. When I open a menu in this window, it
> appears underneath the floating window which makes it useless.
>
>
>
> Do you have some ideas about how to accomplish this?
>
>
>
> On top of this: people around here would like to see this window with
> 'rounded corners', a bit like modern UIs such as used in the Vista look of
> MSN messenger, not the windows 95 look. How could I do that?
>
>
>
> The ideal solution may be to just have a window that doesn't draw anything
> itself and on which I can draw whatever I want and that floats on top of
> another master window. If I could specify its shape that would a plus, but
> if it could only have 'rounded corners' (whatever that may be) it would also
> be ok.
>
>
>
> I already found some windows API calls (in James Robertson's Twitter
> application) that allow me to make a specific color of a window completely
> transparent and act as a hole (when you click on it, the window below
> receives the click), so this can be used to achieve the round corners
> effect, at the expense of not using that color anywhere else in the window.
>
>
>
> Thanks,
>
> Mark
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

Mark Plas
[vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

Hi Steve,

 

Thanks for explaining the reasoning behind the hidden full screen window.

 

In my code (not in the example) I already make the window transparent while it’s opening, not after it is open, so that’s not a problem here. The problems start when calling the dragShape and resizeRectangle primitives. These make every transparent window disappear until the primitive returns which is unfortunate because I was going to use those to allow a user to resize and drag my window.

 

I don’t know why the windows disappear. Perhaps the code in the primitives still make a copy of the whole screen but without the already transparent windows and then display that, making every transparent window disappear, but I don’t see where this is happening.

 

The displayShape primitive also draws on the screen but without making the windows disappear, so it is possible to do this. The main thing that is different is the call to createHiddenFullScreenWindow.

 

As a very short term fix I was thinking about switching my window to opaque when trying to resize or move it. In the longer term I’ll probably have to write the primitive code in the image by using #displayShape, unless someone knows how I can avoid to make the windows disappear of course.

 

Best regards,

Mark

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Steven Kelly
Sent: donderdag 16 oktober 2008 12:02
To: [hidden email]
Subject: Re: [vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

 

I've not looked at the latest VM code for Rectangle>>fromUser, so what I say is based on earlier VMs. The full screen window was to be able to fake drawing outside of VW bounds (which the VM can't do). Instead, it created a new window, the size of the whole screen, and drew to that. It used to copy the whole contents of the screen and display it in the new window, which was a real performance hog on some graphics cards if the content was big (large screen, high colour depth). If it now uses transparency, that's an improvement.

 

Transparent windows can however cause more flickering on open in my experience. With the TransparentWindows (?) package it's best to make windows transparent by hooking in to an event that occurs during opening, rather than after open:

 

postBuildWith: aBuilder

 | w |
 super postBuildWith: aBuilder.
 w := aBuilder window.
 w when: #opening send: #makeTransparent to: w.

 

That might help you at the #open stage of your example, but probably not at the #fromUser stage.

 

Steve

 


From: [hidden email] on behalf of Mark Plas
Sent: Thu 10/16/2008 10:21
To: [hidden email]
Subject: [vwnc] Transparent windows & createHiddenFullScreenWindow in ntanim.c problem

This is a continuation of my first email about 'floating/palette window in VM'.

Runar Jordahl already gave me a tip to look at the Epigent packages in the public repository which put me on track right away. Thanks again Runar.

Then I did some experiments and I'm getting close to what I want. There is however a problem with transparant windows. To reproduce it, load the " Epigent Application Window Styles" package from the public repository and then do this:


        |applicationWindow|
        applicationWindow := ApplicationWindow new.
        applicationWindow open.
        applicationWindow makeTransparent: 0.2.


Next do this:

        Rectangle fromUser.


When you do the 2nd statement, the transparent window disappears, only to reappear a first time (very briefly) when you select the top left corner of the rectangle, and then reappearing completely when the entire rectangle is selected.

So I've looked in the VM source to see what could cause this. The #fromUser method calls two primitives that are handled by "ntanim.c" (primDragShape & primResizeRectangle). I think the cause for this problem has to do with 'createHiddenFullScreenWindow();' both of them perform. This is the function:

static void
createHiddenFullScreenWindow()
{
        ignoreRepaintEvents = TRUE;
    if (!hiddenTopWindow)
        hiddenTopWindow = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW,
                                         kHIDDEN_WINDOW_CLASS_NAME,
                                         AppName,
#if !defined(WS_EX_TRANSPARENT)
# define WS_EX_TRANSPARENT 0
#endif
                                         WS_POPUP|WS_VISIBLE|WS_EX_TRANSPARENT,
                                         screenOriginX,
                                         screenOriginY,
                                         screenCornerX - screenOriginX,
                                         screenCornerY - screenOriginY,
                                         NULL,
                                         NULL,
                                         gblhInstance,
                                         NULL);
}


It creates a full screen window that's transparent and top_most. I'm not very sure what the reason for this window is, but I suspect it to be the cause for the disappearing window. At first I thought the reason for this window was to be able to draw anything onto the screen, but then I found this primitive:

private oop
primDisplayShape(oop receiver, oop shapeOop, oop lineWidthOop,
                 oop xOop, oop yOop, oop millisecondsOop)

...which does something similar as the aforementioned primitives, but doesn't call createHiddenFullScreenWindow() and the problem doesn't occur when I call this primitive.

Does anyone have an idea what might be the reason why the window temporarily disappears and what I can do about it?

Thanks in advance,
Mark

-----Original Message-----
From: Runar Jordahl [[hidden email]]
Sent: woensdag 15 oktober 2008 12:58
To: Mark Plas
Subject: Re: [vwnc] floating/palette window in VW?

You might want to look at
http://www.cincomsmalltalk.com/publicRepository/Epigent%20Application%20Window%20Styles.html

2008/10/15 Mark Plas <[hidden email]>:
> Hello,
>
>
>
> I would like to create a window in VW that floats on top of another, linked,
> window (the so called 'master'). A bit like a palette window in painting
> applications. I know there exists a window type #reserved in VW that can
> turn a window into one that always floats on top of every other window. It
> also reduces the title bar height a bit which gives it a nice look.
>
>
>
> There are however a few problems with it:
>
>
>
> First, it is called #reserved so it may not be a long term solution.
>
>
>
> Second: the window floats on top of every window on your computer. Not only
> the master window, not only VW windows, but every window (also outlook,
> word, explorer). I would like to have it floating above the master window
> only, not the other ones.
>
>
>
> Third problem: I want to display a list of items in the window and offer a
> menu to do some things with it. When I open a menu in this window, it
> appears underneath the floating window which makes it useless.
>
>
>
> Do you have some ideas about how to accomplish this?
>
>
>
> On top of this: people around here would like to see this window with
> 'rounded corners', a bit like modern UIs such as used in the Vista look of
> MSN messenger, not the windows 95 look. How could I do that?
>
>
>
> The ideal solution may be to just have a window that doesn't draw anything
> itself and on which I can draw whatever I want and that floats on top of
> another master window. If I could specify its shape that would a plus, but
> if it could only have 'rounded corners' (whatever that may be) it would also
> be ok.
>
>
>
> I already found some windows API calls (in James Robertson's Twitter
> application) that allow me to make a specific color of a window completely
> transparent and act as a hole (when you click on it, the window below
> receives the click), so this can be used to achieve the round corners
> effect, at the expense of not using that color anywhere else in the window.
>
>
>
> Thanks,
>
> Mark
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc