本文整理汇总了C++中GetAlignment函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAlignment函数的具体用法?C++ GetAlignment怎么用?C++ GetAlignment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetAlignment函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetChild
void Alignment::UpdateChild() {
Widget::Ptr child = GetChild();
if( !child ) {
return;
}
sf::FloatRect allocation( GetAllocation() );
sf::Vector2f spare_space( allocation.width, allocation.height );
spare_space -= child->GetRequisition();
spare_space.x *= 1.f - GetScale().x;
spare_space.y *= 1.f - GetScale().y;
if( ( spare_space.x < 0 ) || ( spare_space.y < 0 ) ) {
#ifdef SFGUI_DEBUG
std::cerr << "SFGUI warning: Alignment got a smaller allocation than it requested." << std::endl;
return;
#endif
}
allocation.left = spare_space.x * GetAlignment().x;
allocation.top = spare_space.y * GetAlignment().y;
allocation.width -= spare_space.x;
allocation.height -= spare_space.y;
child->SetAllocation( allocation );
}
开发者ID:spacechase0,项目名称:SFGUI,代码行数:28,代码来源:Alignment.cpp
示例2: DefaultAllocator
void * SmallObjAllocator::Allocate( std::size_t numBytes, bool doThrow )
{
if ( numBytes > GetMaxObjectSize() )
return DefaultAllocator( numBytes, doThrow );
assert( NULL != pool_ );
if ( 0 == numBytes ) numBytes = 1;
const std::size_t index = GetOffset( numBytes, GetAlignment() ) - 1;
const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() );
(void) allocCount;
assert( index < allocCount );
FixedAllocator & allocator = pool_[ index ];
assert( allocator.BlockSize() >= numBytes );
assert( allocator.BlockSize() < numBytes + GetAlignment() );
void * place = allocator.Allocate();
if ( ( NULL == place ) && TrimExcessMemory() )
place = allocator.Allocate();
if ( ( NULL == place ) && doThrow )
{
#ifdef _MSC_VER
throw std::bad_alloc( "could not allocate small object" );
#else
// GCC did not like a literal string passed to std::bad_alloc.
// so just throw the default-constructed exception.
throw std::bad_alloc();
#endif
}
return place;
}
开发者ID:wangscript,项目名称:evolution3d,代码行数:32,代码来源:SmallObj.cpp
示例3: WXUNUSED
void wxGenericStaticText::OnPaint(wxPaintEvent& WXUNUSED(event))
{
if ( m_label.empty() )
return;
wxPaintDC dc(this);
PrepareDC(dc);
wxRect rect = GetClientRect();
if ( IsEnabled() )
{
dc.SetTextForeground(
wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
}
else // paint disabled text
{
// draw shadow of the text
dc.SetTextForeground(
wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
wxRect rectShadow = rect;
rectShadow.Offset(1, 1);
dc.DrawLabel(m_label, rectShadow, GetAlignment(), m_mnemonic);
dc.SetTextForeground(
wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
}
dc.DrawLabel(m_label, wxNullBitmap, rect, GetAlignment(), m_mnemonic);
}
开发者ID:jonntd,项目名称:dynamica,代码行数:26,代码来源:stattextg.cpp
示例4: assert
bool SmallObjAllocator::IsCorrupt( void ) const
{
if ( NULL == pool_ )
{
assert( false );
return true;
}
if ( 0 == GetAlignment() )
{
assert( false );
return true;
}
if ( 0 == GetMaxObjectSize() )
{
assert( false );
return true;
}
const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() );
for ( std::size_t ii = 0; ii < allocCount; ++ii )
{
if ( pool_[ ii ].IsCorrupt() )
return true;
}
return false;
}
开发者ID:wangscript,项目名称:evolution3d,代码行数:25,代码来源:SmallObj.cpp
示例5: _L1TXX
void _L1TXX( short xpos, short ypos, char _WCI86FAR * str,
/*========*/ struct xycoord _WCI86FAR * concat, struct xycoord _WCI86FAR * extent )
/* Inquire the extents of the character drawing parallelogram and
return the concatenation point. The concatenation point is the same
as the drawing point if it cannot be calculated exactly. */
{
short hor; /* horizontal alignment */
short vert; /* vertical alignment */
struct xycoord up; /* character up vector */
struct xycoord base; /* character base line vector */
struct xycoord space; /* spacing between characters */
struct xycoord length; /* horizontal side of parallelogram */
struct xycoord height; /* vertical side of parallelogram */
struct xycoord trans; /* translation for parallelogram */
GetVectors( &base, &up );
GetAlignment( &hor, &vert );
CalcSpacing( &base, &up, &space );
CalcSides( &length, &height, &base, &up, &space, str );
CalcTranslation( &trans, &length, &height, &up, hor, vert );
CalcCorners( extent, &length, &height, &trans, xpos, ypos );
if( _TextSettings.txpath == _PATH_RIGHT ||
_TextSettings.txpath == _PATH_LEFT ) {
CalcConcat( concat, &length, &space, xpos, ypos, hor, vert );
} else {
CalcConcat( concat, &height, &space, xpos, ypos, hor, vert );
}
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:30,代码来源:l1text.c
示例6: FWL_GetApp
FX_BOOL CXFA_FFListBox::LoadWidget() {
CFWL_ListBox* pListBox = CFWL_ListBox::Create();
pListBox->Initialize();
pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground,
0xFFFFFFFF);
m_pNormalWidget = (CFWL_Widget*)pListBox;
IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
m_pNormalWidget->SetPrivateData(pWidget, this, NULL);
IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
pNoteDriver->RegisterEventTarget(pWidget, pWidget);
m_pOldDelegate = m_pNormalWidget->SetDelegate(this);
m_pNormalWidget->LockUpdate();
CFX_WideStringArray wsLabelArray;
m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
int32_t iItems = wsLabelArray.GetSize();
for (int32_t i = 0; i < iItems; i++) {
pListBox->AddString(wsLabelArray[i]);
}
FX_DWORD dwExtendedStyle = FWL_STYLEEXT_LTB_ShowScrollBarFocus;
if (m_pDataAcc->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) {
dwExtendedStyle |= FWL_STYLEEXT_LTB_MultiSelection;
}
dwExtendedStyle |= GetAlignment();
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
int32_t iSelCount = iSelArray.GetSize();
for (int32_t j = 0; j < iSelCount; j++) {
FWL_HLISTITEM item = pListBox->GetItem(iSelArray[j]);
pListBox->SetSelItem(item, TRUE);
}
m_pNormalWidget->UnlockUpdate();
return CXFA_FFField::LoadWidget();
}
开发者ID:JinAirsOs,项目名称:pdfium,代码行数:34,代码来源:xfa_ffchoicelist.cpp
示例7: GetRelativeAlignment
//----------------------------------------------------------------------------
//
// ROUTINE: CCharacter::GetCrosshairRelativeToPlayer()
//
// PURPOSE: Returns a selected RelationData based on our relation
// with the player. To summarize, this function converts two
// dynamic character classes into a static RelationData
//
//----------------------------------------------------------------------------
CharacterClass GetRelativeAlignment(const RelationSet& r1, const RelationData& c2)
{
CharacterClass CC = NEUTRAL;
CharacterAlignment CA = GetAlignment(r1, c2);
// If we our alignment with eachother was set, then simplify into a
// relations the crosshair system supports (ie RelationData)
if ( CA != INVALID )
{
switch( CA )
{
case LIKE:
CC = GOOD;
break;
case TOLERATE:
CC = NEUTRAL;
break;
case HATE:
CC = BAD;
break;
case UNDETERMINED:
CC = UNKNOWN;
break;
default:
UBER_ASSERT( 0, "Unknown relation" );
};
}
return CC;
}
开发者ID:emoose,项目名称:lithtech,代码行数:39,代码来源:CharacterAlignment.cpp
示例8: UpdateUIProperty
void CXFA_FFComboBox::UpdateWidgetProperty() {
CFWL_ComboBox* pComboBox = (CFWL_ComboBox*)m_pNormalWidget;
if (!pComboBox) {
return;
}
uint32_t dwExtendedStyle = 0;
uint32_t dwEditStyles =
FWL_STYLEEXT_EDT_ReadOnly | FWL_STYLEEXT_EDT_LastLineHeight;
dwExtendedStyle |= UpdateUIProperty();
if (m_pDataAcc->IsChoiceListAllowTextEntry()) {
dwEditStyles &= ~FWL_STYLEEXT_EDT_ReadOnly;
dwExtendedStyle |= FWL_STYLEEXT_CMB_DropDown;
}
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open ||
!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
dwEditStyles |= FWL_STYLEEXT_EDT_ReadOnly;
dwExtendedStyle |= FWL_STYLEEXT_CMB_ReadOnly;
}
dwExtendedStyle |= GetAlignment();
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
if (m_pDataAcc->GetHorizontalScrollPolicy() != XFA_ATTRIBUTEENUM_Off) {
dwEditStyles |= FWL_STYLEEXT_EDT_AutoHScroll;
}
pComboBox->EditModifyStylesEx(dwEditStyles, 0xFFFFFFFF);
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:25,代码来源:xfa_ffchoicelist.cpp
示例9: OnAlignmentChanged
void OpExtensionsDevToolsToolbar::OnAlignmentChanged()
{
if (GetAlignment() == ALIGNMENT_OFF)
{
}
}
开发者ID:prestocore,项目名称:browser,代码行数:7,代码来源:OpExtensionsDevToolsToolbar.cpp
示例10: UpdateUIProperty
void CXFA_FFNumericEdit::UpdateWidgetProperty() {
CFWL_Edit* pWidget = (CFWL_Edit*)m_pNormalWidget;
if (!pWidget) {
return;
}
uint32_t dwExtendedStyle =
FWL_STYLEEXT_EDT_ShowScrollbarFocus | FWL_STYLEEXT_EDT_OuterScrollbar |
FWL_STYLEEXT_EDT_Validate | FWL_STYLEEXT_EDT_Number |
FWL_STYLEEXT_EDT_LastLineHeight;
dwExtendedStyle |= UpdateUIProperty();
if (m_pDataAcc->GetHorizontalScrollPolicy() != XFA_ATTRIBUTEENUM_Off) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll;
}
int32_t iNumCells = m_pDataAcc->GetNumberOfCells();
if (iNumCells > 0) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;
pWidget->SetLimit(iNumCells);
}
dwExtendedStyle |= GetAlignment();
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open ||
!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_ReadOnly;
}
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:25,代码来源:xfa_fftextedit.cpp
示例11: GetAlignment
void wxGenericStaticText::DoDrawLabel(wxDC& dc, const wxRect& rect)
{
#if wxUSE_MARKUP
if ( m_markupText )
m_markupText->Render(dc, rect, wxMarkupText::Render_ShowAccels);
else
#endif // wxUSE_MARKUP
dc.DrawLabel(m_label, rect, GetAlignment(), m_mnemonic);
}
开发者ID:Anonymous2,项目名称:project64,代码行数:9,代码来源:stattextg.cpp
示例12: wxT
wxString pgType::GetSql(ctlTree *browser)
{
if (sql.IsNull())
{
sql = wxT("-- Type: ") + GetQuotedFullIdentifier() + wxT("\n\n")
+ wxT("-- DROP TYPE ") + GetQuotedFullIdentifier() + wxT(";")
+ wxT("\n\nCREATE TYPE ") + GetQuotedFullIdentifier();
if (GetTypeClass() == TYPE_COMPOSITE)
{
sql += wxT(" AS\n (");
sql += GetQuotedTypesList();
}
else if (GetTypeClass() == TYPE_ENUM)
{
sql += wxT(" AS ENUM\n (");
sql += GetQuotedLabelList();
}
else
{
sql += wxT("\n (INPUT=") + qtIdent(GetInputFunction())
+ wxT(", OUTPUT=") + qtIdent(GetOutputFunction());
AppendIfFilled(sql, wxT(", DEFAULT="), qtDbString(GetDefault()));
if (!GetElement().IsNull())
{
sql += wxT(",\n ELEMENT=") + GetElement()
+ wxT(", DELIMITER='") + GetDelimiter() + wxT("'");
}
sql += wxT(",\n INTERNALLENGTH=") + NumToStr(GetInternalLength())
+ wxT(", ALIGNMENT=" + GetAlignment()
+ wxT(", STORAGE=") + GetStorage());
if (GetConnection()->BackendMinimumVersion(8, 3))
{
if (GetTypmodinFunction() != wxEmptyString && GetTypmodoutFunction() != wxEmptyString)
{
sql += wxT(",\n TYPMOD_IN=") + GetTypmodinFunction()
+ wxT(", TYPMOD_OUT=") + GetTypmodoutFunction();
}
else if (GetTypmodinFunction() != wxEmptyString)
sql += wxT(",\n TYPMOD_IN=") + GetTypmodinFunction();
else if (GetTypmodoutFunction() != wxEmptyString)
sql += wxT(",\n TYPMOD_OUT=") + GetTypmodoutFunction();
}
if (GetConnection()->BackendMinimumVersion(9, 1) && GetCollatable())
{
sql += wxT(",\n COLLATABLE=true");
}
}
sql += wxT(");\n")
+ GetOwnerSql(8, 0)
+ GetCommentSql();
if (GetConnection()->BackendMinimumVersion(9, 1))
sql += GetSeqLabelsSql();
}
return sql;
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:57,代码来源:pgType.cpp
示例13: PreFixUp
sbStatus sbMember::FixUp( sbSchema* schema, const sbMember* previous_member )
{
m_Type = PreFixUp( schema, m_TypeName );
size_t offset = previous_member ? previous_member->m_Offset + previous_member->GetTotalSize() : 0;
offset = FIX_ALIGNMENT( offset, GetAlignment() );
m_Offset = offset;
return sbStatus_Ok;
}
开发者ID:RonPieket,项目名称:StructuredBinary,代码行数:10,代码来源:sbMember.cpp
示例14: Hide
void OpGoToIntranetBar::Hide(BOOL focus_page)
{
if (GetAlignment() == ALIGNMENT_OFF)
return;
OpInfobar::Hide();
if (focus_page)
g_input_manager->InvokeAction(OpInputAction::ACTION_FOCUS_PAGE);
}
开发者ID:prestocore,项目名称:browser,代码行数:10,代码来源:OpGoToIntranetBar.cpp
示例15: GetAlignment
int CXTPReportColumn::GetFooterAlignment() const
{
if (m_nFooterAlignment != -1)
return m_nFooterAlignment;
if (GetColumns()->GetReportHeader()->GetPaintManager()->m_bUseColumnTextAlignment)
return GetAlignment();
return GetNormAlignment(DT_LEFT);
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:10,代码来源:XTPReportColumn.cpp
示例16: DefaultDeallocator
void SmallObjAllocator::Deallocate( void * p, std::size_t numBytes )
{
if ( NULL == p ) return;
if ( numBytes > GetMaxObjectSize() )
{
DefaultDeallocator( p );
return;
}
assert( NULL != pool_ );
if ( 0 == numBytes ) numBytes = 1;
const std::size_t index = GetOffset( numBytes, GetAlignment() ) - 1;
const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() );
assert( index < allocCount );
FixedAllocator & allocator = pool_[ index ];
assert( allocator.BlockSize() >= numBytes );
assert( allocator.BlockSize() < numBytes + GetAlignment() );
const bool found = allocator.Deallocate( p, true );
assert( found );
}
开发者ID:dudor,项目名称:pcmanager,代码行数:19,代码来源:SmallObj.cpp
示例17: ToggleVisibility
void OpExtensionsDevToolsToolbar::ToggleVisibility()
{
if (GetAlignment() == ALIGNMENT_OFF)
{
Show();
}
else
{
Hide();
}
}
开发者ID:prestocore,项目名称:browser,代码行数:12,代码来源:OpExtensionsDevToolsToolbar.cpp
示例18: GetAlignment
// Returns the alignment (in bytes) of the specified type.
static int GetAlignment(const Type* type, const TargetInfo* target = nullptr) {
if(auto intType = type->As<IntegerType>()) {
return target->GetAlignment(intType->GetSubtype());
}
else if(auto floatType = type->As<FloatingType>()) {
return target->GetAlignment(floatType->GetSubtype());
}
else if(auto pointerType = type->As<PointerType>()) {
DebugValidator::IsNotNull(target);
return target->GetPointerAlignment();
}
else if(auto arrayType = type->As<ArrayType>()) {
// The alignment of an array is the alignment of its element type.
return GetAlignment(arrayType->ElementType(), target);
}
else if(auto recordType = type->As<RecordType>()) {
// If the record has no members then we use the minimum allowed alignment.
if(recordType->FieldCount() == 0) {
return 0;
}
// The alignment of a record is the alignment of its largest field.
int max = -1;
const Type* maxType;
auto& fields = recordType->Fields();
for(int i = 0; i < fields.Count(); i++) {
int size = GetSize(fields[i].FieldType, target);
if(size > max) {
max = size;
maxType = fields[i].FieldType;
}
}
return GetAlignment(maxType, target);
}
return 0;
}
开发者ID:lgratian,项目名称:compiler,代码行数:41,代码来源:TypeInfo.hpp
示例19: addon
wxString SectionFieldDescriptor::Format(wxString& value)
{
if ( value.Length() > GetSize() ) {
return value.Truncate(GetSize());
} else {
wxString addon(GetFiller(), GetSize() - value.Length());
if ( GetAlignment() == FA_LEFT ) {
return value + addon;
} else {
return addon + value;
}
}
}
开发者ID:Skier,项目名称:vault_repo,代码行数:13,代码来源:ComposerDescriptor.cpp
示例20: dc
void
HtmlText::OnPaint(wxPaintEvent & evt)
{
wxPaintDC dc(this);
wxHtmlRenderingInfo info;
// Vertical align
// Horizontal align is taken care of in LayoutCell()
int y = m_padding;
int align = GetAlignment();
if (align & wxALIGN_CENTER_VERTICAL)
y = (GetClientSize().y - m_cell->GetHeight()) / 2;
else if (align & wxALIGN_BOTTOM)
y = GetClientSize().y - m_padding - m_cell->GetHeight();
// Draw the cell
m_cell->Draw(dc, m_padding, y, 0, INT_MAX, info);
}
开发者ID:mattprintz,项目名称:wx-xword,代码行数:16,代码来源:HtmlText.cpp
注:本文中的GetAlignment函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论