summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/win/PopupMenuWin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/win/PopupMenuWin.cpp')
-rw-r--r--WebCore/platform/win/PopupMenuWin.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp
index 7d8c8d5..4ba5e30 100644
--- a/WebCore/platform/win/PopupMenuWin.cpp
+++ b/WebCore/platform/win/PopupMenuWin.cpp
@@ -30,6 +30,7 @@
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLNames.h"
+#include "HostWindow.h"
#include "Page.h"
#include "PlatformMouseEvent.h"
#include "PlatformScreen.h"
@@ -41,7 +42,7 @@
#include <tchar.h>
#include <windows.h>
#include <windowsx.h>
-#if PLATFORM(WINCE)
+#if OS(WINCE)
#include <ResDefCE.h>
#define MAKEPOINTS(l) (*((POINTS FAR *)&(l)))
#endif
@@ -151,7 +152,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index)
// Determine whether we should animate our popups
// Note: Must use 'BOOL' and 'FALSE' instead of 'bool' and 'false' to avoid stack corruption with SystemParametersInfo
BOOL shouldAnimate = FALSE;
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
::SystemParametersInfo(SPI_GETCOMBOBOXANIMATION, 0, &shouldAnimate, 0);
if (shouldAnimate) {
@@ -279,7 +280,6 @@ void PopupMenu::hide()
::PostMessage(m_popup, WM_NULL, 0, 0);
}
-const int endOfLinePadding = 2;
void PopupMenu::calculatePositionAndSize(const IntRect& r, FrameView* v)
{
// r is in absolute document coordinates, but we want to be in screen coordinates
@@ -325,9 +325,7 @@ void PopupMenu::calculatePositionAndSize(const IntRect& r, FrameView* v)
popupWidth += ScrollbarTheme::nativeTheme()->scrollbarThickness(SmallScrollbar);
// Add padding to align the popup text with the <select> text
- // Note: We can't add paddingRight() because that value includes the width
- // of the dropdown button, so we must use our own endOfLinePadding constant.
- popupWidth += max(0, endOfLinePadding - client()->clientInsetRight()) + max(0, client()->clientPaddingLeft() - client()->clientInsetLeft());
+ popupWidth += max(0, client()->clientPaddingRight() - client()->clientInsetRight()) + max(0, client()->clientPaddingLeft() - client()->clientInsetLeft());
// Leave room for the border
popupWidth += 2 * popupWindowBorderWidth;
@@ -578,7 +576,7 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc)
}
}
if (!m_bmp) {
-#if PLATFORM(WINCE)
+#if OS(WINCE)
BitmapInfo bitmapInfo(true, clientRect().width(), clientRect().height());
#else
BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size());
@@ -713,7 +711,7 @@ void PopupMenu::registerClass()
if (haveRegisteredWindowClass)
return;
-#if PLATFORM(WINCE)
+#if OS(WINCE)
WNDCLASS wcex;
#else
WNDCLASSEX wcex;
@@ -734,7 +732,7 @@ void PopupMenu::registerClass()
haveRegisteredWindowClass = true;
-#if PLATFORM(WINCE)
+#if OS(WINCE)
RegisterClass(&wcex);
#else
RegisterClassEx(&wcex);
@@ -744,7 +742,7 @@ void PopupMenu::registerClass()
LRESULT CALLBACK PopupMenu::PopupMenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
-#if PLATFORM(WINCE)
+#if OS(WINCE)
LONG longPtr = GetWindowLong(hWnd, 0);
#else
LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
@@ -757,7 +755,7 @@ LRESULT CALLBACK PopupMenu::PopupMenuWndProc(HWND hWnd, UINT message, WPARAM wPa
LPCREATESTRUCT createStruct = reinterpret_cast<LPCREATESTRUCT>(lParam);
// Associate the PopupMenu with the window.
-#if PLATFORM(WINCE)
+#if OS(WINCE)
::SetWindowLong(hWnd, 0, (LONG)createStruct->lpCreateParams);
#else
::SetWindowLongPtr(hWnd, 0, (LONG_PTR)createStruct->lpCreateParams);
@@ -891,7 +889,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
}
BOOL shouldHotTrack = FALSE;
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
::SystemParametersInfo(SPI_GETHOTTRACKING, 0, &shouldHotTrack, 0);
#endif
@@ -988,7 +986,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
lResult = 0;
break;
}
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
case WM_PRINTCLIENT:
paint(clientRect(), (HDC)wParam);
break;