wxMDIParentFrame ?

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Javaca
New User
New User
Posts: 5
Joined: Fri Oct 28, 2011 11:34 am

wxMDIParentFrame ?

Post by Javaca »

Hello mans!
I am newbie. Anybody can show me an wxMDIParentFrame example code + wxMDIChildFrame example code for PureBasic? I am using PB 4.51 and wxWidget Port for PB.

Thank you.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: wxMDIParentFrame ?

Post by IdeasVacuum »

...have you taken a look at the examples supplied with the package?

http://www.purebasic.fr/english/viewtopic.php?t=35923
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Javaca
New User
New User
Posts: 5
Joined: Fri Oct 28, 2011 11:34 am

Re: wxMDIParentFrame ?

Post by Javaca »

The package don't have MDI examples.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: wxMDIParentFrame ?

Post by IdeasVacuum »

.... if you can follow the example for a regular frame (window), then MDI should be similar, the wxWidget online notes should help? :|
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Javaca
New User
New User
Posts: 5
Joined: Fri Oct 28, 2011 11:34 am

Re: wxMDIParentFrame ?

Post by Javaca »

This is my example MDI code. The wxMDIChildFrame_Create did not work. Why ?

Code: Select all

XIncludeFile ( #PB_Compiler_Home + "include/inc.wx.pbi")

EnableExplicit

Global APP.i	

Procedure OnInit()
  Protected frame
  Protected mdiparent
  Protected mdichild
  
  frame = wxFrame()
  mdiparent = wxMDIParentFrame()
  mdichild = wxMDIChildFrame()
  
  wxFrame_Create(frame, 0, -1, "", wxSize(-1,-1), wxSize(640,480), #wxDEFAULT_FRAME_STYLE, "frame")		
  wxFrame_Maximize (frame, #True)
  
  ;wxMDIParentFrame_RegisterVirtual(mdiparent, wxMDIParentFrame_OnCreateClient(mdiparent))
  ;wxMDIParentFrame_OnCreateClient(mdiparent)
  
  wxMDIParentFrame_Create(frame, 0, -1, "Parent window", wxSize(-1,-1), wxSize(640,480), #wxDEFAULT_FRAME_STYLE, "frame")
	
	;wxMDIChildFrame_Activate (mdiparent)
	wxMDIChildFrame_Create(mdichild, mdiparent, -1, "Child window", wxSize(-1,-1), wxSize(100,100), #wxDEFAULT_FRAME_STYLE, "mdiparent")
	
	wxWindow_Show(frame,#True)

	ProcedureReturn wxApp_OnInit(app)
	
EndProcedure

Procedure OnExit()	
	ProcedureReturn wxApp_OnExit(app)
EndProcedure	

Procedure Main()	
	app 	= wxApp() 
	wxApp_RegisterVirtual(app,@OnInit(),@OnExit())	
	wxApp_Run(0,0)	
EndProcedure:Main()
Post Reply