Updating comments per the C++ core guidelines and removing trailing whitespace (#194)
Fixed comments that were inconsistent with the style guidelines described in C++ core guidelines and the modern C++/WinRT language projections and removed trailing whitespace. Inserted a space after the beginning of the comment so the text wasn't touching the // on all occurrences. Removed all occurrences of trailing whitespace
This commit is contained in:
@@ -76,7 +76,7 @@ void CalculationResult::OnApplyTemplate()
|
||||
if (m_textContainer)
|
||||
{
|
||||
m_textContainer->SizeChanged += ref new SizeChangedEventHandler(this, &CalculationResult::TextContainerSizeChanged);
|
||||
// We want to know when the size of the container changes so
|
||||
// We want to know when the size of the container changes so
|
||||
// we can rescale the textbox
|
||||
m_textContainerLayoutChangedToken = m_textContainer->LayoutUpdated += ref new EventHandler<Object^>(this, &CalculationResult::OnTextContainerLayoutUpdated);
|
||||
|
||||
@@ -154,15 +154,15 @@ void CalculationResult::OnIsInErrorPropertyChanged(bool /*oldValue*/, bool newVa
|
||||
if (newValue)
|
||||
{
|
||||
// If there's an error message we need to override the normal display font
|
||||
// with the font appropriate for this language. This is because the error
|
||||
// with the font appropriate for this language. This is because the error
|
||||
// message is localized and therefore can contain characters that are not
|
||||
// available in the normal font.
|
||||
// available in the normal font.
|
||||
// We use UIText as the font type because this is the most common font type to use
|
||||
m_textBlock->FontFamily = LocalizationService::GetInstance()->GetLanguageFontFamilyForType(LanguageFontType::UIText);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The error result is no longer an error so we will restore the
|
||||
// The error result is no longer an error so we will restore the
|
||||
// value to FontFamily property to the value provided in the style
|
||||
// for the TextBlock in the template.
|
||||
m_textBlock->ClearValue(TextBlock::FontFamilyProperty);
|
||||
@@ -175,7 +175,7 @@ void CalculationResult::UpdateVisualState()
|
||||
{
|
||||
VisualStateManager::GoToState(this, "Active", true);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
VisualStateManager::GoToState(this, "Normal", true);
|
||||
}
|
||||
@@ -192,8 +192,8 @@ void CalculationResult::UpdateTextState()
|
||||
String^ oldText = m_textBlock->Text;
|
||||
String^ newText = Utils::LRO + DisplayValue + Utils::PDF;
|
||||
|
||||
//Initiate the scaling operation
|
||||
//UpdateLayout will keep calling us until we make it through the below 2 if-statements
|
||||
// Initiate the scaling operation
|
||||
// UpdateLayout will keep calling us until we make it through the below 2 if-statements
|
||||
if (!m_isScalingText || oldText != newText)
|
||||
{
|
||||
m_textBlock->Text = newText;
|
||||
@@ -329,17 +329,17 @@ void CalculationResult::ShowHideScrollButtons(::Visibility vLeft, ::Visibility v
|
||||
void CalculationResult::UpdateScrollButtons()
|
||||
{
|
||||
// When the width is smaller than the container, don't show any
|
||||
if (m_textBlock->ActualWidth < m_textContainer->ActualWidth)
|
||||
if (m_textBlock->ActualWidth < m_textContainer->ActualWidth)
|
||||
{
|
||||
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Collapsed);
|
||||
}
|
||||
// We have more number on both side. Show both arrows
|
||||
else if (m_textContainer->HorizontalOffset > 0 && m_textContainer->HorizontalOffset < (m_textContainer->ExtentWidth - m_textContainer->ViewportWidth))
|
||||
else if (m_textContainer->HorizontalOffset > 0 && m_textContainer->HorizontalOffset < (m_textContainer->ExtentWidth - m_textContainer->ViewportWidth))
|
||||
{
|
||||
ShowHideScrollButtons(::Visibility::Visible, ::Visibility::Visible);
|
||||
}
|
||||
// Width is larger than the container and left most part of the number is shown. Should be able to scroll left.
|
||||
else if (m_textContainer->HorizontalOffset == 0)
|
||||
else if (m_textContainer->HorizontalOffset == 0)
|
||||
{
|
||||
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Visible);
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ void CalculatorButton::OnKeyUp(KeyRoutedEventArgs^ e)
|
||||
}
|
||||
|
||||
void CalculatorButton::OnButtonIdPropertyChanged(
|
||||
NumbersAndOperatorsEnum /*oldValue*/,
|
||||
NumbersAndOperatorsEnum /*oldValue*/,
|
||||
NumbersAndOperatorsEnum newValue)
|
||||
{
|
||||
this->CommandParameter = ref new CalculatorButtonPressedEventArgs(AuditoryFeedback, newValue);
|
||||
|
@@ -13,7 +13,7 @@ namespace CalculatorApp
|
||||
public ref class CalculatorButton sealed: Windows::UI::Xaml::Controls::Button
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CalculatorButton();
|
||||
DEPENDENCY_PROPERTY_OWNER(CalculatorButton);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ void FlipButtons::OnKeyUp(KeyRoutedEventArgs^ e)
|
||||
}
|
||||
|
||||
void FlipButtons::OnButtonIdPropertyChanged(
|
||||
NumbersAndOperatorsEnum /*oldValue*/,
|
||||
NumbersAndOperatorsEnum /*oldValue*/,
|
||||
NumbersAndOperatorsEnum newValue)
|
||||
{
|
||||
this->CommandParameter = newValue;
|
||||
|
@@ -29,7 +29,7 @@ namespace CalculatorApp
|
||||
private:
|
||||
|
||||
void OnButtonIdPropertyChanged(
|
||||
NumbersAndOperatorsEnum oldValue,
|
||||
NumbersAndOperatorsEnum oldValue,
|
||||
NumbersAndOperatorsEnum newValue);
|
||||
};
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
|
||||
void OperandTextBox::OnApplyTemplate()
|
||||
{
|
||||
{
|
||||
this->IsEnabled = false;
|
||||
this->IsHitTestVisible = false;
|
||||
this->IsTapEnabled = false;
|
||||
|
@@ -34,22 +34,22 @@ void OverflowTextBlock::OnApplyTemplate()
|
||||
|
||||
m_expressionContainer = safe_cast<ScrollViewer^>(GetTemplateChild("expressionContainer"));
|
||||
m_expressionContainer->ChangeView(m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth, nullptr, nullptr);
|
||||
|
||||
|
||||
m_scrollLeft = safe_cast<Button^>(GetTemplateChild("scrollLeft"));
|
||||
m_scrollRight = safe_cast<Button^>(GetTemplateChild("scrollRight"));
|
||||
|
||||
|
||||
m_scrollLeftClickEventToken = m_scrollLeft->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
|
||||
m_scrollRightClickEventToken = m_scrollRight->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
|
||||
|
||||
m_scrollingLeft = false;
|
||||
m_scrollingRight = false;
|
||||
|
||||
|
||||
auto borderContainer = safe_cast<Border^>(GetTemplateChild("expressionborder"));
|
||||
m_pointerEnteredEventToken = borderContainer->PointerEntered += ref new PointerEventHandler(this, &OverflowTextBlock::OnPointerEntered);
|
||||
m_pointerExitedEventToken = borderContainer->PointerExited += ref new PointerEventHandler(this, &OverflowTextBlock::OnPointerExited);
|
||||
|
||||
m_listView = safe_cast<ListView^>(GetTemplateChild("TokenList"));
|
||||
|
||||
|
||||
UpdateAllState();
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,7 @@ namespace CalculatorApp
|
||||
public ref class OverflowTextBlock sealed : public Windows::UI::Xaml::Controls::Control
|
||||
{
|
||||
public:
|
||||
OverflowTextBlock()
|
||||
OverflowTextBlock()
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user