本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例6: ShowScrollBar
void CTCEdit::TCSetHorizScroll(bool set)
{
m_Horiz = set;
if(m_isMulityLine && m_Horiz)
ShowScrollBar(SB_HORZ,TRUE);
else
ShowScrollBar(SB_HORZ,FALSE);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例13: ShowScrollBar
void CWatchBarList::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
CListCtrl::OnWindowPosChanged(lpwndpos);
ShowScrollBar(SB_HORZ, FALSE);
ModifyStyle(WS_HSCROLL, 0, SWP_DRAWFRAME);
}
示例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;
}
示例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);
}