| 200 | pass |
| 201 | |
| 202 | def UpdateElementsPos(self, dc): |
| 203 | rect = self.GetRect() |
| 204 | |
| 205 | if self.searchBitmap and self.isSearchButtonVisible: |
| 206 | sw = self.searchBitmap.GetWidth() |
| 207 | sh = self.searchBitmap.GetHeight() |
| 208 | else: |
| 209 | sw = 0 |
| 210 | sh = 0 |
| 211 | |
| 212 | if self.cancelBitmap and self.isCancelButtonVisible: |
| 213 | cw = self.cancelBitmap.GetWidth() |
| 214 | ch = self.cancelBitmap.GetHeight() |
| 215 | else: |
| 216 | cw = 0 |
| 217 | ch = 0 |
| 218 | |
| 219 | cwidth = rect.width |
| 220 | cheight = rect.height |
| 221 | |
| 222 | self.searchButtonX = self.padding |
| 223 | self.searchButtonY = (cheight - sh) / 2 |
| 224 | self.cancelButtonX = cwidth - self.padding - cw |
| 225 | self.cancelButtonY = (cheight - ch) / 2 |
| 226 | |
| 227 | self.editX = self.searchButtonX + self.padding + sw |
| 228 | |
| 229 | editWidth, editHeight = self.EditBox.GetSize() |
| 230 | |
| 231 | self.editY = (cheight - editHeight) / 2 |
| 232 | self.EditBox.SetPosition((self.editX, self.editY)) |
| 233 | self.EditBox.SetSize((self.cancelButtonX - self.padding - self.editX, -1)) |
| 234 | |
| 235 | def OnPaint(self, event): |
| 236 | dc = wx.AutoBufferedPaintDC(self) |