# Path: venster/lib/list.py
# class List(ListView):
#     def __init__(self, *args, **kwargs):
#     def dispose(self):
#     def InsertColumns(self, colDefs):
#     def SetColumns(self, colDefs):
#     def InsertRow(self, i, row, lParam = 0):
#     def SetRow(self, i, row):
#     def SelectAll(self):
#     def InvertSelection(self):
# 
# Path: venster/lib/form.py
# EXIT_NONE = 0
# EXIT_ONDESTROY = 1 #exit app on destroy of form
# EXIT_ONLASTDESTROY = 2 #exit app on destroy of last form
# ID_NEW = 5001
# ID_OPEN = 5002
# ID_EXIT = 5003
# ID_SAVE = 5004
# ID_SAVEAS = 5005
# ID_CLOSE = 5006
# ID_UNDO = 5101
# ID_REDO = 5102
# ID_COPY = 5103
# ID_PASTE = 5104
# ID_CUT = 5105
# ID_SELECTALL = 5106
# ID_CLEAR = 5107
# ID_HELP_CONTENTS = 5201
# ID_ABOUT = 5202
# CTRL_VIEW = "form_CtrlView"
# CTRL_STATUSBAR = "form_CtrlStatusBar"
# CTRL_COOLBAR = "form_CtrlCoolbar"
# class Controls(dict):
# class Form(Window):
#     class CmdUIUpdateEvent(object):
# class CMD_UI_UPDATE(object):
#     def Add(self, *args):
#     def dispose(self):
#     def __getattr__(self, key):
#     def __init__(self, *args, **kwargs):
#     def dispose(self):
#     def CreateAccels(self):
#     def PreTranslateMessage(self, msg):
#     def OnMenuSelect(self, event):
#         def __init__(self):
#         def Enable(self, fEnable):
#     def OnInitMenuPopup(self, event):
#     def DoLayout(self, cx, cy):
#     def OnDestroy(self, event):
#     def OnSize(self, event):
#     def OnCreate(self, event):
#     def OnExitCmd(self, event):
#     def OnCloseCmd(self, event):
#     def OnClose(self, event):
#     def __init__(self, id, handler):
#     def __install__(self, msgMap):
#     def __call__(self, receiver, event):


from venster.windows import *
from venster.wtl import *
from venster.comctl import *
from venster.lib import list
from venster.lib import form
from ctypes import *
        self.SetRedraw(0)
        for i in range(len(columnDefs) - 1):
            #self.SetColumnWidth(i, width / len(columnDefs))
            self.SetColumnWidth(i, -2)
        self.SetColumnWidth(len(columnDefs) - 1, -2)
        self.SetRedraw(1)
        event.handled = False

    msg_handler(WM_SIZE)(OnSize)
                         
    def OnColumnClick(self, event):
        nmlv = NMLISTVIEW.from_address(int(event.lParam))
        print "column clicked!", nmlv.iSubItem
        
    ntf_handler(LVN_COLUMNCLICK)(OnColumnClick)
    
    
class MyForm(form.Form):
    _window_icon_ = blinkyIcon
    _window_icon_sm_ = blinkyIcon
    _window_background_ = 0

    _window_title_ = "Test auto column resize (NOT WORKING!)"

    def OnCreate(self, event):
        aList = MyList(parent = self, orExStyle = WS_EX_CLIENTEDGE)
        aList.InsertColumns(columnDefs)
        for i in range(100):
            aList.InsertRow(i, ["blaat %d" % i, "blaat col2 %d" % i])


# Path: venster/lib/list.py
# class List(ListView):
#     def __init__(self, *args, **kwargs):
#     def dispose(self):
#     def InsertColumns(self, colDefs):
#     def SetColumns(self, colDefs):
#     def InsertRow(self, i, row, lParam = 0):
#     def SetRow(self, i, row):
#     def SelectAll(self):
#     def InvertSelection(self):
# 
# Path: venster/lib/form.py
# EXIT_NONE = 0
# EXIT_ONDESTROY = 1 #exit app on destroy of form
# EXIT_ONLASTDESTROY = 2 #exit app on destroy of last form
# ID_NEW = 5001
# ID_OPEN = 5002
# ID_EXIT = 5003
# ID_SAVE = 5004
# ID_SAVEAS = 5005
# ID_CLOSE = 5006
# ID_UNDO = 5101
# ID_REDO = 5102
# ID_COPY = 5103
# ID_PASTE = 5104
# ID_CUT = 5105
# ID_SELECTALL = 5106
# ID_CLEAR = 5107
# ID_HELP_CONTENTS = 5201
# ID_ABOUT = 5202
# CTRL_VIEW = "form_CtrlView"
# CTRL_STATUSBAR = "form_CtrlStatusBar"
# CTRL_COOLBAR = "form_CtrlCoolbar"
# class Controls(dict):
# class Form(Window):
#     class CmdUIUpdateEvent(object):
# class CMD_UI_UPDATE(object):
#     def Add(self, *args):
#     def dispose(self):
#     def __getattr__(self, key):
#     def __init__(self, *args, **kwargs):
#     def dispose(self):
#     def CreateAccels(self):
#     def PreTranslateMessage(self, msg):
#     def OnMenuSelect(self, event):
#         def __init__(self):
#         def Enable(self, fEnable):
#     def OnInitMenuPopup(self, event):
#     def DoLayout(self, cx, cy):
#     def OnDestroy(self, event):
#     def OnSize(self, event):
#     def OnCreate(self, event):
#     def OnExitCmd(self, event):
#     def OnCloseCmd(self, event):
#     def OnClose(self, event):
#     def __init__(self, id, handler):
#     def __install__(self, msgMap):
#     def __call__(self, receiver, event):


# Path: test/test_list.py
from venster.windows import *
from venster.wtl import *
from venster.comctl import *
from venster.lib import list
from venster.lib import form
from ctypes import *

        self.SetRedraw(0)
        for i in range(len(columnDefs) - 1):
            #self.SetColumnWidth(i, width / len(columnDefs))
            self.SetColumnWidth(i, -2)
        self.SetColumnWidth(len(columnDefs) - 1, -2)
        self.SetRedraw(1)
        event.handled = False

    msg_handler(WM_SIZE)(OnSize)
                         
    def OnColumnClick(self, event):
        nmlv = NMLISTVIEW.from_address(int(event.lParam))
        print "column clicked!", nmlv.iSubItem
        
    ntf_handler(LVN_COLUMNCLICK)(OnColumnClick)
    
    
class MyForm(form.Form):
    _window_icon_ = blinkyIcon
    _window_icon_sm_ = blinkyIcon
    _window_background_ = 0

    _window_title_ = "Test auto column resize (NOT WORKING!)"

    def OnCreate(self, event):
        aList = MyList(parent = self, orExStyle = WS_EX_CLIENTEDGE)
        aList.InsertColumns(columnDefs)
        for i in range(100):
            aList.InsertRow(i, ["blaat %d" % i, "blaat col2 %d" % i])


        self.controls.Add(form.CTRL_VIEW, aList)