diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-03 09:18:35 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-03 09:18:35 -0400 |
| commit | 1aea308645585f2fbc6c8b170381c811d562cc99 (patch) | |
| tree | 1db721a972133a1ed0d9808eafabfbed66f6892f /redo/textfield_windows.go | |
| parent | 585f5f5b62da3170d4398b39670d16811013d078 (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/textfield_windows.go')
| -rw-r--r-- | redo/textfield_windows.go | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/redo/textfield_windows.go b/redo/textfield_windows.go index d325a18..a2add7a 100644 --- a/redo/textfield_windows.go +++ b/redo/textfield_windows.go @@ -19,7 +19,6 @@ func startNewTextField(style C.DWORD) *textField { t := &textField{ controlbase: c, } - t.fpreferredSize = t.textfieldpreferredSize return t } @@ -39,12 +38,36 @@ func (t *textField) SetText(text string) { t.setText(text) } +func (t *textField) setParent(p *controlParent) { + basesetParent(t.controlbase, p) +} + +func (t *textField) containerShow() { + basecontainerShow(t.controlbase) +} + +func (t *textField) containerHide() { + basecontainerHide(t.controlbase) +} + +func (t *textField) allocate(x int, y int, width int, height int, d *sizing) []*allocation { + return baseallocate(t, x, y, width, height, d) +} + const ( // from http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing textfieldWidth = 107 // this is actually the shorter progress bar width, but Microsoft only indicates as wide as necessary textfieldHeight = 14 ) -func (t *textField) textfieldpreferredSize(d *sizing) (width, height int) { +func (t *textField) preferredSize(d *sizing) (width, height int) { return fromdlgunitsX(textfieldWidth, d), fromdlgunitsY(textfieldHeight, d) } + +func (t *textField) commitResize(a *allocation, d *sizing) { + basecommitResize(t.controlbase, a, d) +} + +func (t *textField) getAuxResizeInfo(d *sizing) { + basegetAuxResizeInfo(d) +} |
