mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
CHintBox: add possibility to left hintbox with RC_up and RC_down
RC_up and RC_down are used for text scroll, but most message texts
are small and no scroll mode is required. In case of large texts
it should falling back to scroll mode.
Origin commit data
------------------
Commit: 1d8de839d5
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-01-10 (Tue, 10 Jan 2017)
This commit is contained in:
@@ -134,6 +134,8 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string
|
|||||||
|
|
||||||
hb_font = MSG_FONT;
|
hb_font = MSG_FONT;
|
||||||
|
|
||||||
|
enable_txt_scroll = false;
|
||||||
|
|
||||||
//enable shadow
|
//enable shadow
|
||||||
shadow = CC_SHADOW_ON;
|
shadow = CC_SHADOW_ON;
|
||||||
|
|
||||||
@@ -219,10 +221,14 @@ int CHintBox::exec()
|
|||||||
}
|
}
|
||||||
else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))
|
else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))
|
||||||
{
|
{
|
||||||
if (msg == CRCInput::RC_up)
|
if (enable_txt_scroll){
|
||||||
this->scroll_up();
|
if (msg == CRCInput::RC_up)
|
||||||
|
this->scroll_up();
|
||||||
|
else
|
||||||
|
this->scroll_down();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
this->scroll_down();
|
res = messages_return::cancel_all;
|
||||||
}
|
}
|
||||||
else if (CNeutrinoApp::getInstance()->listModeKey(msg)){
|
else if (CNeutrinoApp::getInstance()->listModeKey(msg)){
|
||||||
// do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!!
|
// do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!!
|
||||||
@@ -274,6 +280,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const
|
|||||||
if (h_lines > h_hint_obj){
|
if (h_lines > h_hint_obj){
|
||||||
txt_mode = text_mode | CTextBox::SCROLL;
|
txt_mode = text_mode | CTextBox::SCROLL;
|
||||||
ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_UP | CComponentsHeader::CC_BTN_DOWN;
|
ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_UP | CComponentsHeader::CC_BTN_DOWN;
|
||||||
|
enable_txt_scroll = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* define y start position of infobox inside body */
|
/* define y start position of infobox inside body */
|
||||||
|
@@ -60,6 +60,7 @@ class CHintBox : public CComponentsWindow
|
|||||||
int y_hint_obj;
|
int y_hint_obj;
|
||||||
int h_hint_obj;
|
int h_hint_obj;
|
||||||
int w_indentation;
|
int w_indentation;
|
||||||
|
bool enable_txt_scroll;
|
||||||
|
|
||||||
Font* hb_font;
|
Font* hb_font;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user