summaryrefslogtreecommitdiff
path: root/redo/table_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-03 09:18:35 -0400
committerPietro Gagliardi <[email protected]>2014-08-03 09:18:35 -0400
commit1aea308645585f2fbc6c8b170381c811d562cc99 (patch)
tree1db721a972133a1ed0d9808eafabfbed66f6892f /redo/table_windows.go
parent585f5f5b62da3170d4398b39670d16811013d078 (diff)
Set up the Control restructure and migrated the Windows implementation over. Lots of repetition, but hopefully more correct and maintainable!
Diffstat (limited to 'redo/table_windows.go')
-rw-r--r--redo/table_windows.go45
1 files changed, 34 insertions, 11 deletions
diff --git a/redo/table_windows.go b/redo/table_windows.go
index 7dfbc56..633486e 100644
--- a/redo/table_windows.go
+++ b/redo/table_windows.go
@@ -30,7 +30,6 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table {
for i := 0; i < ty.NumField(); i++ {
C.tableAppendColumn(t.hwnd, C.int(i), toUTF16(ty.Field(i).Name))
}
- t.fpreferredSize = t.tablepreferredSize
return t
}
@@ -43,16 +42,6 @@ func (t *table) Unlock() {
C.tableUpdate(t.hwnd, C.int(reflect.Indirect(reflect.ValueOf(t.data)).Len()))
}
-const (
- // from C++ Template 05 in http://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx as this is the best I can do for now... (TODO see if I can reliably get item width/height from text size)
- tableWidth = 183
- tableHeight = 50
-)
-
-func (t *table) tablepreferredSize(d *sizing) (width, height int) {
- return fromdlgunitsX(tableWidth, d), fromdlgunitsY(tableHeight, d)
-}
-
//export tableGetCellText
func tableGetCellText(data unsafe.Pointer, row C.int, col C.int, str *C.LPWSTR) {
t := (*table)(data)
@@ -63,3 +52,37 @@ func tableGetCellText(data unsafe.Pointer, row C.int, col C.int, str *C.LPWSTR)
s := fmt.Sprintf("%v", datum)
*str = toUTF16(s)
}
+
+func (t *table) setParent(p *controlParent) {
+ basesetParent(t.controlbase, p)
+}
+
+func (t *table) containerShow() {
+ basecontainerShow(t.controlbase)
+}
+
+func (t *table) containerHide() {
+ basecontainerHide(t.controlbase)
+}
+
+func (t *table) allocate(x int, y int, width int, height int, d *sizing) []*allocation {
+ return baseallocate(t, x, y, width, height, d)
+}
+
+const (
+ // from C++ Template 05 in http://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx as this is the best I can do for now... (TODO see if I can reliably get item width/height from text size)
+ tableWidth = 183
+ tableHeight = 50
+)
+
+func (t *table) preferredSize(d *sizing) (width, height int) {
+ return fromdlgunitsX(tableWidth, d), fromdlgunitsY(tableHeight, d)
+}
+
+func (t *table) commitResize(a *allocation, d *sizing) {
+ basecommitResize(t.controlbase, a, d)
+}
+
+func (t *table) getAuxResizeInfo(d *sizing) {
+ basegetAuxResizeInfo(d)
+}