本文整理汇总了C++中SetRedraw函数的典型用法代码示例。如果您正苦于以下问题:C++ SetRedraw函数的具体用法?C++ SetRedraw怎么用?C++ SetRedraw使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetRedraw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ATLASSERT
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: trim
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: SetRedraw
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: SetRedraw
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;
}
示例5: SetRedraw
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: Init
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: SetRedraw
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: ASSERT
//设置列信息
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: AutoSizeColumns
/*
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: GetFocusHeroes
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: SetRedraw
//------------------------------------------------------------------------
//! 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, ¶msort))
return false;
}
else
{
if (!CGridListCtrlEx::SortColumn(nCol, bAscending))
return false;
}
return true;
}
示例12: AutoSizeColumns
/*
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: SetRedraw
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: SetRedraw
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: GetRootItem
// 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;
}