/*-------------------------------------------------------------------------*/
static VOID before( INT line )
{
    INT          i;
    INDEXPKT    *index;
    static CHAR  str[140], tmp[140];

    if( !pktcount )
        return;

    pktNumber = line;
    Current = index = GetCurrentPkt( line );

#ifndef _LITE_
    ViewUpdate();
#endif
    
    strncpy( tmp, index -> subj ? index -> subj : "", maxXsubj - 6 );
    WSetCurColor( wsubj, C_TITLE );
    WSetXY      ( wsubj, 6, 0 );
    sprintf     ( str, "%-*.*s", maxXsubj - 6, maxXsubj - 6, tmp );
    WPutstr     ( wsubj, str );

    for( i = 0; Quick && i < MAX_LINE; i++ )
        ViewStr( wquick, i, maxXquick, index -> quick[i], index -> color[i] );
}
Example #2
0
VOID ViewReset(VOID)
{
    RECT rc;
    RECT rcT;

    GetWindowRect(ghwndView, &rc);

    rcT.left = 0;
    rcT.top = 0;
    rcT.right = PALETTEMARGIN + gViewBackMargin +
            gpImageCur->cx + gViewBackMargin + PALETTEMARGIN;
    rcT.bottom = PALETTEMARGIN + gViewBackMargin +
            gpImageCur->cy + gViewBackMargin + PALETTEMARGIN;
    AdjustWindowRect(&rcT, VIEWSTYLE, FALSE);

    rc.right = rc.left + (rcT.right - rcT.left);
    rc.bottom = rc.top + (rcT.bottom - rcT.top);
    FitRectToScreen(&rc);

    SetWindowPos(ghwndView, NULL, rc.left, rc.top,
            rc.right - rc.left, rc.bottom - rc.top,
            SWP_NOACTIVATE | SWP_NOZORDER);

    /*
     * If the user wants it, show the View window now.
     */
    if (gfShowView)
        ViewShow(TRUE);

    ViewUpdate();

    /*
     * Clear out the propbar size and position fields, because they
     * probably show the wrong information now.
     */
    PropBarClearPos();
    PropBarClearSize();
}
Example #3
0
VOID SetScreenColor(
    DWORD rgb)
{
    DWORD rgbInverse;
    HDC hdcTemp;
    HBITMAP hbmOld;
    HDC hdcANDTemp;
    HBITMAP hbmANDOld;

    rgb = MyGetNearestColor(rgb, FALSE);

    /*
     * Because we are about to change the screen color, separate
     * out the XOR mask (but only for icons/cursors).
     */
    if (giColorPalType != FT_BITMAP) {
        if (gpImageCur) {
            ImageDCSeparate(ghdcImage, gcxImage, gcyImage, ghdcANDMask,
                    grgbScreen);

            /*
             * Is there a pending undo buffer?  If so, it must be
             * changed as well or an undo that is done after a screen
             * color change will restore the wrong colors!
             */
            if (ghbmUndo) {
                /*
                 * Create some temporary DC's to use when separating
                 * out the undo buffer's masks.  These will be deleted
                 * a little later.
                 */
                hdcTemp = CreateCompatibleDC(ghdcImage);
                hbmOld = SelectObject(hdcTemp, ghbmUndo);
                hdcANDTemp = CreateCompatibleDC(ghdcANDMask);
                hbmANDOld = SelectObject(hdcANDTemp, ghbmUndoMask);

                /*
                 * Separate out the undo buffer's colors, before
                 * changing the screen color.  It will be combined
                 * later.
                 */
                ImageDCSeparate(hdcTemp, gcxImage, gcyImage, hdcANDTemp,
                        grgbScreen);
            }
        }
    }

    if (ghbrScreen)
        DeleteObject(ghbrScreen);

    ghbrScreen = CreateSolidBrush(rgb);
    grgbScreen = rgb;

    if (ghbrInverse)
        DeleteObject(ghbrInverse);

    rgbInverse = ComputeInverseColor(rgb);
    ghbrInverse = CreateSolidBrush(rgbInverse);
    grgbInverse = rgbInverse;

    /*
     * For icons and cursors, we might need to update a few more things.
     */
    if (giColorPalType != FT_BITMAP) {
        /*
         * Recombine the XOR and AND images now that there is a new screen
         * color.  This updates the image DC with the new color properly.
         */
        if (gpImageCur) {
            ImageDCCombine(ghdcImage, gcxImage, gcyImage, ghdcANDMask);

            /*
             * Is there a pending undo buffer?  If so, it has to be
             * recombined with the new screen color.
             */
            if (ghbmUndo) {
                ImageDCCombine(hdcTemp, gcxImage, gcyImage, hdcANDTemp);

                /*
                 * Clean up the DC's that were allocated a little earlier.
                 */
                SelectObject(hdcANDTemp, hbmANDOld);
                DeleteDC(hdcANDTemp);
                SelectObject(hdcTemp, hbmOld);
                DeleteDC(hdcTemp);
            }
        }

        /*
         * Reset the colors on the mouse buttons, just in case a screen
         * or inverse screen color was assigned to either of them.
         */
        SetLeftColor(giColorLeft, gfModeLeft);
        SetRightColor(giColorRight, gfModeRight);

        InvalidateRect(GetDlgItem(ghwndColor, DID_COLORBOX), NULL, TRUE);
    }

    ViewUpdate();
}
Example #4
0
void CClientListCtrl::DoClientspecNew(BOOL bUseDefTemplate, LPCTSTR defName ) 
{
	MainFrame()->ViewClients();
	m_ClientNew.Empty();
	m_OldClient= GET_P4REGPTR()->GetP4Client();

	//		let user type in the new name. if it's blank the user bailed.
	//
	CNewClientDlg newdlg;
	newdlg.SetNew( NEWCLIENT );
	if (FindInListAll(m_Active) != -1)
		newdlg.m_Active = m_Active;
	if (defName)
		newdlg.m_Name = defName;
	if( newdlg.DoModal( ) == IDCANCEL )
		return;

	if (newdlg.m_RunWizard)
	{
		CString txt;
		CString port = GET_P4REGPTR()->GetP4Port();
		CString clientname = newdlg.GetName();
		txt.FormatMessage( IDS_NOCLIENT_s_s_s, clientname, port, GET_P4REGPTR()->GetP4User() );
		int i;
		if ((i = txt.Find(_T('\n'))) != -1)
		{
			txt = txt.Mid(i);
			txt.TrimLeft();
		}
		CClientWizSheet dlg(LoadStringResource(IDS_CLIENTWORKSPACEWIZARD), this, 1);
		dlg.SetMsg(txt);
		dlg.SetName(clientname);
		dlg.SetPort(port);
		dlg.AllowBrowse(FALSE);
		int rc;
		while(1)
		{
			if( (rc = dlg.DoModal()) == IDCANCEL )	// user bailed
			{
				break;
			}
			if ( rc == IDIGNORE )	// user chose to browse existing clients
			{
				ViewUpdate();
				break;
			}
			else	// user clicked the Finish button on the create client page
			{
				CString newClient = dlg.GetName();
				CString newRoot   = dlg.GetRoot();
				BOOL bEdit        = dlg.IsEdit();
				BOOL bTmpl        = dlg.IsTmpl();
				CString tmplate   = dlg.GetTmpl();
				while (m_UpdateState == LIST_UPDATING)
					Sleep(100);
				if (FindInListAll(newClient) != -1)
				{
					CString msg;
					msg.FormatMessage(IDS_CANT_RECREATE_EXISTING_CLIENT_s, newClient);
					AfxMessageBox( msg, MB_ICONSTOP );
				}
				else if (!newClient.IsEmpty() && !newRoot.IsEmpty())
				{
					if (AutoCreateClientSpec(newClient, newRoot, bEdit, bTmpl, tmplate))
						break;;
				}
			}
		}
		return;
	}

	CString saveActive = m_Active;
	m_Active = newdlg.GetName( ) ;
	if ( m_Active.IsEmpty( ) )
		return;

	if ( SetP4Client( TRUE ) ) 
	{
		// rather than use the current directory as the default client root
		// switch to the drive's root and use that; switch back at the end.
		TCHAR	buf[MAX_PATH+1];
		TCHAR	root[4];
		if (GetCurrentDirectory(MAX_PATH, buf))
		{
			_tcsncpy(root, buf, 3);
			root[3] = '\0';
			SetCurrentDirectory(root);
		}
		else
		{
			buf[0] = _T('\0');
		}

		// Get the edit of the new spec underway
		m_NewClient  = (saveActive != m_Active);
		m_NewClicked = TRUE;
		OnEditSpec( m_Active, bUseDefTemplate );
		m_ClientNew = m_Active;

		// restore previous working directory
		if (buf[0])
			SetCurrentDirectory(buf);
	}
}