本文整理汇总了C++中CPDF_Rect::Height方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Rect::Height方法的具体用法?C++ CPDF_Rect::Height怎么用?C++ CPDF_Rect::Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Rect
的用法示例。
在下文中一共展示了CPDF_Rect::Height方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScrollBarShouldVisible
FX_BOOL CPWL_Note::ScrollBarShouldVisible()
{
CPDF_Rect rcContentsFact = m_pContents->GetScrollArea();
CPDF_Rect rcContentsClient = m_pContents->GetClientRect();
return rcContentsFact.Height() > rcContentsClient.Height();
}
示例2: OnMouseWheel
FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pContents->GetScrollPos();
CPDF_Rect rcScroll = m_pContents->GetScrollArea();
CPDF_Rect rcContents = m_pContents->GetClientRect();
if (rcScroll.top - rcScroll.bottom > rcContents.Height())
{
CPDF_Point ptNew = ptScroll;
if (zDelta > 0)
ptNew.y += 30;
else
ptNew.y -= 30;
if (ptNew.y > rcScroll.top)
ptNew.y = rcScroll.top;
if (ptNew.y < rcScroll.bottom + rcContents.Height())
ptNew.y = rcScroll.bottom + rcContents.Height();
if (ptNew.y < rcScroll.bottom)
ptNew.y = rcScroll.bottom;
if (ptNew.y != ptScroll.y)
{
m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
return TRUE;
}
}
return FALSE;
}
示例3: GetMatrix
CFX_AffineMatrix GetMatrix(CPDF_Rect rcAnnot, CPDF_Rect rcStream, CFX_AffineMatrix matrix)
{
if(rcStream.IsEmpty())
return CFX_AffineMatrix();
matrix.TransformRect(rcStream);
rcStream.Normalize();
FX_FLOAT a = rcAnnot.Width()/rcStream.Width();
FX_FLOAT d = rcAnnot.Height()/rcStream.Height();
FX_FLOAT e = rcAnnot.left - rcStream.left * a;
FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d;
return CFX_AffineMatrix(a, 0, 0, d, e, f);
}
示例4: ScrollToItem
void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) {
CPDF_Rect rcClient = GetClientRect();
if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) {
CPDF_Rect rcOrigin = pItem->GetWindowRect();
CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin);
if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top)) {
CPDF_Point ptScroll = GetScrollPos();
if (rcWnd.top > rcClient.top) {
ptScroll.y = rcOrigin.top;
} else if (rcWnd.bottom < rcClient.bottom) {
ptScroll.y = rcOrigin.bottom + rcClient.Height();
}
SetScrollPos(ptScroll);
ResetFace();
InvalidateRect();
if (CPWL_Wnd* pParent = GetParentWindow()) {
pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL,
(intptr_t)&ptScroll.y);
}
}
}
}
示例5: SetScrollPosY
void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy)
{
if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y,fy))
{
CPDF_Rect rcPlate = GetPlateRect();
CPDF_Rect rcContent = CFX_List::GetContentRect();
if (rcPlate.Height() > rcContent.Height())
{
fy = rcPlate.top;
}
else
{
if (FX_EDIT_IsFloatSmaller(fy - rcPlate.Height(), rcContent.bottom))
{
fy = rcContent.bottom + rcPlate.Height();
}
else if (FX_EDIT_IsFloatBigger(fy, rcContent.top))
{
fy = rcContent.top;
}
}
m_ptScrollPos.y = fy;
InvalidateItem(-1);
if (m_pNotify)
{
if (!m_bNotifyFlag)
{
m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollPosY(fy);
m_bNotifyFlag = FALSE;
}
}
}
}
示例6: OnMouseWheel
FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta,
const CPDF_Point& point,
FX_DWORD nFlag) {
CPDF_Point ptScroll = m_pListContent->GetScrollPos();
CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
CPDF_Rect rcContents = m_pListContent->GetClientRect();
if (rcScroll.top - rcScroll.bottom > rcContents.Height()) {
CPDF_Point ptNew = ptScroll;
if (zDelta > 0)
ptNew.y += 30;
else
ptNew.y -= 30;
if (ptNew.y > rcScroll.top)
ptNew.y = rcScroll.top;
if (ptNew.y < rcScroll.bottom + rcContents.Height())
ptNew.y = rcScroll.bottom + rcContents.Height();
if (ptNew.y < rcScroll.bottom)
ptNew.y = rcScroll.bottom;
if (ptNew.y != ptScroll.y) {
m_pListContent->SetScrollPos(ptNew);
m_pListContent->ResetFace();
m_pListContent->InvalidateRect(NULL);
if (CPWL_ScrollBar* pScrollBar = GetVScrollBar())
pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL,
(intptr_t)&ptNew.y);
return TRUE;
}
}
return FALSE;
}
示例7: SetScrollInfo
void CFX_ListCtrl::SetScrollInfo()
{
if (m_pNotify)
{
CPDF_Rect rcPlate = GetPlateRect();
CPDF_Rect rcContent = CFX_List::GetContentRect();
if (!m_bNotifyFlag)
{
m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
rcContent.bottom, rcContent.top, GetFirstHeight(), rcPlate.Height());
m_bNotifyFlag = FALSE;
}
}
}
示例8: GetCharArrayAutoFontSize
FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont,
const CPDF_Rect& rcPlate,
int32_t nCharArray) {
if (pFont && !pFont->IsStandardFont()) {
FX_RECT rcBBox;
pFont->GetFontBBox(rcBBox);
CPDF_Rect rcCell = rcPlate;
FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
FX_FLOAT ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height();
return xdiv < ydiv ? xdiv : ydiv;
}
return 0.0f;
}
示例9: DrawThisAppearance
void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
{
CPDF_Rect rcClient = this->GetClientRect();
CFX_GraphStateData gsd;
gsd.m_LineWidth = 1.0f;
CFX_PathData pathCross;
pathCross.SetPointCount(4);
pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO);
pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO);
pathCross.SetPoint(2, rcClient.right, rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO);
pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, rcClient.bottom, FXPT_LINETO);
pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
}
示例10: ScrollToListItem
void CFX_ListCtrl::ScrollToListItem(int32_t nItemIndex)
{
if (!IsValid(nItemIndex)) return;
CPDF_Rect rcPlate = GetPlateRect();
CPDF_Rect rcItem = CFX_List::GetItemRect(nItemIndex);
CPDF_Rect rcItemCtrl = GetItemRect(nItemIndex);
if (FX_EDIT_IsFloatSmaller(rcItemCtrl.bottom, rcPlate.bottom))
{
if (FX_EDIT_IsFloatSmaller(rcItemCtrl.top, rcPlate.top))
{
SetScrollPosY(rcItem.bottom + rcPlate.Height());
}
}
else if (FX_EDIT_IsFloatBigger(rcItemCtrl.top, rcPlate.top))
{
if (FX_EDIT_IsFloatBigger(rcItemCtrl.bottom, rcPlate.bottom))
{
SetScrollPosY(rcItem.top);
}
}
}
示例11: OnNotify
void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
{
switch (msg)
{
case PNM_NOTEEDITCHANGED:
{
CPDF_Rect rcScroll = m_pContents->GetScrollArea();
PWL_SCROLL_INFO sInfo;
sInfo.fContentMin = rcScroll.bottom;
sInfo.fContentMax = rcScroll.top;
sInfo.fPlateWidth = m_pContents->GetClientRect().Height();
sInfo.fSmallStep = 13.0f;
sInfo.fBigStep = sInfo.fPlateWidth;
if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != 0)
{
FX_BOOL bScrollChanged = FALSE;
if (lParam < 3) //·ÀÖ¹ËÀÑ»· mantis:15759
{
bScrollChanged = ResetScrollBar();
if (bScrollChanged)
{
lParam++;
m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, lParam);
}
}
if (!bScrollChanged)
{
if (m_pContentsBar->IsVisible())
{
m_pContentsBar->OnNotify(pWnd, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo);
m_OldScrollInfo = sInfo;
CPDF_Point ptScroll = m_pContents->GetScrollPos();
CPDF_Point ptOld = ptScroll;
if (ptScroll.y > sInfo.fContentMax)
ptScroll.y = sInfo.fContentMax;
if (ptScroll.y < sInfo.fContentMin + sInfo.fPlateWidth)
ptScroll.y = sInfo.fContentMin + sInfo.fPlateWidth;
if (ptScroll.y < sInfo.fContentMin)
ptScroll.y = sInfo.fContentMin;
if (ptOld.y != ptScroll.y)
{
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
m_pContentsBar->InvalidateRect(NULL);
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
}
}
}
}
}
m_pContents->InvalidateRect(NULL);
return;
case PNM_SCROLLWINDOW:
if (m_pContents)
m_pContents->OnNotify(pWnd, msg, wParam, lParam);
return;
case PNM_SETSCROLLPOS:
if (m_pContentsBar)
m_pContentsBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
return;
}
if (msg == PNM_SETCARETINFO && IsValid())
{
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
if (m_pContents)
{
CPDF_Rect rcClient = m_pContents->GetClientRect();
if (pInfo->ptHead.y > rcClient.top)
{
CPDF_Point pt = m_pContents->OutToIn(pInfo->ptHead);
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y);
CPDF_Point ptScroll = m_pContents->GetScrollPos();
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
return;
}
if (pInfo->ptFoot.y < rcClient.bottom)
{
CPDF_Point pt = m_pContents->OutToIn(pInfo->ptFoot);
pt.y += rcClient.Height();
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y);
CPDF_Point ptScroll = m_pContents->GetScrollPos();
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
return;
//.........这里部分代码省略.........