当前位置: 首页>>代码示例>>C++>>正文


C++ ShowScrollBar函数代码示例

本文整理汇总了C++中ShowScrollBar函数的典型用法代码示例。如果您正苦于以下问题:C++ ShowScrollBar函数的具体用法?C++ ShowScrollBar怎么用?C++ ShowScrollBar使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ShowScrollBar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowScrollBar

void XYDrawbox::RefreshAllScrollBar()
{
	//Horizontal Scrollbar Refresh Setting
	if (this->isXScroll)
	{
		ShowScrollBar(this->hwndThis, SB_HORZ, TRUE);
		scrollinfo.fMask = SIF_ALL;
		scrollinfo.nMax = this->lengthXScroll;
		scrollinfo.nMin = 0;
		scrollinfo.nPage = this->lengthXPage;
		scrollinfo.nPos = this->posXScroll;
		SetScrollInfo(this->hwndThis, SB_HORZ, &scrollinfo, TRUE);
	}
	else
	{
		ShowScrollBar(this->hwndThis, SB_HORZ, FALSE);
	}
	//Vertical Scrollbar Refresh Setting
	if (this->isYScroll)
	{
		ShowScrollBar(this->hwndThis, SB_VERT, TRUE);
		scrollinfo.fMask = SIF_ALL;
		scrollinfo.nMax = this->lengthYScroll;
		scrollinfo.nMin = 0;
		scrollinfo.nPage = this->lengthYPage;
		scrollinfo.nPos = this->posYScroll;
		SetScrollInfo(this->hwndThis, SB_VERT, &scrollinfo, TRUE);
	}
	else
	{
		ShowScrollBar(this->hwndThis, SB_VERT, FALSE);
	}
}
开发者ID:adamadanandy,项目名称:XYDiaCap,代码行数:33,代码来源:xydrawbox.cpp

示例2: GetSystemMetrics

//To on and off the scrollbars of the listbox
void COXMultiComboBox::COXComboLBox::AdjustHScroll()
{
	int nTotalHeight = ((COXMultiComboBox*)m_pWndCombo)->GetTotalHeight();
	int nTotalWidth = ((COXMultiComboBox*)m_pWndCombo)->GetTotalWidth();
	int nBorderWidth = GetSystemMetrics(SM_CXBORDER);
	int nBorderHeight = GetSystemMetrics(SM_CYBORDER);
	int nScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
	int nScrollbarHeight = GetSystemMetrics(SM_CYHSCROLL);
	CRect rcDrop;
	((COXMultiComboBox*)m_pWndCombo)->GetDroppedControlRect(&rcDrop);
	if( (nTotalHeight > rcDrop.Height()-2*nBorderHeight) ||
		((nTotalWidth > rcDrop.Width() - 2*nBorderWidth) &&
		(nTotalHeight > rcDrop.Height()-nScrollbarHeight - 2*nBorderHeight)) )
		m_fVertScrollVisible = TRUE;
	else
		m_fVertScrollVisible = FALSE;

	int nMargin=nTotalWidth-rcDrop.Width()+2*nBorderWidth;
	if(m_fVertScrollVisible)
		nMargin+=nScrollbarWidth;
	if( nMargin>0 )
		m_fHorzScrollVisible = TRUE;
	else
		m_fHorzScrollVisible = FALSE;

	if(m_fHorzScrollVisible)
		ShowScrollBar(SB_BOTH,TRUE);
	else
		ShowScrollBar(SB_HORZ,FALSE);
	ShowScrollBar(SB_VERT,m_fVertScrollVisible);

}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:33,代码来源:OXMultiComboBox.cpp

示例3: ShowScrollBar

bool CDisplayDlg::EndFullScreen()
{
    m_IsFullScreen = false;
    ShowScrollBar(SB_HORZ,TRUE);
    ShowScrollBar(SB_VERT,TRUE);
    return SetSize(m_left,m_top,m_cx,m_cy);
}
开发者ID:luis-wang,项目名称:RemoteControlSystem,代码行数:7,代码来源:DisplayDlg.cpp

示例4: TRACE

