- int currentX, currentY;
- GetPosition(¤tX, ¤tY);
-
- int x1 = x;
- int y1 = y;
- int w1 = width;
- int h1 = height;
-
- if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
- x1 = currentX;
- if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
- y1 = currentY;
-
- // If we're prepared to use the existing size, then...
- if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
- {
- GetSize(&w1, &h1);
- }
-
- int cx; // button font dimensions
- int cy;
-
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
-
- float control_width, control_height, control_x, control_y;
-
- // Deal with default size (using -1 values)
- if (w1<=0)
- w1 = DEFAULT_ITEM_WIDTH;
-
- if (h1<=0)
- h1 = DEFAULT_ITEM_HEIGHT;
-
- control_x = (float)x1;
- control_y = (float)y1;
- control_width = (float)w1;
- control_height = (float)h1;
-
- // Calculations may have made size too small
- if (control_height <= 0)
- control_height = (float)DEFAULT_ITEM_HEIGHT;
-
- if (control_width <= 0)
- control_width = (float)DEFAULT_ITEM_WIDTH;
-
-// wxDebugMsg("About to set the listbox height to %d", (int)control_height);
- MoveWindow(hwnd, (int)control_x, (int)control_y,
- (int)control_width, (int)control_height, TRUE);
-
-/*
-#if WXWIN_COMPATIBILITY
- GetEventHandler()->OldOnSize(width, height);
-#else
- wxSizeEvent event(wxSize(width, height), m_windowId);
- event.eventObject = this;
- GetEventHandler()->ProcessEvent(event);
-#endif
-*/