Commit c69d46af authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

win64 cool version

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64325 954022d7-b5bf-4e40-9824-e11837661b57
parent 763889b3
......@@ -47,7 +47,7 @@ class QAscMainWindow : public QMainWindow
public:
explicit QAscMainWindow(QWidget *parent, CAscApplicationManager* pAppManager) : QMainWindow(parent)
{
this->resize(1000, 500);
this->resize(2000, 1000);
QWidget* pMainPanel = new QAscMainPanel(this, pAppManager, false);
this->setCentralWidget(pMainPanel);
......
......@@ -46,6 +46,7 @@ public:
void focus(bool value = true);
void resizeEvent(int width = 0, int height = 0);
void moveEvent();
bool nativeEvent(const char* data, const int& datalen, void *message, long *result);
void Apply(NSEditorApi::CAscMenuEvent* );
......
......@@ -52,6 +52,15 @@ void QCefView::resizeEvent(QResizeEvent* e)
m_pCefView->resizeEvent();
}
void QCefView::moveEvent(QMoveEvent* e)
{
if (NULL != e)
QWidget::moveEvent(e);
if (NULL != m_pCefView)
m_pCefView->moveEvent();
}
bool QCefView::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
if (m_pCefView)
......
......@@ -22,8 +22,8 @@ public:
void SetBackgroundCefColor(unsigned char r, unsigned char g, unsigned char b);
virtual void focusInEvent(QFocusEvent* e);
virtual void resizeEvent(QResizeEvent* e);
virtual void moveEvent(QMoveEvent* e);
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
......
......@@ -1639,90 +1639,37 @@ std::wstring CCefView::GetUrl()
void CCefView::focus(bool value)
{
if (!m_pInternal)
if (!m_pInternal || !m_pInternal->m_handler.get())
return;
#if 1
if (m_pInternal->m_handler.get())
CefRefPtr<CefBrowser> browser = m_pInternal->m_handler->GetBrowser();
if (browser)
{
#if 0
if (!CefCurrentlyOn(TID_UI))
{
return;
}
#endif
// Give focus to the browser.
browser->GetHost()->SetFocus(value);
CefRefPtr<CefBrowser> browser = m_pInternal->m_handler->GetBrowser();
if (browser)
if (!m_pInternal->m_bIsMouseHook)
{
#if 0
// TEST
if (NULL == m_pInternal->m_pDragAndDropWrapper && false)
{
CefWindowHandle nativeHandle = browser->GetHost()->GetWindowHandle();
DragAcceptFiles(nativeHandle, TRUE);
m_pInternal->m_pDragAndDropWrapper = new CDragAndDropWrapper();
m_pInternal->m_pDragAndDropWrapper->m_pHandler = m_pInternal->m_handler.get();
m_pInternal->m_pDragAndDropWrapper->m_hWnd = nativeHandle;
HRESULT hr = RegisterDragDrop(nativeHandle, m_pInternal->m_pDragAndDropWrapper);
int u = 0;
u++;
}
#endif
// Give focus to the browser.
browser->GetHost()->SetFocus(value);
if (!m_pInternal->m_bIsMouseHook)
if (this->GetType() == cvwtSimple)
{
if (this->GetType() == cvwtSimple)
{
#ifdef WIN32
DWORD threadId = GetWindowThreadProcessId(browser->GetHost()->GetWindowHandle(), NULL);
HHOOK hook = SetWindowsHookEx(WH_MOUSE, MyMouseHook, NULL, threadId);
DWORD threadId = GetWindowThreadProcessId(browser->GetHost()->GetWindowHandle(), NULL);
HHOOK hook = SetWindowsHookEx(WH_MOUSE, MyMouseHook, NULL, threadId);
#endif
}
m_pInternal->m_bIsMouseHook = true;
}
m_pInternal->m_bIsMouseHook = true;
}
}
#endif
}
bool CCefView::nativeEvent(const char* data, const int& datalen, void *message, long *result)
{
#ifdef WIN32
*result = 0;
MSG *msg = static_cast<MSG *>(message);
if(msg->message == WM_CREATE)
{
HWND hWnd = (HWND)m_pInternal->m_pWidgetImpl->parent_wid();
RECT rcClient;
GetWindowRect(hWnd, &rcClient);
CCefViewWidgetImpl* pImpl = m_pInternal->m_pWidgetImpl;
SetWindowPos(hWnd, NULL, pImpl->parent_x(), pImpl->parent_y(), pImpl->parent_width(), pImpl->parent_height(), SWP_FRAMECHANGED);
*result = 0;
return true;
}
else if (msg->message == WM_PAINT)
{
HWND hWnd = (HWND)m_pInternal->m_pWidgetImpl->parent_wid();
PAINTSTRUCT ps;
BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
return true;
}
else if (msg->message == WM_SETFOCUS)
{
focus();
return true;
}
else if (msg->message == WM_ERASEBKGND)
if (msg->message == WM_ERASEBKGND)
{
if (m_pInternal->m_handler && m_pInternal->m_handler->GetBrowser() && m_pInternal->m_handler->GetBrowser()->GetHost())
{
......@@ -1743,10 +1690,6 @@ bool CCefView::nativeEvent(const char* data, const int& datalen, void *message,
}
return true;
}
else if (msg->message == WM_SIZE)
{
this->resizeEvent();
}
else if (msg->message == (WM_USER + 1))
{
if (this->GetType() == cvwtSimple)
......@@ -1755,6 +1698,7 @@ bool CCefView::nativeEvent(const char* data, const int& datalen, void *message,
}
return true;
}
#endif
return false;
}
......@@ -1786,6 +1730,16 @@ void CCefView::resizeEvent(int width, int height)
focus();
}
void CCefView::moveEvent()
{
#if defined(_LINUX) && !defined(_MAC)
if (m_pInternal && m_pInternal->m_handler && m_pInternal->m_handler->GetBrowser() && m_pInternal->m_handler->GetBrowser()->GetHost())
{
m_pInternal->m_handler->GetBrowser()->GetHost()->NotifyMoveOrResizeStarted();
}
#endif
}
void CCefView::Apply(NSEditorApi::CAscMenuEvent* pEvent)
{
if (NULL == pEvent)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment