
#include once "inc/iup.bi"
#include once "inc/iupcontrols.bi"
#include once "inc/iupimglib.bi"
#include once "inc/iupgl.bi"


data_classes:
data "button","radio","toggle"
data "hbox","vbox","zbox","sbox","cbox","fill"
data "dialog","frame","tabs","canvas","glcanvas"
data "menu","submenu","separator"

data "label","text","multiline"
data "list","item","spin","image"
data "matrix","cells","tree","progressbar"
data "dial","gauge","val","colorbrowser","colorbar","user"
data ""

sub _init_ constructor
  IupOpen(0,0)
  IupControlsOpen()
  IupGLCanvasOpen()
  IupImageLibOpen()
end sub

sub _exit_ destructor
  IupClose()
end sub

'
' main
'
const MAX_ATTRIBUTES = 1024
dim as zstring ptr ptr pList = new zstring ptr[MAX_ATTRIBUTES]
dim as string classname
dim as integer nAttributes,nCallbacks

restore data_classes

read classname
while len(classname)
  print "class: " & classname
  print string(78,"-")
  nAttributes = IupGetClassAttributes(classname,pList,MAX_ATTRIBUTES)
  if nAttributes>0 then
    print : print "class attributes "
    for i as integer = 0 to nAttributes-1
      dim as string Attribute = *pList[i]
      if i=nAttributes-1 then
        print Attribute
      else
        print Attribute & ", ";
      end if  
    next
  end if
  nCallbacks = IupGetClassCallbacks(classname,pList,MAX_ATTRIBUTES)
  if nCallbacks>0 then
    print : print "class callbacks "
    for i as integer = 0 to nCallbacks-1
      dim as string Callback = *pList[i]
      if i=nCallbacks-1 then
        print Callback
      else
        print Callback & ", "; 
      end if  
    next
  end if
  ? "press a key ...":sleep:cls
  read classname
wend
sleep






