# Path: wh.py
# def SetLoaddir(d):
#   def __init__(self, frame):
#   def Add(self, flags, keycode, cmd):
#   def GetTable(self):
#   def Realize(self):
#   def __init__(self, parent):
#   def OnLabelLeftClick(self, evt):
#   def GetAllSelectedRows(self):
#   def quoteVal(self, val, quoteChar):
#   def GetAllSelectedCellValues(self, withLabel=True):
#   def __init__(self, frame, size=32, style=wx.TB_FLAT|wx.TB_NODIVIDER):
#   def Enable(self, procOrId, how=None):
#   def AddCheck(self, procOrCls, text=None, bitmap=None):
#   def Add(self, procOrCls, text=None, bitmap=None, kind=wx.ITEM_NORMAL):
#   def __init__(self, frame, config=None):
#   def _currentDirectory(self):
#   def _makePatterns(self, filePatterns):
#   def _saveFile(self, wnd, contents, filePatterns, message, filename):
#   def OpenFile(self, wnd, filePatterns, message=None, filename=None):
#   def SaveFile(self, wnd, content, filePatterns, message=None):
#   def SaveFileAs(self, wnd, content, filePatterns, message=None):
#   def OnSelectFile(self, evt):
#   def GetRecentFilesMenu(self):
#   def _handleMenu(self):
#   def _handleConfig(self):
# def localizePath(path):
# def modPath(name, mod):
# def evalAsPython(val, default=None):
# def GetIcon(name, module=None):
# def GetBitmap(name, module=None):
#   def __init__(self, wnd, proc):
#   def __init__(self, menuOwner=None):
#   def Popup(self, evt):
#   def getId(self, something):
#   def Enable(self, something, how):
#   def IsEnabled(self, something):
#   def Check(self, something, how):
#   def IsChecked(self, something):
#   def Add(self, onproc, name, desc=None, id=-1, macproc=None):
#   def AddCheck(self, onproc, name, desc, how=True):
#   def AppendOneMenu(self, menu, txt, help=None):
#   def Dup(self):
#   def getRepr(self, m, indentstr):
#   def __str__(self):
# def YesNo(b):
# def xlt(s): # translate
# def removeSmartQuote(txt):
# def quoteIfNeeded(txt, quoteChar='"'):
# def shlexSplit(str, sep):
# def copytree(src, dst, symlinks=False, ignore=None, replace=True):
#   def __init__(self, str=None):
#   def setString(self, items):
#   def getList(self):
#   def getString(self):
# def restoreSize(unused_name, unused_defSize=None, unused_defPos=None):
# def breakLines(text, breakLen=80):
# def splitValUnit(value):
# def strToIsoDate(val):
# def utc2local(value):
# def isoDateToStr(value):
# def timeToFloat(value):
# def floatToTime(value, nk=1):
# def prettyTime(val, nk=1):
# def prettyDate(val, long=True):
# def sizeToFloat(value):
# def prettySize(val):
# def floatToSize(val, resolution=0):
# class AcceleratorHelper:
# class Grid(wx.grid.Grid):
# class ToolBar(wx.ToolBar):
# class FileManager:
# class Timer(wx.Timer):
# class Menu(wx.Menu):
# class ParamDict(dict):
# 
# Path: Validator.py
# class Validator():
#   @staticmethod
#   def Get(name):
#     return Validator.validators.get(name.lower())
# 
#   def __init__(self, ctl, unused_params=None):
#     self.chars=[]
#     self.ctl=ctl
# 
#   def OnChar(self, ev):
#     keycode = int(ev.GetKeyCode())
#     if keycode < 256 and keycode >31:
#       if not chr(keycode) in self.chars:
#         return
#       a,e=self.ctl.GetSelection()
#       if a == e:
#         l=len(self.ctl.GetValue())
#         if l >= self.len:
#           return
#     ev.Skip()
# 
#   def GetValue(self):
#     return self.ctl.GetValue()
# 
#   def SetValue(self, val):
#     self.ctl.SetValue(unicode(val))


import adm
import inspect
import wx.xrc as xrc
import wx, os
import xmlres
from wh import xlt, StringType, floatToTime, localTimeMillis
from Validator import Validator
      from xmlhelp import Document as XmlDocument

    def addControls(self, res):
      module=self.module.replace(".", "/")
      path = os.path.join(adm.loaddir, module, "%s.xrc" % self.resname)
      doc=XmlDocument.parseFile(path)
      root=doc.getElement('object')
      objects=root.getElements('object')
      for obj in objects:
        name=obj.getAttribute('name')
        if name:
          self._addControl(name, res)


  def ctl(self, name):
    if name == "_ctls":
      return self._ctls
    elif name.startswith("__"):
      return None
    ctls=self._ctls
    return ctls.get(name.lower())


  def EnableControls(self, ctlList, how=True):
    """
    EnableControls(ctlList, how=True)
    
    Enables or disables the controls listed (list of names)
    """
    if how: how=True
    else:   how=False

