Пример #1
0
LRESULT CScriptEditView::OnFindReplaceCmd( UINT, WPARAM, LPARAM lParam, BOOL& )
{
	CFindReplaceDialog* pDlg = CFindReplaceDialog::GetNotifier(lParam);
	if( pDlg == NULL )
	{
		::MessageBeep( (UINT)-1 );
		return 1;
	}
	ATLASSERT( pDlg == m_pFindDlg );

	if( pDlg->IsTerminating() )
	{
		m_pFindDlg = NULL;
		return 0;
	}

	lstrcpyn( m_fro.StrToFind, pDlg->m_fr.lpstrFindWhat, DIMOF(m_fro.StrToFind) );
	m_fro.bMatchCase = (pDlg->MatchCase() != FALSE);
	m_fro.bWholeWord = (pDlg->MatchWholeWord() != FALSE);

	if( pDlg->FindNext() )
	{
		if( !DoFindText() )
			::MessageBeep( (UINT)-1 );
	}
	else if( pDlg->ReplaceCurrent() )
	{
		long nStart, nEnd;
		GetSel( nStart, nEnd );

		if( nStart != nEnd )
		{
			LPTSTR szFind = (LPTSTR)_alloca( (nEnd - nStart + 1) * sizeof(TCHAR) );
			GetSelText( szFind );
			int nRet;
			if( m_fro.bMatchCase )
				nRet = lstrcmp( szFind, m_fro.StrToFind );
			else
				nRet = lstrcmpi( szFind, m_fro.StrToFind );
			if(nRet == 0)
				ReplaceSel( pDlg->GetReplaceString(), TRUE );
		}

		if( !DoFindText() )
			::MessageBeep( (UINT)-1 );

	}
	else if( pDlg->ReplaceAll() )
	{
		SetRedraw(FALSE);
		CWaitCursor wait;
		while( DoFindText(false) )
			ReplaceSel( pDlg->GetReplaceString(), TRUE );
		SetRedraw( TRUE );
		Invalidate();
		UpdateWindow();
	}

	return 0;
}
Пример #2
0
int CLogListBox::AddString(LogMsgType Type, const CString& strTitle, const CString& strText, const CString& szInfo)
{
	LogListBoxItem * item = new  LogListBoxItem;
	item->Type = Type;

	SYSTEMTIME st;
	::GetLocalTime(&st);
	CString Data;
	Data.Format(_T("%02d:%02d:%02d"), (int)st.wHour, (int)st.wMinute, (int)st.wSecond);
	
	item->strText = trim(strText);
	item->strTitle = trim(strTitle);
	item->Info = trim(szInfo);
	item->Time = Data;

	SetRedraw(FALSE);
	int nPos = CListBox::AddString((LPCTSTR)item);

   if(nPos < 0) return -1;

   SetItemDataPtr(nPos, item);
	SetTopIndex(nPos-1);
	SetCurSel(nPos);
	SetRedraw(TRUE);
	return nPos;
}
Пример #3
0
void CClassView::RefreshTree()
{
	vfc_token_tree * tree = m_cb.get_tree();

	SetRedraw(FALSE);

	DeleteAllItems();
	m_itemRoot	= InsertItem(m_workName,0,0,TVI_ROOT,NULL);
	m_itemGlobalFunction = InsertItem(_T("Globals"),2,2,m_itemRoot,NULL);
	m_itemGlobalTypedef = InsertItem(_T("Globals Typedef"),14,14,m_itemRoot,NULL);
	m_itemGlobalDefine = InsertItem(_T("Globals Define"),12,12,m_itemRoot,NULL);

	vfc_token_array tks;
	if (!tree->get_token_array(&tks))
		return;
	for (size_t i = 0; i < tks.size(); i++)
	{
		vfc_token * tk = tks.at(i);
		if (tk && tk->get_parent() == NULL)
		{
			InsertToken(tk,m_itemRoot);
		}
	}

	Expand(m_itemRoot);

	SetRedraw(TRUE);
}
Пример #4
0
BOOL CPPageAdvanced::OnInitDialog()
{
    __super::OnInitDialog();

    if (CFont* pFont = m_list.GetFont()) {
        LOGFONT logfont;
        pFont->GetLogFont(&logfont);
        logfont.lfWeight = FW_BOLD;
        m_fontBold.CreateFontIndirect(&logfont);
    }

    SetRedraw(FALSE);
    m_list.SetExtendedStyle(m_list.GetExtendedStyle() | LVS_EX_FULLROWSELECT | LVS_EX_AUTOSIZECOLUMNS | LVS_EX_DOUBLEBUFFER | LVS_EX_INFOTIP);
    m_list.InsertColumn(COL_NAME, ResStr(IDS_PPAGEADVANCED_COL_NAME), LVCFMT_LEFT);
    m_list.InsertColumn(COL_VALUE, ResStr(IDS_PPAGEADVANCED_COL_VALUE), LVCFMT_RIGHT);

    GetDlgItem(IDC_EDIT1)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_COMBO1)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_RADIO1)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_RADIO2)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);

    InitSettings();

    for (int i = 0; i < m_list.GetHeaderCtrl()->GetItemCount(); ++i) {
        m_list.SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER);
    }
    SetRedraw(TRUE);
    return TRUE;
}
void CDirectoryTreeCtrl::OnTvnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult)
{
	CWaitCursor curWait;
	SetRedraw(FALSE);

	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	HTREEITEM hItem = pNMTreeView->itemNew.hItem;
	// remove all subitems
	HTREEITEM hRemove = GetChildItem(hItem);
	while(hRemove)
	{
		DeleteItem(hRemove);
		hRemove = GetChildItem(hItem);
	}

	// get the directory
	CString strDir = GetFullPath(hItem);

	// fetch all subdirectories and add them to the node
	AddSubdirectories(hItem, strDir);

	SetRedraw(TRUE);
	Invalidate();
	*pResult = 0;
}
Пример #6
0
void CRefLogList::InsertRefLogColumn()
{
	CString temp;

	Init();
	SetStyle();

	static UINT normal[] =
	{
		IDS_HASH,
		IDS_REF,
		IDS_ACTION,
		IDS_MESSAGE,
		IDS_STATUSLIST_COLDATE,
	};

	static int with[] =
	{
		ICONITEMBORDER+16*4,
		ICONITEMBORDER+16*4,
		ICONITEMBORDER+16*4,
		LOGLIST_MESSAGE_MIN,
		ICONITEMBORDER+16*4,
	};
	m_dwDefaultColumns = 0xFFFF;

	SetRedraw(false);

	m_ColumnManager.SetNames(normal, _countof(normal));
	m_ColumnManager.ReadSettings(m_dwDefaultColumns, 0, m_ColumnRegKey + L"loglist", _countof(normal), with);

	SetRedraw(true);
}
Пример #7
0
WebWatch::SiteItemGroup & CSiteGroupsTree::BuildTree(WebWatch::SiteItemGroup & group)
{
    SetRedraw(FALSE);

    DeleteAllItems();
    m_group2item.clear();

    HTREEITEM root = InsertGroupItem(group);

    WebWatch::SiteItemGroup *defaultGroup = 0;

    WebWatch::SiteItemGroup::GroupIterator it = group.GetGroupsBegin();
    WebWatch::SiteItemGroup::GroupIterator end = group.GetGroupsEnd();
    GroupAppender appender(*this, root);

    while (it != end) {
        WebWatch::SiteItemGroup *subgroup = *it;
        appender(subgroup);

        if (defaultGroup == 0 && subgroup->GetName() == "Default")
            defaultGroup = subgroup;

        ++it;
    }

    SetRedraw();

    if (defaultGroup == 0)
        defaultGroup = &group;

    return *defaultGroup;
}
Пример #8
0
//设置列信息
bool CUserListView::SetColumnDescribe(tagColumnItem ColumnItem[], WORD wColumnCount)
{
	//效验状态
	ASSERT(ColumnItem!=NULL);
	if (GetSafeHwnd()==NULL) return false;

	//删除旧信息
	m_wColumnCount=0;
	WORD wTempCount=m_SkinHeadCtrl.GetItemCount();
	for (WORD i=0;i<wTempCount;i++) DeleteColumn(0);

	//调整参数
	wColumnCount=__min(MAX_COLUMN-1,wColumnCount);

	//插入新信息
	SetRedraw(FALSE);
	for (WORD i=0;i<wColumnCount;i++)
	{
		m_wDataDescribe[i]=ColumnItem[i].wDataDescribe;
		if (m_wColumnCount==0) InsertColumn(m_wColumnCount++,ColumnItem[i].szColumnName,LVCFMT_LEFT,ColumnItem[i].wColumnWidth+m_uImageSpace);
		else InsertColumn(m_wColumnCount++,ColumnItem[i].szColumnName,LVCFMT_LEFT,ColumnItem[i].wColumnWidth);
	}
	SetRedraw(TRUE);

	return true;
}
Пример #9
0
/*
	AutoSizeColumns()

	Dimensiona automaticamente le colonne in base al contenuto/etichetta, da chiamare dopo aver riempito il controllo.
	Usare solo se il controllo si trova in modalita' report.
*/
void CListViewEx::AutoSizeColumns(int nWidthArray[]/*=NULL*/,int nCol/*=-1*/,int nWidth/*=0*/)
{
	SetRedraw(FALSE);

	// deve trovarsi in modalita' report
	if((GetStyle() & LVS_REPORT))
	{
		int nMinCol = nCol < 0 ? 0 : nCol;
		int nMaxCol = nCol < 0 ? GetColumnCount()-1 : nCol;
		
		for(nCol = nMinCol; nCol <= nMaxCol; nCol++) 
		{
			if(nWidthArray)
				nWidth = nWidthArray[nCol];

			if(nWidth <= 0)
			{
				GetListCtrl().SetColumnWidth(nCol,LVSCW_AUTOSIZE);
				int nWidthAutosize = GetListCtrl().GetColumnWidth(nCol);

				GetListCtrl().SetColumnWidth(nCol,LVSCW_AUTOSIZE_USEHEADER);
				int nWidthUseHeader = GetListCtrl().GetColumnWidth(nCol);

				GetListCtrl().SetColumnWidth(nCol,max(MIN_COL_WIDTH,max(nWidthAutosize,nWidthUseHeader)));
			}
			else
				GetListCtrl().SetColumnWidth(nCol,nWidth);
		}
		
		RecalcHeaderTips();
	}

	SetRedraw(TRUE);
}
Пример #10
0
void Interface::Basic::EventDefaultAction(void)
{
    Heroes* hero = GetFocusHeroes();

    if(hero)
    {
	const Maps::Tiles & tile = world.GetTiles(hero->GetIndex());

	// 1. action object
	if(MP2::isActionObject(hero->GetMapsObject(), hero->isShipMaster()) &&
	    (! MP2::isMoveObject(hero->GetMapsObject()) || hero->CanMove()))
	{
	    hero->Action(hero->GetIndex());
	    if(MP2::OBJ_STONELIGHTS == tile.GetObject(false) || MP2::OBJ_WHIRLPOOL == tile.GetObject(false))
		SetRedraw(REDRAW_HEROES);
	    SetRedraw(REDRAW_GAMEAREA);
	}
	else
	// 2. continue
        if(hero->GetPath().isValid())
    	    hero->SetMove(true);
	else
	// 3. hero dialog
	    Game::OpenHeroesDialog(*hero);
    }
    else
    // 4. town dialog
    if(GetFocusCastle())
    {
	Game::OpenCastleDialog(*GetFocusCastle());
    }
}
Пример #11
0
//------------------------------------------------------------------------
//! Changes the row sorting in regard to the specified column
//!
//! @param nCol The index of the column
//! @param bAscending Should the arrow be up or down 
//! @return True / false depending on whether sort is possible
//------------------------------------------------------------------------
bool CGridListCtrlGroups::SortColumn(int nCol, bool bAscending)
{
	CWaitCursor waitCursor;

	if (IsGroupViewEnabled())
	{
		SetRedraw(FALSE);

		GroupByColumn(nCol);

		// Cannot use GetGroupInfo during sort
		PARAMSORT paramsort(m_hWnd, nCol, bAscending, GetColumnTrait(nCol));
		for(int nRow=0 ; nRow < GetItemCount() ; ++nRow)
		{
			int nGroupId = GetRowGroupId(nRow);
			if (nGroupId!=-1 && paramsort.m_GroupNames.FindKey(nGroupId)==-1)
				paramsort.m_GroupNames.Add(nGroupId, GetGroupHeader(nGroupId));
		}

		SetRedraw(TRUE);
		Invalidate(FALSE);

		// Avoid bug in CListCtrl::SortGroups() which differs from ListView_SortGroups
		if (!ListView_SortGroups(m_hWnd, SortFuncGroup, &paramsort))
			return false;
	}
	else
	{
		if (!CGridListCtrlEx::SortColumn(nCol, bAscending))
			return false;
	}

	return true;
}
Пример #12
0
/*
	AutoSizeColumns()

	Dimensiona automaticamente le colonne in base al contenuto/etichetta (solo se il controllo si trova in modalita' report).
	Da chiamare dopo aver riempito il controllo.
*/
void CListCtrlEx::AutoSizeColumns(int nCol/*=-1*/,int nWidth/*=0*/) 
{
	SetRedraw(FALSE);

	if(!(GetStyle() & LVS_REPORT))
		return;

	int nMinCol = nCol < 0 ? 0 : nCol;
	int nMaxCol = nCol < 0 ? GetColumnCount()-1 : nCol;
	
	for(nCol = nMinCol; nCol <= nMaxCol; nCol++) 
	{
		if(nWidth==0)
		{
			CListCtrl::SetColumnWidth(nCol,LVSCW_AUTOSIZE);
			int nWidthAutosize = CListCtrl::GetColumnWidth(nCol);

			CListCtrl::SetColumnWidth(nCol,LVSCW_AUTOSIZE_USEHEADER);
			int nWidthUseHeader = CListCtrl::GetColumnWidth(nCol);

			CListCtrl::SetColumnWidth(nCol,max(MIN_ITEM_WIDTH,max(nWidthAutosize,nWidthUseHeader)));
		}
		else
			CListCtrl::SetColumnWidth(nCol,nWidth);     
	}

	SetRedraw(TRUE);
}
Пример #13
0
void Interface::Basic::EventSystemDialog(void)
{
    const Settings & conf = Settings::Get();

    // Change and save system settings
    const int changes = Dialog::SystemOptions();

    // change scroll
    if(0x10 & changes)
    {
	// hardcore reset pos
	gameArea.SetCenter(0, 0);
	if(GetFocusType() != GameFocus::UNSEL)
	    gameArea.SetCenter(GetFocusCenter());
        gameArea.SetRedraw();

	if(conf.ExtGameHideInterface())
	    controlPanel.ResetTheme();
    }

    // interface themes
    if(0x08 & changes)
    {
        SetRedraw(REDRAW_ICONS | REDRAW_BUTTONS | REDRAW_STATUS | REDRAW_BORDER);
    }

    // interface hide/show
    if(0x04 & changes)
    {
	SetHideInterface(conf.ExtGameHideInterface());
        SetRedraw(REDRAW_ALL);
	ResetFocus(GameFocus::HEROES);
	Redraw();
    }
}
Пример #14
0
void CTreeFileCtrl::DisplayDrives(HTREEITEM hParent, BOOL bUseSetRedraw)
{
  CWaitCursor c;

  //Speed up the job by turning off redraw
  if (bUseSetRedraw)
    SetRedraw(FALSE);

  //Remove any items currently in the tree
  DeleteAllItems();

  //Enumerate the drive letters and add them to the tree control
  DWORD dwDrives = GetLogicalDrives();
  DWORD dwMask = 1;
  for (int i=0; i<32; i++)
  {
    if (dwDrives & dwMask)
    {
      CString sDrive;
      sDrive.Format(_T("%c:\\"), i + _T('A'));
      InsertFileItem(sDrive, sDrive, hParent);
    }
    dwMask <<= 1;
  }

  if (bUseSetRedraw)
    SetRedraw(TRUE);
}
Пример #15
0
// This takes a string and uses it to set the expanded or
// collapsed state of the tree items.
int CStatisticsTree::ApplyExpandedMask(CString theMask, HTREEITEM theItem, int theStringIndex)
{
	HTREEITEM	hCurrent;

	if (theItem == NULL) {
		hCurrent = GetRootItem();
		SetRedraw(false);
		ExpandAll(true);
		m_bExpandingAll = true;
	}
	else
		hCurrent = theItem;

	while (hCurrent != NULL && theStringIndex < theMask.GetLength())
	{
		if (ItemHasChildren(hCurrent) && IsBold(hCurrent)) {
			if (theMask.GetAt(theStringIndex) == '0') Expand(hCurrent, TVE_COLLAPSE);
			theStringIndex++;
			theStringIndex = ApplyExpandedMask(theMask, GetChildItem(hCurrent), theStringIndex);			
		}
		hCurrent = GetNextItem(hCurrent, TVGN_NEXT);
	}
	if (theItem == NULL) {
		SetRedraw(true);
		m_bExpandingAll = true;
	}
	return theStringIndex;
}
Пример #16
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	// OnCommand responds to menu and and toolbar input
	switch(LOWORD(wParam))
	{
	case IDM_FILE_EXIT:
		// Issue a close request to the frame
		PostMessage(WM_CLOSE);
		return TRUE;
	case IDM_DOCK_DEFAULT:
		SetRedraw(FALSE);
		CloseAllDockers();
		LoadDefaultDockers();
		SetRedraw(TRUE);
		RedrawWindow(0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN);
		return TRUE;
	case IDM_DOCK_CLOSEALL:
		CloseAllDockers();
		return TRUE;
	case IDW_VIEW_STATUSBAR:
		OnViewStatusBar();
		return TRUE;
	case IDW_VIEW_TOOLBAR:
		OnViewToolBar();
		return TRUE;
	case IDM_HELP_ABOUT:
		// Display the help dialog
		OnHelp();
		return TRUE;
	}

	return FALSE;
}
Пример #17
0
void
CPropSheet::HideButtons()
{
    SetRedraw(FALSE);
    CWnd *wnd = GetDlgItem(0x3023);
    if (wnd) 
		wnd->ShowWindow(SW_HIDE);
    wnd = GetDlgItem(0x3024);
    if (wnd) 
		wnd->ShowWindow(SW_HIDE);
    wnd = GetDlgItem(0x3025);
    if (wnd) 
		wnd->ShowWindow(SW_HIDE);
    wnd = GetDlgItem(IDCANCEL);
    if (wnd) 
		wnd->ShowWindow(SW_HIDE);
	
    SetRedraw(TRUE);
    InvalidateRect(NULL,FALSE);

    CMenu *menu = GetSystemMenu(FALSE);
	if (menu)
		menu->EnableMenuItem(1, MF_BYPOSITION | MF_DISABLED);

}
Пример #18
0
void CFeedIcoItemListCtrl::FilterItemsBySearchKey(CString* pSearchKey)
{
	if (!IsWindowVisible())
		return;

	if (pSearchKey == NULL || pSearchKey->IsEmpty())
	{
		if (m_stringMatcher.IsOriginal())
			return;
	}

	const StringMatcher::ListItemsNeedShow& listItemsNeedShow = m_stringMatcher.GetMatchResult(pSearchKey);

	SetRedraw(FALSE);

	RemoveAllGroups();//删除分组
	RemoveAllGroupData();//删除m_mapGroups
	DeleteAllItems();//删除items

	for (StringMatcher::ListItemsNeedShow::const_iterator ix = listItemsNeedShow.begin(); ix != listItemsNeedShow.end(); ++ix)
	{
		CRssFeed* listKey = (CRssFeed*)*ix;
		CString strCaption = GetExtentString( listKey->GetDisplayName() );

		int nRet = InsertItem(GetItemCount(), strCaption);
		this->SetItemData(nRet, LPARAM(listKey));
	}
	GroupAllFeedsByType(0);

	SetRedraw(TRUE);
}
Пример #19
0
void ImagePropertyView::UpdateProperty(unsigned int uiImagePropertyId)
{
   ATLASSERT(m_spRemoteReleaseControl != nullptr);
   RemoteReleaseControl& rrc = *m_spRemoteReleaseControl;

   SetRedraw(FALSE);

   // find property by item data
   for (int iIndex=0, iMax = GetItemCount(); iIndex<iMax; iIndex++)
   {
      unsigned int uiPropertyId = GetItemData(iIndex);
      if (uiPropertyId != uiImagePropertyId)
         continue;

      try
      {
         ImageProperty ip = rrc.GetImageProperty(uiPropertyId);

         SetItemText(iIndex, columnValue, ip.AsString());
         SetItemText(iIndex, columnReadOnly, ip.IsReadOnly() ? _T("yes") : _T("no"));
         SetItemText(iIndex, columnRaw, ip.Value().ToString());
      }
      catch (const CameraException& ex)
      {
         SetItemText(iIndex, columnValue, ex.Message());
      }
   }

   SetRedraw(TRUE);
}
Пример #20
0
void CSourceDirListCtrl::RemoveSelectedItems()
{
	SetRedraw(FALSE);
	//Delete all selected items
	POSITION pos = GetFirstSelectedItemPosition();
	
	int nItem = -1;
	while (pos != NULL)
	{
		nItem = GetNextSelectedItem(pos);

		DeleteItem(nItem);
		
		//Delete the previous one item will affect the pos
		pos = GetFirstSelectedItemPosition();
	}

	if(GetItemCount() <= 0)
	{
		SetHeaderCheckedState(0, CL_UNCHECKED);
	}

	SetRedraw(TRUE);
	UpdateWindow();
}
Пример #21
0
void CSharedDirsTreeCtrl::OnTvnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult)
{
	CWaitCursor curWait;
	SetRedraw(FALSE);

	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	CDirectoryItem* pExpanded = (CDirectoryItem*)pNMTreeView->itemNew.lParam;
	if (pExpanded != NULL){
		if (pExpanded->m_eItemType == SDI_UNSHAREDDIRECTORY && !pExpanded->m_strFullPath.IsEmpty()){
			// remove all subitems
			DeleteChildItems(pExpanded);
			// fetch all subdirectories and add them to the node
			FileSystemTreeAddSubdirectories(pExpanded);
		}
		else if(pExpanded->m_eItemType == SDI_FILESYSTEMPARENT){
			DeleteChildItems(pExpanded);
			FileSystemTreeCreateTree();
		}
	}
	else
		ASSERT( false );

	SetRedraw(TRUE);
	Invalidate();
	*pResult = 0;
}
Пример #22
0
/*
 *******************************************************************
 * Function: void CGBLListCtrl::AutoSizeColumns(int columnNumber) 
 *
 * Description : Autio sizes the columns
 *		
 * Paramters : 
 *              int columnNumber - column to resize, if this is -1 all columns
 *              are resized
 *   
 * Returns : 
 *              pointer to the toolbar
 *   
 *******************************************************************
 */
