MX2 – mojox example

This is a little example to show how is ‘built’ a mojox GUI application!

#import "<std>"
#import "<mojo>"
#import "<mojox>"
 
Using std..
Using mojo..
Using mojox..
 
Class MyWindow Extends Window
 
	Method New()
		Super.New( "Button Demo",640,480,WindowFlags.Resizable )


		Local buttons:=New Button[5]
		Local buttons2:=New Button[5]
		
		
		For Local i:=0 To 4
			buttons[i]=New PushButton("Button "+i)
			buttons2[i]=New PushButton("Button2 "+i)
			'buttons2[i].Style.BackgroundColor=Color.Red
		Next
	
		Local mainview:=New DockingView
			
		Local d:=New DockingView
		Local d2:=New DockingView
		
		For Local i:=0 Until 5
			d.AddView(buttons[i],"left")
			d2.AddView(buttons2[i],"left")
		Next
		
		d.Layout="stretch" ' STRETCH the contents of this container (buttons) to fit the 'mainview' size
		d2.Layout="float"
		d.Style.BackgroundColor=Color.Red
		
		mainview.AddView(d,"top")
		mainview.AddView(d2,"top")	
				
		ContentView=mainview 
		
	
		
	End
	
End
 
Function Main()
 
	New AppInstance
	
	New MyWindow
	
	App.Run()
End
mojox-gui example

mojox-gui layout example

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close