()
| 146 | } |
| 147 | |
| 148 | func (tb *ToolBar) applyDefaultButtonWidth() error { |
| 149 | if tb.defaultButtonWidth == 0 { |
| 150 | return nil |
| 151 | } |
| 152 | |
| 153 | dpi := tb.DPI() |
| 154 | width := IntFrom96DPI(tb.defaultButtonWidth, dpi) |
| 155 | |
| 156 | lParam := uintptr(win.MAKELONG(uint16(width), uint16(width))) |
| 157 | if 0 == tb.SendMessage(win.TB_SETBUTTONWIDTH, 0, lParam) { |
| 158 | return newError("SendMessage(TB_SETBUTTONWIDTH)") |
| 159 | } |
| 160 | |
| 161 | size := uint32(tb.SendMessage(win.TB_GETBUTTONSIZE, 0, 0)) |
| 162 | height := win.HIWORD(size) |
| 163 | |
| 164 | lParam = uintptr(win.MAKELONG(uint16(width), height)) |
| 165 | if win.FALSE == tb.SendMessage(win.TB_SETBUTTONSIZE, 0, lParam) { |
| 166 | return newError("SendMessage(TB_SETBUTTONSIZE)") |
| 167 | } |
| 168 | |
| 169 | return nil |
| 170 | } |
| 171 | |
| 172 | // DefaultButtonWidth returns the default button width of the ToolBar. |
| 173 | // |
no test coverage detected