MaxGUI - GetVersion command

BlitzMax Forums/MaxGUI Module/MaxGUI - GetVersion command

degac(Posted 2009) [#1]
As MaxGUI comes with 3 different 'GUI-modules' - each one with different version number, I think it's useful a new function to report the 'internal version & number' used.

In Maxgui.bmx
Rem
bbdoc: Return the internal MaxGUI version
about:
This function returns which module is used (Windows, FLTK, Cocoa) and its internal version
End Rem
Function GetVersion$()
Return maxgui_driver.GetVersion()
End Function


In driver.bmx
Type TMaxGUIDriver

	Field version_OS:String
	Field version_number:String
	Method GetVersion$() Abstract


In win32maxguiex.bmx
maxgui_driver = New TWindowsGUIDriver
maxgui_driver.version_OS="Windows"
maxgui_driver.version_number="0.64"
...
Type TWindowsGUIDriver Extends TMaxGUIDriver 
	...
	Method GetVersion$()
		Return version_OS+" "+version_number
	End Method


In FLTKmaxgui.bmx
Global FLDriver:TFLTKGUIDriver=New TFLTKGuiDriver
maxgui_driver.version_OS="FLTK"
maxgui_driver.version_number="1.43"
...
Type TFLTKGUIDriver Extends TMaxGUIDriver
	Method GetVersion$()
		Return version_OS+" "+version_number
	End Method

In cocoagui.bmx
maxgui_driver=New TCocoaMaxGuiDriver
maxgui_driver.version_OS="Cocoa"
maxgui_driver.version_number="1.43"
...
Type TCocoaMaxGUIDriver Extends TMaxGUIDriver
		
	Method GetVersion$()
		Return version_OS+" "+version_number
	End Method

I think it's handy.


Htbaa(Posted 2009) [#2]
You want GetVersion() to be in the global namespace? I don't think that would be a wise thing, considering the name of the function.
But true, it's always nice to be able to return this kind of information to the programmer and/or user.


degac(Posted 2009) [#3]

You want GetVersion() to be in the global namespace?


No, this is only an idea - based on the way MaxGUI works (it presents a non-oriented object interface to the user, so the need of a command-function).
You can call it - if you want - GetMaxGuiVersion() or simply use the maxgui_driver.GetVersion() method.


Htbaa(Posted 2009) [#4]
That would already be better as GetVersion() would be a pretty generic name :-)