Exemple #1
0
LRESULT CPredView::OnClickNavi(WPARAM wParam, LPARAM lParam)
{
	TRACE("%d\n",wParam);
	if(wParam>=1 && wParam<=4)
		Invalidate();
	if(wParam==5)
	{
		if(wnd_navi.bDropDown==false)
			wnd_navi.SetWindowPos(&this->wndTop,0,0,200,21,SWP_NOMOVE);
		else
			wnd_navi.SetWindowPos(&this->wndTop,0,0,200,42,SWP_NOMOVE);
	}
	if(wParam==6)
	{
		CString tmpstr;
		CFCCDoc* pDoc=(CFCCDoc*)GetDocument();
		wnd_navi.m_nCol.GetWindowTextA(tmpstr);
		nCol=atoi(tmpstr);
		if(nCol<1)
			nCol=1;
		wnd_navi.m_nRow.GetWindowTextA(tmpstr);
		nItemPage=atoi(tmpstr);
		if(nItemPage<10)
			nItemPage=10;
		wnd_navi.nCurPage=1;
		wnd_navi.nTotalPage=pDoc->list_CompoundTest.GetCount()/(nCol*nItemPage)+1;
		wnd_navi.Invalidate();
		tmpstr.Format("%d",nItemPage);
		wnd_navi.m_nRow.SetWindowTextA(tmpstr);
		tmpstr.Format("%d",nCol);
		wnd_navi.m_nCol.SetWindowTextA(tmpstr);
		Invalidate();	
	}
	return LRESULT();
}
Exemple #2
0
LRESULT RemoteKeyboard::OnCursorRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	bHandled = false;
	current_channel_ = -1;
	in_channel_ = false;

	return LRESULT();
}
LRESULT CIEDlg::OnUpdateTitle(WPARAM wp, LPARAM lp)
{
	if (m_PluginInst) {
		const char* scriptStr = "javascript:document.title=document.getElementById(\'IETab2\').title;";
		NPN_GetURL( m_PluginInst->getInstance(), scriptStr, NULL );
	}
	return LRESULT(0);
}
Exemple #4
0
LRESULT IpSetWnd::OnInit()
{
	SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
	// ÉèÖÃ͸Ã÷É«  		
	COLORREF cr_key = RGB(0, 0, 0);
	SetLayeredWindowAttributes(m_hWnd, cr_key, 0, LWA_COLORKEY);
	SetLayeredWindowAttributes(m_hWnd, 0, 170, LWA_ALPHA);
	return LRESULT();
}
Exemple #5
0
//text static의 배경색을 투명하게 하기 위해
LRESULT CPopupDlg::OnCtlColorStatic(WPARAM wParam, LPARAM lParam)
{
	HDC hdc = (HDC)wParam;
	HWND hwndStatic = (HWND) lParam;

	if(GetDlgItem(IDC_STATIC_TEXT)->m_hWnd == hwndStatic)
	{
		SetBkMode(hdc, TRANSPARENT);
		return (HRESULT)(HBRUSH)GetStockObject(NULL_BRUSH);
	}
	return LRESULT();
}
Exemple #6
0
LRESULT PropPage::OnCtlColorDlg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if (BOOLSETTING(SETTINGS_WINDOW_COLORIZE))
	{
		m_hDialogBrush = CreateSolidBrush(Colors::g_bgColor /*GetSysColor(COLOR_BTNFACE)*/); // [!] IRainman fix.
		return LRESULT(m_hDialogBrush);
	}
	else
	{
		return 0;
	}
}
Exemple #7
0
LRESULT PropPage::OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if (BOOLSETTING(SETTINGS_WINDOW_COLORIZE))
	{
		HDC hdc = (HDC)wParam;
		SetBkMode(hdc, TRANSPARENT);
		return LRESULT(m_hDialogBrush);
	}
	else
	{
		return 0;
	}
}
Exemple #8
0
LRESULT FrameWnd::OnInitOtherWndMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	video_wnd_.reset(new VideoWnd());
	video_wnd_->Init(m_hWnd);
	video_wnd_->RunVideo();

	keyboard_.reset(new RemoteKeyboard);
	keyboard_->Init(video_wnd_->GetHwnd());
	keyboard_->ShowWindow(true);

	OnFullWnd();
	return LRESULT();
}
Exemple #9
0
LRESULT RemoteKeyboard::OnCursorRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	bHandled = false;
	POINT point;
	point.x = GET_X_LPARAM(lParam);
	point.y = GET_Y_LPARAM(lParam);
	for (int i = 4; i < 12; ++i) {
		if (InChKeyRect(i, point)) {
			in_channel_ = true;
			current_channel_ = i;
			old_point_ = point;
			return 0;
		}
	}

	return LRESULT();
}
Exemple #10
0
//换肤
LRESULT CManageDlg::OnExchangeSkin(WPARAM wpara,LPARAM lpara)
{
	CString s=CBcfFile::GetAppPath ();//本地路径
	CString strSkin = m_skinmgr.GetSkinBcfFileName();
	CBcfFile f( s + strSkin);
	TCHAR path[MAX_PATH];
	CString skinfolder = f.GetKeyVal(m_skinmgr.GetKeyVal(strSkin),"skinfolder",m_skinmgr.GetSkinPath());

	/*// 2012.12.17 yyf 屏蔽
	wsprintf(path,"%sdialog\\manager_bk.bmp",skinfolder);
	m_bk.SetLoadInfo(path,CGameImageLink::m_bAutoLock);*/
	
	//*-------初始化 m_configDlg--------- 2012.10.17 yyf
	TCHAR pathConfig[MAX_PATH];
	TCHAR PathDefault[MAX_PATH];
	
	wsprintf(pathConfig,"%s%sdialog\\configDlg\\CManageDlgConfig\\configDlg.bcf",s,skinfolder);// 
	wsprintf(PathDefault,"%s%s",s,skinfolder);
	m_configDlg.LoadConfig(pathConfig,PathDefault);	

	int cx,cy; 
	cx=m_configDlg.GetDlgWide();
	cy=m_configDlg.GetDlgHigh(); 
	//-----------------------------------------------------*/
	wsprintf(path,"%sdialog\\apply.bmp",skinfolder);
	m_BtOK.LoadButtonBitmap(path,false);
	wsprintf(path,"%sdialog\\abandon.bmp",skinfolder);
	m_BtCancel.LoadButtonBitmap(path,false);
	CRect ClientRect;
	GetClientRect(&ClientRect);

	/*// 2012.12.17 yyf 屏蔽
	CGameImageHelper	help(&m_bk);
	MoveWindow(ClientRect.left,ClientRect.top,help.GetWidth(),help.GetHeight());*/
	
	MoveWindow(ClientRect.left,ClientRect.top,cx,cy);// 2012.12.17 yyf
	//OnPaint();
	
	SetWndRgn();// 设置窗口圆角2012.10.17 yyf
	Invalidate();
	return LRESULT(0);
}
Exemple #11
0
//换肤
LRESULT CIMMain::OnExchangeSkin(WPARAM wpara,LPARAM lpara)
{
#ifndef  MAINROOM_USE_SHORTMSG
	CIMSession *imSession=NULL;
	OutputDebugString("*rende*CIMMain::OnExchangeSkin");
	POSITION pos= imSessionList.GetHeadPosition();
	//先要从队列中找到会话窗口
	while(pos)
	{
		imSession=imSessionList.GetNext(pos);
		if(imSession != NULL)
		{
			//换肤
			imSession->PostMessage(WM_EXCHANGE_SKIN,wpara,0);
		}
	}
#endif
	Invalidate();
	return LRESULT(0);
}
LRESULT CIEDlg::OnUpdateStatus(WPARAM wp, LPARAM lp)
{
	if (m_PluginInst) {
		UINT len = m_StatusText.GetLength() + 1;
		UINT ulen = MultiByteToWideChar( CP_ACP, 0, LPCTSTR(m_StatusText), len, NULL, 0 );
		WCHAR* utext = new WCHAR[ ulen ];
		if( utext )	{
			ulen = MultiByteToWideChar( CP_ACP, 0, LPCTSTR(m_StatusText), len, utext, ulen );
			len = WideCharToMultiByte( CP_UTF8, 0, utext, ulen, NULL, 0, NULL, NULL );
			char* u8text = new char[ len ];
			WideCharToMultiByte( CP_UTF8, 0, utext, ulen, u8text, len, NULL, NULL );
			NPN_Status( m_PluginInst->getInstance(), u8text );
			delete []u8text;
			delete []utext;
			return 0;
		}
		else NPN_Status( m_PluginInst->getInstance(), "" );
	}
	return LRESULT(0);
}
Exemple #13
0
LRESULT RemoteKeyboard::OnCursorMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	if (in_channel_) {
		TCHAR name[32];
		_stprintf_s(name, sizeof(name) / sizeof(TCHAR), _T("rkbc_%02d"), current_channel_);
		PDUI_CONTROL ctrl = m_PaintManager.FindControl(name);
		RECT rect = ctrl->GetPos();
		int add_x = GET_X_LPARAM(lParam) - old_point_.x;
		int add_y = GET_Y_LPARAM(lParam) - old_point_.y;
		old_point_.x = GET_X_LPARAM(lParam);
		old_point_.y = GET_Y_LPARAM(lParam);
		rect.left += add_x;
		rect.right += add_x;
		rect.top += add_y;
		rect.bottom += add_y;
		ctrl->SetPos(rect);
	}

	bHandled = false;
	return LRESULT();
}
Exemple #14
0
LRESULT RemoteKeyboard::OnPopClickMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandle)
{
	switch (wParam)
	{
		case ClassSchedule: {
			PDUI_CONTROL panel = m_PaintManager.FindControl(_T("sync_panel"));
			panel->SetVisible(!panel->IsVisible());
			break;
		}

		case PTZ: {
			ptz_wnd_.reset(new PtzWnd(m_hWnd));
			ptz_wnd_->DoModal();
			break;
		}

		case ControlPanel: {
			PDUI_CONTROL panel = m_PaintManager.FindControl(_T("control_panel"));
			panel->SetVisible(!panel->IsVisible());
			break;
		}

		case LinkServe: {
			IpSetWnd ipset_wnd(m_hWnd, ServerIP);
			ipset_wnd.DoModal();
			break;
		}

		case BackStreams: {
			IpSetWnd ipset_wnd(m_hWnd, BackStreamsIP);
			ipset_wnd.DoModal();
			break;
		}

		default:
			break;
	}
	return LRESULT();
}
Exemple #15
0
//换肤
LRESULT CConnectDlg::OnExchangeSkin(WPARAM wpara,LPARAM lpara)
{
    LoadSkin();
    return LRESULT(0);
}
Exemple #16
0
//换肤
LRESULT CChatControl::OnExchangeSkin(WPARAM wpara,LPARAM lpara)
{
	LoadSkin();
	Invalidate();
	return LRESULT(0);
}
Exemple #17
0
LRESULT SetupPopWnd::ResponseDefaultKeyEvent(WPARAM wParam)
{
	ShowWindow(SW_HIDE);
	return LRESULT();
}
Exemple #18
0
LRESULT SetupPopWnd::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	ShowWindow(SW_HIDE);
	bHandled = FALSE;
	return LRESULT();
}
Exemple #19
0
LRESULT FrameWnd::OnWndSizeChangeMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	keyboard_->ResetWndSize();
	return LRESULT();
}
Exemple #20
0
bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
                                  QtWindows::WindowsEventType et,
                                  WPARAM wParam, LPARAM lParam, LRESULT *result)
{
    *result = 0;

    MSG msg;
    msg.hwnd = hwnd;         // re-create MSG structure
    msg.message = message;   // time and pt fields ignored
    msg.wParam = wParam;
    msg.lParam = lParam;
    msg.pt.x = GET_X_LPARAM(lParam);
    msg.pt.y = GET_Y_LPARAM(lParam);

    // Run the native event filters.
    long filterResult = 0;
    QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
    if (dispatcher && dispatcher->filterNativeEvent(d->m_eventType, &msg, &filterResult)) {
        *result = LRESULT(filterResult);
        return true;
    }

    QWindowsWindow *platformWindow = findPlatformWindow(hwnd);
    if (platformWindow) {
        filterResult = 0;
        if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) {
            *result = LRESULT(filterResult);
            return true;
        }
    }

    switch (et) {
    case QtWindows::InputMethodStartCompositionEvent:
        return QWindowsInputContext::instance()->startComposition(hwnd);
    case QtWindows::InputMethodCompositionEvent:
        return QWindowsInputContext::instance()->composition(hwnd, lParam);
    case QtWindows::InputMethodEndCompositionEvent:
        return QWindowsInputContext::instance()->endComposition(hwnd);
    case QtWindows::InputMethodRequest:
        return QWindowsInputContext::instance()->handleIME_Request(wParam, lParam, result);
    case QtWindows::InputMethodOpenCandidateWindowEvent:
    case QtWindows::InputMethodCloseCandidateWindowEvent:
        // TODO: Release/regrab mouse if a popup has mouse grab.
        return false;
    case QtWindows::ClipboardEvent:
    case QtWindows::DestroyEvent:

    case QtWindows::UnknownEvent:
        return false;
    case QtWindows::AccessibleObjectFromWindowRequest:
#ifndef QT_NO_ACCESSIBILITY
        return QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(hwnd, wParam, lParam, result);
#else
        return false;
#endif
    case QtWindows::DisplayChangedEvent:
        return d->m_screenManager.handleDisplayChange(wParam, lParam);
    case QtWindows::SettingChangedEvent:
        return d->m_screenManager.handleScreenChanges();
    default:
        break;
    }

    // Before CreateWindowEx() returns, some events are sent,
    // for example WM_GETMINMAXINFO asking for size constraints for top levels.
    // Pass on to current creation context
    if (!platformWindow && !d->m_creationContext.isNull()) {
        switch (et) {
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
        case QtWindows::QuerySizeHints:
            d->m_creationContext->applyToMinMaxInfo(reinterpret_cast<MINMAXINFO *>(lParam));
            return true;
#endif
        case QtWindows::ResizeEvent:
            d->m_creationContext->obtainedGeometry.setSize(QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
            return true;
        case QtWindows::MoveEvent:
            d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
            return true;
        case QtWindows::CalculateSize:
            return false;
        default:
            break;
        }
    }
    if (platformWindow) {
        // Suppress events sent during DestroyWindow() for native children.
        if (platformWindow->testFlag(QWindowsWindow::WithinDestroy))
            return false;
        if (QWindowsContext::verboseEvents > 1)
            qDebug().nospace() << "Event window: " << platformWindow->window();
    } else {
        qWarning("%s: No Qt Window found for event 0x%x (%s), hwnd=0x%p.",
                 __FUNCTION__, message,
                 QWindowsGuiEventDispatcher::windowsMessageName(message), hwnd);
        return false;
    }

    switch (et) {
    case QtWindows::KeyDownEvent:
    case QtWindows::KeyEvent:
    case QtWindows::InputMethodKeyEvent:
    case QtWindows::InputMethodKeyDownEvent:
        return d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
    case QtWindows::MoveEvent:
        platformWindow->handleMoved();
        return true;
    case QtWindows::ResizeEvent:
        platformWindow->handleResized((int)wParam);
        return true;
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
    case QtWindows::QuerySizeHints:
        platformWindow->getSizeHints(reinterpret_cast<MINMAXINFO *>(lParam));
        return true;// maybe available on some SDKs revisit WM_NCCALCSIZE
    case QtWindows::CalculateSize:
        // NCCALCSIZE_PARAMS structure if wParam==TRUE
        if (wParam && QWindowsContext::verboseWindows) {
            const NCCALCSIZE_PARAMS *ncp = reinterpret_cast<NCCALCSIZE_PARAMS *>(lParam);
            qDebug() << platformWindow->window() << *ncp;
        }
        break;
#endif
    case QtWindows::ExposeEvent:
        return platformWindow->handleWmPaint(hwnd, message, wParam, lParam);
    case QtWindows::NonClientMouseEvent:
        if (platformWindow->frameStrutEventsEnabled())
            return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
        break;
/* the mouse tracking on windows already handles the reset of the cursor
 * and does not like somebody else handling it.
 * on WINCE its necessary to handle this event to get the correct cursor
 */
#ifdef Q_OS_WINCE
    case QtWindows::CursorEvent:
        {
            QWindowsWindow::baseWindowOf(platformWindow->window())->applyCursor();
            return true;
        }
#endif
    case QtWindows::MouseWheelEvent:
    case QtWindows::MouseEvent:
    case QtWindows::LeaveEvent:
        return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
    case QtWindows::TouchEvent:
        return d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
    case QtWindows::FocusInEvent: // see QWindowsWindow::requestActivateWindow().
    case QtWindows::FocusOutEvent:
        handleFocusEvent(et, platformWindow);
        return true;
    case QtWindows::ShowEvent:
        platformWindow->handleShown();
        return true;
    case QtWindows::HideEvent:
        platformWindow->handleHidden();
        return true;
    case QtWindows::CloseEvent:
        QWindowSystemInterface::handleCloseEvent(platformWindow->window());
        return true;
    case QtWindows::ThemeChanged: // ### fixme: Compress these events?
        if (QWindowsTheme *theme = QWindowsTheme::instance())
            theme->windowsThemeChanged(platformWindow->window());
        return true;
#ifndef Q_OS_WINCE
    case QtWindows::ActivateWindowEvent:
        if (platformWindow->testFlag(QWindowsWindow::BlockedByModal))
            if (const QWindow *modalWindow = QGuiApplication::modalWindow())
                QWindowsWindow::baseWindowOf(modalWindow)->alertWindow();
        break;
#endif
#ifndef QT_NO_CONTEXTMENU
    case QtWindows::ContextMenu:
        handleContextMenuEvent(platformWindow->window(), msg);
        return true;
#endif
    default:
        break;
    }
    return false;
}
Exemple #21
0
LRESULT RemoteKeyboard::OnResetBackStreamsIpMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandle)
{
	::PostMessage(pa_hwnd_, uMsg, wParam, lParam);
	return LRESULT();
}
Exemple #22
0
LRESULT RemoteKeyboard::OnUpdateStatus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandle)
{
	static bool _last_enabled = true;
	bool _enable = (wParam != 0);
	unsigned int _check_value = (unsigned int)(lParam);
	TCHAR name[32];

	if (_last_enabled != _enable) {
		_last_enabled = _enable;
		for (int i = 1;; ++i) {
			_stprintf_s(name, sizeof(name) / sizeof(TCHAR), _T("rkbc_%02d"), i);
			if (!EnableControl(name, _last_enabled))
				break;
		}
	}

	if (_last_enabled) {
		unsigned int _recode_status = _check_value & 0x3;
		unsigned int _ch_status = (_check_value >> 2) & 0xf;
		unsigned int _director_status = (_check_value >> 6) & 0x3;

		for (int i = 1; i < 14; ++i) {
			_stprintf_s(name, sizeof(name) / sizeof(TCHAR), _T("rkbc_%02d"), i);

			if (i < 4) {
				EnableControl(name, _recode_status != i);
			} else if (i < 12) {
				EnableControl(name, _ch_status != i - 3);
			} else {
				EnableControl(name, _director_status != i - 11);
			}
		}
	}

	auto _GetExtendInfoWrap = [this](byte* &pBuf, long &nSize) -> boolean {
		boolean ret = false;

		RpcTryExcept
			ret = rkbc_GetExtendInfo(m_hwBinding, kExtendType_LessionInfo, __int64(m_lession_info_checksum), &pBuf, &nSize);
		RpcExcept(1)
			ret = false;
		RpcEndExcept

			return ret;
	};

	/* 如果同步排课界面不处于显示状态,则不刷新 */
	if (!m_PaintManager.FindControl(_T("sync_panel"))->IsVisible())	 
		return 0;
	byte *pBuf = 0;
	long nSize = 0;
	if (_enable && _GetExtendInfoWrap(pBuf, nSize) && pBuf) {
		auto const &items = g_LessionMappingTable;

		pugi::xml_document doc;
		if (doc.load(LPCTSTR(pBuf))) {
			pugi::xml_node elem = doc.child(_T("lesson"));
			if (elem) {
				for (int i = 0; i < _countof(items); ++i) {
					DuiLib::CControlUI *ctrl;
					if (ctrl = m_PaintManager.FindControl(items[i].name))
						ctrl->SetText(elem.attribute(items[i].attr).as_string());
				}

				m_lession_info = LPCTSTR(pBuf);
				boost::crc_32_type result;
				result.process_bytes(reinterpret_cast<const byte *>(m_lession_info.data()), (m_lession_info.size() + 1) * sizeof(wchar_t));
				m_lession_info_checksum = result.checksum();
			}
		}
		midl_user_free(pBuf);
	}

	return LRESULT();
}
LRESULT CGraphicWindowChildFrame::OnTabChange(WPARAM wParam, LPARAM /*lParam*/)
{
	// add this tab move to the back list
	int newTab = (int)wParam;
	int prevTab = -1;
	if( backTabCount() > 0 ) {
		prevTab = m_backTabList[backTabCount()];
	}
	if( prevTab != newTab )
		m_backTabList.add( newTab );

	switch( wParam ) {
		case 0:  // Model Window Selected
			ASSERT_RETURN_ITEM( m_pGraphicWindow, FALSE );
			m_pGraphicWindow->ShowWindow( SW_SHOW );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );
			windowFilter().windowType = MODEL_WINDOW;
			VAHelpPane.updateActiveWindow( windowFilter().windowType );
			m_pGraphicWindow->SetAServiceCase();
			SetIcon( theApp.LoadIcon( MAKEINTRESOURCE( IDI_MODEL )), TRUE );
			break;
		case 1:  // Results Window Selected
			ASSERT_RETURN_ITEM( m_pGraphicWindow, FALSE );
			m_pGraphicWindow->ShowWindow( SW_SHOW );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );
			windowFilter().windowType = POST_WINDOW;
			VAHelpPane.updateActiveWindow( windowFilter().windowType );
			SetIcon( theApp.LoadIcon( MAKEINTRESOURCE( IDI_RESULT )), TRUE );
			if( theProject.useBackgroundEngine() == false ) {
				if( !AnalyzeIfNoResults() ) {
					; // assume analysis engine has displayed a message on failure...
				}
			}
			m_pGraphicWindow->SetAResultCase( false );
			break;
		case 2:  // Design Window Selected
			ASSERT_RETURN_ITEM( m_pGraphicWindow, FALSE );
			m_pGraphicWindow->ShowWindow( SW_SHOW );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );
			// TeK Add 4/26/2007: Only if we have something to design!
			if( theModel.nodes() < 2 ) {
				AfxMessageBox( "Please create a model, then you may work on design!", MB_ICONINFORMATION );
				windowFilter().windowType = MODEL_WINDOW;
				SetTab( 0 );
			}
			else if( theController.designSoftwareIsPresent() ) {
				// for speed improvement, lets stop the feaBacgroundProcessor, first see if it is working
				if( theEngine.FEABackgroundProcessorHasWorkToDo() ) {
						VAHelpPane.showTempTip( "The model has not been set up for analysis."
							" Analyze the project first!", true );
				}
				else {
					theEngine.stopSetupFEABackgroundProcessor();
					SetupAutoDesignGroups();
					theController.doAllUnityChecks();
					theEngine.startSetupFEABackgroundProcessor();
					windowFilter().windowType = DESIGN_WINDOW;
					VAHelpPane.updateActiveWindow( windowFilter().windowType );
					if( !theController.designCasesHaveValidResults() ) {
						VAHelpPane.showTempTip( "There are no 'design' load combinations with results."
							" Check design settings in Load Case Manager, or Analyze!", true );
					}
				}
				Invalidate();
				SetIcon( theApp.LoadIcon( MAKEINTRESOURCE( IDI_DESIGN )), TRUE );
			}
			else {
				AfxMessageBox( "You have not purchased the optional design features, please visit www.iesweb.com or call 1-800-707-0816.", 
					MB_ICONINFORMATION | MB_OK );
				SetTab(0);
				return LRESULT(0);
			}
			break;
		case 3:  // reportView or gridView
			SetReportView();
			break;
		case 4:  // memberView (or multi)
			{
			if( m_pGraphicWindow ) m_pGraphicWindow->ShowWindow( SW_HIDE );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );

			// we've got to decide whether or not we show the single member view
			// or the multi member view
			// lets see if we've got a selected chain
			if( m_pGraphicWindow ) {
				m_pGraphicWindow->SetAResultCase( false );
				CLoadCase* aLoadCase = m_pGraphicWindow->windowFilter().loadCase();
				const CResultCase* aResultCase = m_pGraphicWindow->windowFilter().resultCase();
				 // see if we have a chain
				 int count = theModel.elements( MEMBER_ELEMENT, OnlySelected );
				 bool forceSingleMemberPlot = false;
				 CCombineMembers cm(true);
				 bool haveAChain = (OK_TO_COMBINE == cm.CanCombine()); //areSelectedMembersAChain( true );
				 if( count > 1 && haveAChain ) {
					 // make sure we don't have too many members
					int graphPoints = 0;
					//const TPointerArray<const CMember>& chain = theMemberChain();
					const CMemberArray& chain = cm.GetChain();
					if( aResultCase != NULL ) {
						for( int i = 1; i <= count; i++ ) {
							const CMember* pM = chain[i];
							const CResult* pMFR = aResultCase->result( *pM );
							if( pMFR )
								graphPoints += ((CResult*)pMFR)->locations();
						}
					}
					if( graphPoints >= MAX_GRAPH_DATA_COUNT || count+1 >= MAX_X_ANNOTATION_COUNT ) {
						MessageBox( "You have selected too many members. Please select fewer members for your multi-member plot.", "VisualAnalysis",
							MB_OK | MB_ICONEXCLAMATION );
						forceSingleMemberPlot = true;
					 }
					else {  // we can set up the multi member view
						m_pMultiMemberWindow->memberChain().flush();
						for( int i = 1; i <= chain.getItemsInContainer(); i++ )
							m_pMultiMemberWindow->memberChain().add( chain[i] );
						m_pMultiMemberWindow->windowFilter().windowType = MULTIMEMBER_GRAPHIC_WINDOW;
						SetupMemberPlotFilter( m_pMultiMemberWindow->windowFilter(), aLoadCase, aResultCase, NULL );
						m_tabWnd.GetTabCtrl()->ChangeTabClient( 4, m_pMultiMemberWindow );
					}
				 }

				 if( forceSingleMemberPlot || haveAChain == false || count <= 1 )  {  // create a single member view 
						CMember* pM = (CMember*)theModel.element( MEMBER_ELEMENT, 1, (count > 0) );
						m_pMemberWindow->windowFilter().windowType = MEMBER_GRAPHIC_WINDOW;
						SetupMemberPlotFilter( m_pMemberWindow->windowFilter(), aLoadCase, aResultCase, pM );
						m_tabWnd.GetTabCtrl()->ChangeTabClient( 4, m_pMemberWindow );
				 }
		   }  // m_pGraphicWindow
		   else {  // this should not happen
			   ASSERT( FALSE );
				m_pMemberWindow->ShowWindow( SW_HIDE );
				m_pMultiMemberWindow->ShowWindow( SW_HIDE );
				m_pReportWindow->ShowWindow( SW_HIDE );
			}
			}
			break;
		default:
			ASSERT( FALSE );
			break;
	}
	CWnd* theClient = AfxGetMainWnd();
	if( theClient ) {
		theClient->SendMessage( VIEW_MANAGER_CHANGE_MESSAGE, 0, 0 );
	}
	if( wParam == 3 ) {
		m_tabWnd.GetTabCtrl()->SetFocus();
	}

	// TeK Add 10/13/2009: Prevent the entire tab row from disappearing!
	//        UpdateWindows didn't work?, try ShowWindow!
	// RDV Note 10/1/09 - Add this to hopefully clear up the tab visibility issues reported
	//m_tabWnd.UpdateWindow();
