mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-22 08:58:43 +00:00
Added: clear_on_escape property to edit box
--HG-- branch : develop
This commit is contained in:
parent
71d969c40b
commit
455a923031
3 changed files with 26 additions and 0 deletions
|
@ -264,6 +264,7 @@ namespace NLGUI
|
||||||
// because of multiline, thz parent container will be moved to top
|
// because of multiline, thz parent container will be moved to top
|
||||||
// The good position can be restored by a press on enter then
|
// The good position can be restored by a press on enter then
|
||||||
bool _WantReturn : 1; // Want return char, don't call the enter action handler
|
bool _WantReturn : 1; // Want return char, don't call the enter action handler
|
||||||
|
bool _ClearOnEscape : 1; // clear content when ESC is pressed?
|
||||||
bool _Savable : 1; // should content be saved ?
|
bool _Savable : 1; // should content be saved ?
|
||||||
bool _DefaultInputString : 1; // Is the current input string the default one (should not be edited)
|
bool _DefaultInputString : 1; // Is the current input string the default one (should not be edited)
|
||||||
bool _Frozen : 1; // is the control frozen? (cannot edit in it)
|
bool _Frozen : 1; // is the control frozen? (cannot edit in it)
|
||||||
|
|
|
@ -77,6 +77,7 @@ namespace NLGUI
|
||||||
_ResetFocusOnHide(false),
|
_ResetFocusOnHide(false),
|
||||||
_BackupFatherContainerPos(false),
|
_BackupFatherContainerPos(false),
|
||||||
_WantReturn(false),
|
_WantReturn(false),
|
||||||
|
_ClearOnEscape(false),
|
||||||
_Savable(true),
|
_Savable(true),
|
||||||
_DefaultInputString(false),
|
_DefaultInputString(false),
|
||||||
_Frozen(false),
|
_Frozen(false),
|
||||||
|
@ -239,6 +240,11 @@ namespace NLGUI
|
||||||
return toString( _WantReturn );
|
return toString( _WantReturn );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( name == "clear_on_escape" )
|
||||||
|
{
|
||||||
|
return toString( _ClearOnEscape );
|
||||||
|
}
|
||||||
|
else
|
||||||
if( name == "savable" )
|
if( name == "savable" )
|
||||||
{
|
{
|
||||||
return toString( _Savable );
|
return toString( _Savable );
|
||||||
|
@ -413,6 +419,14 @@ namespace NLGUI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( name == "clear_on_escape" )
|
||||||
|
{
|
||||||
|
bool b;
|
||||||
|
if( fromString( value, b ) )
|
||||||
|
_ClearOnEscape = b;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
if( name == "savable" )
|
if( name == "savable" )
|
||||||
{
|
{
|
||||||
bool b;
|
bool b;
|
||||||
|
@ -514,6 +528,7 @@ namespace NLGUI
|
||||||
xmlSetProp( node, BAD_CAST "backup_father_container_pos",
|
xmlSetProp( node, BAD_CAST "backup_father_container_pos",
|
||||||
BAD_CAST toString( _BackupFatherContainerPos ).c_str() );
|
BAD_CAST toString( _BackupFatherContainerPos ).c_str() );
|
||||||
xmlSetProp( node, BAD_CAST "want_return", BAD_CAST toString( _WantReturn ).c_str() );
|
xmlSetProp( node, BAD_CAST "want_return", BAD_CAST toString( _WantReturn ).c_str() );
|
||||||
|
xmlSetProp( node, BAD_CAST "clear_on_escape", BAD_CAST toString( _ClearOnEscape ).c_str() );
|
||||||
xmlSetProp( node, BAD_CAST "savable", BAD_CAST toString( _Savable ).c_str() );
|
xmlSetProp( node, BAD_CAST "savable", BAD_CAST toString( _Savable ).c_str() );
|
||||||
xmlSetProp( node, BAD_CAST "max_float_prec", BAD_CAST toString( _MaxFloatPrec ).c_str() );
|
xmlSetProp( node, BAD_CAST "max_float_prec", BAD_CAST toString( _MaxFloatPrec ).c_str() );
|
||||||
|
|
||||||
|
@ -620,6 +635,9 @@ namespace NLGUI
|
||||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"want_return" );
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"want_return" );
|
||||||
if (prop) _WantReturn = convertBool(prop);
|
if (prop) _WantReturn = convertBool(prop);
|
||||||
|
|
||||||
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"clear_on_escape" );
|
||||||
|
if (prop) _ClearOnEscape = convertBool(prop);
|
||||||
|
|
||||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"savable" );
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"savable" );
|
||||||
if (prop) _Savable = convertBool(prop);
|
if (prop) _Savable = convertBool(prop);
|
||||||
|
|
||||||
|
@ -991,6 +1009,11 @@ namespace NLGUI
|
||||||
// stop selection
|
// stop selection
|
||||||
_CurrSelection = NULL;
|
_CurrSelection = NULL;
|
||||||
_CursorAtPreviousLineEnd = false;
|
_CursorAtPreviousLineEnd = false;
|
||||||
|
if (_ClearOnEscape)
|
||||||
|
{
|
||||||
|
setInputString(ucstring(""));
|
||||||
|
triggerOnChangeAH();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case KeyTAB:
|
case KeyTAB:
|
||||||
makeTopWindow();
|
makeTopWindow();
|
||||||
|
|
|
@ -2655,6 +2655,7 @@
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
|
clear_on_escape="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
continuous_text_update="false"
|
continuous_text_update="false"
|
||||||
bg_texture="W_box_blank.tga"
|
bg_texture="W_box_blank.tga"
|
||||||
|
@ -2695,6 +2696,7 @@
|
||||||
menu_r="#menu_r"
|
menu_r="#menu_r"
|
||||||
max_historic="#max_historic"
|
max_historic="#max_historic"
|
||||||
want_return="#want_return"
|
want_return="#want_return"
|
||||||
|
clear_on_escape="#clear_on_escape"
|
||||||
backup_father_container_pos="#backup_father_container_pos"
|
backup_father_container_pos="#backup_father_container_pos"
|
||||||
on_focus_lost="#on_focus_lost"
|
on_focus_lost="#on_focus_lost"
|
||||||
on_focus_lost_params="#on_focus_lost_params"
|
on_focus_lost_params="#on_focus_lost_params"
|
||||||
|
|
Loading…
Reference in a new issue