Fixed preferred size forgetfulness.

This commit is contained in:
Pietro Gagliardi 2014-10-16 15:16:11 -04:00
parent 66d241074a
commit 7c9c51a083
4 changed files with 3 additions and 7 deletions

View File

@ -55,7 +55,6 @@ const (
) )
func (b *button) preferredSize(d *sizing) (width, height int) { func (b *button) preferredSize(d *sizing) (width, height int) {
return 0,0/*TODO/*
// comctl32.dll version 6 thankfully provides a method to grab this... // comctl32.dll version 6 thankfully provides a method to grab this...
var size C.SIZE var size C.SIZE
@ -69,5 +68,4 @@ return 0,0/*TODO/*
// don't worry about the error return from GetSystemMetrics(); there's no way to tell (explicitly documented as such) // don't worry about the error return from GetSystemMetrics(); there's no way to tell (explicitly documented as such)
xmargins := 2 * int(C.GetSystemMetrics(C.SM_CXEDGE)) xmargins := 2 * int(C.GetSystemMetrics(C.SM_CXEDGE))
return xmargins + int(b.textlen), fromdlgunitsY(buttonHeight, d) return xmargins + int(b.textlen), fromdlgunitsY(buttonHeight, d)
*/
} }

View File

@ -69,8 +69,6 @@ const (
) )
func (c *checkbox) preferredSize(d *sizing) (width, height int) { func (c *checkbox) preferredSize(d *sizing) (width, height int) {
return 0,0/*TODO return fromdlgunitsX(checkboxXFromLeftOfBoxToLeftOfLabel, d) + int(c.textlen),
return fromdlgunitsX(checkboxXFromLeftOfBoxToLeftOfLabel, d) + int(c._textlen),
fromdlgunitsY(checkboxHeight, d) fromdlgunitsY(checkboxHeight, d)
*/
} }

View File

@ -42,7 +42,7 @@ const (
) )
func (l *label) preferredSize(d *sizing) (width, height int) { func (l *label) preferredSize(d *sizing) (width, height int) {
return 0,0//TODO return int(l._textlen), fromdlgunitsY(labelHeight, d) return int(l.textlen), fromdlgunitsY(labelHeight, d)
} }
/*TODO /*TODO

View File

@ -71,5 +71,5 @@ const (
) )
func (t *textfield) preferredSize(d *sizing) (width, height int) { func (t *textfield) preferredSize(d *sizing) (width, height int) {
return 0,0//TODO return fromdlgunitsX(textfieldWidth, d), fromdlgunitsY(textfieldHeight, d) return fromdlgunitsX(textfieldWidth, d), fromdlgunitsY(textfieldHeight, d)
} }