38 #include <wx/button.h>
74 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
89 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
90 wxDialog::Create( parent,
id, caption, pos,
size, style );
95 GetSizer()->SetSizeHints(
this);
137 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
138 itemDialog1->SetSizer(itemBoxSizer2);
140 m_BeforePunct =
new wxCheckBox( itemDialog1,
wxID_ANY,
_(
"Capital letters before punctuation should remain capitalized"), wxDefaultPosition, wxDefaultSize, 0 );
144 m_BeforeCap =
new wxCheckBox( itemDialog1,
wxID_ANY,
_(
"Capital letters before other capital letters should remain capitalized"), wxDefaultPosition, wxDefaultSize, 0 );
146 itemBoxSizer2->Add(
m_BeforeCap, 0, wxALIGN_LEFT|wxALL, 5);
148 m_BeforeNum =
new wxCheckBox( itemDialog1,
wxID_ANY,
_(
"Capital letters before numbers should remain capitalized"), wxDefaultPosition, wxDefaultSize, 0 );
150 itemBoxSizer2->Add(
m_BeforeNum, 0, wxALIGN_LEFT|wxALL, 5);
152 m_RmCommas =
new wxCheckBox( itemDialog1,
wxID_ANY,
_(
"Commas should be removed"), wxDefaultPosition, wxDefaultSize, 0 );
154 itemBoxSizer2->Add(
m_RmCommas, 0, wxALIGN_LEFT|wxALL, 5);
156 m_KeepLast =
new wxCheckBox( itemDialog1,
wxID_ANY,
_(
"Keep caps single letter at the end"), wxDefaultPosition, wxDefaultSize, 0 );
158 itemBoxSizer2->Add(
m_KeepLast, 0, wxALIGN_LEFT|wxALL, 5);
160 wxBoxSizer* itemBoxSizer12 =
new wxBoxSizer(wxHORIZONTAL);
161 itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
163 wxButton* itemButton13 =
new wxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
164 itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
166 wxButton* itemButton14 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
167 itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
221 bool modified =
false;
226 string new_name = *name;
227 FixCaps(new_name, before_punct, before_cap, before_num, rm_commas, keep_last);
228 modified |= new_name != *name;
240 bool modified =
false;
244 FixCaps(new_name, before_punct, before_cap, before_num, rm_commas, keep_last);
246 new_feat->
SetData().SetRna().SetExt().SetName() = new_name;
251 FixCaps(new_name, before_punct, before_cap, before_num, rm_commas, keep_last);
253 new_feat->
SetData().SetRna().SetExt().SetGen().SetProduct() = new_name;
270 "coproporphyrinogen III",
316 "Mg\\-protoporphyrin IX",
362 size_t len = name.size();
363 for (
size_t i = 0;
i <
len;
i++)
void AddCommand(IEditCommand &command)
static void FixCaps(string &name, bool before_punct, bool before_cap, bool before_num, bool rm_commas, bool keep_last)
CFixProductNames()
Constructors.
wxCheckBox * m_BeforePunct
CRef< CCmdComposite > GetCommand()
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Fix Product Names"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
CSeq_entry_Handle m_TopSeqEntry
static CRef< CCmdComposite > apply(CSeq_entry_Handle tse, bool before_punct=false, bool before_cap=false, bool before_num=false, bool rm_commas=false, bool keep_last=false)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
static bool ShowToolTips()
Should we show tooltips?
~CFixProductNames()
Destructor.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
namespace ncbi::objects::
void FixAbbreviationsInElement(string &result, bool fix_end_of_sentence=true)
static const char * capitalized_names[]
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
size_t Replace(CTempStringEx search, CTempString replace, CRegexp::TCompile compile_flags=CRegexp::fCompile_default, CRegexp::TMatch match_flags=CRegexp::fMatch_default, size_t max_replace=0)
Replace occurrences of a substring within a string by pattern.
string GetResult(void)
Get result string.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
bool IsSetProduct(void) const
Check if a value has been assigned to Product data member.
bool IsSetExt(void) const
generic fields for ncRNA, tmRNA, miscRNA Check if a value has been assigned to Ext data member.
bool IsGen(void) const
Check if variant Gen is selected.
const TGen & GetGen(void) const
Get the variant data.
const TName & GetName(void) const
Get the variant data.
const TProduct & GetProduct(void) const
Get the Product member data.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsName(void) const
Check if variant Name is selected.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsProt(void) const
Check if variant Prot is selected.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TProt & GetProt(void) const
Get the variant data.
const TRna & GetRna(void) const
Get the variant data.
bool IsRna(void) const
Check if variant Rna is selected.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
const struct ncbi::grid::netcache::search::fields::SIZE size
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define EDIT_EACH_NAME_ON_PROTREF(Itr, Var)
C++ wrappers for the Perl-compatible regular expression (PCRE) library.