set attributes in Menu::Refresh() by operators<<()
this also makes Window::{Bold,UnderLine,Reverse,Altcharset} private.
these should only be called by internals of Window class.
This commit is contained in:
@@ -737,10 +737,10 @@ template <typename T> void NCurses::Menu<T>::Refresh()
|
||||
continue;
|
||||
}
|
||||
if ((*itsOptionsPtr)[i]->isBold)
|
||||
Window::Bold(1);
|
||||
*this << fmtBold;
|
||||
if (highlightEnabled && int(i) == itsHighlight)
|
||||
{
|
||||
Reverse(1);
|
||||
*this << fmtReverse;
|
||||
*this << itsHighlightColor;
|
||||
}
|
||||
if ((*itsOptionsPtr)[i]->isSelected && itsSelectedPrefix)
|
||||
@@ -753,10 +753,10 @@ template <typename T> void NCurses::Menu<T>::Refresh()
|
||||
if (highlightEnabled && int(i) == itsHighlight)
|
||||
{
|
||||
*this << clEnd;
|
||||
Reverse(0);
|
||||
*this << fmtReverseEnd;
|
||||
}
|
||||
if ((*itsOptionsPtr)[i]->isBold)
|
||||
Window::Bold(0);
|
||||
*this << fmtBoldEnd;
|
||||
line++;
|
||||
}
|
||||
Window::Refresh();
|
||||
|
||||
40
src/window.h
40
src/window.h
@@ -469,26 +469,6 @@ namespace NCurses
|
||||
///
|
||||
class BadSize { };
|
||||
|
||||
/// Sets state of bold attribute (internal use only)
|
||||
/// @param bold_state state of bold attribute
|
||||
///
|
||||
void Bold(bool bold_state) const;
|
||||
|
||||
/// Sets state of underline attribute (internal use only)
|
||||
/// @param underline_state state of underline attribute
|
||||
///
|
||||
void Underline(bool underline_state) const;
|
||||
|
||||
/// Sets state of reverse attribute (internal use only)
|
||||
/// @param reverse_state state of reverse attribute
|
||||
///
|
||||
void Reverse(bool reverse_state) const;
|
||||
|
||||
/// Sets state of altcharset attribute (internal use only)
|
||||
/// @param altcharset_state state of altcharset attribute
|
||||
///
|
||||
void AltCharset(bool altcharset_state) const;
|
||||
|
||||
/// Sets colors of window (interal use only)
|
||||
/// @param fg foregound color
|
||||
/// @param bg background color
|
||||
@@ -559,6 +539,26 @@ namespace NCurses
|
||||
Border itsBorder;
|
||||
|
||||
private:
|
||||
/// Sets state of bold attribute (internal use only)
|
||||
/// @param bold_state state of bold attribute
|
||||
///
|
||||
void Bold(bool bold_state) const;
|
||||
|
||||
/// Sets state of underline attribute (internal use only)
|
||||
/// @param underline_state state of underline attribute
|
||||
///
|
||||
void Underline(bool underline_state) const;
|
||||
|
||||
/// Sets state of reverse attribute (internal use only)
|
||||
/// @param reverse_state state of reverse attribute
|
||||
///
|
||||
void Reverse(bool reverse_state) const;
|
||||
|
||||
/// Sets state of altcharset attribute (internal use only)
|
||||
/// @param altcharset_state state of altcharset attribute
|
||||
///
|
||||
void AltCharset(bool altcharset_state) const;
|
||||
|
||||
/// pointer to container used as history
|
||||
std::deque<std::wstring> *itsHistory;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user