From 1a3dcbfe17d5bbaa26a702381ef717ba779898d7 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Mon, 21 Sep 2009 01:34:37 +0200 Subject: [PATCH] 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. --- src/menu.h | 8 ++++---- src/window.h | 40 ++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/menu.h b/src/menu.h index e5f20534..a832a3e6 100644 --- a/src/menu.h +++ b/src/menu.h @@ -737,10 +737,10 @@ template void NCurses::Menu::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 void NCurses::Menu::Refresh() if (highlightEnabled && int(i) == itsHighlight) { *this << clEnd; - Reverse(0); + *this << fmtReverseEnd; } if ((*itsOptionsPtr)[i]->isBold) - Window::Bold(0); + *this << fmtBoldEnd; line++; } Window::Refresh(); diff --git a/src/window.h b/src/window.h index 96df44ad..f401f143 100644 --- a/src/window.h +++ b/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 *itsHistory;