void COXScrollTip::RedrawBackground(CRect rect)
	// --- In  :
	// --- Out : 
	// --- Returns :
	// --- Effect : Updates the windows that are covered by the specified rect (screen coordinates)
	{
	// We give the windows that are under the top left and bottom right corner of 
	// the specified rect the opportunity the redraw themselves now.
	// Other areas will be repainted through a (posted) WM_PAINT, which will
	// be handled later.
	if (!rect.IsRectEmpty())
		{
		CWnd* pBackTopLeftWnd = CWnd::WindowFromPoint(rect.TopLeft());
		if (pBackTopLeftWnd != NULL)
			{
			pBackTopLeftWnd = pBackTopLeftWnd->GetTopLevelParent();
			ASSERT(pBackTopLeftWnd != NULL);
			pBackTopLeftWnd->RedrawWindow(&rect);
			}
		CWnd* pBackBottomRightWnd = CWnd::WindowFromPoint(rect.BottomRight());
		if ((pBackBottomRightWnd != NULL) && (pBackTopLeftWnd != pBackBottomRightWnd))
			{
			pBackBottomRightWnd = pBackBottomRightWnd->GetTopLevelParent();
			ASSERT(pBackBottomRightWnd != NULL);
			pBackBottomRightWnd->RedrawWindow(&rect);
			}
		}
	}
