本文整理汇总了C++中Composite::ClampOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ Composite::ClampOffset方法的具体用法?C++ Composite::ClampOffset怎么用?C++ Composite::ClampOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composite
的用法示例。
在下文中一共展示了Composite::ClampOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VScroll
void CompositeDlg::VScroll(int code, short int cpos ) {
switch (code) {
case SB_LINEUP: theTex->offset--; break;
case SB_LINEDOWN: theTex->offset++; break;
case SB_PAGEUP: theTex->offset -= NDLG; break;
case SB_PAGEDOWN: theTex->offset += NDLG; break;
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
theTex->offset = cpos;
break;
}
theTex->ClampOffset();
UpdateSubTexNames();
LoadDialog(ip->GetTime());
}
示例2: LoadDialog
void CompositeDlg::LoadDialog(BOOL draw)
{
if (theTex) {
theTex->ClampOffset();
SetScrollRange(hScroll,SB_CTL,0,theTex->subTex.Count()-NDLG,FALSE);
SetScrollPos(hScroll,SB_CTL,theTex->offset,TRUE);
EnableWindow(hScroll,theTex->NumSubTexmaps()>NDLG);
if (theTex->subTex.Count()>NDLG) {
EnableWindow(GetDlgItem(hPanel,IDC_COMP_UP),theTex->offset>0);
EnableWindow(GetDlgItem(hPanel,IDC_COMP_PAGEUP),theTex->offset>0);
EnableWindow(GetDlgItem(hPanel,IDC_COMP_DOWN),theTex->offset+NDLG<theTex->subTex.Count());
EnableWindow(GetDlgItem(hPanel,IDC_COMP_PAGEDOWN),theTex->offset+NDLG<theTex->subTex.Count());
} else {
EnableWindow(GetDlgItem(hPanel,IDC_COMP_UP),FALSE);
EnableWindow(GetDlgItem(hPanel,IDC_COMP_PAGEUP),FALSE);
EnableWindow(GetDlgItem(hPanel,IDC_COMP_DOWN),FALSE);
EnableWindow(GetDlgItem(hPanel,IDC_COMP_PAGEDOWN),FALSE);
}
Interval valid;
theTex->Update(ip->GetTime(),valid);
UpdateSubTexNames();
TSTR buf;
buf.printf(_T("%d"),theTex->subTex.Count());
SetDlgItemText(hPanel,IDC_COMP_NUMMAPS,buf);
for (int i=0; i<min(theTex->subTex.Count(),NDLG); i++) {
ShowWindow(GetDlgItem(hPanel,mapIDs[i]),SW_SHOW);
ShowWindow(GetDlgItem(hPanel,labelIDs[i]),SW_SHOW);
ShowWindow(GetDlgItem(hPanel,mapOnIDs[i]),SW_SHOW);
// SetCheckBox(hPanel, mapOnIDs[i], theTex->mapOn[i+theTex->offset]);
}
for (; i<NDLG; i++) {
ShowWindow(GetDlgItem(hPanel,mapIDs[i]),SW_HIDE);
ShowWindow(GetDlgItem(hPanel,labelIDs[i]),SW_HIDE);
ShowWindow(GetDlgItem(hPanel,mapOnIDs[i]),SW_HIDE);
}
}
}