//#pragma message( TEK "Tab windows still disappear, sometimes, for some customers..." )
	m_tabWnd.ShowWindow( SW_SHOW );

	return FALSE;
}
Exemple #24
0
LRESULT FrameWnd::ResponseDefaultKeyEvent(WPARAM wParam)
{
	if(wParam == VK_ESCAPE)
		OnQuitFullWnd();
	return LRESULT();
}
Exemple #25
0
LRESULT FrameWnd::OnChildEscMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	OnQuitFullWnd();
	return LRESULT();
}
Exemple #26
0
LRESULT SetupPopWnd::OnShowWindow(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	return LRESULT();
}
bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
                                  QtWindows::WindowsEventType et,
                                  WPARAM wParam, LPARAM lParam, LRESULT *result)
{
    *result = 0;

    MSG msg;
    msg.hwnd = hwnd;         // re-create MSG structure
    msg.message = message;   // time and pt fields ignored
    msg.wParam = wParam;
    msg.lParam = lParam;
    msg.pt.x = msg.pt.y = 0;
    if (et != QtWindows::CursorEvent && (et & (QtWindows::MouseEventFlag | QtWindows::NonClientEventFlag))) {
        msg.pt.x = GET_X_LPARAM(lParam);
        msg.pt.y = GET_Y_LPARAM(lParam);
        // For non-client-area messages, these are screen coordinates (as expected
        // in the MSG structure), otherwise they are client coordinates.
        if (!(et & QtWindows::NonClientEventFlag)) {
            ClientToScreen(msg.hwnd, &msg.pt);
        }
    } else {
#ifndef Q_OS_WINCE
        GetCursorPos(&msg.pt);
#endif
    }

    // Run the native event filters.
    long filterResult = 0;
    QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
    if (dispatcher && dispatcher->filterNativeEvent(d->m_eventType, &msg, &filterResult)) {
        *result = LRESULT(filterResult);
        return true;
    }

    QWindowsWindow *platformWindow = findPlatformWindow(hwnd);
    if (platformWindow) {
        filterResult = 0;
        if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) {
            *result = LRESULT(filterResult);
            return true;
        }
    }

    switch (et) {
    case QtWindows::InputMethodStartCompositionEvent:
        return QWindowsInputContext::instance()->startComposition(hwnd);
    case QtWindows::InputMethodCompositionEvent:
        return QWindowsInputContext::instance()->composition(hwnd, lParam);
    case QtWindows::InputMethodEndCompositionEvent:
        return QWindowsInputContext::instance()->endComposition(hwnd);
    case QtWindows::InputMethodRequest:
        return QWindowsInputContext::instance()->handleIME_Request(wParam, lParam, result);
    case QtWindows::InputMethodOpenCandidateWindowEvent:
    case QtWindows::InputMethodCloseCandidateWindowEvent:
        // TODO: Release/regrab mouse if a popup has mouse grab.
        return false;
    case QtWindows::DestroyEvent:
        if (platformWindow && !platformWindow->testFlag(QWindowsWindow::WithinDestroy)) {
            qWarning() << "External WM_DESTROY received for " << platformWindow->window()
                       << ", parent: " << platformWindow->window()->parent()
                       << ", transient parent: " << platformWindow->window()->transientParent();
            }
        return false;
    case QtWindows::ClipboardEvent:
        return false;
    case QtWindows::UnknownEvent:
        return false;
    case QtWindows::AccessibleObjectFromWindowRequest:
#ifndef QT_NO_ACCESSIBILITY
        return QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(hwnd, wParam, lParam, result);
#else
        return false;
#endif
    case QtWindows::DisplayChangedEvent:
        return d->m_screenManager.handleDisplayChange(wParam, lParam);
    case QtWindows::SettingChangedEvent:
        return d->m_screenManager.handleScreenChanges();
    default:
        break;
    }

    // Before CreateWindowEx() returns, some events are sent,
    // for example WM_GETMINMAXINFO asking for size constraints for top levels.
    // Pass on to current creation context
    if (!platformWindow && !d->m_creationContext.isNull()) {
        switch (et) {
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
        case QtWindows::QuerySizeHints:
            d->m_creationContext->applyToMinMaxInfo(reinterpret_cast<MINMAXINFO *>(lParam));
            return true;
#endif
        case QtWindows::ResizeEvent:
            d->m_creationContext->obtainedGeometry.setSize(QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
            return true;
        case QtWindows::MoveEvent:
            d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
            return true;
        case QtWindows::CalculateSize:
            return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result);
        case QtWindows::GeometryChangingEvent:
            return QWindowsWindow::handleGeometryChangingMessage(&msg, d->m_creationContext->window,
                                                                 d->m_creationContext->margins + d->m_creationContext->customMargins);
        default:
            break;
        }
    }
    if (platformWindow) {
        // Suppress events sent during DestroyWindow() for native children.
        if (platformWindow->testFlag(QWindowsWindow::WithinDestroy))
            return false;
        if (QWindowsContext::verbose > 1)
            qCDebug(lcQpaEvents) << "Event window: " << platformWindow->window();
    } else {
        qWarning("%s: No Qt Window found for event 0x%x (%s), hwnd=0x%p.",
                 __FUNCTION__, message,
                 QWindowsGuiEventDispatcher::windowsMessageName(message), hwnd);
        return false;
    }

    switch (et) {
    case QtWindows::KeyDownEvent:
    case QtWindows::KeyEvent:
    case QtWindows::InputMethodKeyEvent:
    case QtWindows::InputMethodKeyDownEvent:
    case QtWindows::KeyboardLayoutChangeEvent:
    case QtWindows::AppCommandEvent:
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
        return platformSessionManager()->isInteractionBlocked() ? true : d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
#else
        return d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
#endif
    case QtWindows::MoveEvent:
        platformWindow->handleMoved();
        return true;
    case QtWindows::ResizeEvent:
        platformWindow->handleResized((int)wParam);
        return true;
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
    case QtWindows::QuerySizeHints:
        platformWindow->getSizeHints(reinterpret_cast<MINMAXINFO *>(lParam));
        return true;// maybe available on some SDKs revisit WM_NCCALCSIZE
    case QtWindows::CalculateSize:
        return QWindowsGeometryHint::handleCalculateSize(platformWindow->customMargins(), msg, result);
    case QtWindows::NonClientHitTest:
        return platformWindow->handleNonClientHitTest(QPoint(msg.pt.x, msg.pt.y), result);
    case QtWindows::GeometryChangingEvent:
        return platformWindow->QWindowsWindow::handleGeometryChanging(&msg);
#endif // !Q_OS_WINCE
    case QtWindows::ExposeEvent:
        return platformWindow->handleWmPaint(hwnd, message, wParam, lParam);
    case QtWindows::NonClientMouseEvent:
        if (platformWindow->frameStrutEventsEnabled())
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
            return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
#else
            return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
#endif
        break;
/* the mouse tracking on windows already handles the reset of the cursor
 * and does not like somebody else handling it.
 * on WINCE its necessary to handle this event to get the correct cursor
 */
#ifdef Q_OS_WINCE
    case QtWindows::CursorEvent:
        {
            QWindowsWindow::baseWindowOf(platformWindow->window())->applyCursor();
            return true;
        }
#endif
    case QtWindows::MouseWheelEvent:
    case QtWindows::MouseEvent:
    case QtWindows::LeaveEvent:
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
        return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
#else
        return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
#endif
    case QtWindows::TouchEvent:
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
        return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
#else
        return d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
#endif
    case QtWindows::FocusInEvent: // see QWindowsWindow::requestActivateWindow().
    case QtWindows::FocusOutEvent:
        handleFocusEvent(et, platformWindow);
        return true;
    case QtWindows::ShowEventOnParentRestoring: // QTBUG-40696, prevent Windows from re-showing hidden transient children (dialogs).
        if (!platformWindow->window()->isVisible()) {
            *result = 0;
            return true;
        }
        break;
    case QtWindows::HideEvent:
        platformWindow->handleHidden();
        return false;// Indicate transient children should be hidden by windows (SW_PARENTCLOSING)
    case QtWindows::CloseEvent:
        QWindowSystemInterface::handleCloseEvent(platformWindow->window());
        return true;
    case QtWindows::ThemeChanged: {
        // Switch from Aero to Classic changes margins.
        const Qt::WindowFlags flags = platformWindow->window()->flags();
        if ((flags & Qt::WindowType_Mask) != Qt::Desktop && !(flags & Qt::FramelessWindowHint))
            platformWindow->setFlag(QWindowsWindow::FrameDirty);
        if (QWindowsTheme *theme = QWindowsTheme::instance())
            theme->windowsThemeChanged(platformWindow->window());
        return true;
    }
    case QtWindows::CompositionSettingsChanged:
        platformWindow->handleCompositionSettingsChanged();
        return true;
#ifndef Q_OS_WINCE
    case QtWindows::ActivateWindowEvent:
        if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus) {
            *result = LRESULT(MA_NOACTIVATE);
            return true;
        }
