Extend IGlass Window Problems

BlitzMax Forums/BlitzMax Programming/Extend IGlass Window Problems

Hi Filax and All,

I've been working a bit with IGlass and I'm attempting to create a simple tilemap editor (I know, not another one!). However I'm attempting to Extend IGlass's basic window to create a simple tile selection window:

' This is a class that combines the IGlass elements to create a window that 
' allows the selection of tiles.

Include "../IGlass PC 1.5.1/IGL_Classe/Inc_IGlass.bmx"

Type TileWindow Extends IGL_Window
	
	Field tilesWidth:Int = 0 
	Field tilesHeight:Int = 0
	Field tileSize:Int = 0
	Field numTiles:Int = 0
	Field tiledImages:TImage
	Field sbarTexture:IGL_Scrollbar
	
	Method CreateIt:TileWindow(Caption:String,Px:Int,Py:Int,Tx:Int,Ty:Int, images:TImage, TileSize:Int, NumTiles:Int )
	
		Self.tileSize = TileSize
		Self.numTiles = NumTiles
		
		tiledImages = images
		
		tilesWidth = Tx / tileSize
		tilesHeight = Ty / tileSize
	
		BLock:Byte=True 	'Can be locked in place
		BMinimize:Byte=True 'Can be minimized
		BClose:Byte=True 	'Can be closed
		ClassType:Int=IGL_NormalWindow 'Is a normal window
		Super.Create(Caption,Px,Py,Tx,Ty,BLock, BMinimize, BClose, ClassType)
		
		sbarTx:Int = 8
		sbarPx:Int = sbarTx - 8
		
		sbarTexture = IGL_Scrollbar.Create(Super,"",sbarPx,0,sbarTx,Ty,0.0,0.0,Float(NumTiles),1)
		
		Return Self
	End Method
	
	Method Refresh()
		'Super.Refresh()
		'Draw array of textures on texture window
		Local posx:Int = Px+5
		Local posy:Int = Py+25
		
		Local index:Int = sbarTexture.Value
		
		For Local x:Int = 0 To tilesWidth-1
			For Local y:Int = 0 To tilesHeight-1
				DrawImage( tiledImages, posx, posy, index )
				index:+1
				index:Mod numTiles
				posy:+tileSize
			Next 
			posy = Py+tileSize
			posx:+tileSize
		Next
		
	End Method

	
End Type

'Rem 
'Test Harness

Graphics 640, 480, 0

IGL_InitGUI(1)

' Build an editor window e.g. list of textures and scroll bar!
Global wndTexture:TileWindow
Global tileImage:TImage = LoadAnimImage("spiral.png", 32, 32, 0, 100, FILTEREDIMAGE|MASKEDIMAGE)
'CreateIt:TileWindow(Caption:String,Px:Int,Py:Int,Tx:Int,Ty:Int, images:TImage, TileSize:Int, NumTiles:Int )
wndTexture= New TileWindow.CreateIt("Textures",10,10,135,395,tileImage,32,100)
' Why does field not surface in child
wndTexture.Alpha=1.0


While Not KeyHit(KEY_ESCAPE)
	Cls
	IGL_RefreshGUI()
	wndTexture.Refresh()
	Flip
	FlushMem
Wend

'End Rem


However I'm unable to get the new window to refresh without directly calling it's refresh method. I'm at a loss at the moment as this is basic OO stuff (althoght I've probably missed something;o)!

So how do I extend a window and it's Refresh method to create my own windows?

Regards

Merx