<commit_before>// -*- C++ -*-
/* GG is a GUI for SDL and OpenGL.
   Copyright (C) 2003 <NAME>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
    
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA

   If you do not wish to comply with the terms of the LGPL please
   contact the author as other terms are available for a fee.
    
   <NAME>
   <EMAIL> */

/* $Header$ */

#ifndef _GGEdit_h_
#define _GGEdit_h_

#ifndef _GGTextControl_h_
#include "GGTextControl.h"
#endif

namespace GG {

/** This is a single-line text input control.
   This is a simple edit box control.  It shares the Text interface that StaticText and DynamicText use, so it 
   can be treated in many ways very similarly to a std::string.  The imlementation is very similar to DynamicText, 
   using a Font and a pre-calculated vector of Font::LineData structs (since this is a single-line edit box, the 
   vector should have exactly one element).  Note that the second set of constructors determine the height of 
   the control based on the height of the font used and the value of the constant PIXEL_MARGIN.  There are two
   types of signals emitted by an Edit control.  The first is EditedSignal(); this is emitted every time the
   contents of the Edit change.  Sometimes, however, you don't want that.  For instance, say you want to keep
   the value of the text in the Edit to between (numerical values) 100 and 300.  If the Edit currently reads "200", 
   the user may decide to highlight the "2", hit delete, then type a "1".  If updates are immediate, you will
   receive notification that the Edit says "00" (an invalid value), when that is just a temporary value you 
   don't care about.  In such situations the other signal, FocusUpdateSignal(), should be useful.  It is only 
   emitted when the Edit is losing the input focus and the contents have changed since it gained the input 
   focus.  So you would only receive a single update, namely "100", which is a valid number for that control, 
   and you would receive it only when it is certain that the user is finished editing the text (when the focus
   changes).  Note that both signals may be used at the same time, if desired.*/
class GG_API Edit : public TextControl<commit_msg>Fixed really old comment.<commit_after>// -*- C++ -*-
/* GG is a GUI for SDL and OpenGL.
   Copyright (C) 2003 <NAME>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
    
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA

   If you do not wish to comply with the terms of the LGPL please
   contact the author as other terms are available for a fee.
    
   <NAME>
   <EMAIL> */

/* $Header$ */

#ifndef _GGEdit_h_
#define _GGEdit_h_

#ifndef _GGTextControl_h_
#include "GGTextControl.h"
#endif

namespace GG {

/** This is a single-line text input control.
   This is a simple edit box control.  It inherits from TextControl, so it 
   can be treated in many ways very similarly to a std::string.  
   Note that the second set of constructors determine the height of 
   the control based on the height of the font used and the value of the constant PIXEL_MARGIN.  There are two
   types of signals emitted by an Edit control.  The first is EditedSignal(); this is emitted every time the
   contents of the Edit change.  Sometimes, however, you don't want that.  For instance, say you want to keep
   the value of the text in the Edit to between (numerical values) 100 and 300.  If the Edit currently reads "200", 
   the user may decide to highlight the "2", hit delete, then type a "1".  If updates are immediate, you will
   receive notification that the Edit says "00" (an invalid value), when that is just a temporary value you 
   don't care about.  In such situations the other signal, FocusUpdateSignal(), should be useful.  It is only 
   emitted when the Edit is losing the input focus and the contents have changed since it gained the input 
   focus.  So you would only receive a single update, namely "100", which is a valid number for that control, 
   and you would receive it only when it is certain that the user is finished editing the text (when the focus
   changes).  Note that both signals may be used at the same time, if desired.*/
class GG_API Edit : public TextControl
{'fraction_non_alphanumeric': 0.04694323144104803, 'fraction_numerical': 0.013100436681222707, 'mean_word_length': 3.3976, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '757676', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1393, 'n_words': 879}