Modal dialogs

BlitzMax Forums/BlitzMax GUI Programming/Modal dialogs

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

@Dreamora: I'm going in the C# way, it's just not being shown in the example. let me show a more detailed one (with the region opened).

Import blide.blgui

Type WelcomeDialog Extends BGWindow  
	Field but1:BGGlowButton 
	'#Region  THIS CODE IS GENERATED BY THE GUI EDITOR
	Method Load()          
		Self.Create("This is my window", 10, 10, 400, 400, Null, enums.FormStyles.TitleBar | enums.FormStyles.IsResizable  )      'This is the window
		but1 = New BGGlowButton	'the window has a button called but1
		but1.Create(Self, "ok", 1, 40)    'the button is created

		'Handlers:
		Self.Event_Close = Welcomedialog_Close_Handler	'This is the function that will be called when the window is closed.
		Self.Event_Resize = WelcomeDialog_Resize_Handler ' This is the handler for resize window.
		but1.Event_Action = But1_EventAction_Handler	    'This is the function that is called when the button is pressed

	End Method    
	
	'This functions sends event-handling from generic functions the methods in the apropiate instance:
	'you can always change the original function pointers to anyway else.

	Function But1_EventAction_Handler(sender:BGBasicGadget,e:BGMouseEvent)     
     		WelcomeDialog(BGGlowButton(sender).GetWindow()).But1_Pressed(e)
	End Function 
                    
	Function Welcomedialog_Close_Handler(sender:bgbasicgadget, e:BGSimpleEvent)
		WelcomeDialog(sender).WelcomeDialog_Close(e) 
	End Function 
  
	Function WelcomeDialog_Resize_Handler(sender:bgbasicgadget, e:BGMouseEvent)
		WelcomeDialog(sender).WelcomeDialog_Resize(e)
	End Function
	'#End Region

	Method WelcomeDialog_Close(e:BGSimpleEvent)
		End
	End Method
	    
	Method But1_Pressed(e:BGMouseEvent)
		Notify("button pressed:  "    + but1.Text_get() + " contained in an object of type " +  but1.Container_Get().GetType()) + " mouse button used: " + e.Button + " Event identifier: " + e.id         	
	End Method 
End Type

Local I:WelcomeDialog= New WelcomeDialog 'Creates the instance
i.Load	'Creates the GUI elements and loads all the form

Repeat
	DoEvents()  	
Forever