|
From: <ufo...@li...> - 2010-06-20 23:00:36
|
Revision: 1152
http://ufo2000.svn.sourceforge.net/ufo2000/?rev=1152&view=rev
Author: ssvb
Date: 2010-06-20 23:00:30 +0000 (Sun, 20 Jun 2010)
Log Message:
-----------
Added possibility to hide empty text entry line for chat windows
This can save some of the precious screen space when working
with low resolution (640x480 is the minimally supported screen
resolution at the moment). Also it may be handly when user input
is not needed (a window with some informational text messages).
From: Siarhei Siamashka <sia...@gm...>
Modified Paths:
--------------
trunk/src/wind.cpp
trunk/src/wind.h
Modified: trunk/src/wind.cpp
===================================================================
--- trunk/src/wind.cpp 2010-06-20 22:35:38 UTC (rev 1151)
+++ trunk/src/wind.cpp 2010-06-20 23:00:30 UTC (rev 1152)
@@ -32,6 +32,7 @@
m_height = text_height(font);
m_font = font;
m_color = color;
+ m_hide_when_empty = false;
}
ConsoleStatusLine::~ConsoleStatusLine()
@@ -273,7 +274,10 @@
return false;
}
}
+ int old_height = m_status_line->get_height();
m_status_line->process_keyboard_input(keycode, scancode);
+ if (m_status_line->get_height() != old_height)
+ set_full_redraw();
return false;
}
Modified: trunk/src/wind.h
===================================================================
--- trunk/src/wind.h 2010-06-20 22:35:38 UTC (rev 1151)
+++ trunk/src/wind.h 2010-06-20 23:00:30 UTC (rev 1152)
@@ -76,6 +76,7 @@
std::string m_text;
FONT *m_font;
int m_color;
+ bool m_hide_when_empty;
bool backspace();
@@ -85,7 +86,13 @@
virtual void redraw_full(BITMAP *bmp, int x, int y);
virtual bool resize(int width, int height);
+ virtual int get_height() const
+ {
+ return m_hide_when_empty && m_text.empty() ? 0 : m_height;
+ }
+ void hide_when_empty() { m_hide_when_empty = true; }
+ void show_when_empty() { m_hide_when_empty = false; }
bool process_keyboard_input(int keycode, int scancode);
const std::string &get_text() const { return m_text; }
@@ -136,6 +143,8 @@
#endif
;
+ void hide_empty_status_line() { m_status_line->hide_when_empty(); }
+ void show_empty_status_line() { m_status_line->show_when_empty(); }
bool process_keyboard_input(int keycode, int scancode);
const char *get_text();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|