1. Secondary window always on top

In the following program, Window 3 is always on top of Window 1 (parent).
Can you avoid? It use Win32Lib 0.50c.

Thanks,

Rodolfo Valeiras

---

include WIN32LIB.EW

constant
   V1 = create(Window, "Window 1",  0, Default, Default, 200, 200, 0),
   V2 = create(Window, "Window 2",  0, Default, Default, 300, 100, 0),
   V3 = create(Window, "Window 3", V1, Default, Default, 200, 300, 0),

   B2 = create(PushButton, "2", V1, 10, 10, 30, 30, 0),
   B3 = create(PushButton, "3", V1, 10, 50, 30, 30, 0)


procedure OnClick_B2()
   openWindow(V2, Normal)
end procedure
onClick[B2] = routine_id("OnClick_B2")

procedure OnClick_B3()
   openWindow(V3, Normal)
end procedure
onClick[B3] = routine_id("OnClick_B3")


WinMain(V1, Normal)

new topic     » topic index » view message » categorize

2. Re: Secondary window always on top

On Sat, 2 Sep 2000 21:01:12 +0200, Rodolfo Valeiras wrote:

>In the following program, Window 3 is always on top of Window 1 (parent).
>Can you avoid? It use Win32Lib 0.50c.
>
>Thanks,
>
>Rodolfo Valeiras
>
>---
>
>include WIN32LIB.EW
>
>constant
>   V1 = create(Window, "Window 1",  0, Default, Default, 200, 200, 0),
>   V2 = create(Window, "Window 2",  0, Default, Default, 300, 100, 0),
>   V3 = create(Window, "Window 3", V1, Default, Default, 200, 300, 0),
>
>   B2 = create(PushButton, "2", V1, 10, 10, 30, 30, 0),
>   B3 = create(PushButton, "3", V1, 10, 50, 30, 30, 0)
>
>
>procedure OnClick_B2()
>   openWindow(V2, Normal)
>end procedure
>onClick[B2] = routine_id("OnClick_B2")
>
>procedure OnClick_B3()
>   openWindow(V3, Normal)
>end procedure
>onClick[B3] = routine_id("OnClick_B3")
>
>
>WinMain(V1, Normal)

Sure, just 'create' it the same way that you created Window V2...  You
specified that V3 was a child of V1 but V2 as it's own window.  Since V3 is
a child of V1 it is kept on top of the parent until it is closed.  Try this:

constant
  V1 = create(Window, "Window 1", 0, Default, Default, 200, 200, 0),
  V2 = create(Window, "Window 2", 0, Default, Default, 300, 100, 0),
  V3 = create(Window, "Window 3", 0, Default, Default, 200, 300, 0),

-- Brian

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

3. Re: Secondary window always on top

> Sure, just 'create' it the same way that you created Window V2...  You
> specified that V3 was a child of V1 but V2 as it's own window.  Since V3
is
> a child of V1 it is kept on top of the parent until it is closed.

Thank you, Brian. But, it is possible to put a child window below her
parent?

Rodolfo.

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

4. Re: Secondary window always on top

The order that windows are displayed in, is called the Z-ORDER.

   The second parameter of SetWindowPos sets what order ( or place )

   a window will be displayed at ( it z-order position ).

   Also see functions BringWindowToTop, DeferWindowPos.

   By using these functions, you should be able to place a window

   above or below any other window.

   Bernie

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

Search



Quick Links

User menu

Not signed in.

Misc Menu