Exemplo n.º 1
0
afx_msg void CServerView::OnPaste()
{
    FNAME	szFileName;
    LPOBJECT lpObject;
    DWORD	dwImageID;
    LPIMAGE lpImage = NULL;
    FRMTYPEINFO SrcTypeInfo;

    CServerDoc* pDoc = GetDocument();
    ASSERT(pDoc);

    lpImage = pDoc->GetImage();
    if (!lpImage)
        return;

    DeactivateTool();

    lpObject = GetClipboardObject(lpImage, szFileName, &dwImageID, &SrcTypeInfo);
    if (!lpObject)
        return;

    init_paste(lpObject);

    TransformObjectsStart(lpImage, PasteEndProc, IDC_OBJECTTRANSFORM, YES,
                          IDS_UNDOPASTE, YES, szFileName, dwImageID, FALSE, &SrcTypeInfo);
}
Exemplo n.º 2
0
void CDetailView::OnCbnSelchangeCombo1()
{
	// TODO: Add your control notification handler code here
	CServerDoc* doc = (CServerDoc*)GetDocument();
	ServerControl* sc = doc->getSelectedServer();
	if (sc)
	{
		bool func_ok;
		int prior = m_Priority.GetCurSel();
		switch (prior)
		{
		case 0: // high
			func_ok = sc->setPriority(HIGH);
			break;
		case 1: // above_normal
			func_ok = sc->setPriority(ABOVE_NORMAL);
			break;
		case 2: // normal
			func_ok = sc->setPriority(NORMAL);
			break;
		case 3:
			func_ok = sc->setPriority(LOW);
			break;
		default:
			func_ok = false;
		}

		if (!func_ok)
			MessageBox("Could not set process priority.","Error...");
	}
	else
		MessageBox("No server selected","Error...");
    doc->UpdateAllViews(NULL);
}
Exemplo n.º 3
0
afx_msg void CServerView::OnHideMarquee()
{
    if (STOP) return;
    CServerDoc* pDoc = GetDocument();
    LPIMAGE lpImage = pDoc->GetImage();
    if (lpImage)
        ShowMarquee(lpImage, !IsMarqueeVisible(lpImage));
}
Exemplo n.º 4
0
afx_msg void CServerView::OnHideObjMarquee()
{
    if (!Control.Retail )
        return;

    if (STOP) return;
    CServerDoc* pDoc = GetDocument();
    LPIMAGE lpImage = pDoc->GetImage();

    RemoveObjectMarquee(lpImage);
    lpImage->UseObjectMarquee = !lpImage->UseObjectMarquee;
}
Exemplo n.º 5
0
void CMainFrame::OnPingboosterChangevalue()
{
	// TODO: Add your command handler code here
	CServerView* serverview = (CServerView*)m_wndSplitter.GetPane(0,0);
	CServerDoc* doc = (CServerDoc*)serverview->GetDocument();
	
	CPingBoosterDialog dlg(doc->getBoosterValue(),this);

	if (dlg.DoModal() == IDOK)
	{
		doc->setBoosterValue(dlg.getValue());
	}
}
Exemplo n.º 6
0
afx_msg void CServerView::OnStitch()
{
    if (STOP) return;
    CServerDoc* pDoc = GetDocument();
    LPIMAGE lpImage = pDoc->GetImage();

    DeactivateTool();
    if (ImgMultipleObjects(lpImage))
    {
        Message(IDS_OBJECTSNEEDCOMBINE);
        return;
    }
    ActivateTool( IDC_STITCH );
}
Exemplo n.º 7
0
afx_msg LRESULT CInPlaceFrame::OnResizeChild(WPARAM wParam, LPARAM lParam)
{
	CRect rSize((LPRECT)lParam);
	CServerDoc *pDoc = (CServerDoc*)GetActiveDocument();

	// change our extents
	pDoc->m_sizeDoc.cx = MulDiv(pDoc->m_ZoomDenom.cx, rSize.Width(),
		pDoc->m_ZoomNum.cx);
	pDoc->m_sizeDoc.cy = MulDiv(pDoc->m_ZoomDenom.cy, rSize.Height(),
		pDoc->m_ZoomNum.cy);

	// Notify the container that we have changed
	pDoc->NotifyChanged();
	return COleIPFrameWnd::OnResizeChild(wParam,lParam);
}
Exemplo n.º 8
0
afx_msg LRESULT CMainFrame::OnUpdateMenu(WPARAM wParam, LPARAM lParam)
{
	CServerView* serverview = (CServerView*)m_wndSplitter.GetPane(0,0);
	CServerDoc* doc = (CServerDoc*)serverview->GetDocument();

	CMenu* menu = GetMenu();
	ASSERT(menu);

	if (doc->boosts())
	{
		menu->CheckMenuItem(ID_PINGBOOSTER_RUN,MF_BYCOMMAND | MF_CHECKED);
		menu->EnableMenuItem(ID_PINGBOOSTER_CHANGEVALUE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	}
	return 0;
}
Exemplo n.º 9
0
afx_msg void CServerView::OnPasteSpecial()
{
    COlePasteSpecialDialog psd;
    psd.AddFormat(CF_METAFILEPICT,TYMED_MFPICT,AFX_IDS_METAFILE_FORMAT,
                  FALSE,FALSE);
    psd.AddFormat(CF_DIB,TYMED_HGLOBAL,AFX_IDS_DIB_FORMAT,
                  FALSE,FALSE);
    psd.AddFormat(CF_BITMAP,TYMED_GDI,AFX_IDS_BITMAP_FORMAT,
                  FALSE,FALSE);
    psd.AddFormat(Control.cfImage,TYMED_HGLOBAL,IDS_MGXIMAGE5_FORMAT,
                  FALSE,FALSE);
    psd.AddFormat(Control.cfImagePP4,TYMED_HGLOBAL,IDS_MGXIMAGE_FORMAT,
                  FALSE,FALSE);
    if (psd.DoModal() == IDOK)
    {
        int index = psd.GetPasteIndex();
        if (index >= 0 && index <= psd.m_ps.cPasteEntries)
        {
            FNAME	szFileName;
            LPOBJECT lpObject;
            DWORD	dwImageID;
            LPIMAGE lpImage = NULL;
            FRMTYPEINFO SrcTypeInfo;

            CServerDoc* pDoc = GetDocument();
            ASSERT(pDoc);

            lpImage = pDoc->GetImage();
            if (!lpImage)
                return;

            DeactivateTool();

            lpObject = GetClipboardObject(lpImage, szFileName, &dwImageID,
                                          &SrcTypeInfo,psd.m_ps.arrPasteEntries[index].fmtetc.cfFormat);

            if (!lpObject)
                return;

            init_paste(lpObject);

            TransformObjectsStart(lpImage, PasteEndProc, IDC_OBJECTTRANSFORM, YES,
                                  IDS_UNDOPASTE, YES, szFileName, dwImageID, FALSE, &SrcTypeInfo);
        }
    }
}
Exemplo n.º 10
0
afx_msg void CServerView::OnEscape()
{
    // always try to kill the one shot tool
    SetupOneShotTool();
    if (STOP) return;
    CServerDoc* pDoc = GetDocument();
    LPIMAGE lpImage = pDoc->GetImage();

    if (lpImage)
    {
        HWND hActiveWnd = GetSafeHwnd();
        if (hActiveWnd == hZoomWindow)
            return;
        if ( Tool.bActive && Tool.lpToolProc )
            DestroyProc( hActiveWnd, 1L );
    }
}
Exemplo n.º 11
0
void CImage::SetViewMode(VIEW_MODE ViewMode)
{
if (m_ViewMode == ViewMode)
    return;
m_ViewMode = ViewMode;
if (InMaskEditMode())
    {
    ImgColorMapChanged(this);
	ImgInitDisplay(this);
	CServerDoc *pDoc = PictPubApp.GetDocument(this);
	if (pDoc)
		{
		CServerView *pView = pDoc->GetActiveView();
		if (pView)
	    	pView->SetupImageDisplayPalette();
		}
   }
UpdateImage(this, NULL, YES);
}
Exemplo n.º 12
0
void CMainFrame::OnClose()
{
	// TODO: Add your message handler code here and/or call default

	// stopping the servers must be done here for some reason I forgot (prolly cause else the program crashes when trying to get the document)
	CServerView* serverview = (CServerView*)m_wndSplitter.GetPane(0,0);
	CServerDoc* doc = (CServerDoc*)serverview->GetDocument();
	bool no_kill = false;
	if (doc->runningServers())
	{
		int res = MessageBox("Shut down servers?\r\n\r\nNote: When running ServerChecker again, you must stop these servers manually first!\r\nServerChecker cannot obtain control over running servers.","Servers:",MB_YESNOCANCEL |MB_APPLMODAL | MB_ICONQUESTION );
		if (res != IDCANCEL)
			no_kill = (res == IDNO);
		else
			return;
	}
	doc->stopAllServers(no_kill);
	CFrameWnd::OnClose();
}
Exemplo n.º 13
0
afx_msg void CServerView::OnRulerShow()
{
    if (STOP) return;
    CServerDoc* pDoc = GetDocument();
    LPIMAGE lpImage = pDoc->GetImage();

    if (lpImage)
    {
        HWND hActiveWnd = GetSafeHwnd();
        if (m_lpDisplay->HasRulers)
            DestroyRulers(hActiveWnd);
        else
            CreateRulers(hActiveWnd);

        ComputeDispRect(hActiveWnd);
        ComputeFileRect(hActiveWnd, 0, 0, m_lpDisplay->FileRate );
        SetupRulers(hActiveWnd);
        InvalidateRect(NULL, TRUE);
    }
}
Exemplo n.º 14
0
void CMainFrame::OnPingboosterRun()
{
	// TODO: Add your command handler code here
	CMenu* menu = GetMenu();
	UINT state = menu->GetMenuState(ID_PINGBOOSTER_RUN,MF_BYCOMMAND);
	UINT teststate = menu->GetMenuState(ID_PINGBOOSTER_CHANGEVALUE,MF_BYCOMMAND);
	bool turnon = !(state & MF_CHECKED);
	if (!turnon)
	{
		menu->CheckMenuItem(ID_PINGBOOSTER_RUN,MF_BYCOMMAND | MF_UNCHECKED);
		menu->EnableMenuItem(ID_PINGBOOSTER_CHANGEVALUE, MF_BYCOMMAND | MF_ENABLED);
	}
	else
	{
		menu->CheckMenuItem(ID_PINGBOOSTER_RUN,MF_BYCOMMAND | MF_CHECKED);
		menu->EnableMenuItem(ID_PINGBOOSTER_CHANGEVALUE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	}

	CServerView* serverview = (CServerView*)m_wndSplitter.GetPane(0,0);
	CServerDoc* doc = (CServerDoc*)serverview->GetDocument();
	doc->boost(turnon);
}
Exemplo n.º 15
0
void CDetailView::OnBnClickedTimecontrol()
{
	// TODO: Add your control notification handler code here
	CServerDoc* doc = (CServerDoc*)GetDocument();
	ServerControl* sc = doc->getSelectedServer();
	if (sc)
	{
		bool enableTime = false;
		if (m_TimeControlled.GetCheck() == BST_CHECKED)
		{
			enableTime = true;
		}
		GetDlgItem(IDC_STARTTIME)->EnableWindow(enableTime);
		GetDlgItem(IDC_STOPTIME)->EnableWindow(enableTime);

		sc->SetTimeControlled(enableTime);
	}
	else
	{
		m_TimeControlled.SetCheck(BST_UNCHECKED);
	}
    doc->UpdateAllViews(NULL);
}
Exemplo n.º 16
0
void COlelistBox::OnLButtonDown(UINT nFlags, CPoint point)
{
	FNAME       *lpResult;
    CDataItem   *pDataItem;
    LPIMAGE      lpImage = GetActiveImage();
	CServerDoc  *pDoc = PictPubApp.GetDocument(lpImage);
	int          num;
    CRect        r,rr;
    BOOL         bCreateDoc = (pDoc == NULL);
    CPoint       p;

	CListBox::OnLButtonDown(nFlags, point);
    FORWARD_WM_LBUTTONUP(GetSafeHwnd(), point.x, point.y, nFlags, ::SendMessage);

	lpResult = ExtBsr_GetSelection(GetParent()->GetSafeHwnd(), &num);

    if (!lpResult || num != 1)
    	return;
	lstrcpy(Names.Clipboard, lpResult[0]);
	if (LookupExtFileN(Names.Clipboard, Names.PasteImageFile, 
		IDN_CLIPBOARD, NO))
	{
		if (bCreateDoc)
		{
			LPFRAME lpFrame = FrameOpen(FDT_GRAYSCALE, 1, 1, 72);
			if (lpFrame)
			{
	            POSITION    Pos;
				lpImage = CreateImage(NULL,lpFrame,NULL,NULL,
						IDN_PP,IDC_SAVECT,IMG_DOCUMENT,NULL);
				if (!lpImage)
				{
					FrameClose(lpFrame);
					return;
				}
				pDoc = (CServerDoc*)PictPubApp.OpenDocumentFile(
					lpImage->CurFile, lpImage, FALSE);
				if (!pDoc)
				{
					DestroyImage(lpImage);
					return;
				}
		 	}
			else
				return;
		}

		if (pDoc)
		{
		    pDataItem = new CDataItem(pDoc, Names.Clipboard, YES);
		    GetParent()->GetWindowRect(&r);
		    ClientToScreen(&point);
		    GetItemRect(GetCurSel(), &rr);
		    ClientToScreen(&rr);
		    p.x = rr.Width() / 2;
		    p.y = rr.Height() / 2;
		
		    // NOTE!!the pDataItem will be internally destroyed once the drag/drop 
		    // operation is completed therefore we do not need to delete the pDataItem
		    pDataItem->DoDragDrop(&rr, p, FALSE, DROPEFFECT_COPY, &r);
		
		    if (bCreateDoc)
				pDoc->OnCloseDocument();
		}
    }
    else if(Names.Clipboard[0])
    {
  	  	// deleted the file...notify the browser
  		UpdatePasteFromFile(NULL);
	} 
}
Exemplo n.º 17
0
LOCAL LPCMDLIST ProgActivateWindow(LPACTIVATEWINDOW_PARMS lpParms)
/***********************************************************************/
{
int iOffset, nDocs;
CWnd *pActiveWnd, *pNextWnd, *pChild;
CMDIFrameWnd *pMainWnd;
	
pNextWnd = NULL;

pMainWnd = (CMDIFrameWnd *)PictPubApp.m_pMainWnd;

// first look for the filename
CServerDoc *pDoc = PictPubApp.GetDocument(lpParms->szFileName);
if (pDoc)
	{
	// ignore if we are in place
	if (pDoc->IsInPlaceActive())
		return(NULL);

	POSITION ViewPos = pDoc->GetFirstViewPosition();
	if (ViewPos)
		{
	    CView* pView = pDoc->GetNextView( ViewPos );
		if (pView)
			pNextWnd = pView->GetParent();
		}
	}

// if not found, try using windows offsets
if (!pNextWnd && lpParms->iOffset)
	{
	nDocs = 0;
	pChild = pActiveWnd = pMainWnd->MDIGetActive();
	while (pChild)
		{
		++nDocs;
		pChild = pChild->GetWindow(GW_HWNDNEXT);
		}

	if (nDocs)
		{
		iOffset = lpParms->iOffset;
		pNextWnd = pActiveWnd;
		if (iOffset > 0)
			{
			if (iOffset >= nDocs)
				iOffset = nDocs - 1;
			while(pNextWnd && (--iOffset >= 0))
				pNextWnd = pNextWnd->GetWindow(GW_HWNDNEXT);
			}
		else
			{
			if (iOffset <= (-nDocs))
				iOffset = (-nDocs) + 1;
			while(pNextWnd && (++iOffset <= 0))
				pNextWnd = pNextWnd->GetWindow(GW_HWNDPREV);
			}
		}
	}

if (pNextWnd)
	{
	CPPMDIChildWnd *pMDIChild = (CPPMDIChildWnd *)pNextWnd;
	CServerView *pView = (CServerView*)pMDIChild->GetActiveView();
	if (pView)
		{
        CServerDoc *pDoc = pView->GetDocument();
       	ASSERT(pDoc && pDoc->m_lpImage);
		if (pDoc && pDoc->m_lpImage && !pDoc->IsInPlaceActive())
			{
			pMainWnd->MDIActivate(pNextWnd);
			return(pDoc->m_lpImage->lpCmdList);
			}
		}
	}
return(NULL);
}
Exemplo n.º 18
0
BOOL HandleCommandLine( HWND hWindow, LPTSTR lpszCmdLine, LPINT lpPrint )
/***********************************************************************/
{
	FNAME    szFileName;
	LPTSTR   lp;
	BOOL     bPassedByClient;
	LPIMAGE  lpImageDoc;
	HWND     hWnd;
	WORD 	 wChar;

	*lpPrint = NO;
	if( !lpszCmdLine )
    	return( TRUE );

	// Check if we have "[/ | -]embedding" and a possible filename.
	// usage: PP ["[-/]embedding"] file1 file2 ...

	//dbg("full command line = '%ls'", lpszCmdLine );

	// See if the command line is being passed by a client
	bPassedByClient = NO;
	if(( lp = lstrfind( lpszCmdLine, _T("embedding") )) &&
   	   ( lp == lpszCmdLine || lp == ( MyCharNext( lpszCmdLine ))))
   	{ 	// Command line passed by a client
		//  dbg(_T("command line passed by client"));
    	bPassedByClient = YES;
    	lpszCmdLine = SkipSpaces( MyCharNextN( lp, 9 )); 	// skip over _T("embedding")
   	}

	while( *lpszCmdLine )		// Process any files and switches on the command line
   	{ 
    	// Skip white space and see if we're done...
    	lpszCmdLine = SkipSpaces( lpszCmdLine );
    	if( !( *lpszCmdLine ))	// If NULL get out
        	break; 

		//  dbg( _T("file='%ls' print=%d"), lpszCmdLine, *lpPrint );dbg(0);

    	// Check for any switches preceeding the file name: only /p for now
    	while( TRUE )	
    	{ 
			if( IsDBCSLeadByte(( BYTE )*lpszCmdLine ))
				wChar = *(( LPWORD )lpszCmdLine );
			else
				wChar = *lpszCmdLine;

			if( wChar != _T('/'))	// if not a switch...
				break;

        	lpszCmdLine = MyCharNext( lpszCmdLine );	// Skip over the slash

        	if( !*lpszCmdLine )		// If NULL get out
            	break; 

			if( IsDBCSLeadByte(( BYTE )*lpszCmdLine ))
				wChar = *(( LPWORD )lpszCmdLine );
			else
				wChar = *lpszCmdLine;

        	if( wChar == _T('p') || wChar == _T('P') )
            	*lpPrint = YES;

        	lpszCmdLine = SkipSpaces( MyCharNext( lpszCmdLine ));
		}

    	// Skip white space and see if we're done...
    	lpszCmdLine = SkipSpaces( lpszCmdLine );
    	if( !( *lpszCmdLine ))		// If NULL get out
        	break; 

    	// Try to zap the space after a single file name
    	if(( lp = lstrfind( lpszCmdLine, _T(" ") )))
        	*lp = _T('\0'); // If we found a space, zap it

    	// Copy the full path name into szFileName
    	if( lStrChr( lpszCmdLine, _T('\\') ))
        	lstrcpy( szFileName, lpszCmdLine );
    	else				// If not a full path name...
   		{ 
        	GetCurrentDir( szFileName, sizeof(FNAME) );
        	FixPath( szFileName );
        	lstrcat( szFileName, lpszCmdLine );
		}

    	// Now we're done with lpszCmdLine, so set it up for the next loop
		// If we had found a space, there might be more file names
    	if( lp )	
        	lpszCmdLine = MyCharNext( lp );
    	else    
			lpszCmdLine += lstrlen( lpszCmdLine ); // Point to nothing

    	// Process szFileName

    	// Special handling of documents passed by a client
    	if ( bPassedByClient )
    	{
			CServerDoc *pDoc = PictPubApp.GetDocument(szFileName);
			if (pDoc)
        	{
            	// It's already open....
            	POSITION ViewPos = pDoc->GetFirstViewPosition();
            	ASSERT(ViewPos!=NULL);
            	CView* pView = pDoc->GetNextView( ViewPos );
            	ASSERT(pView);
            	// NOTE send Message to View's Parent MDIFrame
            	SendMessage( PictPubApp.Get_hClientAstral(), WM_MDIACTIVATE, 
                	(WORD)pView->GetParentFrame()->GetSafeHwnd(), 0L );
            	lpImageDoc->fOwnedByClient = YES;
            	*szFileName = _T('\0'); // Zap it
        	}
    	}

    	// If we have a file name, open it...
    	if ( *szFileName )
			hWnd = AstralImageLoad(  0, szFileName, MAYBE, YES );
    	else    
			hWnd = NULL;

    	// If the printing option was passed, print it and close it
    	if ( hWnd && *lpPrint )
    	{
         	FORWARD_WM_COMMAND(PictPubApp.Get_hWndAstral(), IDM_PRINT, NULL, 0, SendMessage);
        	CloseImage( NO, NULL, NULL );
    	}
	}
	return( TRUE );
}
Exemplo n.º 19
0
void CDetailView::OnBnClickedUpdate()
{
	// TODO: Add your control notification handler code here
	bool updateable = false; // state of the update button
	
	CServerDoc* doc = (CServerDoc*)GetDocument();
	ServerControl* sc= doc->getSelectedServer();
	if (sc)
	{
		int game = m_Type.GetCurSel();

		CString server = _T("");
		unsigned short port = 0;
		CString tmp;

		m_Port.GetWindowText(tmp);
		port = (unsigned short)(strtol(tmp,NULL,10)%USHRT_MAX);

		if (game != NORMAL_PROGRAM_INDEX)
		{
			if (!port)
			{
				MessageBox("Invalid port","Error:");
				updateable = true;
			}
		}

		m_IP.GetWindowText(server);

		CString executable;
		m_Executable.GetWindowText(executable);

		CString name;
		m_Name.GetWindowText(name);
		
		m_Startup.GetWindowText(tmp);
		int startup = strtol(tmp,NULL,10);

		m_TimeOut.GetWindowText(tmp);
		int timeout = strtol(tmp,NULL,10);

		m_Pause.GetWindowText(tmp);
		int pause = strtol(tmp,NULL,10);

		bool timecontrol = (m_TimeControlled.GetCheck() == BST_CHECKED);
		//CTime starttime;
		SYSTEMTIME starttime;
		m_StartTime.GetTime(&starttime);

		//CTime stoptime;
		SYSTEMTIME stoptime;
		m_StopTime.GetTime(&stoptime);

		try
		{
			if (timeout <= 0 || startup <= 0 || pause <= 0)
			{
				throw "Timeout, startup and pause must be positive, non-zero integers.";
			}
			sc->setServer(server,port)->setGame(game)->setExecutable(executable);
			sc->setTimeOut(timeout)->setPause(pause)->setStartUp(startup)->setServerName(name);
			sc->SetStartStopTime(starttime, stoptime);
		}
		catch (char* error)
		{
			MessageBox(error,"Error...",MB_OK | MB_ICONWARNING);
			updateable = true;
		}
	}
	GetDlgItem(IDC_UPDATE)->EnableWindow(updateable);
	doc->UpdateAllViews(NULL);
}
Exemplo n.º 20
0
void CDetailView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/)
{
	// TODO: Add your specialized code here and/or call the base class
	CServerDoc* doc = (CServerDoc*)GetDocument();
	ServerControl* sc= doc->getSelectedServer();
	if (sc)
	{
		m_IP.SetWindowText(sc->getServerIP());
		m_Executable.SetWindowText(sc->getExecutable());

		CString tmp;
		tmp.Format("%d",sc->getPort());

		m_Port.SetWindowText( tmp );
		m_Type.SetCurSel(sc->getGameType());

		if (sc->getGameType() == NORMAL_PROGRAM_INDEX)
		{
			GetDlgItem(IDC_TIMEOUT)->EnableWindow(false);
			GetDlgItem(IDC_STARTUP)->EnableWindow(false);
			GetDlgItem(IDC_PAUSE)->EnableWindow(false);
			GetDlgItem(IDC_IP)->EnableWindow(false);
			GetDlgItem(IDC_PORT)->EnableWindow(false);
		}
		else
		{
			GetDlgItem(IDC_TIMEOUT)->EnableWindow(true);
			GetDlgItem(IDC_STARTUP)->EnableWindow(true);
			GetDlgItem(IDC_PAUSE)->EnableWindow(true);
			GetDlgItem(IDC_IP)->EnableWindow(true);
			GetDlgItem(IDC_PORT)->EnableWindow(true);
		}

		tmp.Format("%d",sc->getPause());
		m_Pause.SetWindowText(tmp);

		tmp.Format("%d",sc->getStartup());
		m_Startup.SetWindowText(tmp);

		tmp.Format("%d",sc->getTimeOut());
		m_TimeOut.SetWindowText(tmp);

		m_Name.SetWindowText(sc->getServerName());

		PRIORITY prior = sc->getPriority();
		switch (prior)
		{
		case HIGH:
			m_Priority.SetCurSel(0);
			break;
		case LOW:
			m_Priority.SetCurSel(3);
			break;
		case ABOVE_NORMAL:
			m_Priority.SetCurSel(1);
			break;
		default:
			m_Priority.SetCurSel(2);
			break;
		}

		if (sc->IsTimeControlled())
		{
			m_TimeControlled.SetCheck(BST_CHECKED);
			GetDlgItem(IDC_STARTTIME)->EnableWindow(true);
			GetDlgItem(IDC_STOPTIME)->EnableWindow(true);
			
			//CTime starttime = sc->GetStartTime();
			SYSTEMTIME starttime = sc->GetStartTime();
			//CTimestoptime = sc->GetStopTime();
			SYSTEMTIME stoptime = sc->GetStopTime();
			m_StartTime.SetTime(&starttime);
			m_StopTime.SetTime(&stoptime);			
		}
		else
		{
			m_TimeControlled.SetCheck(BST_UNCHECKED);
			GetDlgItem(IDC_STARTTIME)->EnableWindow(false);
			GetDlgItem(IDC_STOPTIME)->EnableWindow(false);
			//CTime starttime = sc->GetStartTime();
			SYSTEMTIME starttime = sc->GetStartTime();
			//CTimestoptime = sc->GetStopTime();
			SYSTEMTIME stoptime = sc->GetStopTime();
			m_StartTime.SetTime(&starttime);
			m_StopTime.SetTime(&stoptime);		
		}
	}
	else
	{
		m_IP.SetWindowText(_T(""));
		m_Executable.SetWindowText(_T(""));
		m_Port.SetWindowText(_T(""));
		m_Type.SetCurSel(-1);
		m_Startup.SetWindowText(_T(""));
		m_Pause.SetWindowText(_T(""));
		m_TimeOut.SetWindowText(_T(""));
		m_Priority.SetCurSel(-1);
		m_Name.SetWindowText(_T(""));
		m_TimeControlled.SetCheck(BST_UNCHECKED);
		GetDlgItem(IDC_STARTTIME)->EnableWindow(false);
		GetDlgItem(IDC_STOPTIME)->EnableWindow(false);

		SYSTEMTIME nothing;
		memset(&nothing,0,sizeof(SYSTEMTIME));

		m_StartTime.SetTime(nothing);
		m_StopTime.SetTime(nothing);
	}
	GetDlgItem(IDC_UPDATE)->EnableWindow(false); // disable update button
	UpdateData();
}
Exemplo n.º 21
0
BOOL CInPlaceFrame::OnCreateControlBars(
// OnCreateControlBars is called by the framework to create control
// bars on the container application's windows.
CWnd* pWndFrame, 
CWnd* pWndDoc)
{
	// ------------------------------------------------
	// create new ribbonbar
	// ------------------------------------------------
	if (!m_wndRibbonBar.Create(pWndFrame,MAKEINTRESOURCE(IDD_INPLACE_BLANKTOOLBOX),
		CBRS_TOP,IDD_INPLACE_BLANKTOOLBOX))
	{
		TRACE("Failed to install new ribbonbar\n");
		return FALSE;
	}

	if (!CanGetBorderSpace(NULL, m_lpFrame, TRUE))
	{
		// Kill the fixed ribbon we couldn't get some space
		m_wndRibbonBar.DestroyWindow();

		// create a Floating Ribbon
		if (!m_wndFloatRibbonBar.Create(IDD_INPLACE_BLANKTOOLBOXFLOAT, 
			pWndFrame)) 
		{
			TRACE("Failed to install new ribbonbar\n");
			return FALSE;
		}

		// Force the window to top and show. Don't know why this works but don't
		// touch!
		m_wndFloatRibbonBar.SetWindowPos(NULL, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_DRAWFRAME);
		m_wndFloatRibbonBar.SetOwner(this);
	}
	else
		m_wndRibbonBar.SetOwner(this);

	// ------------------------------------------------
	// create the Toolbox
	// ------------------------------------------------
/* Nezar commented for now
	CCustToolList *pCustToolList = PictPubApp.GetCustomBoxes();
	if (!pCustToolList || 
		!(m_pToolBox = pCustToolList->CreateInsitueBox(pWndFrame)))
	{
		TRACE("Failed to install new toolbox\n");
		return FALSE;
	}
	else
	{
		m_bNeedSetInitToolbarPos = TRUE;
		m_pToolBox->SetOwner(this); 
	}

*/

//-----------------------------------------------------------------------------
// This is good code for creating our own Status bar.  If we can determine
// if the Client has NO status bar then we will want to create our own, else
// "by convention" we are to use its' bar.
//-----------------------------------------------------------------------------
//	// create new statusbar
//	if (m_lpFrame)
//		m_bUseOwnStatusBar = 
//			(NOERROR != m_lpFrame->SetStatusText("Picture Publisher Ready"));
//
//	if (m_bUseOwnStatusBar)
//	{
//		if (!m_wndStatusBar.Create(pWndFrame) || 
//			!m_wndStatusBar.SetIndicators(indicators,
//				sizeof(indicators)/sizeof(UINT)))
//		{
//			TRACE("Failed to install new statusbar\n");
//			return FALSE;
//		}
//		m_wndStatusBar.SetOwner(this);
//	}
	
	CServerDoc *pDoc = (CServerDoc*)GetActiveDocument();
	ASSERT(pDoc);
	if (pDoc)
	{
		CServerView *pView = pDoc->GetActiveView();
		ASSERT(pView);
		if (pView)
		{
			CRect rPosRect;
	
			pDoc->InPlaceInitialUpdate(pWndFrame);
			pDoc->GetItemPosition((LPRECT)&rPosRect);
			CRect rDispRect((LPRECT)&pView->m_lpDisplay->DispRect);
			if ((rPosRect.Width() != rDispRect.Width()) ||
				(rPosRect.Height() != rDispRect.Height()))
				SetUpdateCacheFlag(TRUE);
			else
				SetUpdateCacheFlag(FALSE);
		}
	}

	return TRUE;
}