void CGBLListCtrl::AutoSizeColumns(int columnIndex /*=-1*/) 
{
     SetRedraw(false);
     int minColumn;
     int maxColumn;

     if(columnIndex < 0 )
     {
        minColumn = 0;
        maxColumn = GetColumnCount()-1;
     }
     else
     {
        minColumn = minColumn = columnIndex;
     }

     for (int i = minColumn; i <= maxColumn; i++) 
     {
          SetColumnWidth(i,LVSCW_AUTOSIZE);
          int columnWidth = GetColumnWidth(i);
          SetColumnWidth(i,LVSCW_AUTOSIZE_USEHEADER);
          int headerWidth = GetColumnWidth(i);
          int width = max(15,max(columnWidth,headerWidth));
          SetColumnWidth(i,width);
     }
     SetRedraw(true);
}
Пример #23
0
//*****************************************************************************
LRESULT CBCGPStatic::OnSetText (WPARAM, LPARAM)
{
	if (m_bBackstageMode && !globalData.IsHighContastMode())
	{
		SetRedraw(FALSE);
	}

	LRESULT lr = Default ();

	if (m_bBackstageMode && !globalData.IsHighContastMode())
	{
		SetRedraw(TRUE);
		RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
	}

	if (GetParent () != NULL)
	{
		CRect rect;
		GetWindowRect (rect);

		GetParent ()->ScreenToClient (&rect);
		GetParent ()->RedrawWindow (rect);
	}

	return lr;
}
Пример #24
0
void CExtResizableDialog::ArrangeLayout(
	int cx, // = -1
	int cy  // = -1
	)
{
	if( cx < 0 || cy < 0 )
	{
		CRect rcClient;
		GetClientRect( &rcClient );
		cx = rcClient.Width();
		cy = rcClient.Height();
	} // if( cx < 0 || cy < 0 )

	SetRedraw( FALSE );

POSITION pos = m_mapRDI.GetStartPosition();
	while( pos != NULL )
	{
		HWND _hWnd;
		RDI_t _rdi;
		m_mapRDI.GetNextAssoc( pos, _hWnd, _rdi );
		ASSERT( ::IsWindow( _hWnd ) );
		if( !::IsWindow( _hWnd ) )
			continue;
		int x =	_rdi.m_MargLT.cx + cx*_rdi.m_AnchLT.cx/100;
		int y = _rdi.m_MargLT.cy + cy*_rdi.m_AnchLT.cy/100;
		::SendMessage( _hWnd, WM_SETREDRAW, FALSE, 0 );
		::MoveWindow(
			_hWnd,
			x,
			y,
			_rdi.m_MargRB.cx + cx*_rdi.m_AnchRB.cx/100 - x,
			_rdi.m_MargRB.cy + cy*_rdi.m_AnchRB.cy/100 - y,
			FALSE
			);
	}

	pos = m_mapRDI.GetStartPosition();
	while( pos != NULL )
	{
		HWND _hWnd;
		RDI_t _rdi;
		m_mapRDI.GetNextAssoc( pos, _hWnd, _rdi );
		ASSERT( ::IsWindow( _hWnd ) );
		if( !::IsWindow( _hWnd ) )
			continue;
		_hWnd;
		_rdi;
		::SendMessage( _hWnd, WM_SETREDRAW, TRUE, 0 );
	}

	SetRedraw( TRUE );
	RedrawWindow(
		NULL,
		NULL,
		RDW_ERASE|RDW_INVALIDATE
			|RDW_UPDATENOW
			|RDW_ALLCHILDREN
		);
}
Пример #25
0
void Form_ADChannel_Draw(LPWindow pWindow)
{
	uint16 i;
	LPControl	lpControl;

	//清除显存
	EraseBuffer();

	//禁止绘图
	SetRedraw(FALSE);

	//禁止刷屏
	EnableScreenFlush(FALSE);

	//设置视图
	SetGdiView(pWindow->nViewPosX, pWindow->nViewPosY, pWindow->nViewSizeX, pWindow->nViewSizeY);
	EnableGdiView(TRUE);
//     sprintf(sZero_Value,"%d",fZero_Value);

//     
//     sprintf(sCali_Title,"%s",sScale_Title);
//		DrawGbText("重量标定", 112, 88);
//		DrawGbText("按确定键开始标定,否则请返回", 42, 110);
    
    DrawGbText("AD通道1",5,44);
    DrawGbText("AD通道2",5,66);
    DrawGbText("AD通道3",5,88);
    DrawGbText("AD通道4",5,110);

    snprintf(sADChannel_Title, 23, "通道的AD值 SCS-ZC-%d", (Get_System_Mode() + 1));

	DrawGbText(sADChannel_Title, 5, 21);
    DrawHoriLine(0, 40, 240);
    DrawHoriLine(0, 62, 240);
    DrawHoriLine(0, 84, 240);
    DrawHoriLine(0, 106, 240);
    DrawHoriLine(0, 127, 240);
    DrawVertLine(60, 40, 88);
//     DrawVertLine(140, 40, 44);

	//绘制控件
	for(i = 0; i < pWindow->nNbControls; i++)
	{
		lpControl = *(pWindow->pLPControls + i);
		if(lpControl->state & CTRL_VISABLE)
		{
			lpControl->DrawFunc(lpControl);
		}
	}

	//使能刷屏
	EnableScreenFlush(TRUE);

	//刷屏
	FlushScreen();

	//使能绘图
	SetRedraw(TRUE);
}
Пример #26
0
void CProcessModuleList::Walk()
{
    if (0 == m_dwPID)
    {
        return;
    }

    //禁止重绘
    SetRedraw(FALSE);
    
    //////////////////////////////////////////////////////////////////////////
    //清理性工作
    DeleteAllItems();
    m_nTotal = 0;
    
    //////////////////////////////////////////////////////////////////////////
    
    
    //对进程模块进行遍历,并插入到list view中
    HANDLE         hProcessSnap = NULL; 
    BOOL           bRet         = FALSE; 
    MODULEENTRY32 me32        = {0}; 
    CString str;
    
    hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, m_dwPID);     
    if (INVALID_HANDLE_VALUE == hProcessSnap) 
    {
        return;
    }
    
    me32.dwSize = sizeof(MODULEENTRY32); 
    
    bRet = Module32First(hProcessSnap, &me32);
    if (!bRet)
    {
        //不要忘记对句柄的处理
        goto ERROR_CLEAN;
    }
    
    do 
    {
        str.Format("%s|0x%p|0x%p", me32.szExePath,
                               me32.modBaseAddr,
                               me32.modBaseSize);
        InsertRecord(str);

        m_nTotal++;
        
    } while (Module32Next(hProcessSnap, &me32));
    
