Child Windows?

BlitzMax Forums/MaxGUI Module/Child Windows?

William Drescher(Posted 2008) [#1]
Could someone please show me how to create a window that is a child to another window and that doesn't leave the parent window's borders?


SebHoll(Posted 2008) [#2]
Officially,MDI child windows aren't supported by MaxGUI as a cross platform solution is currently unavailable. What would you have been using them for?


jsp(Posted 2008) [#3]
As Seb said, they are not supported !!
Nevertheless they were working using the old MaxGui. So if you don't yet use the new MaxGuiEx, here is an example:



William Drescher(Posted 2008) [#4]
Quick note to all people using the new Win32MaxGUIEx:
This code works the same with the new module:
Import MaxGUI.Win32MaxGUI

Local MainWindow:TGadget = CreateWindow:TGadget("MainWindow",272,149,365,193,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_STATUS |WINDOW_CLIENTCOORDS )
	Local ChildWindow:TGadget = CreateWindow:TGadget("ChildWindow",243,71,99,105,MainWindow:TGadget,WINDOW_TITLEBAR|WINDOW_TOOL |WINDOW_CHILD)

Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			Select EventSource()
				Case MainWindow	MainWindow_WC( MainWindow:TGadget )
				Case ChildWindow	ChildWindow_WC( ChildWindow:TGadget )
			End Select

	End Select
Forever

Function MainWindow_WC( Window:TGadget )
	DebugLog "Window MainWindow wants to be closed"

	End
End Function

Function ChildWindow_WC( Window:TGadget )
	DebugLog "Window ChildWindow wants to be closed"

	End
End Function