Пример #1
0
int
attr_off(attr_t at, void *opts)
{
	(void) wattr_off(stdscr, at, opts);

	return (OK);
}
Пример #2
0
void lynx_standout( int flag )
{
  if ( flag )
  {
    wattr_on( LYwin, 262144, 0 );
  }
  else
  {
    wattr_off( LYwin, 262144, 0 );
  }
  return;
}
Пример #3
0
int
slk_attr_off(const attr_t at, void *opts)
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_attr_off(%x, %p)", at, opts);
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0)
		code = wattr_off(__m_screen->_slk._w, at, opts);

	return __m_return_code("slk_attr_off", code);
}
Пример #4
0
void CListWidget::update(int c)
{
	if(_visible)
	{
		uint tw = _size.width();
		uint th = _size.height();

		if(focused())
		{		
#ifdef __PDCURSES__
			// Mouse wheel scrolling
			if(c == KEY_MOUSE && _count > th)
			{
				if(Mouse_status.changes == MOUSE_WHEEL_DOWN)
				{
					_scroll += 4;
					_changed = true;
				}
				else if(Mouse_status.changes == MOUSE_WHEEL_UP && _scroll >= 4)
				{
					_scroll -= 4;
					_changed = true;
				}
			}
#endif
		}

		if((_listenKeys || focused()) && _count > th)
		{
			if(c == KEY_NPAGE)	// PAGE DOWN
			{
				_scroll += 4;
				_changed = true;
			}
			else if(c == KEY_PPAGE && _scroll >= 4)	// PAGE UP
			{
				_scroll -= 4;
				_changed = true;
			}
		}

		if(_changed)
		{
			move_panel(_panel, _pos.y(), _pos.x());
			top_panel(_panel);
			wclear(_window);

			if((_count < th && _scroll < _count) || (_count > th && _scroll > _count)) _scroll = _count;
			if(_count > th && _scroll < th) _scroll = th;

			uint b = 0, n = 0;

			for(uint i = 0; i < _items.size() && i < _scroll + b; ++i)
			{
				if(_items[i]->nocrlf()) b++;

				if(!_items[i]->nocrlf())
					n = 0;

				const string &message = _items[i]->text();

				for(uint j = 0; j < _leftMargin; ++j)
					waddch(_window, ' ');

				attr_t a = attribute(_items[i]->backgroundColor(), _items[i]->foregroundColor(), _items[i]->bold());
				wattr_on(_window, a, 0);

				n++;

				for(uint j = 0; j < message.size(); ++j, n++)
				{
					if(n >= tw - _leftMargin - _rightMargin)
					{
						n = 0;
						wattr_off(_window, a, 0);
						waddch(_window, '\n');
						for(uint j = 0; j < _leftMargin; ++j)
							waddch(_window, ' ');
						wattr_on(_window, a, 0);
					}

					waddch(_window, toULong(message[j]));
				}

				wattr_off(_window, a, 0);

				if(i < _scroll + b - 1 && i != _items.size() - 1 && !_items[i]->nocrlf())
					waddch(_window, '\n');
			}

			_changed = false;
		}
	}
}
Пример #5
0
NCURSES_EXPORT(int) (attroff) (int z)
{
	T((T_CALLED("attroff(%s)"), _traceattr2(0,(chtype)z)));
	returnCode(wattr_off(stdscr, (attr_t)((z)), ((void *)0)));
}
Пример #6
0
NCURSES_EXPORT(int) (attr_off) (attr_t a1, void * z)
{
	T((T_CALLED("attr_off(%s,%p)"), _traceattr2(0,a1), (const void *)z)); returnCode(wattr_off(stdscr,a1,z));
}
Пример #7
0
NCURSES_EXPORT(int) (wattroff) (WINDOW * a1, int z)
{
	T((T_CALLED("wattroff(%p,%d)"), (const void *)a1, z)); returnCode(wattr_off(a1, (attr_t)(z), ((void *)0)));
}
Пример #8
0
void CTabWidget::update(int c)
{
	if(_visible)
	{
		move_panel(_panel, _pos.y(), _pos.x());
		//top_panel(_panel);
		wclear(_window);

		if(_listenKeys)
		{
			if(c == KEY_LEFT)
			{
				if(currentIndex() - 1 >= 0)
					setCurrentIndex(currentIndex() - 1);
				else
					setCurrentIndex(count() - 1);
			}
			else if(c == KEY_RIGHT)
			{
				if(currentIndex() + 1 < int(count()))
					setCurrentIndex(currentIndex() + 1);
				else
					setCurrentIndex(0);
			}
		}

		uint tw = _size.width() - _leftMargin - _rightMargin;

		// Is left mouse button pressed?
#ifdef __PDCURSES__
		bool leftClick = focused() && Mouse_status.button[0] == BUTTON_PRESSED;
#else
		bool leftClick = false;
		MEVENT event;
		if(getmouse(&event) == OK)
			leftClick = focused() && (event.bstate & BUTTON1_PRESSED);
#endif

		int k = 0;
		for(uint i = 0; i < _widgets.size(); ++i)
		{
			if(leftClick)
			{
				if(_mousePos.x() >= _pos.x() + _leftMargin + k &&
				   _mousePos.x() < _pos.x() + _leftMargin + k + _widgets[i]->name().size() &&
				   _mousePos.y() == (_bottom ? _pos.y() + _size.height() - 1 : _pos.y()))
				{
					// select tab
					setCurrentIndex(i);
				}
			}

			if(currentIndex() == i)
				wattr_on(_window, A_BOLD, 0);

			mvwaddstr(_window, _bottom ? _size.height() - 1 : 0, _leftMargin + k, _widgets[i]->name().c_str());

			if(_currentIndex == i)
				wattr_off(_window, A_BOLD, 0);

			k += _widgets[i]->name().size() + 1;
		}

		if(_layout)
		{
			if(_changed)
			{
				DEBUG_ui("CTabWidget::update, 0");
				_layout->setSize(_size.width(), _size.height() - 1);
				_layout->setPosition(_pos.x(), _bottom ? _pos.y() : _pos.y() + 1);
				_changed = false;
				DEBUG_ui("CTabWidget::update, 1");
			}

			_layout->update(c);
		}
	}
}
Пример #9
0
void lynx_stop_underline( void )
{
  wattr_off( LYwin, 131072, 0 );
  return;
}
Пример #10
0
void lynx_stop_reverse( void )
{
  wattr_off( LYwin, 262144, 0 );
  return;
}
Пример #11
0
void lynx_stop_bold( void )
{
  wattr_off( LYwin, 2097152, 0 );
  return;
}