ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/dclient/src/backend/ndk/frame.cpp
(Generate patch)

Comparing deliantra/dclient/src/backend/ndk/frame.cpp (file contents):
Revision 1.1 by sf-pippijn, Sun Oct 17 08:15:08 2010 UTC vs.
Revision 1.4 by sf-pippijn, Sun Oct 24 20:31:51 2010 UTC

1/* frame.cc 1/* frame.cc
2 * This file is part of NDK++ library 2 * This file is part of NDK++ library
3 * Copyright (c) 2003,2004 by Stanislav Ievlev 3 * Copyright (c) 2003,2004 by Stanislav Ievlev
4 * 4 *
5 * This file is covered by the GNU Library General Public License, 5 * This file is covered by the GNU Library General Public License,
6 * which should be included with libndk++ as the file COPYING. 6 * which should be included with libndk as the file COPYING.
7 */ 7 */
8 8
9#include <ncurses/pen.hh> 9#include <ndk/pen.hh>
10#include <ndk++/frame.hh> 10#include <ndk/frame.hh>
11#include <ndk++/palette.hh> 11#include <ndk/palette.hh>
12 12
13 13
14ndk::frame::frame (std::string const &title, panel *parent) 14ndk::frame::frame (std::string const &title, panel *parent)
15 : panel (parent) 15 : panel (parent)
16 , title_ (title) 16 , title_ (title)
22void 22void
23ndk::frame::draw () 23ndk::frame::draw ()
24{ 24{
25 panel::draw (); 25 panel::draw ();
26 26
27 ncurses::pen p (*this); 27 pen p (*this);
28 p.clear (); 28 p.clear ();
29 29
30 p.set_color (palette::instance ()[active_ ? colors::frame1 : colors::frame2]); 30 p.set_color (palette::instance ().find (active_ ? colors::frame1 : colors::frame2)->second);
31 p.frame (); 31 p.frame ();
32 if (!title_.empty ()) 32 if (!title_.empty ())
33 p.title (title_.substr (0, width () - 2)); 33 p.title (title_.substr (0, width () - 2));
34 p.set_color (palette::instance ()[colors::frame2]); 34 p.set_color (palette::instance ().find (colors::frame2)->second);
35} 35}
36 36
37int 37int
38ndk::frame::padding () const 38ndk::frame::padding () const
39{ 39{
40 return 1; 40 return 1;
41}
42
43std::string const &
44ndk::frame::title () const
45{
46 return title_;
41} 47}
42 48
43void 49void
44ndk::frame::set_title (std::string const &title) 50ndk::frame::set_title (std::string const &title)
45{ 51{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines