本文整理汇总了C++中SetScrollSizes函数的典型用法代码示例。如果您正苦于以下问题:C++ SetScrollSizes函数的具体用法?C++ SetScrollSizes怎么用?C++ SetScrollSizes使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetScrollSizes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckScrollBars
void CStartupView::OnSize(UINT nType, int cx, int cy)
{
BOOL bHBar, bVBar;
CheckScrollBars(bHBar, bVBar);
CScrollView::OnSize(nType, cx, cy);
int iNewWidth = cx < VIEW_DEFAULT_WIDTH ? VIEW_DEFAULT_WIDTH : cx;
int iNewHeight = cy < VIEW_DEFAULT_HEIGHT ? VIEW_DEFAULT_HEIGHT : cy;
int nVOffset = 0;
int nHOffset = 0;
DWORD dwStyle = AfxGetApp()->GetMainWnd()->GetStyle();
CRect rcMainWnd;
AfxGetApp()->GetMainWnd()->GetWindowRect(&rcMainWnd);
if((dwStyle & WS_MAXIMIZE) != 0 || m_bIsRetFromEditMode)
{
nVOffset = bVBar? 17: 0;
nHOffset = bHBar? 17: 0;
}
CSize siTotal = GetTotalSize();
CRect rcClient(0, 0, siTotal.cx, siTotal.cy);
if (!m_bIsRetFromEditMode || ! m_rcLastMainWndRect.EqualRect(&rcMainWnd)) {
SetScrollSizes(MM_TEXT, CSize(iNewWidth + nHOffset, iNewHeight + nVOffset));
} else {
SetScrollSizes(MM_TEXT, m_szLastSize);
}
RepositionButtons();
UpdateBars();
}
示例2: if
void CUIDesignerView::Notify(TNotifyUI& msg)
{
CControlUI* pControl=msg.pSender;
if(msg.sType == _T("PropertyBeginChanged"))
{
UIAttribute* pAttrib = (UIAttribute*)msg.lParam;
m_UICommandHistory.Begin(pControl, pAttrib->pstrName, pAttrib->pstrValue);
}
else if(msg.sType == _T("PropertyEndChanged"))
{
UIAttribute* pAttrib = (UIAttribute*)msg.lParam;
m_UICommandHistory.End(pControl, pAttrib->pstrName, pAttrib->pstrValue);
}
else if(msg.sType == _T("PosBeginChanged"))
m_UICommandHistory.Begin(*(CArray<CControlUI*,CControlUI*>*)msg.lParam, actionModify);
else if(msg.sType == _T("PosEndChanged"))
m_UICommandHistory.End();
else if(msg.sType==_T("setpos"))
{
if(GetControlType(pControl)==typeForm)
{
CWindowUI* pForm=m_LayoutManager.GetForm();
SIZE size;
size.cx=pForm->GetFixedWidth();
size.cy=pForm->GetFixedHeight();
pForm->SetInitSize(size.cx,size.cy);
g_pPropertiesWnd->SetPropValue(pControl,tagWindowSize);
SetScrollSizes(MM_TEXT,CSize(size.cx+FORM_OFFSET_X+80,
size.cy+FORM_OFFSET_Y+80));
m_MultiTracker.SetFormSize(size);
}
else
{
CControlUI* pParent=pControl->GetParent();
if(pParent)
pParent->SetPos(pParent->GetPos());
g_pPropertiesWnd->SetPropValue(pControl,tagPos);
g_pPropertiesWnd->SetPropValue(pControl,tagSize);
}
}
else if(msg.sType==_T("formsize"))
{
if(GetControlType(pControl)!=typeForm)
return;
CWindowUI* pForm=m_LayoutManager.GetForm();
SIZE size=pForm->GetInitSize();
pForm->SetFixedWidth(size.cx);
pForm->SetFixedHeight(size.cy);
SetScrollSizes(MM_TEXT,CSize(size.cx+FORM_OFFSET_X+80,
size.cy+FORM_OFFSET_Y+80));
m_MultiTracker.SetFormSize(size);
}
this->GetDocument()->SetModifiedFlag();
}
示例3: GetTrueClientSize
void CBigScrollView::SetScaleToFitSize(SIZE sizeTotal)
{
// do not use CScrollView::SetScaleToFit();
// this function change the size of the view !
wxSize sizeClient, sizeSb;
GetTrueClientSize(sizeClient, sizeSb);
if (m_nMapMode != MM_TEXT)
{
wxASSERT(m_nMapMode > 0); // must be set
CWindowDC dc(NULL);
dc.SetMapMode(m_nMapMode);
dc.DPtoLP(&sizeClient);
}
if (sizeClient.cy < MulDiv(sizeTotal.cy, sizeClient.cx, sizeTotal.cx))
{
// add 1% to eliminate scroll bars
sizeTotal.cy = MulDiv(sizeTotal.cy, 101, 100);
sizeTotal.cx = MulDiv(sizeTotal.cx, sizeClient.cy, sizeTotal.cy);
sizeTotal.cy = sizeClient.cy;
}
else
{
// add 1% to eliminate scroll bars
sizeTotal.cx = MulDiv(sizeTotal.cx, 101, 100);
sizeTotal.cx = sizeClient.cx;
sizeTotal.cy = MulDiv(sizeTotal.cy, sizeClient.cx, sizeTotal.cx);
}
SetScrollSizes(m_nMapMode, sizeTotal);
}
示例4: SetScrollSizes
/*************
* DESCRIPTION: constructor
* INPUT: -
* OUTPUT: -
*************/
CMatView::CMatView()
{
SetScrollSizes(MM_TEXT, CSize(0, 0), CSize(MATWIDTH, MATTOTALHEIGHT), CSize(MATWIDTH, MATTOTALHEIGHT));
nSelectedMaterial = -1;
m_nIDDrag = RegisterClipboardFormat(_T("MatView"));
pMatWnd = this;
}
示例5: GetClientRect
/*************
* DESCRIPTION: handler for refreshing of screen, called from Windows
* INPUT: pDC pointer to device context
* OUTPUT: -
*************/
void CMatView::OnDraw(CDC *pDC)
{
CPalette *pOldPalette;
CRect rect;
int i, x, y;
pOldPalette = pDC->SelectPalette(m_pPalette, TRUE);
pDC->RealizePalette();
GetClientRect(rect);
i = 0;
x = y = 0;
for (i = 0; i < aMaterials.GetSize(); i++)
{
((CMaterial*)aMaterials[i])->Show(pDC, x, y);
x += MATWIDTH;
if (x + MATWIDTH > rect.right && i < aMaterials.GetSize() - 1)
{
x = 0;
y += MATTOTALHEIGHT;
}
}
SetScrollSizes(MM_TEXT, CSize(rect.Width() - MATWIDTH, y + MATTOTALHEIGHT), CSize(MATWIDTH/2, MATTOTALHEIGHT/2), CSize(MATWIDTH/2, MATTOTALHEIGHT/2));
pDC->SelectPalette(pOldPalette, TRUE);
}
示例6: InitUI
void CUIDesignerView::OnInitialUpdate()
{
__super::OnInitialUpdate();
// TODO: 在此添加专用代码和/或调用基类
CUIDesignerDoc* pDoc=GetDocument();
m_LayoutManager.Init(this->GetSafeHwnd(),pDoc->GetPathName());
CFormUI* pForm=m_LayoutManager.GetForm();
g_pClassView->InsertUITreeItem(pForm,pDoc->GetTitle());
if(pForm->GetRowCount()>0)
{
InitUI(pForm->GetItemAt(0), 1);
m_LayoutManager.GetManager()->InitControls(pForm->GetItemAt(0));
}
g_pClassView->SelectUITreeItem(pForm);
m_bInit=true;
m_MultiTracker.SetHandleSize(TRACKER_HANDLE_SIZE);
m_MultiTracker.SetStyle(dottedLine|resizeOutside);
m_MultiTracker.SetFormSize(pForm->GetInitSize());
m_MultiTracker.Add(CreateTracker(pForm));
SetScrollSizes(MM_TEXT,CSize(FORM_INIT_WIDTH+80,FORM_INIT_HEIGHT+80));
}
示例7: GetDocument
void CVistaView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate ();
CString string;
CSize sizeTotal;
CBitmap* pBitmap = GetDocument ()->GetBitmap ();
//
// If a bitmap is loaded, set the view size equal to the bitmap size.
// Otherwise, set the view's width and height to 0.
//
if (pBitmap != NULL) {
DIBSECTION ds;
pBitmap->GetObject (sizeof (DIBSECTION), &ds);
sizeTotal.cx = ds.dsBm.bmWidth;
sizeTotal.cy = ds.dsBm.bmHeight;
string.Format (_T ("\t%d x %d, %d bpp"), ds.dsBm.bmWidth,
ds.dsBm.bmHeight, ds.dsBmih.biBitCount);
}
else {
sizeTotal.cx = sizeTotal.cy = 0;
string.Empty ();
}
AfxGetMainWnd ()->SendMessage (WM_USER_UPDATE_STATS, 0,
(LPARAM) (LPCTSTR) string);
SetScrollSizes (MM_TEXT, sizeTotal);
}
示例8: GetDocument
void CDlgView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
CBitmap BK;
BK.LoadBitmap(IDB_BITMAP_ADDAPP_BJ);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
MemDC.SelectObject(&BK);
BITMAP bm;
BK.GetBitmap(&bm);
//pDC->BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &MemDC, 0, 0, SRCCOPY);
CRect m_Rect;
GetClientRect(&m_Rect);
m_Rect.bottom += 100;
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = 262;
//if (m_pDisplayDlg != NULL)
//{
sizeTotal.cy = GetAllCtrlHeight();
//}
SetScrollSizes(MM_TEXT, sizeTotal);
//updateListCtrlPos();
// TODO: add draw code here
}
示例9: GetDocument
void CGDIPlusDBBView::OnInitialUpdate()
{
CGDIPlusDBBDoc* pDoc = GetDocument();
GdiplusStartup(&m_gdiplusToken, &m_gdiplusStartupInput, NULL);
// 显示默认中国地图
USES_CONVERSION;
pDoc->m_pStrMapName = "china.jpg";
CString pStrFullPath = pDoc->m_pStrMapPath + pDoc->m_pStrMapName;
LPWSTR wStrFullPath = A2W(pStrFullPath);
Image imgDefault(wStrFullPath);
// 滚动条大小
CSize sizeTotal;
sizeTotal.cx = imgDefault.GetWidth();
sizeTotal.cy = imgDefault.GetHeight();
SetScrollSizes(MM_TEXT, sizeTotal);
// 准备画布
CDC * pDC = this->GetDC();
m_memDC.CreateCompatibleDC(NULL);
m_memBitmap.CreateCompatibleBitmap(pDC,2000,2000);
ReleaseDC(pDC);
CScrollView::OnInitialUpdate();
}
示例10: SetScrollSizes
void CView2::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
SetScrollSizes(MM_TEXT, CSize(1, 1));
}
示例11: ASSERT
void CDibView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
ASSERT(GetDocument() != NULL);
SetScrollSizes(MM_TEXT, GetDocument()->GetDocSize());
}
示例12: SetScrollSizes
void CImageThumbToolView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
SetScrollSizes(MM_TEXT, CSize(1000, 500));
}
示例13: GetDocument
LRESULT CDComView::OnDocUpdate(WPARAM nNumNewLinesCleared, LPARAM)
{
CRect rcClient;
CPoint ptScroll;
CDComDoc *pDoc;
CMainFrame *pMainFrm = (CMainFrame *)AfxGetMainWnd();
if (pMainFrm)
{
m_sizeCharDimensions = pMainFrm->GetLineDimentions("a", 1);
}
pDoc = GetDocument();
if (pDoc)
{
pDoc->m_cLineBuffer.Enter();
ptScroll = GetDeviceScrollPosition();
if ((nNumNewLinesCleared) && (IsScrollBarAtBottom() == false))
{
ptScroll.y -= m_sizeCharDimensions.cy * nNumNewLinesCleared;
ScrollToPosition(ptScroll);
}
GetClientRect(&rcClient);
SetCaretPos(ptScroll, rcClient);
SetScrollSizes();
pDoc->m_cLineBuffer.Exit();
}
return 0;
}
示例14: GetParentFrame
void CPrime95View::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CFrameWnd *parent;
CSize sz;
CPoint pos;
int new_scroll_height, new_scroll_width;
parent = GetParentFrame();
if (parent != NULL) {
if (charHeight == 0) getCharSize ();
sz = GetTotalSize ();
new_scroll_height = NumLines * charHeight;
new_scroll_width = MaxLineSize * charWidth;
pos = GetScrollPosition ();
pos.y += (new_scroll_height - sz.cy);
if (pos.y < 0) pos.y = 0;
sz.cx = new_scroll_width;
sz.cy = new_scroll_height;
SetScrollSizes (MM_TEXT, sz);
ScrollToPosition (pos);
parent->RecalcLayout ();
}
CScrollView::OnUpdate (pSender, lHint, pHint);
}
示例15: sz
void CSpermView::OnSize(UINT nType, int cx, int cy)
{
CSize sz(100,100);
SetScrollSizes(MM_TEXT,sz);
CScrollView::OnSize(nType, cx, cy);
}