ERROR_CLEAN:
    CloseHandle(hProcessSnap);
    hProcessSnap = NULL;
    
    //开启重绘
    SetRedraw(TRUE);
    
    AutoSize();    
}
Пример #27
0
void CFileTreeCtrl::setSelectedFullPath(const std::wstring &sPath)
{
    populate();

    SetRedraw(FALSE);
    SetCursor(LoadCursor(NULL, IDC_WAIT));

    SelectItem(m_hRoot);
    Expand(m_hRoot, TVE_EXPAND);

    // Traverse Tree
    HTREEITEM hItem = m_hRoot;
    HTREEITEM hChildItem;
    HTREEITEM hNextItem;

    std::vector<std::wstring> tokens;
    std::vector<std::wstring>::const_iterator iterToken;
    Utils::tokenize(sPath, tokens, L"\\/");

    CString sItemValue;
    for(iterToken = tokens.begin(); iterToken != tokens.end(); ++iterToken)
    {
        hChildItem = GetChildItem(hItem);

        while (hChildItem != NULL)
        {
            hNextItem = GetNextItem(hChildItem, TVGN_NEXT);

            std::wstring sItemValue = GetItemText(hChildItem);
            std::wstring::size_type pos = sItemValue.find(L"\\", 0);
            if(pos != std::wstring::npos)
                sItemValue.erase(pos);

            if(sItemValue == *iterToken)
            {
                break;
            }

            hChildItem = hNextItem;
        }

        hItem = hChildItem;

        if(hItem != NULL)
        {
            // Found a matching item, select it and force expansion to populate tree
            SelectItem(hItem);
            Expand(hItem, TVE_EXPAND);
        }
        else
        {
            // Didn't find a matching item
            break;
        }
    }

    SetCursor(LoadCursor (NULL, IDC_ARROW));
    SetRedraw(TRUE);
}
Пример #28
0
void CMainFrame::OnDockDefault()
{
	SetRedraw(FALSE);	// Suppress drawing to the frame window
	CloseAllDockers();
	LoadDefaultDockers();
	SetRedraw(TRUE);	// Re-enable drawing to the frame window
	RedrawWindow(0, 0, RDW_INVALIDATE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
Пример #29
0
void CPngListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	SetRedraw(FALSE);
	CListBox::OnLButtonDown(nFlags, point);
	SetRedraw(TRUE);
	Invalidate(FALSE);
}
void CHTRichEditCtrl::Reset()
{
	m_astrBuff.RemoveAll();
	SetRedraw(FALSE);
	SetWindowText(_T(""));
	SetRedraw();
	Invalidate();
}