# Path: wh.py
# def SetLoaddir(d):
#   def __init__(self, frame):
#   def Add(self, flags, keycode, cmd):
#   def GetTable(self):
#   def Realize(self):
#   def __init__(self, parent):
#   def OnLabelLeftClick(self, evt):
#   def GetAllSelectedRows(self):
#   def quoteVal(self, val, quoteChar):
#   def GetAllSelectedCellValues(self, withLabel=True):
#   def __init__(self, frame, size=32, style=wx.TB_FLAT|wx.TB_NODIVIDER):
#   def Enable(self, procOrId, how=None):
#   def AddCheck(self, procOrCls, text=None, bitmap=None):
#   def Add(self, procOrCls, text=None, bitmap=None, kind=wx.ITEM_NORMAL):
#   def __init__(self, frame, config=None):
#   def _currentDirectory(self):
#   def _makePatterns(self, filePatterns):
#   def _saveFile(self, wnd, contents, filePatterns, message, filename):
#   def OpenFile(self, wnd, filePatterns, message=None, filename=None):
#   def SaveFile(self, wnd, content, filePatterns, message=None):
#   def SaveFileAs(self, wnd, content, filePatterns, message=None):
#   def OnSelectFile(self, evt):
#   def GetRecentFilesMenu(self):
#   def _handleMenu(self):
#   def _handleConfig(self):
# def localizePath(path):
# def modPath(name, mod):
# def evalAsPython(val, default=None):
# def GetIcon(name, module=None):
# def GetBitmap(name, module=None):
#   def __init__(self, wnd, proc):
#   def __init__(self, menuOwner=None):
#   def Popup(self, evt):
#   def getId(self, something):
#   def Enable(self, something, how):
#   def IsEnabled(self, something):
#   def Check(self, something, how):
#   def IsChecked(self, something):
#   def Add(self, onproc, name, desc=None, id=-1, macproc=None):
#   def AddCheck(self, onproc, name, desc, how=True):
#   def AppendOneMenu(self, menu, txt, help=None):
#   def Dup(self):
#   def getRepr(self, m, indentstr):
#   def __str__(self):
# def YesNo(b):
# def xlt(s): # translate
# def removeSmartQuote(txt):
# def quoteIfNeeded(txt, quoteChar='"'):
# def shlexSplit(str, sep):
# def copytree(src, dst, symlinks=False, ignore=None, replace=True):
#   def __init__(self, str=None):
#   def setString(self, items):
#   def getList(self):
#   def getString(self):
# def restoreSize(unused_name, unused_defSize=None, unused_defPos=None):
# def breakLines(text, breakLen=80):
# def splitValUnit(value):
# def strToIsoDate(val):
# def utc2local(value):
# def isoDateToStr(value):
# def timeToFloat(value):
# def floatToTime(value, nk=1):
# def prettyTime(val, nk=1):
# def prettyDate(val, long=True):
# def sizeToFloat(value):
# def prettySize(val):
# def floatToSize(val, resolution=0):
# class AcceleratorHelper:
# class Grid(wx.grid.Grid):
# class ToolBar(wx.ToolBar):
# class FileManager:
# class Timer(wx.Timer):
# class Menu(wx.Menu):
# class ParamDict(dict):
# 
# Path: Validator.py
# class Validator():
#   @staticmethod
#   def Get(name):
#     return Validator.validators.get(name.lower())
# 
#   def __init__(self, ctl, unused_params=None):
#     self.chars=[]
#     self.ctl=ctl
# 
#   def OnChar(self, ev):
#     keycode = int(ev.GetKeyCode())
#     if keycode < 256 and keycode >31:
#       if not chr(keycode) in self.chars:
#         return
#       a,e=self.ctl.GetSelection()
#       if a == e:
#         l=len(self.ctl.GetValue())
#         if l >= self.len:
#           return
#     ev.Skip()
# 
#   def GetValue(self):
#     return self.ctl.GetValue()
# 
#   def SetValue(self, val):
#     self.ctl.SetValue(unicode(val))


# Path: controlcontainer.py
import adm
import inspect
import wx.xrc as xrc
import wx, os
import xmlres
from wh import xlt, StringType, floatToTime, localTimeMillis
from Validator import Validator
      from xmlhelp import Document as XmlDocument


    def addControls(self, res):
      module=self.module.replace(".", "/")
      path = os.path.join(adm.loaddir, module, "%s.xrc" % self.resname)
      doc=XmlDocument.parseFile(path)
      root=doc.getElement('object')
      objects=root.getElements('object')
      for obj in objects:
        name=obj.getAttribute('name')
        if name:
          self._addControl(name, res)


  def ctl(self, name):
    if name == "_ctls":
      return self._ctls
    elif name.startswith("__"):
      return None
    ctls=self._ctls
    return ctls.get(name.lower())


  def EnableControls(self, ctlList, how=True):
    """
    EnableControls(ctlList, how=True)
    
    Enables or disables the controls listed (list of names)
    """
    if how: how=True
    else:   how=False

    if isinstance(ctlList, StringType):