(alignment Alignment2D)
| 133 | } |
| 134 | |
| 135 | func (s *static) setTextAlignment(alignment Alignment2D) error { |
| 136 | if alignment == s.textAlignment { |
| 137 | return nil |
| 138 | } |
| 139 | |
| 140 | var styleBit uint32 |
| 141 | |
| 142 | switch alignment { |
| 143 | case AlignHNearVNear, AlignHNearVCenter, AlignHNearVFar: |
| 144 | styleBit |= win.SS_LEFT |
| 145 | |
| 146 | case AlignHCenterVNear, AlignHCenterVCenter, AlignHCenterVFar: |
| 147 | styleBit |= win.SS_CENTER |
| 148 | |
| 149 | case AlignHFarVNear, AlignHFarVCenter, AlignHFarVFar: |
| 150 | styleBit |= win.SS_RIGHT |
| 151 | } |
| 152 | |
| 153 | if err := setAndClearWindowLongBits(s.hwndStatic, win.GWL_STYLE, styleBit, win.SS_LEFT|win.SS_CENTER|win.SS_RIGHT); err != nil { |
| 154 | return err |
| 155 | } |
| 156 | |
| 157 | s.textAlignment = alignment |
| 158 | |
| 159 | s.Invalidate() |
| 160 | |
| 161 | return nil |
| 162 | } |
| 163 | |
| 164 | func (s *static) setText(text string) (changed bool, err error) { |
| 165 | if text == s.text() { |
no test coverage detected