summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-09-19 01:09:23 +0200
committerAraq <rumpf_a@web.de>2014-09-19 01:09:23 +0200
commit4bf0bb7ad745afdf00ea024f0e60489846cca355 (patch)
treee7f4a1e175818bf1c7188bc88754321a489693a2
parent137ade4f6e595a7a228943c849ff0a9684d90299 (diff)
downloadNim-4bf0bb7ad745afdf00ea024f0e60489846cca355.tar.gz
cleaned up iup.nim
-rw-r--r--lib/wrappers/iup.nim1002
1 files changed, 501 insertions, 501 deletions
diff --git a/lib/wrappers/iup.nim b/lib/wrappers/iup.nim
index dd98b84b8..6695dc5e2 100644
--- a/lib/wrappers/iup.nim
+++ b/lib/wrappers/iup.nim
@@ -68,7 +68,7 @@ proc alarm*(title, msg, b1, b2, b3: cstring): cint {.
 proc scanf*(format: cstring): cint {.
   importc: "IupScanf", dynlib: dllname, cdecl, varargs.}
 proc listDialog*(theType: cint, title: cstring, size: cint, 
-                 list: cstringArray, op, max_col, max_lin: cint, 
+                 list: cstringArray, op, maxCol, maxLin: cint, 
                  marks: ptr cint): cint {.
                  importc: "IupListDialog", dynlib: dllname, cdecl.}
 proc getText*(title, text: cstring): cint {.
@@ -77,15 +77,15 @@ proc getColor*(x, y: cint, r, g, b: var byte): cint {.
   importc: "IupGetColor", dynlib: dllname, cdecl.}
 
 type
-  Iparamcb* = proc (dialog: PIhandle, param_index: cint, 
-                    user_data: pointer): cint {.cdecl.}
+  Iparamcb* = proc (dialog: PIhandle, paramIndex: cint, 
+                    userData: pointer): cint {.cdecl.}
 
-proc getParam*(title: cstring, action: Iparamcb, user_data: pointer, 
+proc getParam*(title: cstring, action: Iparamcb, userData: pointer, 
                format: cstring): cint {.
                importc: "IupGetParam", cdecl, varargs, dynlib: dllname.}
-proc getParamv*(title: cstring, action: Iparamcb, user_data: pointer, 
-                format: cstring, param_count, param_extra: cint, 
-                param_data: pointer): cint {.
+proc getParamv*(title: cstring, action: Iparamcb, userData: pointer, 
+                format: cstring, paramCount, paramExtra: cint, 
+                paramData: pointer): cint {.
                 importc: "IupGetParamv", cdecl, dynlib: dllname.}
 
 
@@ -125,7 +125,7 @@ proc destroy*(ih: PIhandle) {.importc: "IupDestroy", cdecl, dynlib: dllname.}
 proc detach*(child: PIhandle) {.importc: "IupDetach", cdecl, dynlib: dllname.}
 proc append*(ih, child: PIhandle): PIhandle {.
   importc: "IupAppend", cdecl, dynlib: dllname, discardable.}
-proc insert*(ih, ref_child, child: PIhandle): PIhandle {.
+proc insert*(ih, refChild, child: PIhandle): PIhandle {.
   importc: "IupInsert", cdecl, dynlib: dllname, discardable.}
 proc getChild*(ih: PIhandle, pos: cint): PIhandle {.
   importc: "IupGetChild", cdecl, dynlib: dllname.}
@@ -143,7 +143,7 @@ proc getDialog*(ih: PIhandle): PIhandle {.
   importc: "IupGetDialog", cdecl, dynlib: dllname.}
 proc getDialogChild*(ih: PIhandle, name: cstring): PIhandle {.
   importc: "IupGetDialogChild", cdecl, dynlib: dllname.}
-proc reparent*(ih, new_parent: PIhandle): cint {.
+proc reparent*(ih, newParent: PIhandle): cint {.
   importc: "IupReparent", cdecl, dynlib: dllname.}
 
 proc popup*(ih: PIhandle, x, y: cint): cint {.
@@ -181,7 +181,7 @@ proc setfAttribute*(ih: PIhandle, name, format: cstring) {.
   importc: "IupSetfAttribute", cdecl, dynlib: dllname, varargs.}
 proc getAllAttributes*(ih: PIhandle, names: cstringArray, n: cint): cint {.
   importc: "IupGetAllAttributes", cdecl, dynlib: dllname.}
-proc setAtt*(handle_name: cstring, ih: PIhandle, name: cstring): PIhandle {.
+proc setAtt*(handleName: cstring, ih: PIhandle, name: cstring): PIhandle {.
   importc: "IupSetAtt", cdecl, dynlib: dllname, varargs, discardable.}
 
 proc setGlobal*(name, value: cstring) {.
@@ -226,7 +226,7 @@ proc getAllDialogs*(names: cstringArray, n: cint): cint {.
 proc getName*(ih: PIhandle): cstring {.
   importc: "IupGetName", cdecl, dynlib: dllname.}
 
-proc setAttributeHandle*(ih: PIhandle, name: cstring, ih_named: PIhandle) {.
+proc setAttributeHandle*(ih: PIhandle, name: cstring, ihNamed: PIhandle) {.
   importc: "IupSetAttributeHandle", cdecl, dynlib: dllname.}
 proc getAttributeHandle*(ih: PIhandle, name: cstring): PIhandle {.
   importc: "IupGetAttributeHandle", cdecl, dynlib: dllname.}
@@ -266,9 +266,9 @@ proc hbox*(child: PIhandle): PIhandle {.
 proc hboxv*(children: ptr PIhandle): PIhandle {.
   importc: "IupHboxv", cdecl, dynlib: dllname.}
 
-proc normalizer*(ih_first: PIhandle): PIhandle {.
+proc normalizer*(ihFirst: PIhandle): PIhandle {.
   importc: "IupNormalizer", cdecl, dynlib: dllname, varargs.}
-proc normalizerv*(ih_list: ptr PIhandle): PIhandle {.
+proc normalizerv*(ihList: ptr PIhandle): PIhandle {.
   importc: "IupNormalizerv", cdecl, dynlib: dllname.}
 
 proc cbox*(child: PIhandle): PIhandle {.
@@ -434,516 +434,516 @@ const
   IUP_MASK_INT* = "[+/-]?/d+"
   IUP_MASK_UINT* = "/d+"
   
-# from 32 to 126, all character sets are equal,

-# the key code i the same as the character code.

-const

-  K_SP* = cint(ord(' '))

-  K_exclam* = cint(ord('!'))   

-  K_quotedbl* = cint(ord('\"'))

-  K_numbersign* = cint(ord('#'))

-  K_dollar* = cint(ord('$'))

-  K_percent* = cint(ord('%'))

-  K_ampersand* = cint(ord('&'))

-  K_apostrophe* = cint(ord('\''))

-  K_parentleft* = cint(ord('('))

-  K_parentright* = cint(ord(')'))

-  K_asterisk* = cint(ord('*'))

-  K_plus* = cint(ord('+'))

-  K_comma* = cint(ord(','))

-  K_minus* = cint(ord('-'))

-  K_period* = cint(ord('.'))

-  K_slash* = cint(ord('/'))

-  K_0* = cint(ord('0'))

-  K_1* = cint(ord('1'))

-  K_2* = cint(ord('2'))

-  K_3* = cint(ord('3'))

-  K_4* = cint(ord('4'))

-  K_5* = cint(ord('5'))

-  K_6* = cint(ord('6'))

-  K_7* = cint(ord('7'))

-  K_8* = cint(ord('8'))

-  K_9* = cint(ord('9'))

-  K_colon* = cint(ord(':'))

-  K_semicolon* = cint(ord(';'))

-  K_less* = cint(ord('<'))

-  K_equal* = cint(ord('='))

-  K_greater* = cint(ord('>'))   

-  K_question* = cint(ord('?'))   

-  K_at* = cint(ord('@'))   

-  K_upperA* = cint(ord('A'))   

-  K_upperB* = cint(ord('B'))   

-  K_upperC* = cint(ord('C'))   

-  K_upperD* = cint(ord('D'))   

-  K_upperE* = cint(ord('E'))   

-  K_upperF* = cint(ord('F'))   

-  K_upperG* = cint(ord('G'))   

-  K_upperH* = cint(ord('H'))   

-  K_upperI* = cint(ord('I'))   

-  K_upperJ* = cint(ord('J'))   

-  K_upperK* = cint(ord('K'))   

-  K_upperL* = cint(ord('L'))   

-  K_upperM* = cint(ord('M'))   

-  K_upperN* = cint(ord('N'))   

-  K_upperO* = cint(ord('O'))   

-  K_upperP* = cint(ord('P'))   

-  K_upperQ* = cint(ord('Q'))  

-  K_upperR* = cint(ord('R'))  

-  K_upperS* = cint(ord('S'))  

-  K_upperT* = cint(ord('T'))  

-  K_upperU* = cint(ord('U'))  

-  K_upperV* = cint(ord('V')) 

-  K_upperW* = cint(ord('W')) 

-  K_upperX* = cint(ord('X'))  

-  K_upperY* = cint(ord('Y'))  

-  K_upperZ* = cint(ord('Z'))  

-  K_bracketleft* = cint(ord('[')) 

-  K_backslash* = cint(ord('\\'))  

-  K_bracketright* = cint(ord(']'))  

-  K_circum* = cint(ord('^'))   

-  K_underscore* = cint(ord('_'))   

-  K_grave* = cint(ord('`'))   

-  K_lowera* = cint(ord('a'))  

-  K_lowerb* = cint(ord('b'))   

-  K_lowerc* = cint(ord('c')) 

-  K_lowerd* = cint(ord('d'))   

-  K_lowere* = cint(ord('e'))   

-  K_lowerf* = cint(ord('f'))  

-  K_lowerg* = cint(ord('g'))

-  K_lowerh* = cint(ord('h')) 

-  K_loweri* = cint(ord('i')) 

-  K_lowerj* = cint(ord('j')) 

-  K_lowerk* = cint(ord('k'))

-  K_lowerl* = cint(ord('l'))

-  K_lowerm* = cint(ord('m'))

-  K_lowern* = cint(ord('n'))

-  K_lowero* = cint(ord('o'))

-  K_lowerp* = cint(ord('p'))

-  K_lowerq* = cint(ord('q'))

-  K_lowerr* = cint(ord('r'))

-  K_lowers* = cint(ord('s'))

-  K_lowert* = cint(ord('t'))

-  K_loweru* = cint(ord('u'))

-  K_lowerv* = cint(ord('v'))

-  K_lowerw* = cint(ord('w'))

-  K_lowerx* = cint(ord('x'))

-  K_lowery* = cint(ord('y'))

-  K_lowerz* = cint(ord('z'))

-  K_braceleft* = cint(ord('{'))

-  K_bar* = cint(ord('|'))

-  K_braceright* = cint(ord('}'))

-  K_tilde* = cint(ord('~'))

-

-proc isPrint*(c: cint): bool = return c > 31 and c < 127

-

-# also define the escape sequences that have keys associated

-const

-  K_BS* = cint(ord('\b'))

-  K_TAB* = cint(ord('\t'))

-  K_LF* = cint(10)

-  K_CR* = cint(13)

-

-# IUP Extended Key Codes, range start at 128

-# Modifiers use 256 interval

-# These key code definitions are specific to IUP

-

-proc isXkey*(c: cint): bool = return c > 128

-proc isShiftXkey*(c: cint): bool = return c > 256 and c < 512

-proc isCtrlXkey*(c: cint): bool = return c > 512 and c < 768

-proc isAltXkey*(c: cint): bool = return c > 768 and c < 1024

-proc isSysXkey*(c: cint): bool = return c > 1024 and c < 1280

-

-proc iUPxCODE*(c: cint): cint = return c + cint(128) # Normal (must be above 128)

+# from 32 to 126, all character sets are equal,
+# the key code i the same as the character code.
+const
+  K_SP* = cint(ord(' '))
+  K_exclam* = cint(ord('!'))   
+  K_quotedbl* = cint(ord('\"'))
+  K_numbersign* = cint(ord('#'))
+  K_dollar* = cint(ord('$'))
+  K_percent* = cint(ord('%'))
+  K_ampersand* = cint(ord('&'))
+  K_apostrophe* = cint(ord('\''))
+  K_parentleft* = cint(ord('('))
+  K_parentright* = cint(ord(')'))
+  K_asterisk* = cint(ord('*'))
+  K_plus* = cint(ord('+'))
+  K_comma* = cint(ord(','))
+  K_minus* = cint(ord('-'))
+  K_period* = cint(ord('.'))
+  K_slash* = cint(ord('/'))
+  K_0* = cint(ord('0'))
+  K_1* = cint(ord('1'))
+  K_2* = cint(ord('2'))
+  K_3* = cint(ord('3'))
+  K_4* = cint(ord('4'))
+  K_5* = cint(ord('5'))
+  K_6* = cint(ord('6'))
+  K_7* = cint(ord('7'))
+  K_8* = cint(ord('8'))
+  K_9* = cint(ord('9'))
+  K_colon* = cint(ord(':'))
+  K_semicolon* = cint(ord(';'))
+  K_less* = cint(ord('<'))
+  K_equal* = cint(ord('='))
+  K_greater* = cint(ord('>'))   
+  K_question* = cint(ord('?'))   
+  K_at* = cint(ord('@'))   
+  K_upperA* = cint(ord('A'))   
+  K_upperB* = cint(ord('B'))   
+  K_upperC* = cint(ord('C'))   
+  K_upperD* = cint(ord('D'))   
+  K_upperE* = cint(ord('E'))   
+  K_upperF* = cint(ord('F'))   
+  K_upperG* = cint(ord('G'))   
+  K_upperH* = cint(ord('H'))   
+  K_upperI* = cint(ord('I'))   
+  K_upperJ* = cint(ord('J'))   
+  K_upperK* = cint(ord('K'))   
+  K_upperL* = cint(ord('L'))   
+  K_upperM* = cint(ord('M'))   
+  K_upperN* = cint(ord('N'))   
+  K_upperO* = cint(ord('O'))   
+  K_upperP* = cint(ord('P'))   
+  K_upperQ* = cint(ord('Q'))  
+  K_upperR* = cint(ord('R'))  
+  K_upperS* = cint(ord('S'))  
+  K_upperT* = cint(ord('T'))  
+  K_upperU* = cint(ord('U'))  
+  K_upperV* = cint(ord('V')) 
+  K_upperW* = cint(ord('W')) 
+  K_upperX* = cint(ord('X'))  
+  K_upperY* = cint(ord('Y'))  
+  K_upperZ* = cint(ord('Z'))  
+  K_bracketleft* = cint(ord('[')) 
+  K_backslash* = cint(ord('\\'))  
+  K_bracketright* = cint(ord(']'))  
+  K_circum* = cint(ord('^'))   
+  K_underscore* = cint(ord('_'))   
+  K_grave* = cint(ord('`'))   
+  K_lowera* = cint(ord('a'))  
+  K_lowerb* = cint(ord('b'))   
+  K_lowerc* = cint(ord('c')) 
+  K_lowerd* = cint(ord('d'))   
+  K_lowere* = cint(ord('e'))   
+  K_lowerf* = cint(ord('f'))  
+  K_lowerg* = cint(ord('g'))
+  K_lowerh* = cint(ord('h')) 
+  K_loweri* = cint(ord('i')) 
+  K_lowerj* = cint(ord('j')) 
+  K_lowerk* = cint(ord('k'))
+  K_lowerl* = cint(ord('l'))
+  K_lowerm* = cint(ord('m'))
+  K_lowern* = cint(ord('n'))
+  K_lowero* = cint(ord('o'))
+  K_lowerp* = cint(ord('p'))
+  K_lowerq* = cint(ord('q'))
+  K_lowerr* = cint(ord('r'))
+  K_lowers* = cint(ord('s'))
+  K_lowert* = cint(ord('t'))
+  K_loweru* = cint(ord('u'))
+  K_lowerv* = cint(ord('v'))
+  K_lowerw* = cint(ord('w'))
+  K_lowerx* = cint(ord('x'))
+  K_lowery* = cint(ord('y'))
+  K_lowerz* = cint(ord('z'))
+  K_braceleft* = cint(ord('{'))
+  K_bar* = cint(ord('|'))
+  K_braceright* = cint(ord('}'))
+  K_tilde* = cint(ord('~'))
+
+proc isPrint*(c: cint): bool = return c > 31 and c < 127
+
+# also define the escape sequences that have keys associated
+const
+  K_BS* = cint(ord('\b'))
+  K_TAB* = cint(ord('\t'))
+  K_LF* = cint(10)
+  K_CR* = cint(13)
+
+# IUP Extended Key Codes, range start at 128
+# Modifiers use 256 interval
+# These key code definitions are specific to IUP
+
+proc isXkey*(c: cint): bool = return c > 128
+proc isShiftXkey*(c: cint): bool = return c > 256 and c < 512
+proc isCtrlXkey*(c: cint): bool = return c > 512 and c < 768
+proc isAltXkey*(c: cint): bool = return c > 768 and c < 1024
+proc isSysXkey*(c: cint): bool = return c > 1024 and c < 1280
+
+proc iUPxCODE*(c: cint): cint = return c + cint(128) # Normal (must be above 128)
 proc iUPsxCODE*(c: cint): cint = 
   return c + cint(256)
   # Shift (must have range to include the standard keys and the normal 
   # extended keys, so must be above 256
 
-proc iUPcxCODE*(c: cint): cint = return c + cint(512) # Ctrl

-proc iUPmxCODE*(c: cint): cint = return c + cint(768) # Alt

-proc iUPyxCODE*(c: cint): cint = return c + cint(1024) # Sys (Win or Apple) 

-
-const

-  IUP_NUMMAXCODES* = 1280 ## 5*256=1280  Normal+Shift+Ctrl+Alt+Sys

-

-  K_HOME* = iupxCODE(1)                

-  K_UP* = iupxCODE(2)

-  K_PGUP* = iupxCODE(3)

-  K_LEFT* = iupxCODE(4)

-  K_MIDDLE* = iupxCODE(5)

-  K_RIGHT* = iupxCODE(6)

-  K_END* = iupxCODE(7)

-  K_DOWN* = iupxCODE(8)

-  K_PGDN* = iupxCODE(9)

-  K_INS* = iupxCODE(10)    

-  K_DEL* = iupxCODE(11)    

-  K_PAUSE* = iupxCODE(12)

-  K_ESC* = iupxCODE(13)

-  K_ccedilla* = iupxCODE(14)

-  K_F1* = iupxCODE(15)

-  K_F2* = iupxCODE(16)

-  K_F3* = iupxCODE(17)

-  K_F4* = iupxCODE(18)

-  K_F5* = iupxCODE(19)

-  K_F6* = iupxCODE(20)

-  K_F7* = iupxCODE(21)

-  K_F8* = iupxCODE(22)

-  K_F9* = iupxCODE(23)

-  K_F10* = iupxCODE(24)

-  K_F11* = iupxCODE(25)

-  K_F12* = iupxCODE(26)

-  K_Print* = iupxCODE(27)

-  K_Menu* = iupxCODE(28)

-

-  K_acute* = iupxCODE(29) # no Shift/Ctrl/Alt

-

-  K_sHOME* = iUPsxCODE(K_HOME)

-  K_sUP* = iUPsxCODE(K_UP)

-  K_sPGUP* = iUPsxCODE(K_PGUP)

-  K_sLEFT* = iUPsxCODE(K_LEFT)

-  K_sMIDDLE* = iUPsxCODE(K_MIDDLE)

-  K_sRIGHT* = iUPsxCODE(K_RIGHT)

-  K_sEND* = iUPsxCODE(K_END)

-  K_sDOWN* = iUPsxCODE(K_DOWN)

-  K_sPGDN* = iUPsxCODE(K_PGDN)

-  K_sINS* = iUPsxCODE(K_INS)

-  K_sDEL* = iUPsxCODE(K_DEL)

-  K_sSP* = iUPsxCODE(K_SP)

-  K_sTAB* = iUPsxCODE(K_TAB)

-  K_sCR* = iUPsxCODE(K_CR)

-  K_sBS* = iUPsxCODE(K_BS)

-  K_sPAUSE* = iUPsxCODE(K_PAUSE)

-  K_sESC* = iUPsxCODE(K_ESC)

-  K_sCcedilla* = iUPsxCODE(K_ccedilla)

-  K_sF1* = iUPsxCODE(K_F1)

-  K_sF2* = iUPsxCODE(K_F2)

-  K_sF3* = iUPsxCODE(K_F3)

-  K_sF4* = iUPsxCODE(K_F4)

-  K_sF5* = iUPsxCODE(K_F5)

-  K_sF6* = iUPsxCODE(K_F6)

-  K_sF7* = iUPsxCODE(K_F7)

-  K_sF8* = iUPsxCODE(K_F8)

-  K_sF9* = iUPsxCODE(K_F9)

-  K_sF10* = iUPsxCODE(K_F10)

-  K_sF11* = iUPsxCODE(K_F11)

-  K_sF12* = iUPsxCODE(K_F12)

-  K_sPrint* = iUPsxCODE(K_Print)

-  K_sMenu* = iUPsxCODE(K_Menu)

-

-  K_cHOME* = iUPcxCODE(K_HOME)

-  K_cUP* = iUPcxCODE(K_UP)

-  K_cPGUP* = iUPcxCODE(K_PGUP)

-  K_cLEFT* = iUPcxCODE(K_LEFT)

-  K_cMIDDLE* = iUPcxCODE(K_MIDDLE)

-  K_cRIGHT* = iUPcxCODE(K_RIGHT)

-  K_cEND* = iUPcxCODE(K_END)

-  K_cDOWN* = iUPcxCODE(K_DOWN)

-  K_cPGDN* = iUPcxCODE(K_PGDN)

-  K_cINS* = iUPcxCODE(K_INS)

-  K_cDEL* = iUPcxCODE(K_DEL)

-  K_cSP* = iUPcxCODE(K_SP)

-  K_cTAB* = iUPcxCODE(K_TAB)

-  K_cCR* = iUPcxCODE(K_CR)

-  K_cBS* = iUPcxCODE(K_BS)

-  K_cPAUSE* = iUPcxCODE(K_PAUSE)

-  K_cESC* = iUPcxCODE(K_ESC)

-  K_cCcedilla* = iUPcxCODE(K_ccedilla)

-  K_cF1* = iUPcxCODE(K_F1)

-  K_cF2* = iUPcxCODE(K_F2)

-  K_cF3* = iUPcxCODE(K_F3)

-  K_cF4* = iUPcxCODE(K_F4)

-  K_cF5* = iUPcxCODE(K_F5)

-  K_cF6* = iUPcxCODE(K_F6)

-  K_cF7* = iUPcxCODE(K_F7)

-  K_cF8* = iUPcxCODE(K_F8)

-  K_cF9* = iUPcxCODE(K_F9)

-  K_cF10* = iUPcxCODE(K_F10)

-  K_cF11* = iUPcxCODE(K_F11)

-  K_cF12* = iUPcxCODE(K_F12)

-  K_cPrint* = iUPcxCODE(K_Print)

-  K_cMenu* = iUPcxCODE(K_Menu)

-

-  K_mHOME* = iUPmxCODE(K_HOME)

-  K_mUP* = iUPmxCODE(K_UP)

-  K_mPGUP* = iUPmxCODE(K_PGUP)

-  K_mLEFT* = iUPmxCODE(K_LEFT)

-  K_mMIDDLE* = iUPmxCODE(K_MIDDLE)

-  K_mRIGHT* = iUPmxCODE(K_RIGHT)

-  K_mEND* = iUPmxCODE(K_END)

-  K_mDOWN* = iUPmxCODE(K_DOWN)

-  K_mPGDN* = iUPmxCODE(K_PGDN)

-  K_mINS* = iUPmxCODE(K_INS)

-  K_mDEL* = iUPmxCODE(K_DEL)

-  K_mSP* = iUPmxCODE(K_SP)

-  K_mTAB* = iUPmxCODE(K_TAB)

-  K_mCR* = iUPmxCODE(K_CR)

-  K_mBS* = iUPmxCODE(K_BS)

-  K_mPAUSE* = iUPmxCODE(K_PAUSE)

-  K_mESC* = iUPmxCODE(K_ESC)

-  K_mCcedilla* = iUPmxCODE(K_ccedilla)

-  K_mF1* = iUPmxCODE(K_F1)

-  K_mF2* = iUPmxCODE(K_F2)

-  K_mF3* = iUPmxCODE(K_F3)

-  K_mF4* = iUPmxCODE(K_F4)

-  K_mF5* = iUPmxCODE(K_F5)

-  K_mF6* = iUPmxCODE(K_F6)

-  K_mF7* = iUPmxCODE(K_F7)

-  K_mF8* = iUPmxCODE(K_F8)

-  K_mF9* = iUPmxCODE(K_F9)

-  K_mF10* = iUPmxCODE(K_F10)

-  K_mF11* = iUPmxCODE(K_F11)

-  K_mF12* = iUPmxCODE(K_F12)

-  K_mPrint* = iUPmxCODE(K_Print)

-  K_mMenu* = iUPmxCODE(K_Menu)

-

-  K_yHOME* = iUPyxCODE(K_HOME)

-  K_yUP* = iUPyxCODE(K_UP)

-  K_yPGUP* = iUPyxCODE(K_PGUP)

-  K_yLEFT* = iUPyxCODE(K_LEFT)

-  K_yMIDDLE* = iUPyxCODE(K_MIDDLE)

-  K_yRIGHT* = iUPyxCODE(K_RIGHT)

-  K_yEND* = iUPyxCODE(K_END)

-  K_yDOWN* = iUPyxCODE(K_DOWN)

-  K_yPGDN* = iUPyxCODE(K_PGDN)

-  K_yINS* = iUPyxCODE(K_INS)

-  K_yDEL* = iUPyxCODE(K_DEL)

-  K_ySP* = iUPyxCODE(K_SP)

-  K_yTAB* = iUPyxCODE(K_TAB)

-  K_yCR* = iUPyxCODE(K_CR)

-  K_yBS* = iUPyxCODE(K_BS)

-  K_yPAUSE* = iUPyxCODE(K_PAUSE)

-  K_yESC* = iUPyxCODE(K_ESC)

-  K_yCcedilla* = iUPyxCODE(K_ccedilla)

-  K_yF1* = iUPyxCODE(K_F1)

-  K_yF2* = iUPyxCODE(K_F2)

-  K_yF3* = iUPyxCODE(K_F3)

-  K_yF4* = iUPyxCODE(K_F4)

-  K_yF5* = iUPyxCODE(K_F5)

-  K_yF6* = iUPyxCODE(K_F6)

-  K_yF7* = iUPyxCODE(K_F7)

-  K_yF8* = iUPyxCODE(K_F8)

-  K_yF9* = iUPyxCODE(K_F9)

-  K_yF10* = iUPyxCODE(K_F10)

-  K_yF11* = iUPyxCODE(K_F11)

-  K_yF12* = iUPyxCODE(K_F12)

-  K_yPrint* = iUPyxCODE(K_Print)

-  K_yMenu* = iUPyxCODE(K_Menu)

-

-  K_sPlus* = iUPsxCODE(K_plus)   

-  K_sComma* = iUPsxCODE(K_comma)   

-  K_sMinus* = iUPsxCODE(K_minus)   

-  K_sPeriod* = iUPsxCODE(K_period)   

-  K_sSlash* = iUPsxCODE(K_slash)   

-  K_sAsterisk* = iUPsxCODE(K_asterisk)

-                        

-  K_cupperA* = iUPcxCODE(K_upperA)

-  K_cupperB* = iUPcxCODE(K_upperB)

-  K_cupperC* = iUPcxCODE(K_upperC)

-  K_cupperD* = iUPcxCODE(K_upperD)

-  K_cupperE* = iUPcxCODE(K_upperE)

-  K_cupperF* = iUPcxCODE(K_upperF)

-  K_cupperG* = iUPcxCODE(K_upperG)

-  K_cupperH* = iUPcxCODE(K_upperH)

-  K_cupperI* = iUPcxCODE(K_upperI)

-  K_cupperJ* = iUPcxCODE(K_upperJ)

-  K_cupperK* = iUPcxCODE(K_upperK)

-  K_cupperL* = iUPcxCODE(K_upperL)

-  K_cupperM* = iUPcxCODE(K_upperM)

-  K_cupperN* = iUPcxCODE(K_upperN)

-  K_cupperO* = iUPcxCODE(K_upperO)

-  K_cupperP* = iUPcxCODE(K_upperP)

-  K_cupperQ* = iUPcxCODE(K_upperQ)

-  K_cupperR* = iUPcxCODE(K_upperR)

-  K_cupperS* = iUPcxCODE(K_upperS)

-  K_cupperT* = iUPcxCODE(K_upperT)

-  K_cupperU* = iUPcxCODE(K_upperU)

-  K_cupperV* = iUPcxCODE(K_upperV)

-  K_cupperW* = iUPcxCODE(K_upperW)

-  K_cupperX* = iUPcxCODE(K_upperX)

-  K_cupperY* = iUPcxCODE(K_upperY)

-  K_cupperZ* = iUPcxCODE(K_upperZ)

-  K_c1* = iUPcxCODE(K_1)

-  K_c2* = iUPcxCODE(K_2)

-  K_c3* = iUPcxCODE(K_3)

-  K_c4* = iUPcxCODE(K_4)

-  K_c5* = iUPcxCODE(K_5)

-  K_c6* = iUPcxCODE(K_6)

-  K_c7* = iUPcxCODE(K_7)        

-  K_c8* = iUPcxCODE(K_8)         

-  K_c9* = iUPcxCODE(K_9)

-  K_c0* = iUPcxCODE(K_0)

-  K_cPlus* = iUPcxCODE(K_plus)   

-  K_cComma* = iUPcxCODE(K_comma)   

-  K_cMinus* = iUPcxCODE(K_minus)   

-  K_cPeriod* = iUPcxCODE(K_period)   

-  K_cSlash* = iUPcxCODE(K_slash)   

-  K_cSemicolon* = iUPcxCODE(K_semicolon) 

-  K_cEqual* = iUPcxCODE(K_equal)

-  K_cBracketleft* = iUPcxCODE(K_bracketleft)

-  K_cBracketright* = iUPcxCODE(K_bracketright)

-  K_cBackslash* = iUPcxCODE(K_backslash)

-  K_cAsterisk* = iUPcxCODE(K_asterisk)

-

-  K_mupperA* = iUPmxCODE(K_upperA)

-  K_mupperB* = iUPmxCODE(K_upperB)

-  K_mupperC* = iUPmxCODE(K_upperC)

-  K_mupperD* = iUPmxCODE(K_upperD)

-  K_mupperE* = iUPmxCODE(K_upperE)

-  K_mupperF* = iUPmxCODE(K_upperF)

-  K_mupperG* = iUPmxCODE(K_upperG)

-  K_mupperH* = iUPmxCODE(K_upperH)

-  K_mupperI* = iUPmxCODE(K_upperI)

-  K_mupperJ* = iUPmxCODE(K_upperJ)

-  K_mupperK* = iUPmxCODE(K_upperK)

-  K_mupperL* = iUPmxCODE(K_upperL)

-  K_mupperM* = iUPmxCODE(K_upperM)

-  K_mupperN* = iUPmxCODE(K_upperN)

-  K_mupperO* = iUPmxCODE(K_upperO)

-  K_mupperP* = iUPmxCODE(K_upperP)

-  K_mupperQ* = iUPmxCODE(K_upperQ)

-  K_mupperR* = iUPmxCODE(K_upperR)

-  K_mupperS* = iUPmxCODE(K_upperS)

-  K_mupperT* = iUPmxCODE(K_upperT)

-  K_mupperU* = iUPmxCODE(K_upperU)

-  K_mupperV* = iUPmxCODE(K_upperV)

-  K_mupperW* = iUPmxCODE(K_upperW)

-  K_mupperX* = iUPmxCODE(K_upperX)

-  K_mupperY* = iUPmxCODE(K_upperY)

-  K_mupperZ* = iUPmxCODE(K_upperZ)

-  K_m1* = iUPmxCODE(K_1)

-  K_m2* = iUPmxCODE(K_2)

-  K_m3* = iUPmxCODE(K_3)

-  K_m4* = iUPmxCODE(K_4)

-  K_m5* = iUPmxCODE(K_5)

-  K_m6* = iUPmxCODE(K_6)

-  K_m7* = iUPmxCODE(K_7)        

-  K_m8* = iUPmxCODE(K_8)         

-  K_m9* = iUPmxCODE(K_9)

-  K_m0* = iUPmxCODE(K_0)

-  K_mPlus* = iUPmxCODE(K_plus)   

-  K_mComma* = iUPmxCODE(K_comma)   

-  K_mMinus* = iUPmxCODE(K_minus)   

-  K_mPeriod* = iUPmxCODE(K_period)   

-  K_mSlash* = iUPmxCODE(K_slash)   

-  K_mSemicolon* = iUPmxCODE(K_semicolon) 

-  K_mEqual* = iUPmxCODE(K_equal)

-  K_mBracketleft* = iUPmxCODE(K_bracketleft)

-  K_mBracketright* = iUPmxCODE(K_bracketright)

-  K_mBackslash* = iUPmxCODE(K_backslash)

-  K_mAsterisk* = iUPmxCODE(K_asterisk)

-

-  K_yA* = iUPyxCODE(K_upperA)

-  K_yB* = iUPyxCODE(K_upperB)

-  K_yC* = iUPyxCODE(K_upperC)

-  K_yD* = iUPyxCODE(K_upperD)

-  K_yE* = iUPyxCODE(K_upperE)

-  K_yF* = iUPyxCODE(K_upperF)

-  K_yG* = iUPyxCODE(K_upperG)

-  K_yH* = iUPyxCODE(K_upperH)

-  K_yI* = iUPyxCODE(K_upperI)

-  K_yJ* = iUPyxCODE(K_upperJ)

-  K_yK* = iUPyxCODE(K_upperK)

-  K_yL* = iUPyxCODE(K_upperL)

-  K_yM* = iUPyxCODE(K_upperM)

-  K_yN* = iUPyxCODE(K_upperN)

-  K_yO* = iUPyxCODE(K_upperO)

-  K_yP* = iUPyxCODE(K_upperP)

-  K_yQ* = iUPyxCODE(K_upperQ)

-  K_yR* = iUPyxCODE(K_upperR)

-  K_yS* = iUPyxCODE(K_upperS)

-  K_yT* = iUPyxCODE(K_upperT)

-  K_yU* = iUPyxCODE(K_upperU)

-  K_yV* = iUPyxCODE(K_upperV)

-  K_yW* = iUPyxCODE(K_upperW)

-  K_yX* = iUPyxCODE(K_upperX)

-  K_yY* = iUPyxCODE(K_upperY)

-  K_yZ* = iUPyxCODE(K_upperZ)

-  K_y1* = iUPyxCODE(K_1)

-  K_y2* = iUPyxCODE(K_2)

-  K_y3* = iUPyxCODE(K_3)

-  K_y4* = iUPyxCODE(K_4)

-  K_y5* = iUPyxCODE(K_5)

-  K_y6* = iUPyxCODE(K_6)

-  K_y7* = iUPyxCODE(K_7)        

-  K_y8* = iUPyxCODE(K_8)         

-  K_y9* = iUPyxCODE(K_9)

-  K_y0* = iUPyxCODE(K_0)

-  K_yPlus* = iUPyxCODE(K_plus)

-  K_yComma* = iUPyxCODE(K_comma)

-  K_yMinus* = iUPyxCODE(K_minus)   

-  K_yPeriod* = iUPyxCODE(K_period)   

-  K_ySlash* = iUPyxCODE(K_slash)   

-  K_ySemicolon* = iUPyxCODE(K_semicolon) 

-  K_yEqual* = iUPyxCODE(K_equal)

-  K_yBracketleft* = iUPyxCODE(K_bracketleft)

-  K_yBracketright* = iUPyxCODE(K_bracketright)

-  K_yBackslash* = iUPyxCODE(K_backslash)

-  K_yAsterisk* = iUPyxCODE(K_asterisk)

-
-proc controlsOpen*(): cint {.cdecl, importc: "IupControlsOpen", dynlib: dllname.}

-proc controlsClose*() {.cdecl, importc: "IupControlsClose", dynlib: dllname.}

-

-proc oldValOpen*() {.cdecl, importc: "IupOldValOpen", dynlib: dllname.}

-proc oldTabsOpen*() {.cdecl, importc: "IupOldTabsOpen", dynlib: dllname.}

-

-proc colorbar*(): PIhandle {.cdecl, importc: "IupColorbar", dynlib: dllname.}

-proc cells*(): PIhandle {.cdecl, importc: "IupCells", dynlib: dllname.}

-proc colorBrowser*(): PIhandle {.cdecl, importc: "IupColorBrowser", dynlib: dllname.}

-proc gauge*(): PIhandle {.cdecl, importc: "IupGauge", dynlib: dllname.}

-proc dial*(theType: cstring): PIhandle {.cdecl, importc: "IupDial", dynlib: dllname.}

-proc matrix*(action: cstring): PIhandle {.cdecl, importc: "IupMatrix", dynlib: dllname.}

-

-# IupMatrix utilities

+proc iUPcxCODE*(c: cint): cint = return c + cint(512) # Ctrl
+proc iUPmxCODE*(c: cint): cint = return c + cint(768) # Alt
+proc iUPyxCODE*(c: cint): cint = return c + cint(1024) # Sys (Win or Apple) 
+
+const
+  IUP_NUMMAXCODES* = 1280 ## 5*256=1280  Normal+Shift+Ctrl+Alt+Sys
+
+  K_HOME* = iUPxCODE(1)                
+  K_UP* = iUPxCODE(2)
+  K_PGUP* = iUPxCODE(3)
+  K_LEFT* = iUPxCODE(4)
+  K_MIDDLE* = iUPxCODE(5)
+  K_RIGHT* = iUPxCODE(6)
+  K_END* = iUPxCODE(7)
+  K_DOWN* = iUPxCODE(8)
+  K_PGDN* = iUPxCODE(9)
+  K_INS* = iUPxCODE(10)    
+  K_DEL* = iUPxCODE(11)    
+  K_PAUSE* = iUPxCODE(12)
+  K_ESC* = iUPxCODE(13)
+  K_ccedilla* = iUPxCODE(14)
+  K_F1* = iUPxCODE(15)
+  K_F2* = iUPxCODE(16)
+  K_F3* = iUPxCODE(17)
+  K_F4* = iUPxCODE(18)
+  K_F5* = iUPxCODE(19)
+  K_F6* = iUPxCODE(20)
+  K_F7* = iUPxCODE(21)
+  K_F8* = iUPxCODE(22)
+  K_F9* = iUPxCODE(23)
+  K_F10* = iUPxCODE(24)
+  K_F11* = iUPxCODE(25)
+  K_F12* = iUPxCODE(26)
+  K_Print* = iUPxCODE(27)
+  K_Menu* = iUPxCODE(28)
+
+  K_acute* = iUPxCODE(29) # no Shift/Ctrl/Alt
+
+  K_sHOME* = iUPsxCODE(K_HOME)
+  K_sUP* = iUPsxCODE(K_UP)
+  K_sPGUP* = iUPsxCODE(K_PGUP)
+  K_sLEFT* = iUPsxCODE(K_LEFT)
+  K_sMIDDLE* = iUPsxCODE(K_MIDDLE)
+  K_sRIGHT* = iUPsxCODE(K_RIGHT)
+  K_sEND* = iUPsxCODE(K_END)
+  K_sDOWN* = iUPsxCODE(K_DOWN)
+  K_sPGDN* = iUPsxCODE(K_PGDN)
+  K_sINS* = iUPsxCODE(K_INS)
+  K_sDEL* = iUPsxCODE(K_DEL)
+  K_sSP* = iUPsxCODE(K_SP)
+  K_sTAB* = iUPsxCODE(K_TAB)
+  K_sCR* = iUPsxCODE(K_CR)
+  K_sBS* = iUPsxCODE(K_BS)
+  K_sPAUSE* = iUPsxCODE(K_PAUSE)
+  K_sESC* = iUPsxCODE(K_ESC)
+  K_sCcedilla* = iUPsxCODE(K_ccedilla)
+  K_sF1* = iUPsxCODE(K_F1)
+  K_sF2* = iUPsxCODE(K_F2)
+  K_sF3* = iUPsxCODE(K_F3)
+  K_sF4* = iUPsxCODE(K_F4)
+  K_sF5* = iUPsxCODE(K_F5)
+  K_sF6* = iUPsxCODE(K_F6)
+  K_sF7* = iUPsxCODE(K_F7)
+  K_sF8* = iUPsxCODE(K_F8)
+  K_sF9* = iUPsxCODE(K_F9)
+  K_sF10* = iUPsxCODE(K_F10)
+  K_sF11* = iUPsxCODE(K_F11)
+  K_sF12* = iUPsxCODE(K_F12)
+  K_sPrint* = iUPsxCODE(K_Print)
+  K_sMenu* = iUPsxCODE(K_Menu)
+
+  K_cHOME* = iUPcxCODE(K_HOME)
+  K_cUP* = iUPcxCODE(K_UP)
+  K_cPGUP* = iUPcxCODE(K_PGUP)
+  K_cLEFT* = iUPcxCODE(K_LEFT)
+  K_cMIDDLE* = iUPcxCODE(K_MIDDLE)
+  K_cRIGHT* = iUPcxCODE(K_RIGHT)
+  K_cEND* = iUPcxCODE(K_END)
+  K_cDOWN* = iUPcxCODE(K_DOWN)
+  K_cPGDN* = iUPcxCODE(K_PGDN)
+  K_cINS* = iUPcxCODE(K_INS)
+  K_cDEL* = iUPcxCODE(K_DEL)
+  K_cSP* = iUPcxCODE(K_SP)
+  K_cTAB* = iUPcxCODE(K_TAB)
+  K_cCR* = iUPcxCODE(K_CR)
+  K_cBS* = iUPcxCODE(K_BS)
+  K_cPAUSE* = iUPcxCODE(K_PAUSE)
+  K_cESC* = iUPcxCODE(K_ESC)
+  K_cCcedilla* = iUPcxCODE(K_ccedilla)
+  K_cF1* = iUPcxCODE(K_F1)
+  K_cF2* = iUPcxCODE(K_F2)
+  K_cF3* = iUPcxCODE(K_F3)
+  K_cF4* = iUPcxCODE(K_F4)
+  K_cF5* = iUPcxCODE(K_F5)
+  K_cF6* = iUPcxCODE(K_F6)
+  K_cF7* = iUPcxCODE(K_F7)
+  K_cF8* = iUPcxCODE(K_F8)
+  K_cF9* = iUPcxCODE(K_F9)
+  K_cF10* = iUPcxCODE(K_F10)
+  K_cF11* = iUPcxCODE(K_F11)
+  K_cF12* = iUPcxCODE(K_F12)
+  K_cPrint* = iUPcxCODE(K_Print)
+  K_cMenu* = iUPcxCODE(K_Menu)
+
+  K_mHOME* = iUPmxCODE(K_HOME)
+  K_mUP* = iUPmxCODE(K_UP)
+  K_mPGUP* = iUPmxCODE(K_PGUP)
+  K_mLEFT* = iUPmxCODE(K_LEFT)
+  K_mMIDDLE* = iUPmxCODE(K_MIDDLE)
+  K_mRIGHT* = iUPmxCODE(K_RIGHT)
+  K_mEND* = iUPmxCODE(K_END)
+  K_mDOWN* = iUPmxCODE(K_DOWN)
+  K_mPGDN* = iUPmxCODE(K_PGDN)
+  K_mINS* = iUPmxCODE(K_INS)
+  K_mDEL* = iUPmxCODE(K_DEL)
+  K_mSP* = iUPmxCODE(K_SP)
+  K_mTAB* = iUPmxCODE(K_TAB)
+  K_mCR* = iUPmxCODE(K_CR)
+  K_mBS* = iUPmxCODE(K_BS)
+  K_mPAUSE* = iUPmxCODE(K_PAUSE)
+  K_mESC* = iUPmxCODE(K_ESC)
+  K_mCcedilla* = iUPmxCODE(K_ccedilla)
+  K_mF1* = iUPmxCODE(K_F1)
+  K_mF2* = iUPmxCODE(K_F2)
+  K_mF3* = iUPmxCODE(K_F3)
+  K_mF4* = iUPmxCODE(K_F4)
+  K_mF5* = iUPmxCODE(K_F5)
+  K_mF6* = iUPmxCODE(K_F6)
+  K_mF7* = iUPmxCODE(K_F7)
+  K_mF8* = iUPmxCODE(K_F8)
+  K_mF9* = iUPmxCODE(K_F9)
+  K_mF10* = iUPmxCODE(K_F10)
+  K_mF11* = iUPmxCODE(K_F11)
+  K_mF12* = iUPmxCODE(K_F12)
+  K_mPrint* = iUPmxCODE(K_Print)
+  K_mMenu* = iUPmxCODE(K_Menu)
+
+  K_yHOME* = iUPyxCODE(K_HOME)
+  K_yUP* = iUPyxCODE(K_UP)
+  K_yPGUP* = iUPyxCODE(K_PGUP)
+  K_yLEFT* = iUPyxCODE(K_LEFT)
+  K_yMIDDLE* = iUPyxCODE(K_MIDDLE)
+  K_yRIGHT* = iUPyxCODE(K_RIGHT)
+  K_yEND* = iUPyxCODE(K_END)
+  K_yDOWN* = iUPyxCODE(K_DOWN)
+  K_yPGDN* = iUPyxCODE(K_PGDN)
+  K_yINS* = iUPyxCODE(K_INS)
+  K_yDEL* = iUPyxCODE(K_DEL)
+  K_ySP* = iUPyxCODE(K_SP)
+  K_yTAB* = iUPyxCODE(K_TAB)
+  K_yCR* = iUPyxCODE(K_CR)
+  K_yBS* = iUPyxCODE(K_BS)
+  K_yPAUSE* = iUPyxCODE(K_PAUSE)
+  K_yESC* = iUPyxCODE(K_ESC)
+  K_yCcedilla* = iUPyxCODE(K_ccedilla)
+  K_yF1* = iUPyxCODE(K_F1)
+  K_yF2* = iUPyxCODE(K_F2)
+  K_yF3* = iUPyxCODE(K_F3)
+  K_yF4* = iUPyxCODE(K_F4)
+  K_yF5* = iUPyxCODE(K_F5)
+  K_yF6* = iUPyxCODE(K_F6)
+  K_yF7* = iUPyxCODE(K_F7)
+  K_yF8* = iUPyxCODE(K_F8)
+  K_yF9* = iUPyxCODE(K_F9)
+  K_yF10* = iUPyxCODE(K_F10)
+  K_yF11* = iUPyxCODE(K_F11)
+  K_yF12* = iUPyxCODE(K_F12)
+  K_yPrint* = iUPyxCODE(K_Print)
+  K_yMenu* = iUPyxCODE(K_Menu)
+
+  K_sPlus* = iUPsxCODE(K_plus)   
+  K_sComma* = iUPsxCODE(K_comma)   
+  K_sMinus* = iUPsxCODE(K_minus)   
+  K_sPeriod* = iUPsxCODE(K_period)   
+  K_sSlash* = iUPsxCODE(K_slash)   
+  K_sAsterisk* = iUPsxCODE(K_asterisk)
+                        
+  K_cupperA* = iUPcxCODE(K_upperA)
+  K_cupperB* = iUPcxCODE(K_upperB)
+  K_cupperC* = iUPcxCODE(K_upperC)
+  K_cupperD* = iUPcxCODE(K_upperD)
+  K_cupperE* = iUPcxCODE(K_upperE)
+  K_cupperF* = iUPcxCODE(K_upperF)
+  K_cupperG* = iUPcxCODE(K_upperG)
+  K_cupperH* = iUPcxCODE(K_upperH)
+  K_cupperI* = iUPcxCODE(K_upperI)
+  K_cupperJ* = iUPcxCODE(K_upperJ)
+  K_cupperK* = iUPcxCODE(K_upperK)
+  K_cupperL* = iUPcxCODE(K_upperL)
+  K_cupperM* = iUPcxCODE(K_upperM)
+  K_cupperN* = iUPcxCODE(K_upperN)
+  K_cupperO* = iUPcxCODE(K_upperO)
+  K_cupperP* = iUPcxCODE(K_upperP)
+  K_cupperQ* = iUPcxCODE(K_upperQ)
+  K_cupperR* = iUPcxCODE(K_upperR)
+  K_cupperS* = iUPcxCODE(K_upperS)
+  K_cupperT* = iUPcxCODE(K_upperT)
+  K_cupperU* = iUPcxCODE(K_upperU)
+  K_cupperV* = iUPcxCODE(K_upperV)
+  K_cupperW* = iUPcxCODE(K_upperW)
+  K_cupperX* = iUPcxCODE(K_upperX)
+  K_cupperY* = iUPcxCODE(K_upperY)
+  K_cupperZ* = iUPcxCODE(K_upperZ)
+  K_c1* = iUPcxCODE(K_1)
+  K_c2* = iUPcxCODE(K_2)
+  K_c3* = iUPcxCODE(K_3)
+  K_c4* = iUPcxCODE(K_4)
+  K_c5* = iUPcxCODE(K_5)
+  K_c6* = iUPcxCODE(K_6)
+  K_c7* = iUPcxCODE(K_7)        
+  K_c8* = iUPcxCODE(K_8)         
+  K_c9* = iUPcxCODE(K_9)
+  K_c0* = iUPcxCODE(K_0)
+  K_cPlus* = iUPcxCODE(K_plus)   
+  K_cComma* = iUPcxCODE(K_comma)   
+  K_cMinus* = iUPcxCODE(K_minus)   
+  K_cPeriod* = iUPcxCODE(K_period)   
+  K_cSlash* = iUPcxCODE(K_slash)   
+  K_cSemicolon* = iUPcxCODE(K_semicolon) 
+  K_cEqual* = iUPcxCODE(K_equal)
+  K_cBracketleft* = iUPcxCODE(K_bracketleft)
+  K_cBracketright* = iUPcxCODE(K_bracketright)
+  K_cBackslash* = iUPcxCODE(K_backslash)
+  K_cAsterisk* = iUPcxCODE(K_asterisk)
+
+  K_mupperA* = iUPmxCODE(K_upperA)
+  K_mupperB* = iUPmxCODE(K_upperB)
+  K_mupperC* = iUPmxCODE(K_upperC)
+  K_mupperD* = iUPmxCODE(K_upperD)
+  K_mupperE* = iUPmxCODE(K_upperE)
+  K_mupperF* = iUPmxCODE(K_upperF)
+  K_mupperG* = iUPmxCODE(K_upperG)
+  K_mupperH* = iUPmxCODE(K_upperH)
+  K_mupperI* = iUPmxCODE(K_upperI)
+  K_mupperJ* = iUPmxCODE(K_upperJ)
+  K_mupperK* = iUPmxCODE(K_upperK)
+  K_mupperL* = iUPmxCODE(K_upperL)
+  K_mupperM* = iUPmxCODE(K_upperM)
+  K_mupperN* = iUPmxCODE(K_upperN)
+  K_mupperO* = iUPmxCODE(K_upperO)
+  K_mupperP* = iUPmxCODE(K_upperP)
+  K_mupperQ* = iUPmxCODE(K_upperQ)
+  K_mupperR* = iUPmxCODE(K_upperR)
+  K_mupperS* = iUPmxCODE(K_upperS)
+  K_mupperT* = iUPmxCODE(K_upperT)
+  K_mupperU* = iUPmxCODE(K_upperU)
+  K_mupperV* = iUPmxCODE(K_upperV)
+  K_mupperW* = iUPmxCODE(K_upperW)
+  K_mupperX* = iUPmxCODE(K_upperX)
+  K_mupperY* = iUPmxCODE(K_upperY)
+  K_mupperZ* = iUPmxCODE(K_upperZ)
+  K_m1* = iUPmxCODE(K_1)
+  K_m2* = iUPmxCODE(K_2)
+  K_m3* = iUPmxCODE(K_3)
+  K_m4* = iUPmxCODE(K_4)
+  K_m5* = iUPmxCODE(K_5)
+  K_m6* = iUPmxCODE(K_6)
+  K_m7* = iUPmxCODE(K_7)        
+  K_m8* = iUPmxCODE(K_8)         
+  K_m9* = iUPmxCODE(K_9)
+  K_m0* = iUPmxCODE(K_0)
+  K_mPlus* = iUPmxCODE(K_plus)   
+  K_mComma* = iUPmxCODE(K_comma)   
+  K_mMinus* = iUPmxCODE(K_minus)   
+  K_mPeriod* = iUPmxCODE(K_period)   
+  K_mSlash* = iUPmxCODE(K_slash)   
+  K_mSemicolon* = iUPmxCODE(K_semicolon) 
+  K_mEqual* = iUPmxCODE(K_equal)
+  K_mBracketleft* = iUPmxCODE(K_bracketleft)
+  K_mBracketright* = iUPmxCODE(K_bracketright)
+  K_mBackslash* = iUPmxCODE(K_backslash)
+  K_mAsterisk* = iUPmxCODE(K_asterisk)
+
+  K_yA* = iUPyxCODE(K_upperA)
+  K_yB* = iUPyxCODE(K_upperB)
+  K_yC* = iUPyxCODE(K_upperC)
+  K_yD* = iUPyxCODE(K_upperD)
+  K_yE* = iUPyxCODE(K_upperE)
+  K_yF* = iUPyxCODE(K_upperF)
+  K_yG* = iUPyxCODE(K_upperG)
+  K_yH* = iUPyxCODE(K_upperH)
+  K_yI* = iUPyxCODE(K_upperI)
+  K_yJ* = iUPyxCODE(K_upperJ)
+  K_yK* = iUPyxCODE(K_upperK)
+  K_yL* = iUPyxCODE(K_upperL)
+  K_yM* = iUPyxCODE(K_upperM)
+  K_yN* = iUPyxCODE(K_upperN)
+  K_yO* = iUPyxCODE(K_upperO)
+  K_yP* = iUPyxCODE(K_upperP)
+  K_yQ* = iUPyxCODE(K_upperQ)
+  K_yR* = iUPyxCODE(K_upperR)
+  K_yS* = iUPyxCODE(K_upperS)
+  K_yT* = iUPyxCODE(K_upperT)
+  K_yU* = iUPyxCODE(K_upperU)
+  K_yV* = iUPyxCODE(K_upperV)
+  K_yW* = iUPyxCODE(K_upperW)
+  K_yX* = iUPyxCODE(K_upperX)
+  K_yY* = iUPyxCODE(K_upperY)
+  K_yZ* = iUPyxCODE(K_upperZ)
+  K_y1* = iUPyxCODE(K_1)
+  K_y2* = iUPyxCODE(K_2)
+  K_y3* = iUPyxCODE(K_3)
+  K_y4* = iUPyxCODE(K_4)
+  K_y5* = iUPyxCODE(K_5)
+  K_y6* = iUPyxCODE(K_6)
+  K_y7* = iUPyxCODE(K_7)        
+  K_y8* = iUPyxCODE(K_8)         
+  K_y9* = iUPyxCODE(K_9)
+  K_y0* = iUPyxCODE(K_0)
+  K_yPlus* = iUPyxCODE(K_plus)
+  K_yComma* = iUPyxCODE(K_comma)
+  K_yMinus* = iUPyxCODE(K_minus)   
+  K_yPeriod* = iUPyxCODE(K_period)   
+  K_ySlash* = iUPyxCODE(K_slash)   
+  K_ySemicolon* = iUPyxCODE(K_semicolon) 
+  K_yEqual* = iUPyxCODE(K_equal)
+  K_yBracketleft* = iUPyxCODE(K_bracketleft)
+  K_yBracketright* = iUPyxCODE(K_bracketright)
+  K_yBackslash* = iUPyxCODE(K_backslash)
+  K_yAsterisk* = iUPyxCODE(K_asterisk)
+
+proc controlsOpen*(): cint {.cdecl, importc: "IupControlsOpen", dynlib: dllname.}
+proc controlsClose*() {.cdecl, importc: "IupControlsClose", dynlib: dllname.}
+
+proc oldValOpen*() {.cdecl, importc: "IupOldValOpen", dynlib: dllname.}
+proc oldTabsOpen*() {.cdecl, importc: "IupOldTabsOpen", dynlib: dllname.}
+
+proc colorbar*(): PIhandle {.cdecl, importc: "IupColorbar", dynlib: dllname.}
+proc cells*(): PIhandle {.cdecl, importc: "IupCells", dynlib: dllname.}
+proc colorBrowser*(): PIhandle {.cdecl, importc: "IupColorBrowser", dynlib: dllname.}
+proc gauge*(): PIhandle {.cdecl, importc: "IupGauge", dynlib: dllname.}
+proc dial*(theType: cstring): PIhandle {.cdecl, importc: "IupDial", dynlib: dllname.}
+proc matrix*(action: cstring): PIhandle {.cdecl, importc: "IupMatrix", dynlib: dllname.}
+
+# IupMatrix utilities
 proc matSetAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
                       value: cstring) {.
-                      cdecl, importc: "IupMatSetAttribute", dynlib: dllname.}

+                      cdecl, importc: "IupMatSetAttribute", dynlib: dllname.}
 proc matStoreAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
                         value: cstring) {.cdecl, 
-                        importc: "IupMatStoreAttribute", dynlib: dllname.}

+                        importc: "IupMatStoreAttribute", dynlib: dllname.}
 proc matGetAttribute*(ih: PIhandle, name: cstring, lin, col: cint): cstring {.
-  cdecl, importc: "IupMatGetAttribute", dynlib: dllname.}

+  cdecl, importc: "IupMatGetAttribute", dynlib: dllname.}
 proc matGetInt*(ih: PIhandle, name: cstring, lin, col: cint): cint {.
-  cdecl, importc: "IupMatGetInt", dynlib: dllname.}

+  cdecl, importc: "IupMatGetInt", dynlib: dllname.}
 proc matGetFloat*(ih: PIhandle, name: cstring, lin, col: cint): cfloat {.
-  cdecl, importc: "IupMatGetFloat", dynlib: dllname.}

+  cdecl, importc: "IupMatGetFloat", dynlib: dllname.}
 proc matSetfAttribute*(ih: PIhandle, name: cstring, lin, col: cint, 
                        format: cstring) {.cdecl, 
                        importc: "IupMatSetfAttribute", 
-                       dynlib: dllname, varargs.}

-

-# Used by IupColorbar

+                       dynlib: dllname, varargs.}
+
+# Used by IupColorbar
 const
-  IUP_PRIMARY* = -1

-  IUP_SECONDARY* = -2

-

-# Initialize PPlot widget class

-proc pPlotOpen*() {.cdecl, importc: "IupPPlotOpen", dynlib: dllname.}

-

-# Create an PPlot widget instance

-proc pPlot*: PIhandle {.cdecl, importc: "IupPPlot", dynlib: dllname.}

-

-# Add dataset to plot

+  IUP_PRIMARY* = -1
+  IUP_SECONDARY* = -2
+
+# Initialize PPlot widget class
+proc pPlotOpen*() {.cdecl, importc: "IupPPlotOpen", dynlib: dllname.}
+
+# Create an PPlot widget instance
+proc pPlot*: PIhandle {.cdecl, importc: "IupPPlot", dynlib: dllname.}
+
+# Add dataset to plot
 proc pPlotBegin*(ih: PIhandle, strXdata: cint) {.
-  cdecl, importc: "IupPPlotBegin", dynlib: dllname.}

+  cdecl, importc: "IupPPlotBegin", dynlib: dllname.}
 proc pPlotAdd*(ih: PIhandle, x, y: cfloat) {.
-  cdecl, importc: "IupPPlotAdd", dynlib: dllname.}

+  cdecl, importc: "IupPPlotAdd", dynlib: dllname.}
 proc pPlotAddStr*(ih: PIhandle, x: cstring, y: cfloat) {.
-  cdecl, importc: "IupPPlotAddStr", dynlib: dllname.}

+  cdecl, importc: "IupPPlotAddStr", dynlib: dllname.}
 proc pPlotEnd*(ih: PIhandle): cint {.
-  cdecl, importc: "IupPPlotEnd", dynlib: dllname.}

-

-proc pPlotInsertStr*(ih: PIhandle, index, sample_index: cint, x: cstring, 
+  cdecl, importc: "IupPPlotEnd", dynlib: dllname.}
+
+proc pPlotInsertStr*(ih: PIhandle, index, sampleIndex: cint, x: cstring, 
                      y: cfloat) {.cdecl, importc: "IupPPlotInsertStr", 
-                     dynlib: dllname.}

-proc pPlotInsert*(ih: PIhandle, index, sample_index: cint, 
+                     dynlib: dllname.}
+proc pPlotInsert*(ih: PIhandle, index, sampleIndex: cint, 
                   x, y: cfloat) {.
-                  cdecl, importc: "IupPPlotInsert", dynlib: dllname.}

-

-# convert from plot coordinates to pixels

+                  cdecl, importc: "IupPPlotInsert", dynlib: dllname.}
+
+# convert from plot coordinates to pixels
 proc pPlotTransform*(ih: PIhandle, x, y: cfloat, ix, iy: var cint) {.
-  cdecl, importc: "IupPPlotTransform", dynlib: dllname.}

-

-# Plot on the given device. Uses a "cdCanvas*".

+  cdecl, importc: "IupPPlotTransform", dynlib: dllname.}
+
+# Plot on the given device. Uses a "cdCanvas*".
 proc pPlotPaintTo*(ih: PIhandle, cnv: pointer) {.
-  cdecl, importc: "IupPPlotPaintTo", dynlib: dllname.}

-

+  cdecl, importc: "IupPPlotPaintTo", dynlib: dllname.}
+