本文整理汇总了C++中PAGE_INFO::GetSizeMils方法的典型用法代码示例。如果您正苦于以下问题:C++ PAGE_INFO::GetSizeMils方法的具体用法?C++ PAGE_INFO::GetSizeMils怎么用?C++ PAGE_INFO::GetSizeMils使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PAGE_INFO
的用法示例。
在下文中一共展示了PAGE_INFO::GetSizeMils方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPageLayoutInfoFromDialog
void DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog()
{
int idx = std::max( m_paperSizeComboBox->GetSelection(), 0 );
const wxString paperType = m_pageFmt[idx];
// here we assume translators will keep original paper size spellings
if( paperType.Contains( PAGE_INFO::Custom ) )
{
GetCustomSizeMilsFromDialog();
if( m_layout_size.x && m_layout_size.y )
{
if( m_layout_size.x < m_layout_size.y )
m_orientationComboBox->SetStringSelection( _( "Portrait" ) );
else
m_orientationComboBox->SetStringSelection( _( "Landscape" ) );
}
}
else
{
PAGE_INFO pageInfo; // SetType() later to lookup size
static const wxChar* papers[] = {
// longest common string first, since sequential search below
PAGE_INFO::A4,
PAGE_INFO::A3,
PAGE_INFO::A2,
PAGE_INFO::A1,
PAGE_INFO::A0,
PAGE_INFO::A,
PAGE_INFO::B,
PAGE_INFO::C,
PAGE_INFO::D,
PAGE_INFO::E,
PAGE_INFO::USLetter,
PAGE_INFO::USLegal,
PAGE_INFO::USLedger,
};
unsigned i;
for( i=0; i < arrayDim( papers ); ++i )
{
if( paperType.Contains( papers[i] ) )
{
pageInfo.SetType( papers[i] );
break;
}
}
wxASSERT( i != arrayDim(papers) ); // dialog UI match the above list?
m_layout_size = pageInfo.GetSizeMils();
// swap sizes to match orientation
bool isPortrait = (bool) m_orientationComboBox->GetSelection();
if( ( isPortrait && m_layout_size.x >= m_layout_size.y ) ||
( !isPortrait && m_layout_size.x < m_layout_size.y ) )
{
m_layout_size.Set( m_layout_size.y, m_layout_size.x );
}
}
}
示例2: BuildWorkSheetGraphicList
void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
const PAGE_INFO& aPageInfo,
const TITLE_BLOCK& aTitleBlock,
COLOR4D aColor, COLOR4D aAltColor )
{
WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
#define milsTomm (25.4/1000)
m_titleBlock = &aTitleBlock;
m_paperFormat = &aPageInfo.GetType();
wxPoint LTmargin( Mm2mils( pglayout.GetLeftMargin() ),
Mm2mils( pglayout.GetTopMargin() ) );
wxPoint RBmargin( Mm2mils( pglayout.GetRightMargin() ),
Mm2mils( pglayout.GetBottomMargin() ) );
SetMargins( LTmargin, RBmargin );
SetPageSize( aPageInfo.GetSizeMils() );
// Build the basic layout shape, if the layout list is empty
if( pglayout.GetCount() == 0 && !pglayout.VoidListAllowed() )
pglayout.SetPageLayout();
WORKSHEET_DATAITEM::m_WSunits2Iu = m_milsToIu / milsTomm;
WORKSHEET_DATAITEM::m_Color = aColor; // the default color to draw items
WORKSHEET_DATAITEM::m_AltColor = aAltColor; // an alternate color to draw items
// Left top corner position
DPOINT lt_corner;
lt_corner.x = pglayout.GetLeftMargin();
lt_corner.y = pglayout.GetTopMargin();
WORKSHEET_DATAITEM::m_LT_Corner = lt_corner;
// Right bottom corner position
DPOINT rb_corner;
rb_corner.x = (m_pageSize.x*milsTomm) - pglayout.GetRightMargin();
rb_corner.y = (m_pageSize.y*milsTomm) - pglayout.GetBottomMargin();
WORKSHEET_DATAITEM::m_RB_Corner = rb_corner;
WS_DRAW_ITEM_TEXT* gtext;
int pensize;
for( unsigned ii = 0; ; ii++ )
{
WORKSHEET_DATAITEM* wsItem = pglayout.GetItem( ii );
if( wsItem == NULL )
break;
// Generate it only if the page option allows this
if( wsItem->GetPage1Option() < 0 // Not on page 1
&& m_sheetNumber <= 1 )
continue;
if( wsItem->GetPage1Option() > 0 // Only on page 1
&& m_sheetNumber > 1 )
continue;
COLOR4D color = wsItem->GetItemColor();
pensize = wsItem->GetPenSizeUi();
switch( wsItem->GetType() )
{
case WORKSHEET_DATAITEM::WS_TEXT:
{
WORKSHEET_DATAITEM_TEXT * wsText = (WORKSHEET_DATAITEM_TEXT*)wsItem;
bool multilines = false;
if( wsText->m_SpecialMode )
wsText->m_FullText = wsText->m_TextBase;
else
{
wsText->m_FullText = BuildFullText( wsText->m_TextBase );
multilines = wsText->ReplaceAntiSlashSequence();
}
if( wsText->m_FullText.IsEmpty() )
break;
if( pensize == 0 )
pensize = m_penSize;
wsText->SetConstrainedTextSize();
wxSize textsize;
textsize.x = KiROUND( wsText->m_ConstrainedTextSize.x
* WORKSHEET_DATAITEM::m_WSunits2Iu );
textsize.y = KiROUND( wsText->m_ConstrainedTextSize.y
* WORKSHEET_DATAITEM::m_WSunits2Iu );
if( wsText->IsBold())
pensize = GetPenSizeForBold( std::min( textsize.x, textsize.y ) );
for( int jj = 0; jj < wsText->m_RepeatCount; jj++)
{
if( jj && ! wsText->IsInsidePage( jj ) )
continue;
//.........这里部分代码省略.........