void CGrammarBuilderComplxConDlg::HidePopup()
{
	CWnd* pWnd;

	pWnd=&m_recPopup;
	pWnd->ShowWindow(SW_HIDE);
	m_bPopupVisible=FALSE;
	pWnd=&m_datatblComplexConcepts;
	pWnd->RedrawWindow();
}
示例#3
0
void CDlgStackTrace::Size()
{_STT();
	if ( !::IsWindow( GetSafeHwnd() ) ) return;

	CWnd *pCtrl;
	RECT rect, ctrl;
	GetClientRect( &rect );

	// Combo
	SetRect( &ctrl, rect.left + 2, rect.top + 2, rect.right - ( 80 * 1 ), rect.top + 24 );
	pCtrl = GetDlgItem( IDC_TAB );
	if ( pCtrl ) { pCtrl->MoveWindow( &ctrl ); pCtrl->RedrawWindow(); }

	// Refresh
	SetRect( &ctrl, rect.right - 80, rect.top, rect.right, rect.top + 24 );
	pCtrl = GetDlgItem( IDC_REFRESH );
	if ( pCtrl ) { pCtrl->MoveWindow( &ctrl ); pCtrl->RedrawWindow(); }

	// Thread combo
	SetRect( &ctrl, rect.left, rect.top + 25, rect.right, rect.top + 50 );
	pCtrl = GetDlgItem( IDC_THREAD );
	if ( pCtrl ) { pCtrl->MoveWindow( &ctrl ); pCtrl->RedrawWindow(); }

	// Tree
	SetRect( &ctrl, rect.left, rect.top + 50, rect.right, rect.bottom );
	pCtrl = GetDlgItem( IDC_LIST );
	if ( pCtrl ) { pCtrl->MoveWindow( &ctrl ); pCtrl->RedrawWindow(); }

	// Set columns
	long w = ( rect.right - rect.left ) - GetSystemMetrics( SM_CXVSCROLL ) - 4;
	if ( ::IsWindow( m_list.GetSafeHwnd() ) )
	{
		int sel = m_tabSource.GetCurSel();
		if ( sel == 2 )
		{	m_list.SetColumnWidth( 0, w - ( w / 4 ) );
			m_list.SetColumnWidth( 1, w / 4 );
		} // end if			
		else m_list.SetColumnWidth( 0, w );
	} // end if

}
示例#4
0
void CGrammarTopicOrderDlg::OnLButtonUp(UINT nFlags, CPoint point) 
{
	int i,j,k,nMovedItemsIndex,nDestinationItemsIndex;
	CString Q,R,S,T,strMovedItem,strDestinationItem;
	CWnd* pWnd;

	if (m_bDragging)
	{
	    m_pDragImage->EndDrag(); 
		KillTimer(1);              //kill scroll timer if it's running
		delete m_pDragImage;
		ReleaseCapture(); 
		ShowCursor(TRUE); 
		m_bDragging=FALSE;
		if (hDropTarget!=NULL)
		{
			pWnd=&m_ctrltreeTopics;
			pWnd->RedrawWindow();  //erase the previously drawn drag image
			nMovedItemsIndex=(int)m_pTree->GetItemData(m_hSelected);    //retrieve the index of the item being moved
			strMovedItem=m_pTree->GetItemText(m_hSelected);
			nDestinationItemsIndex=(int)m_pTree->GetItemData(hDropTarget);   //retrieve the index of the destination
			strDestinationItem=m_pTree->GetItemText(hDropTarget);
			T=m_strTopics;
			strMovedItem=L"|"+strMovedItem+L"/";
			strDestinationItem=L"|"+strDestinationItem+L"/";
			T=L"|"+T;
			i=T.Find(strMovedItem);
			j=T.Find(strDestinationItem);
			if (i>-1 && j>-1)
			{
				S=T.Left(i+1);    //get the items preceding the moved item, include |
				T=T.Mid(i+1);
				k=T.Find(L"/");
				T=T.Mid(k+1);   //remove the label for the topic being moved
				k=T.Find(L"|");
				strMovedItem+=T.Left(k+1);
				T=T.Mid(k+1);     //remove the index of the moved item
				T=S+T;
				k=T.Find(strDestinationItem);
				if (i<j)        //if moving down the tree
				{
					k=T.Find(L"|",k+1);   //find the end of this item
				}
				strMovedItem=strMovedItem.Mid(1);   //remove leading |
				T=T.Left(k+1)+strMovedItem+T.Mid(k+1);   //insert moved item before destination item
				T=T.Mid(1);          //remove leading |
				m_strTopics=T;
				LoadTopics();
			}
		}
	}
	CDialog::OnLButtonUp(nFlags, point);
}
示例#5
0
void CDlgImgView::Size()
{
	// Punt if no window
	if ( !::IsWindow( GetSafeHwnd() ) ) return;

	RECT rect, ctrl;
	GetClientRect( &rect );

	CopyRect( &ctrl, &rect );
	ctrl.bottom = ctrl.top + 32;
	CWnd *pCtrl = GetDlgItem( IDC_TOOLBAR );
	if ( pCtrl != NULL ) 
	{	pCtrl->MoveWindow( &ctrl ); pCtrl->RedrawWindow(); }

	ctrl.top = ctrl.bottom + 1;
	ctrl.bottom = rect.bottom;
	pCtrl = GetDlgItem( IDC_IMG );
	if ( pCtrl != NULL ) 
	{	
		CopyRect( &m_imgrect, &ctrl );

		CWinDc *pdc = m_img.GetShowDc();
		if ( pdc != NULL ) CopyRect( &m_imgrect, *pdc );
		else
		{	CWinImg *pimg = m_img.GetImg();
			if ( pimg != NULL ) CopyRect( &m_imgrect, *pimg );
		} // end if

		CGrDC::Center( &m_imgrect, &ctrl );
		if ( m_imgrect.top < ctrl.top ) OffsetRect( &m_imgrect, 0, ctrl.top - m_imgrect.top );

		pCtrl->MoveWindow( &m_imgrect );

		pCtrl->RedrawWindow(); 

	} // end if

}
BOOL CHyperlinkLabel::OnEraseBkgnd(CDC* pDC)
{
	// Declare variables
	CRect rcWnd;

	// Get some values
	GetWindowRect(&rcWnd);
	CWnd* pParent = GetParent();

	// Be sure we get rid of the messy hyperlink
	pParent->ScreenToClient(&rcWnd);
	pParent->RedrawWindow(&rcWnd, 0, RDW_NOCHILDREN | RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW | RDW_UPDATENOW);

	return TRUE;
}
示例#7
0
void COwnerVstEditor::OnPaint()
//-----------------------------
{
	CAbstractVstEditor::OnPaint();
	if(static_cast<CVstPlugin &>(m_VstPlugin).isBridged)
	{
		// Force redrawing for the plugin window in the bridged process.
		// Otherwise, bridged plugin GUIs will not always be refreshed properly.
		CRect rect;
		if(m_plugWindow.GetUpdateRect(&rect, FALSE))
		{
			CWnd *child = m_plugWindow.GetWindow(GW_CHILD | GW_HWNDFIRST);
			if(child) child->RedrawWindow(&rect, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN);
		}
	}
}
示例#8
0
//------------------------------------------------------------------------//
void CBCGPGlobalUtils::ForceAdjustLayout (CBCGPDockManager* pDockManager, BOOL bForce,
										  BOOL bForceInvisible, BOOL bForceNcArea)
{
	if (pDockManager != NULL && 
		(CBCGPControlBar::m_bHandleMinSize || bForce))
	{
		CWnd* pDockSite = pDockManager->GetDockSite ();

		if (pDockSite == NULL)
		{
			return;
		}
			
		if (!pDockSite->IsWindowVisible () && !bForceInvisible)
		{
			return;
		}

		if (pDockSite->IsKindOf(RUNTIME_CLASS(CBCGPFrameWnd)) || pDockSite->IsKindOf(RUNTIME_CLASS(CBCGPMDIFrameWnd)))
		{
			m_bIsAdjustLayout = (pDockSite->GetStyle() & WS_MAXIMIZE) == WS_MAXIMIZE;
		}

		CRect rectWnd;
		pDockSite->SetRedraw (FALSE);
		pDockSite->GetWindowRect (rectWnd);
		pDockSite->SetWindowPos (NULL, -1, -1, 
			rectWnd.Width () + 1, rectWnd.Height () + 1, 
			SWP_NOZORDER |  SWP_NOMOVE | SWP_NOACTIVATE);
		pDockSite->SetWindowPos (NULL, -1, -1, 
			rectWnd.Width (), rectWnd.Height (), 
			SWP_NOZORDER |  SWP_NOMOVE  | SWP_NOACTIVATE);
		pDockSite->SetRedraw (TRUE);

		if (bForceNcArea)
		{
			pDockSite->SetWindowPos(NULL, 0, 0, 0, 0, 
				SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
		}

		m_bIsAdjustLayout = FALSE;

		pDockSite->RedrawWindow (NULL, NULL, 
			RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
	}
}
示例#9
0
void CGrammarTopicOrderDlg::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (m_bDragging)
	{
		int nTreeHeight;
		BOOL b;
		CDC* pDC;
		CWnd* pWnd;
        CRect rect;
		LPRECT lpRect;
		HWND  hWnd;            //handle of this window
		pWnd=&m_ctrltreeTopics;
		pDC=pWnd->GetDC();
		pWnd->RedrawWindow();  //erase the previously drawn drag image
		point.y-=30;
		point.x-=20;
		b=m_pDragImage->Draw(pDC,0,point,ILD_NORMAL);
		HTREEITEM hTest;
		UINT i;
		UINT* pFlags;
		pFlags=&i;
		CPoint pt;
		pt=point;
		pt.y+=7;
		hTest=m_pTree->HitTest(pt,pFlags);
		if (hTest!=NULL)
		{
			b=m_pTree->SelectDropTarget(hTest); 
			hDropTarget=hTest;   //save for LButtonUp
			b=m_pDragImage->Draw(pDC,0,point,ILD_NORMAL);
		}
		//now check if cursor near top or bottom of tree so that tree needs to be scrolled
		pWnd=&m_ctrltreeTopics;
		hWnd=pWnd->GetSafeHwnd();
		lpRect=&rect;
		pWnd->GetWindowRect(lpRect);
		nTreeHeight=rect.bottom-rect.top-25;
        if ((point.y>=0 && point.y<=15) || (point.y>=nTreeHeight-10 && point.y<=nTreeHeight))  //if cursor still in tree but near top or bottom
		{
            i=(UINT)SetTimer(1,500,NULL);   //init timer to 500 msecs, if timer expires, OnTimer will scroll the tree
			ASSERT(i!=0);
		}
	}  
	CDialog::OnMouseMove(nFlags, point);
}
示例#10
0
// helper function to loop through and enable / disable all child windows
void EnableDescendants(HWND hWnd, BOOL enable)
{
    // walk through HWNDs to avoid creating temporary CWnd objects
    // unless we need to call this function recursively
    for (HWND hWndChild = ::GetTopWindow(hWnd); hWndChild != NULL;
            hWndChild = ::GetNextWindow(hWndChild, GW_HWNDNEXT))
    {
        CWnd* pWnd = CWnd::FromHandlePermanent(hWndChild);
        if (pWnd != NULL)
        {
            pWnd->EnableWindow(enable);
            pWnd->RedrawWindow();
        }
        if (::GetTopWindow(hWndChild) != NULL)
        {
            // send to child windows after parent
            EnableDescendants(hWndChild,enable);
        }
    }
}
BOOL COXLayoutManager::OnSize(int cx, int cy)
{
	if(m_pContainerWnd == NULL || !::IsWindow(m_pContainerWnd->m_hWnd))
		return TRUE;

	if(cx == 0 || cy == 0 || m_wcTable.GetSize() == 0)
		return TRUE;

	m_cx = __min(__max(cx, m_cxMin), m_cxMax);
	m_cy = __min(__max(cy, m_cyMin), m_cyMax);
	
	int nLastResult = OX_LM_SIZING_OK;
	while (true)
	{
		// m_cx and m_cy adjustment reaching screen limit
		if (m_cx <= 0 || m_cx > 32767 || m_cy <= 0 || m_cy > 32767)
		{
			// whenever seeing this msg, check all constraint and min/max settings
			TRACE0("COXLayoutManager::OnSize(): contraints have internal conflicts.\r\n");
			return FALSE;
		}
		
		int nResult = CalcLayout();

		if (nResult == OX_LM_SIZING_FAIL)
		{
			TRACE0("COXLayoutManager::OnSize(): contraints have internal conflicts.\r\n");
			return FALSE;
		}
			
		if (nResult == OX_LM_SIZING_OK)
		{
			// save container's min/max good value
			if (nLastResult != OX_LM_SIZING_OK)
			{
				if (nLastResult & OX_LM_SIZING_NEEDLARGERCX)
					m_cxMin = m_cx;
				else if (nLastResult & OX_LM_SIZING_NEEDSMALLERCX)
					m_cxMax = m_cx;

				if (nLastResult & OX_LM_SIZING_NEEDLARGERCY)
					m_cyMin = m_cy;
				else if (nLastResult & OX_LM_SIZING_NEEDSMALLERCY)
					m_cyMax = m_cy;
			}
		
			// normal exit from while loop
			break;
		}

		// adjust m_cx and m_cy until all constraints can be conformed
		nLastResult = nResult;
		if (nResult & OX_LM_SIZING_NEEDLARGERCX)
			m_cx++;
		else if (nResult & OX_LM_SIZING_NEEDSMALLERCX)
			m_cx--;

		if (nResult & OX_LM_SIZING_NEEDLARGERCY)
			m_cy++;
		else if (nResult & OX_LM_SIZING_NEEDSMALLERCY)
			m_cy--;
	}

	// reposition wnd
	int nNumWindows = PtrToInt( m_wcTable.GetSize());
	HDWP hdwp = ::BeginDeferWindowPos(nNumWindows);
	if (hdwp)
	{
		for (int i = 0; i < nNumWindows; i++)
		{
			COXWndConstraint* pWC = m_wcTable[i];
			CWnd* pWnd = m_pContainerWnd->GetDlgItem(pWC->nID);
			ASSERT(pWnd);
			if (pWnd)
			{
				CRect rectWC = pWC->GetRect();
				::DeferWindowPos(hdwp, pWnd->m_hWnd, NULL, 
					rectWC.left, rectWC.top, rectWC.Width(), rectWC.Height(), 
					SWP_NOZORDER);
				pWnd->RedrawWindow();

			}
		}
		return ::EndDeferWindowPos(hdwp);
	}
	return FALSE;
}
示例#12
0
void CGrammarTopicOrderDlg::OnTimer(UINT nIDEvent) 
{
	int j,k,nTreeTop,nTreeHeight,nLeft;
	UINT i;
	UINT* pFlags;
	BOOL b;
	CRect rect;
	HTREEITEM hFirstVisible,hNextVisible,hTest;
	CWnd* pWnd;
	CDC* pDC;
	LPRECT lpRect;
	LPPOINT lpPoint;
	CPoint pt,ptSave;
	HWND  hWnd;            //handle of this window

	lpRect=&rect;
	lpPoint=&pt;
	pFlags=&i;
	pWnd=this;
	hWnd=pWnd->GetSafeHwnd();
	pWnd->GetWindowRect(lpRect);
	nLeft=rect.left;
	pWnd=&m_ctrltreeTopics;
	hWnd=pWnd->GetSafeHwnd();
	pWnd->GetWindowRect(lpRect);
	nTreeTop=rect.top;
	nTreeHeight=rect.bottom-rect.top;
//	nTreeHeight=rect.bottom-rect.top-25;
	GetCursorPos(lpPoint);    //get the mouse's position
	SetTimer (1,400,NULL);     //reset timer to 400 msecs for subsequent scrolls
    // Get the current cursor position and window height.
    // Scroll the window if the cursor is near the top or bottom
	pt.y-=nTreeTop;
	ptSave=pt;
	if (pt.y>=0 && pt.y<=15) //if cursor still in tree but near top
	{
		hFirstVisible=m_pTree->GetFirstVisibleItem();
		hNextVisible=m_pTree->GetPrevSiblingItem(hFirstVisible);
		m_pTree->EnsureVisible(hNextVisible);
		//kill the timer if the window did not scroll, or redraw the drop target highlight if the window did scroll.
		if (m_pTree->GetFirstVisibleItem()==hFirstVisible)  //tree didn't scroll
		{
			hNextVisible=m_pTree->GetParentItem(hFirstVisible);  //move up to root node
			m_pTree->EnsureVisible(hNextVisible);
			KillTimer (1);
		}
		else
		{
			pDC=pWnd->GetDC();
			pWnd->RedrawWindow();  //erase the previously drawn drag image
			pt.y-=10;
			pt.x-=nLeft;    //200;
			b=m_pDragImage->Draw(pDC,0,pt,ILD_NORMAL);  //draw the new drag image
			hTest=m_pTree->HitTest(ptSave,pFlags);
			if (hTest!=NULL)
			{
				b=m_pTree->SelectDropTarget(hTest); 
				hDropTarget=hTest;   //save for LButtonUp
				b=m_pDragImage->Draw(pDC,0,pt,ILD_NORMAL);
			}
		}
	}
	else if (pt.y>=nTreeHeight-10 && pt.y<=nTreeHeight)
	{
//		hFirstVisible=m_pTree->GetDropHilightItem( );   //get item currently highlighted
//		hNextVisible=m_pTree->GetNextSiblingItem(hFirstVisible);  //get the next item
		hNextVisible=m_pTree->GetFirstVisibleItem();
		k=m_pTree->GetVisibleCount();
		for (j=0;j<k;j++) hNextVisible=m_pTree->GetNextVisibleItem(hNextVisible);
		m_pTree->EnsureVisible(hNextVisible);           //scroll down to next item
		pDC=pWnd->GetDC();
		pWnd->RedrawWindow();  //erase the previously drawn drag image
		pt.y-=20;
		pt.x-=nLeft;    //200;
		b=m_pDragImage->Draw(pDC,0,pt,ILD_NORMAL);  //draw the new drag image
ptSave.y=pt.y;
		hTest=m_pTree->HitTest(ptSave,pFlags);
//		hTest=m_pTree->HitTest(pt,pFlags);
		if (hTest!=NULL)
		{
			b=m_pTree->SelectDropTarget(hTest); 
			hDropTarget=hTest;   //save for LButtonUp
			b=m_pDragImage->Draw(pDC,0,pt,ILD_NORMAL);
		}
	}
//	CDialog::OnTimer(nIDEvent);
}
示例#13
0
文件: CtlLayouter.cpp 项目: xagi/junk
//! コントロール親ウィンドウのメッセージ処理時に呼び出す
void CCtlLayouter::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam) {
	if (m_pParent == NULL)
		return;

	// サイズ変更時に無効領域を登録する
	if (message == WM_SIZE) {
		m_pParent->Invalidate();
		m_bNeedLayout = true;
	}

	// 親ウィンドウがサイズ変更されたらコントロールもあらかじめ指定されている方法で再配置する
	if (message == WM_PAINT && m_bNeedLayout) {
		m_bNeedLayout = false;

		CRect rcClient;
		m_pParent->GetClientRect(&rcClient);

		std::vector<Item>::iterator it = m_Items.begin();
		std::vector<Item>::iterator end = m_Items.end();
		while (it != end) {
			CWnd* pCtl = it->pCtl;
			CRect rcCtl, rcCtlNew;

			pCtl->GetWindowRect(&rcCtl);
			m_pParent->ScreenToClient(&rcCtl);

			int w = rcCtl.Width();
			int h = rcCtl.Height();
			DWORD anchorFlags = it->AnchorFlags;

			if (anchorFlags & Anchor::Left) {
				rcCtlNew.left = rcClient.left + it->Left;
			} else {
				rcCtlNew.left = rcClient.right - it->Right - w;
			}

			if (anchorFlags & Anchor::Right) {
				rcCtlNew.right = rcClient.right - it->Right;
			} else {
				rcCtlNew.right = rcClient.left + it->Left + w;
			}

			if (anchorFlags & Anchor::Top) {
				rcCtlNew.top = rcClient.top + it->Top;
			} else {
				rcCtlNew.top = rcClient.bottom - it->Bottom - h;
			}

			if (anchorFlags & Anchor::Bottom) {
				rcCtlNew.bottom = rcClient.bottom - it->Bottom;
			} else {
				rcCtlNew.bottom = rcClient.top + it->Top + h;
			}

			// コントロール配置&サイズ変更
			UINT nSwpFlags = SWP_NOZORDER;
			if (it->AnchorFlags & Anchor::NoRedraw)
				nSwpFlags |= SWP_NOREDRAW;
			pCtl->SetWindowPos(NULL, rcCtlNew.left, rcCtlNew.top, rcCtlNew.Width(), rcCtlNew.Height(), nSwpFlags);

			if (it->AnchorFlags & Anchor::Invalidate)
				pCtl->Invalidate();
			if (it->AnchorFlags & Anchor::Redraw)
				pCtl->RedrawWindow(); // サイズ変更無い場合に再描画されないものがあるのでフラグにより強制再描画

			it++;
		}

		//if (!(m_DefaultAnchorFlags & Anchor::NoRedraw))
		//	m_pParent->RedrawWindow();
		//if (m_DefaultAnchorFlags & Anchor::Invalidate)
		//	m_pParent->Invalidate();
	}
}
示例#14
0
void CRegenerationDlg::ExecutingRule(int nRuleType,int nSyntacticCategory,int nGroup,int nRule)
{
	CString strRuleType,strSyncat,strGroup,strNumber;
	wchar_t c[5];
	CWnd* pWnd;

	switch (nRuleType)
	{
	case 1:
		strRuleType=L"Feature Copying";
		break;
	case 2:
		strRuleType=L"Collocation Correction";
		break;
	case 3:
		strRuleType=L"Structural Adjustment";
		break;
	case 4:
		strRuleType=L"Spellout";
		break;
	case 5:
		strRuleType=L"Word Morphophonemic";
		break;
	case 6:
		strRuleType=L"Clitic";
		break;
	case 7:
		strRuleType=L"Constituent Movmement";
		break;
	case 8:
		strRuleType=L"Phrase Structure";
		break;
	case 9:
		strRuleType=L"Find/Replace";
		break;
	case 10:
		strRuleType=L"Structural Adjustment";
		break;
	case 11:
		strRuleType=L"Affix Hopping";
		break;
	case 12:
		strRuleType=L"Theta Grid Adjustment";
		break;
	case 13:
		strRuleType=L"Pronoun and Switch Reference Identification";
		break;
	case 14:
		strRuleType=L"Pronoun and Switch Reference Spellout";
		break;
	default:
		strRuleType=L"";
		break;
	}
	switch (nSyntacticCategory)
	{
	case 1:
		strSyncat=L"Nouns";
		break;
	case 2:
		strSyncat=L"Verbs";
		break;
	case 3:
		strSyncat=L"Adjectives";
		break;
	case 4:
		strSyncat=L"Adverbs";
		break;
	case 5:
		strSyncat=L"Adpositions";
		break;
	case 6:
		strSyncat=L"Conjunctions";
		break;
	case 7:
		strSyncat=L"Pronouns";
		break;
	case 8:
		strSyncat=L"Particles";
		break;
	case 101:
		strSyncat=L"Noun Phrases";
		break;
	case 102:
		strSyncat=L"Verb Phrases";
		break;
	case 103:
		strSyncat=L"Adjective Phrases";
		break;
	case 104:
		strSyncat=L"Adverb Phrases";
		break;
	case 105:
		strSyncat=L"Clauses";
		break;
	case 106:
		strSyncat=L"User Defined";
		break;
	case 107:
		strSyncat=L"All Categories";
		break;
	default:
		strSyncat=L"";
		break;
	}
	if (nRuleType==9 || nRuleType==10 || nRuleType==13) strSyncat=L"";   //RRs and Find/Replace rules and Pronoun ID rules don't have syncats
	_itow(nGroup,c,10);
	strGroup=c;
	if (nGroup==0) strGroup=L"";
	_itow(nRule,c,10);
	strNumber=c;
	if (nRule==0) strNumber=L"";
	pWnd=GetDlgItem(IDC_EDITRULETYPE);
	pWnd->SetWindowText(strRuleType);
	pWnd->RedrawWindow();
	pWnd=GetDlgItem(IDC_EDITRULESYNCAT);
	pWnd->SetWindowText(strSyncat);
	pWnd->RedrawWindow();
	pWnd=GetDlgItem(IDC_EDITRULEGROUP);
	pWnd->SetWindowText(strGroup);
	pWnd->RedrawWindow();
	pWnd=GetDlgItem(IDC_EDITRULENUMBER);
	pWnd->SetWindowText(strNumber);
	pWnd->RedrawWindow();
}
void CThetaGridAdjustmentSimpleOutputDlg::OnLfClickDatatblinput(short Pane, long Row, long Column, long ClickPos, long FAR* Status) 
{
	int i,j,n;
	CString S,T;
	bool bFound;
	CDTData val;
	CWnd* pWnd;
	CNewWordDlg NWdlg;
	CSemanticDomainNamesDlg SDNdlg;

	if (Column<0 || Row<0) return;        //if user clicked on a row's label column
	if (m_nType==1)                 //if specifying grammatical relations and entering adpositions
	{
		if (Row==0)
		{
			SDNdlg.m_nType=14;
			SDNdlg.m_pDoc=m_pDoc;
			if (SDNdlg.DoModal()==IDOK)
			{
				T=SDNdlg.m_strSelectedDomains;
				val=T;
				m_datatblInput.GetCellSet().GetItem(Row,Column).SetValue(val);
			}
		}
		else if (Row==1)
		{
			NWdlg.m_nType=1;      
			NWdlg.m_pDoc=m_pDoc;
			NWdlg.m_strFontName=m_pDoc->GetTargetLanguageFontName();
			if (NWdlg.DoModal()==IDOK)
			{
				T=NWdlg.m_strNewWord;
A:				n=m_pDoc->m_nTAdpositions;
				for (i=0,bFound=false;i<n && !bFound;i++) 
				{
					S=m_pDoc->m_starTAdpositions[i];
					j=S.Find(L"|");
					if (j>-1) S=S.Left(j);   //remove the extra forms
					if (S==T)
					{
						T=m_pDoc->m_starTAdpositionIDs[i];
						val=T;
						m_datatblInput.GetCellSet().GetItem(Row,Column).SetValue(val);
						bFound=true; 
					}
				}
				if (!bFound)    //if user entered a new adposition
				{
					if (AfxMessageBox(L"This adposition is not yet in the lexicon.  Do you want to add it to the lexicon now?",MB_YESNO)==IDYES)
					{
						AddNewAdposition(T);   //add the new word
						goto A;
					}
				}
			}
		}
	}
	else         //else working on an object complement
	{
		if (Column==0)          //if entering the complementizer
		{
			NWdlg.m_nType=1;      
			NWdlg.m_pDoc=m_pDoc;
			NWdlg.m_strFontName=m_pDoc->GetTargetLanguageFontName();
			if (NWdlg.DoModal()==IDOK)
			{
				T=NWdlg.m_strNewWord;    //get the complementizer
				val=T;
				m_datatblInput.GetCellSet().GetItem(Row,Column).SetValue(val);
			}
		}
		else if (Column==1)    //if specifying subject raised to object
		{
			m_bSubjectRaised=!m_bSubjectRaised;
			if (m_bSubjectRaised)
			{
				T=m_pDoc->GetPropertyString(1);   //get the character for PRO
				if (T==L"")   //user hasn't yet defined a value for PRO
				{
					AfxMessageBox(L"Please define a value called 'PRO' for Noun Surface Realization.  Then specify it in the Setup dialog in the Grammar tab.",MB_OK);
				}
				else
				{
					T=m_pDoc->GetFeatureValueNameFromCharacter(1,7,T,FALSE);
				}
				val=T;
				m_datatblInput.GetCellSet().GetItem(Row,2).SetValue(val);  //set subject's Surface Realization to PRO
			}
			pWnd=&m_datatblInput;
			pWnd->RedrawWindow();   //repaint entire table so that the subject noun's surface realization cell will be painted black or white
		}
		else if (Column==2)
		{
			//if (m_bSubjectRaised)    //if user checked the subject raised box, we need to uncheck it
			//{
			//	val=L"0";
			//	m_datatblInput.GetCellSet().GetItem(0,1).SetValue(val);    //get the grammatical relation
			//	OnLfClickDatatblinput(Pane, 0, 1, ClickPos, Status);
			//}
			SDNdlg.m_nType=15;
			SDNdlg.m_pDoc=m_pDoc;
			if (SDNdlg.DoModal()==IDOK)
			{
				T=SDNdlg.m_strSelectedDomains;
				val=T;
				m_datatblInput.GetCellSet().GetItem(Row,Column).SetValue(val);
			}
		}
		else if (Column==3)   //if specifying the verb's target tense
		{
			SDNdlg.m_nType=16;
			SDNdlg.m_pDoc=m_pDoc;
			if (SDNdlg.DoModal()==IDOK)
			{
				T=SDNdlg.m_strSelectedDomains;
				val=T;
				m_datatblInput.GetCellSet().GetItem(Row,Column).SetValue(val);
			}
		}
	}
}