void CMessageFrame::OnStop() 
{
	//      Let the context have it.
	if(GetMainContext()) {
		GetMainContext()->AllInterrupt();
	}
}
void CMessageFrame::OnUpdateStop(CCmdUI* pCmdUI) 
{
	//      Defer to the context's wisdom.
	if(GetMainContext()) {
		pCmdUI->Enable(GetMainContext()->CanAllInterrupt());
	}
	else {
		pCmdUI->Enable(FALSE);
	}
}
void CMessageFrame::LoadMessage( MSG_FolderInfo *folderInfo, MessageKey id )
{
	INTL_CharSetInfo c = LO_GetDocumentCharacterSetInfo( GetMainContext()->GetContext() );
	int16 cur_csid = INTL_GetCSIDocCSID( c );
	int16 doc_csid = MSG_GetFolderCSID( folderInfo );

	if (!doc_csid)
		doc_csid = INTL_DefaultWinCharSetID(0);

	if ( cur_csid != doc_csid )
		RefreshNewEncoding( doc_csid, FALSE );

	MSG_LoadMessage( m_pPane, folderInfo, id );

	if (id == MSG_MESSAGEKEYNONE)
		m_pMessageView->SetAttachments(NULL, 0);
	else
		MSG_AddBacktrackMessage( m_pPane, folderInfo, id );

	MSG_FolderLine folderLine;
	MSG_MessageLine messageLine;
	MSG_GetFolderLineById( m_pMaster, folderInfo, &folderLine );
	MSG_GetThreadLineById( m_pPane, id, &messageLine );

	SetIsNews( folderLine.flags & MSG_FOLDER_FLAG_NEWSGROUP ? TRUE : FALSE );
	m_bCategory = (folderLine.flags & MSG_FOLDER_FLAG_CATEGORY ? TRUE : FALSE);

	m_pInfoBar->Update();
}
CWnd * CComposeFrame::GetEditorWnd(void)
{
    if (m_bUseHtml) 
    {
    	CWinCX * pWinCX = (CWinCX*)GetMainContext();
    	HWND hwnd = pWinCX->GetPane();
    	return CWnd::FromHandle(hwnd);
    }
	return (CWnd *)&m_Editor;
}
void CComposeFrame::SetEditorParent(CWnd * pWnd)
{
   CWinCX * pWinCX = (CWinCX*)GetMainContext();

   // after the window is created, tell the browser view to resize the 
   // parent which resizes the editor.
   if (pWinCX) 
   {
      CNetscapeView * pView = (CNetscapeView*)pWinCX->GetView();
      if (pView)
         pView->SetChild (pWnd);
   }
}
LPCTSTR CMessageFrame::GetWindowMenuTitle()
{
	static CString cs;
	CString csTitle = szLoadString( IDS_TITLE_NOSUBJECT );
	cs = m_bNews ? szLoadString( IDS_TITLE_ARTICLE ) : szLoadString( IDS_TITLE_MESSAGE );
	
	MWContext *pXPCX = GetMainContext()->GetContext();
	if ( pXPCX && pXPCX->title) {
		csTitle = fe_MiddleCutString(pXPCX->title, 40);
	}
	cs += csTitle;

	return cs;
}
void CComposeFrame::SetQuoteSelection(void)
{
	int32 eReplyOnTop = 0;

	if (PREF_NOERROR == PREF_GetIntPref("mailnews.reply_on_top", &eReplyOnTop) &&
			eReplyOnTop != 0) {
    // call backend with insertion call-back
		if (UseHtml()) 
		{
			int32 offset = EDT_GetInsertPointOffset( GetMainContext()->GetContext() );
			SetQuoteSel(offset);
		}
		else 
		{
			int tmpStartSel, tmpEndSel;
			GetEditor()->GetSel(tmpStartSel, tmpEndSel);
			// we only care about start position
			SetQuoteSel((int32) tmpStartSel);
		}
	}
}
Exemple #8
0
bool cWindowSFML::Create( WindowSettings Settings, ContextSettings Context ) {
	if ( mWindow.Created )
		return false;

	sf::VideoMode mode			= sf::VideoMode::getDesktopMode();
	mWindow.WindowConfig		= Settings;
	mWindow.ContextConfig		= Context;
	mWindow.DesktopResolution	= eeSize( mode.width, mode.height );

	if ( mWindow.WindowConfig.Style & WindowStyle::Titlebar )
		mWindow.Flags |= sf::Style::Titlebar;

	if ( mWindow.WindowConfig.Style & WindowStyle::Resize )
		mWindow.Flags |= sf::Style::Resize;

	if ( mWindow.WindowConfig.Style & WindowStyle::NoBorder )
		mWindow.Flags = sf::Style::None;

	if ( mWindow.WindowConfig.Style & WindowStyle::UseDesktopResolution ) {
		mWindow.WindowConfig.Width	= mode.width;
		mWindow.WindowConfig.Height	= mode.height;
	}

	Uint32 TmpFlags = mWindow.Flags;

	if ( mWindow.WindowConfig.Style & WindowStyle::Fullscreen )
		TmpFlags |= sf::Style::Fullscreen;

	mSFMLWindow.create( sf::VideoMode( Settings.Width, Settings.Height, Settings.BitsPerPixel ), mWindow.WindowConfig.Caption, TmpFlags, sf::ContextSettings( Context.DepthBufferSize, Context.StencilBufferSize ) );

	mSFMLWindow.setVerticalSyncEnabled( Context.VSync );

	if ( NULL == cGL::ExistsSingleton() ) {
		cGL::CreateSingleton( mWindow.ContextConfig.Version );
		cGL::instance()->Init();
	}

	CreatePlatform();

	GetMainContext();

	CreateView();

	Setup2D();

	mWindow.Created = true;
	mVisible = true;

	if ( "" != mWindow.WindowConfig.Icon ) {
		Icon( mWindow.WindowConfig.Icon );
	}

	/// Init the clipboard after the window creation
	reinterpret_cast<cClipboardSFML*> ( mClipboard )->Init();

	/// Init the input after the window creation
	reinterpret_cast<cInputSFML*> ( mInput )->Init();

	LogSuccessfulInit( GetVersion() );

	return true;
}