本文整理汇总了C++中GetAlignment函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAlignment函数的具体用法?C++ GetAlignment怎么用?C++ GetAlignment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetAlignment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 );
}
示例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;
}
示例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);
}
示例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;
}
示例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 );
}
}
示例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();
}
示例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;
}
示例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);
}
示例9: OnAlignmentChanged
void OpExtensionsDevToolsToolbar::OnAlignmentChanged()
{
if (GetAlignment() == ALIGNMENT_OFF)
{
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}