#ifndef QT_NO_TABLETEVENT
        if (!d->m_tabletSupport.isNull())
            d->m_tabletSupport->notifyActivate();
#endif // !QT_NO_TABLETEVENT
        if (platformWindow->testFlag(QWindowsWindow::BlockedByModal))
            if (const QWindow *modalWindow = QGuiApplication::modalWindow())
                QWindowsWindow::baseWindowOf(modalWindow)->alertWindow();
        break;
    case QtWindows::MouseActivateWindowEvent:
        if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus) {
            *result = LRESULT(MA_NOACTIVATE);
            return true;
        }
        break;
#endif
#ifndef QT_NO_CONTEXTMENU
    case QtWindows::ContextMenu:
        return handleContextMenuEvent(platformWindow->window(), msg);
#endif
    case QtWindows::WhatsThisEvent: {
#ifndef QT_NO_WHATSTHIS
        QWindowSystemInterface::handleEnterWhatsThisEvent();
        return true;
#endif
    }   break;
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
    case QtWindows::QueryEndSessionApplicationEvent: {
        QWindowsSessionManager *sessionManager = platformSessionManager();
        if (sessionManager->isActive()) { // bogus message from windows
            *result = sessionManager->wasCanceled() ? 0 : 1;
            return true;
        }

        sessionManager->setActive(true);
        sessionManager->blocksInteraction();
        sessionManager->clearCancellation();

        QGuiApplicationPrivate *qGuiAppPriv = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
        qGuiAppPriv->commitData();

        if (lParam & ENDSESSION_LOGOFF)
            fflush(NULL);

        *result = sessionManager->wasCanceled() ? 0 : 1;
        return true;
    }
    case QtWindows::EndSessionApplicationEvent: {
        QWindowsSessionManager *sessionManager = platformSessionManager();

        sessionManager->setActive(false);
        sessionManager->allowsInteraction();
        bool endsession = (bool) wParam;

        // we receive the message for each toplevel window included internal hidden ones,
        // but the aboutToQuit signal should be emitted only once.
        QGuiApplicationPrivate *qGuiAppPriv = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
        if (endsession && !qGuiAppPriv->aboutToQuitEmitted) {
            qGuiAppPriv->aboutToQuitEmitted = true;
            int index = QGuiApplication::staticMetaObject.indexOfSignal("aboutToQuit()");
            qApp->qt_metacall(QMetaObject::InvokeMetaMethod, index,0);
            // since the process will be killed immediately quit() has no real effect
            QGuiApplication::quit();
        }
        return true;
    }
#endif // !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
    default:
        break;
    }
    return false;
}
Exemple #28
0
LRESULT SetupPopWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled)
{
	return LRESULT();
}
Exemple #29
0
//换肤
LRESULT CIMWnd::OnExchangeSkin(WPARAM wpara,LPARAM lpara)
{
	LoadSkin();
	Invalidate();
	return LRESULT(0);
}
Exemple #30
0
LRESULT FrameWnd::OnInit()
{
	::PostMessage(m_hWnd, kAM_InitOtherWndMsg, 0, 0);	// 发送一个自定义消息到消息队列中
	return LRESULT();
}