BOOL CView::LoadPictureFile(LPCTSTR szFile)
{
	if (m_pPicture)
	{
		m_pPicture->Release();
		m_pPicture = NULL;
	}

	TRACE(szFile);
	TRACE("\n");

	m_xCurrentScroll = 0;
	m_yCurrentScroll = 0;
	ShowScrollBar(SB_HORZ, FALSE);
	ShowScrollBar(SB_VERT, FALSE);

	// Create IPicture from image file
	if (S_OK == ::OleLoadPicturePath(T2OLE(szFile), NULL, 0, 0,	IID_IPicture, (LPVOID *)&m_pPicture))
	{
		CMainFrame* pFrame = GetPicApp()->GetMainFrame();
		pFrame->SendMessage(UWM_FILELOADED, 0, (LPARAM)szFile);
		Invalidate();
		return TRUE;
	}
	else
	{
		TRACE("Failed to load picture\n");

		// Set Frame title back to default
		CMainFrame* pFrame = GetPicApp()->GetMainFrame();
		pFrame->SendMessage(UWM_FILELOADED, 0, (LPARAM)LoadString(IDW_MAIN).c_str());
		return FALSE;
	}
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:34,代码来源:View.cpp

示例5: GetClientRect

void NFOView::CheckScrollbar(void)
{
    RECT viewWindowRect;
    GetClientRect(_handle, &viewWindowRect);

    HDC viewWindowDC = GetDC(_handle);
    HFONT hFont = (HFONT)SendMessage(_handle, WM_GETFONT, NULL, NULL);
    SelectObject(viewWindowDC, hFont);
    TEXTMETRICW tm;
    GetTextMetricsW(viewWindowDC, &tm); 
    ReleaseDC(_handle, viewWindowDC);

    // check vertical scrollbar
    int lineCount = SendMessage(_handle, EM_GETLINECOUNT, NULL, NULL);
    int lineCountOfViewWindow = viewWindowRect.bottom / tm.tmHeight;
    ShowScrollBar(_handle, SB_VERT, lineCount > lineCountOfViewWindow);

    // check horizontal scrollbar
    int maxLineLength = 0;
    for (int lineNum = 0; lineNum < lineCount; lineNum++)
    {
        int charIndex = SendMessage(_handle, EM_LINEINDEX, (WPARAM)lineNum, NULL);
        if (-1 != charIndex)
        {
            int lineLength = SendMessage(_handle, EM_LINELENGTH, (WPARAM)charIndex, NULL);
            if (lineLength > maxLineLength)
            {
                maxLineLength = lineLength;
            }
        }
    }
    int lineLengthOfViewWindow = viewWindowRect.right / tm.tmAveCharWidth;
    ShowScrollBar(_handle, SB_HORZ, maxLineLength > lineLengthOfViewWindow);
}
开发者ID:wowh,项目名称:SimpleNfoViewer,代码行数:34,代码来源:NFOView.cpp

示例6: ShowScrollBar

void CTCEdit::TCSetHorizScroll(bool set)
{
	m_Horiz = set;
	if(m_isMulityLine && m_Horiz)
		ShowScrollBar(SB_HORZ,TRUE);
	else
		ShowScrollBar(SB_HORZ,FALSE);
}
开发者ID:JohnWilliam1988,项目名称:TCIDE,代码行数:8,代码来源:TCEdit.cpp

示例7: GetImageRect

LRESULT CView::OnWindowPosChanged(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	if (m_pPicture)
	{
		CRect rcImage = GetImageRect();
		DWORD dwStyle = (DWORD)GetWindowLongPtr(GWL_STYLE);
		DWORD dwExStyle = (DWORD)GetWindowLongPtr(GWL_EXSTYLE);
		AdjustWindowRectEx(&rcImage, dwStyle, FALSE, dwExStyle);

		CRect rcView = GetClientRect();
		AdjustWindowRectEx(&rcView, dwStyle, FALSE, dwExStyle);

		SCROLLINFO si;
		ZeroMemory(&si, sizeof(SCROLLINFO));
		si.cbSize = sizeof(si);
		si.fMask  = SIF_RANGE | SIF_PAGE | SIF_POS;
		si.nMin   = 0;

		if (rcView.Width()  >= rcImage.Width())
		{
			m_xCurrentScroll = 0;
			ShowScrollBar(SB_HORZ, FALSE);
		}
		else
		{
			si.nMax   = rcImage.Width();
			si.nPage  = rcView.Width();
			si.nPos   = m_xCurrentScroll;
			SetScrollInfo(SB_HORZ, si, TRUE);
			ShowScrollBar(SB_HORZ, TRUE);
		}

		if (rcView.Height() >= rcImage.Height())
		{
			m_yCurrentScroll = 0;
			ShowScrollBar(SB_VERT, FALSE);
		}
		else
		{
			si.nMax   = rcImage.Height();
			si.nPage  = rcView.Height();
			si.nPos   = m_yCurrentScroll;
			SetScrollInfo(SB_VERT, si, TRUE);
			ShowScrollBar(SB_VERT, TRUE);
		}

		int xNewPos = MIN(m_xCurrentScroll, rcImage.Width() - rcView.Width());
		m_xCurrentScroll = MAX(xNewPos, 0);
		int yNewPos = MIN(m_yCurrentScroll, rcImage.Height() - rcView.Height());
		m_yCurrentScroll = MAX(yNewPos, 0);

		// Paint the window directly to eliminate flicker
		CClientDC dcView(this);
		Paint(dcView);
	}

	return 0L;
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:58,代码来源:View.cpp

示例8: winCanvasSetDYAttrib

static int winCanvasSetDYAttrib(Ihandle* ih, const char *value)
{
  if (ih->data->sb & IUP_SB_VERT)
  {
    double posy, ymin, ymax;
    float dy;
    int iposy, ipagey;

    if (!iupStrToFloatDef(value, &dy, 0.1f))
      return 1;

    ymin = iupAttribGetFloat(ih, "YMIN");
    ymax = iupAttribGetFloat(ih, "YMAX");
    posy = ih->data->posy;

    iupCanvasCalcScrollIntPos(ymin, ymax, dy, posy, 
                              IUP_SB_MIN, IUP_SB_MAX, &ipagey, &iposy);

    winCanvasSetScrollInfo(ih->handle, IUP_SB_MIN, IUP_SB_MAX, ipagey, SB_VERT, iupAttribGetBoolean(ih, "YAUTOHIDE"));

    if (dy >= (ymax-ymin))
    {
      if (iupAttribGetBoolean(ih, "YAUTOHIDE"))
      {
        iupAttribSet(ih, "YHIDDEN", "YES");
        ShowScrollBar(ih->handle, SB_VERT, FALSE);
        SetScrollPos(ih->handle, SB_VERT, IUP_SB_MIN, FALSE);
      }
      else
      {
        EnableScrollBar(ih->handle, SB_VERT, ESB_DISABLE_BOTH);
        SetScrollPos(ih->handle, SB_VERT, IUP_SB_MIN, TRUE);
      }

      ih->data->posy = (float)ymin;
      return 1;
    }
    else
    {
      if (iupAttribGetBoolean(ih, "YAUTOHIDE"))
      {
        iupAttribSet(ih, "YHIDDEN", "NO");
        ShowScrollBar(ih->handle, SB_VERT, TRUE);
      }
      else
        EnableScrollBar(ih->handle, SB_VERT, ESB_ENABLE_BOTH);

      /* also update position because it could have being changed */
      iupCanvasCalcScrollRealPos(ymin, ymax, &posy,
                                 IUP_SB_MIN, IUP_SB_MAX, ipagey, &iposy);
      SetScrollPos(ih->handle, SB_VERT, iposy, TRUE);
      ih->data->posy = (float)posy;
    }
  }
  return 1;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:56,代码来源:iupwin_canvas.c

示例9: winCanvasSetDXAttrib

static int winCanvasSetDXAttrib(Ihandle* ih, const char *value)
{
  if (ih->data->sb & IUP_SB_HORIZ)
  {
    double posx, xmin, xmax;
    float dx;
    int iposx, ipagex;

    if (!iupStrToFloatDef(value, &dx, 0.1f))
      return 1;

    xmin = iupAttribGetFloat(ih, "XMIN");
    xmax = iupAttribGetFloat(ih, "XMAX");
    posx = ih->data->posx;

    iupCanvasCalcScrollIntPos(xmin, xmax, dx, posx, 
                              IUP_SB_MIN, IUP_SB_MAX, &ipagex, &iposx);

    winCanvasSetScrollInfo(ih->handle, IUP_SB_MIN, IUP_SB_MAX, ipagex, SB_HORZ, iupAttribGetBoolean(ih, "XAUTOHIDE"));

    if (dx >= (xmax-xmin))
    {
      if (iupAttribGetBoolean(ih, "XAUTOHIDE"))
      {
        iupAttribSet(ih, "XHIDDEN", "YES");
        ShowScrollBar(ih->handle, SB_HORZ, FALSE);
        SetScrollPos(ih->handle, SB_HORZ, IUP_SB_MIN, FALSE);
      }
      else
      {
        EnableScrollBar(ih->handle, SB_HORZ, ESB_DISABLE_BOTH);
        SetScrollPos(ih->handle, SB_HORZ, IUP_SB_MIN, TRUE);
      }

      ih->data->posx = (float)xmin;
    }
    else
    {
      if (iupAttribGetBoolean(ih, "XAUTOHIDE"))
      {
        iupAttribSet(ih, "XHIDDEN", "NO");
        ShowScrollBar(ih->handle, SB_HORZ, TRUE);
      }
      else
        EnableScrollBar(ih->handle, SB_HORZ, ESB_ENABLE_BOTH);

      /* also update position because it could have being changed */
      iupCanvasCalcScrollRealPos(xmin, xmax, &posx, 
                                 IUP_SB_MIN, IUP_SB_MAX, ipagex, &iposx);
      SetScrollPos(ih->handle, SB_HORZ, iposx, TRUE);
      ih->data->posx = (float)posx;
    }
  }
  return 1;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:55,代码来源:iupwin_canvas.c

示例10: MoveWindow

void CDisplayDlg::FullScreen()
{

    m_IsFullScreen  = true;
    MoveWindow(0,0,m_ScreenWidth,m_ScreenHeight);
    ScrollWindowEx(GetScrollPos(SB_HORZ),GetScrollPos(SB_VERT),NULL, NULL, NULL, NULL, SW_ERASE|SW_SCROLLCHILDREN);
    SetScrollPos(SB_HORZ,0);
    SetScrollPos(SB_VERT,0);
    ShowScrollBar(SB_HORZ,FALSE);
    ShowScrollBar(SB_VERT,FALSE);
}
开发者ID:luis-wang,项目名称:RemoteControlSystem,代码行数:11,代码来源:DisplayDlg.cpp

示例11: ShowScrollBar

// Actual zoom code.
void CPreviewView::DoZoom(UINT nPage, CPoint point)
{
	if (m_nZoomState == ZOOM_OUT)
	{
		// taking over scroll bars
		m_nPages = m_nZoomOutPages;
		ShowScrollBar(SB_HORZ, FALSE);      //hide the horizontal bar

		BOOL bShowBar = m_pPreviewInfo->GetMaxPage() < 0x8000 &&
			m_pPreviewInfo->GetMaxPage() -
			m_pPreviewInfo->GetMinPage() <= 32767U;

		ShowScrollBar(SB_VERT, bShowBar);       //Show the vertical bar

		if (bShowBar)
		{
			SetScrollRange(SB_VERT, m_pPreviewInfo->GetMinPage(),
								m_pPreviewInfo->GetMaxPage(), FALSE);

			SetScrollPos(SB_VERT, m_nCurrentPage, TRUE);
		}

		SetCurrentPage(m_nCurrentPage, TRUE);
	}
	else
	{
		m_nPages = 1;       // only one page in zoomed states

		m_pPageInfo[0].sizeZoomOutRatio = m_pPageInfo[nPage].sizeZoomOutRatio;
		m_pPageInfo[0].sizeUnscaled = m_pPageInfo[nPage].sizeUnscaled;

		// Sets the printer page
		SetCurrentPage(m_nCurrentPage + nPage, FALSE);

		SetScaledSize(0);

		CSize* pRatio = &m_pPageInfo[nPage].sizeScaleRatio;

		// convert Hit Point from screen 1:1
		point.x = MulDiv(point.x, pRatio->cx, pRatio->cy);
		point.y = MulDiv(point.y, pRatio->cx, pRatio->cy);

		// Adjust point for page position
		point += (CSize)m_pPageInfo[0].rectScreen.TopLeft();

		// Scroll to center
		CenterOnPoint(point);
	}
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:50,代码来源:viewprev.cpp

示例12: SetWndProclpParam

BOOL XYDrawbox::InitWnd()
{
	SetWndProclpParam(this);
	std::cout << "WNDPROC :D:" << (this->wndProcThis) << std::endl;
	if (XYWndBase::InitWnd() == FALSE)
	{
		std::cout << "WARNING!!" << std::endl;
		return FALSE;
	}
	else
	{
		ShowScrollBar(this->hwndThis, SB_HORZ, FALSE);
		ShowScrollBar(this->hwndThis, SB_VERT, FALSE);
	}
	return TRUE;
}
开发者ID:adamadanandy,项目名称:XYDiaCap,代码行数:16,代码来源:xydrawbox.cpp

示例13: ShowScrollBar

void CWatchBarList::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos) 
{
	CListCtrl::OnWindowPosChanged(lpwndpos);
	
    ShowScrollBar(SB_HORZ, FALSE);
    ModifyStyle(WS_HSCROLL, 0, SWP_DRAWFRAME);
}
开发者ID:xiaoyugm,项目名称:chtproject,代码行数:7,代码来源:WatchBarList.cpp

示例14: GetClientRect

void CBirchCtrl::ResetScrollBar()
{
	// Flag to avoid a call from OnSize while resetting the scrollbar
	m_bScrollBarMessage = TRUE;

	CRect rFrame;

	GetClientRect( rFrame );

	// Need for scrollbars?
	if( rFrame.Height() > m_iDocHeight + 8 )
	{
		ShowScrollBar( SB_VERT, FALSE );	// Hide it
		SetScrollPos( SB_VERT, 0 );
	}
	else
	{
		SCROLLINFO	si;
		si.cbSize = sizeof(SCROLLINFO);
		si.fMask = SIF_PAGE | SIF_RANGE;
		si.nPage = rFrame.Height()/*/m_iLineHeight*/;
		si.nMax = (m_iDocHeight + 8)/*/m_iLineHeight*/;
		si.nMin = 0 ;

		SetScrollInfo( SB_VERT, &si );
		EnableScrollBarCtrl( SB_VERT, TRUE );
	}

	m_bScrollBarMessage = FALSE;
}
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:30,代码来源:BirchCtrl.cpp

示例15: end_shop_mode

void end_shop_mode()
{
	RECT dummy_rect = {0,0,0,0};

    if(PSD[SDF_ASK_ABOUT_TEXT_BOX] == 1)
    	ShowWindow(talk_edit_box, SW_SHOW);

	ShowScrollBar(shop_sbar,SB_CTL,false);
	if (store_pre_shop_mode == 20) {
		sprintf(old_str1,"You conclude your business.");
		sprintf(old_str2,"");
		sprintf(one_back1,"You conclude your business.");
		sprintf(one_back2,"");

		strnum1 = strnum2 = oldstrnum1 = oldstrnum2 = 0;
		place_talk_str((char *)old_str1,"",0,dummy_rect);
		}
		else {
			DeleteObject(talk_gworld);
			talk_gworld = NULL;
			}

	overall_mode = store_pre_shop_mode;
	create_clip_region();
	if (overall_mode == MODE_TALK_TOWN)
		overall_mode = MODE_TOWN;
	if (overall_mode == MODE_TOWN) {
		center = c_town.p_loc;
		update_explored(center);
		}
	stat_screen_mode = 0;
	put_item_screen(stat_window,0);
	put_pc_screen();
	refresh_screen(0);
}
开发者ID:PBrookfield,项目名称:cboe-msvc,代码行数:35,代码来源:boe.dlgutil.cpp


注:本文中的ShowScrollBar函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。