wxWindowID
id,
constwxPoint& pos,
constwxSize&
size,
longstyle ) :
141SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
142wxPanel::Create( parent,
id, pos,
size, style );
147GetSizer()->SetSizeHints(
this);
188wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
189itemPanel1->SetSizer(itemBoxSizer2);
191wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
192itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
194wxHyperlinkCtrl* itemHyperlinkCtrl4 =
newwxHyperlinkCtrl( itemPanel1,
ID_ADDAUTH,
_(
"Add Author"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
195itemBoxSizer3->Add(itemHyperlinkCtrl4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
197wxHyperlinkCtrl* itemHyperlinkCtrl5 =
newwxHyperlinkCtrl( itemPanel1,
ID_ADDCONSORTIUM,
_(
"Add Consortium"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
198itemBoxSizer3->Add(itemHyperlinkCtrl5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
200wxHyperlinkCtrl* itemHyperlinkCtrl6 =
newwxHyperlinkCtrl( itemPanel1,
ID_IMPORT_AUTHORS,
_(
"Import Authors"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
201itemBoxSizer3->Add(itemHyperlinkCtrl6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
203wxHyperlinkCtrl* itemHyperlinkCtrl7 =
newwxHyperlinkCtrl( itemPanel1,
ID_IMPORT_AUTHORS_AFFILIATION,
_(
"Import Authors and Affiliation"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
204itemBoxSizer3->Add(itemHyperlinkCtrl7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
206wxStaticLine* itemStaticLine8 =
newwxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
207itemBoxSizer2->Add(itemStaticLine8, 0, wxGROW|wxALL, 5);
209wxBoxSizer* itemBoxSizer10 =
newwxBoxSizer(wxVERTICAL);
210itemBoxSizer2->Add(itemBoxSizer10, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
212wxBoxSizer* itemBoxSizer9 =
newwxBoxSizer(wxHORIZONTAL);
213itemBoxSizer10->Add(itemBoxSizer9, 0, wxALIGN_LEFT|wxALL, 5);
215wxStaticText* itemStaticText10 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"First Name"), wxDefaultPosition, wxSize(90, -1), wxALIGN_CENTRE );
216itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
218wxStaticText* itemStaticText11 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"M.I."), wxDefaultPosition, wxSize(90, -1), wxALIGN_CENTRE );
219itemBoxSizer9->Add(itemStaticText11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
221wxStaticText* itemStaticText12 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Last Name"), wxDefaultPosition, wxSize(90, -1), wxALIGN_CENTRE );
222itemBoxSizer9->Add(itemStaticText12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
224wxStaticText* itemStaticText13 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Suffix"), wxDefaultPosition, wxSize(50, -1), wxALIGN_CENTRE );
225itemBoxSizer9->Add(itemStaticText13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
227wxStaticText* itemStaticText14 =
newwxStaticText( itemPanel1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );
228itemBoxSizer9->Add(itemStaticText14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
230 m_ScrolledWindow=
newwxScrolledWindow( itemPanel1,
ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
235 m_Sizer=
newwxFlexGridSizer(0, 2, 0, 0);
240 if(name_list_exists)
242wxBoxSizer* itemBoxSizer4 =
newwxBoxSizer(wxHORIZONTAL);
243itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
245wxButton* itemButton1 =
newwxButton( itemPanel1,
ID_REPLACE_ALL_AUTHORS,
_(
"Replace All Authors"), wxDefaultPosition, wxDefaultSize, 0 );
246itemBoxSizer4->Add(itemButton1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
248wxButton* itemButton2 =
newwxButton( itemPanel1,
ID_REPLACE_SAME_AUTHORS,
_(
"Replace Same Authors"), wxDefaultPosition, wxDefaultSize, 0 );
249itemBoxSizer4->Add(itemButton2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
261 while(
m_Sizer->GetItemCount() > 0) {
263 m_Sizer->GetItem(pos)->DeleteWindows();
268 inttotal_height = 0;
271 intmax_rows_displayed = 6;
276auth != edited_auth_list.
SetNames().SetStd().end();
280}
else if((*auth)->GetName().IsName()) {
282 m_Sizer->Add(
row, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);
284itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());
285 m_Sizer->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);
287 introw_height, row_width;
288 row->GetClientSize(&row_width, &row_height);
289 if(row_width > total_width) {
290total_width = row_width;
292 if(num_rows < max_rows_displayed) {
293total_height += row_height;
299}
else if((*auth)->GetName().IsConsortium()) {
301 m_Sizer->Add(
row, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);
303itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());
304 m_Sizer->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);
306 introw_height, row_width;
307 row->GetClientSize(&row_width, &row_height);
308 if(row_width > total_width) {
309total_width = row_width;
311 if(num_rows < max_rows_displayed) {
312total_height += row_height;
325edited_auth_list.
SetNames().SetStd().push_back(auth);
328 introw_height, row_width;
329 row->GetClientSize(&row_width, &row_height);
330 if(row_width > total_width) {
331total_width = row_width;
333 if(num_rows < max_rows_displayed) {
334total_height += row_height;
348 if(!wxPanel::TransferDataToWindow())
357 boolis_empty =
true;
380 if(!wxPanel::TransferDataFromWindow())
386wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
387 for(; node !=
m_Sizer->GetChildren().end(); ++node) {
388wxWindow *w = (*node)->GetWindow();
394 if(singleauth_panel) {
395edited_auth = singleauth_panel->
GetAuthor();
399edited_auth = consort_panel->
GetAuthor();
403 if(edited_auth && (keep_blank || !
IsAuthorEmpty(*edited_auth))) {
405new_auth->
Assign(*edited_auth);
406edited_auth_list.
SetNames().SetStd().push_back(new_auth);
412 if(!edited_auth_list.
IsSetNames() || ! edited_auth_list.
SetNames().IsStd() || edited_auth_list.
SetNames().SetStd().empty())
415new_auth->
SetName().SetName().SetLast(
"?");
416edited_auth_list.
SetNames().SetStd().push_back(new_auth);
443edited_auth_list.
Assign(auth_list);
454 for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it)
456wxWindow* child = (**it).GetWindow();
473wxSizerItem* auth =
NULL;
477 for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it)
479wxWindow* child = (**it).GetWindow();
497 static bool s_IsLastRow(wxWindow* wnd, wxSizerItemList& itemList)
499 boolis_last =
false;
503 for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it)
505wxWindow* child = (**it).GetWindow();
516 if((auth1 || auth2) && is_last)
532wxSizerItemList& itemList =
m_Sizer->GetChildren();
537edited_auth_list.
SetNames().SetStd().push_back(auth);
546 if(event.GetURL() !=
wxT(
"delete")) {
550 DeleteRow((wxWindow*)event.GetEventObject());
559wxSizerItemList& itemList =
m_Sizer->GetChildren();
562wxSizerItemList::iterator it = itemList.begin();
563wxSizerItemList::iterator before = itemList.end();
565 while(it != itemList.end())
571 if(
row== row_num - 1)
577 if(row_num ==
row- 1)
580 if(before != itemList.end())
582wxSizerItemList::iterator after = before;
584 while(after != itemList.end())
593 if(after != itemList.end())
595 swap(*before, *after);
596(**before).GetWindow()->MoveBeforeInTabOrder((**after).GetWindow());
609wxSizerItemList& itemList =
m_Sizer->GetChildren();
612wxSizerItemList::iterator it = itemList.begin();
613 while(it != itemList.end())
615wxWindow *win = (**it).GetWindow();
618 if((auth1 || auth2) && link == win)
629 row->MoveBeforeInTabOrder(link);
637wxSizerItemList& itemList =
m_Sizer->GetChildren();
640wxSizerItemList::iterator it = itemList.begin();
641 while(it != itemList.end())
643wxWindow *win = (**it).GetWindow();
646 if((auth1 || auth2) && link == win)
653 while(it != itemList.end())
655wxWindow *win = (**it).GetWindow();
658 if((auth1 || auth2))
666 if(index == itemList.size()) {
674 row->MoveAfterInTabOrder(link);
680 m_Sizer->Insert(index,
row, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 0);
682itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());
683 m_Sizer->Insert(index + 1, itemHyperLink, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 0);
727edited_auth_list.
SetNames().SetStd().push_back(auth);
752edited_auth_list.
SetNames().SetStd().push_back(auth);
763 m_Sizer->Add(
row, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);
765itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());
766 m_Sizer->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);
774 row->GetClientSize(0, &row_height);
808wxFileDialog asn_open_file(
this,
wxT(
"Import authors and affiliation from file"),
m_WorkDir, wxEmptyString,
811wxFD_OPEN | wxFD_FILE_MUST_EXIST);
813 if(asn_open_file.ShowModal() == wxID_OK) {
814wxString path = asn_open_file.GetPath();
815 if(path.IsEmpty())
return;
824 string msg=
"Authors and affiliation could not be imported";
857wxNotebook* notebook =
dynamic_cast<wxNotebook*
>(this->GetParent());
864 for(
size_t i= 0;
i< notebook->GetPageCount(); ++
i) {
887wxWindow *win = GetParent();
902win = win->GetParent();
905 returncmd_processor;
911wxWindow *win = GetParent();
920win = win->GetParent();
948 boolmodified =
false;
954replacement->
Assign(*pub_it);
958 switch((*pub)->Which())
961(*pub)->SetGen().SetAuthors().SetNames(edited_names);
964(*pub)->SetArticle().SetAuthors().SetNames(edited_names);
967(*pub)->SetBook().SetAuthors().SetNames(edited_names);
970(*pub)->SetProc().SetBook().SetAuthors().SetNames(edited_names);
973(*pub)->SetSub().SetAuthors().SetNames(edited_names);
976(*pub)->SetPatent().SetAuthors().SetNames(edited_names);
979(*pub)->SetMan().SetCit().SetAuthors().SetNames(edited_names);
982(*pub)->SetGen().SetAuthors().SetNames(edited_names);
996cmd_processor->
Execute(comp_cmd);
998new_names->Assign(edited_names);
1024 boolmodified =
false;
1030replacement->
Assign(*pub_it);
1034 switch((*pub)->Which())
1037 if((*pub)->SetGen().SetAuthors().SetNames().Equals(original_names))
1039(*pub)->SetGen().SetAuthors().SetNames(edited_names);
1044 if((*pub)->SetArticle().SetAuthors().SetNames().Equals(original_names))
1046(*pub)->SetArticle().SetAuthors().SetNames(edited_names);
1051 if((*pub)->SetBook().SetAuthors().SetNames().Equals(original_names))
1053(*pub)->SetBook().SetAuthors().SetNames(edited_names);
1058 if((*pub)->SetProc().SetBook().SetAuthors().SetNames().Equals(original_names))
1060(*pub)->SetProc().SetBook().SetAuthors().SetNames(edited_names);
1065 if((*pub)->SetSub().SetAuthors().SetNames().Equals(original_names))
1067(*pub)->SetSub().SetAuthors().SetNames(edited_names);
1072 if((*pub)->SetPatent().SetAuthors().SetNames().Equals(original_names))
1074(*pub)->SetPatent().SetAuthors().SetNames(edited_names);
1079 if((*pub)->SetMan().SetCit().SetAuthors().SetNames().Equals(original_names))
1081(*pub)->SetMan().SetCit().SetAuthors().SetNames(edited_names);
1086 if((*pub)->SetGen().SetAuthors().SetNames().Equals(original_names))
1088(*pub)->SetGen().SetAuthors().SetNames(edited_names);
1103cmd_processor->
Execute(comp_cmd);
1105new_names->Assign(edited_names);
1122 empty->SetAuthors();
static bool s_IsLastRow(wxWindow *wnd, wxSizerItemList &itemList)
#define ID_REPLACE_ALL_AUTHORS
#define ID_REPLACE_SAME_AUTHORS
@Auth_list.hpp User-defined methods of the data storage class.
void SetAffil(CRef< objects::CAffil > affil)
wxScrolledWindow * m_ScrolledWindow
void DeleteRow(wxWindow *wnd)
wxFlexGridSizer * m_Sizer
void ImportAuthorsFromFile()
@ ID_IMPORT_AUTHORS_AFFILIATION
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void PopulateAuthors(objects::CAuth_list &auth_list)
static bool IsAuthorEmpty(const objects::CAuthor &auth)
bool Create(wxWindow *parent, wxWindowID id=ID_AUTHORNAMES, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
virtual void ApplyCommand()
virtual bool TransferDataToWindow()
CRef< CSerialObject > m_EditedAuthList
objects::CSeq_entry_Handle GetSeqEntryHandle()
virtual void InsertAuthorBefore(wxWindow *link)
virtual bool TransferDataFromWindow()
void OnAddauthHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_ADDAUTH
CAuthorNamesPanel()
Constructors.
~CAuthorNamesPanel()
Destructor.
virtual void AddLastAuthor(wxWindow *link)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
virtual void x_AddRowToWindow(wxWindow *row)
virtual void ApplySubmitBlock(objects::CSubmit_block &block)
void x_AddNewEmptyAuthor(void)
void OnReplaceAllAuthors(wxCommandEvent &event)
bool x_GetAuthors(bool keep_blank=false)
void OnImportAuthorsAffiliationHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_IMPORT_AUTHORS_AFFILIATION
static bool ShowToolTips()
Should we show tooltips?
virtual void InsertAuthorAfter(wxWindow *link)
void OnReplaceSameAuthors(wxCommandEvent &event)
void CreateControls()
Creates the controls and sizers.
void OnImportAuthorsHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_IMPORT_AUTHORS
virtual void OnImport(CNcbiIfstream &istr)
virtual bool IsExportEnabled(void)
void Init()
Initialises member variables.
void x_AdjustScroll(wxWindow *row, bool scroll_to_end=true)
virtual void x_InsertRowtoWindow(wxWindow *row, size_t index)
ICommandProccessor * GetUndoManager()
virtual wxSizerItem * x_FindSingleAuthor(wxWindow *wnd, wxSizerItemList &itemList)
CRef< objects::CSubmit_block > m_SubmitBlock
void OnDelete(wxHyperlinkEvent &event)
virtual CRef< CSerialObject > OnExport(void)
bool m_show_replace_buttons
virtual void x_MoveRowUp(int row_num)
virtual bool IsImportEnabled(void)
virtual int x_FindRow(wxWindow *wnd, wxSizerItemList &itemList)
void OnAddconsortiumHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_ADDCONSORTIUM
virtual void SetAuthors(const objects::CAuth_list &auth_list)
void AddCommand(IEditCommand &command)
CRef< objects::CAuthor > GetAuthor() const
ICommandProccessor * GetUndoManager(void)
ICommandProccessor * GetUndoManager(void)
static wxString GetDialogFilter(EFileType fileType)
objects::CSeq_entry_Handle GetSEH()
Base class for all serializable objects.
CRef< objects::CAuthor > GetAuthor() const
static bool IsPlaceholder(const objects::CAuthor &author)
virtual void ApplySubmitCommand()=0
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
CSubmissionPageChangeListener * GetParentWizard(wxWindow *wnd) const
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
const string & GetMsg(void) const
Get message string.
void Info(CExceptionArgs_Base &args)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators â.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
@ fIncludeGivenEntry
Include the top (given) entry.
@ fRecursive
Iterate recursively.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
bool IsSetAffil(void) const
author affiliation Check if a value has been assigned to Affil data member.
void ResetNames(void)
Reset Names data member.
void SetName(TName &value)
Assign a value to Name data member.
void SetAffil(TAffil &value)
Assign a value to Affil data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetNames(void) const
Check if a value has been assigned to Names data member.
void SetNames(TNames &value)
Assign a value to Names data member.
bool IsSetName(void) const
Author, Primary or Secondary Check if a value has been assigned to Name data member.
const TNames & GetNames(void) const
Get the Names member data.
const TStd & GetStd(void) const
Get the variant data.
bool IsStd(void) const
Check if variant Std is selected.
bool IsConsortium(void) const
Check if variant Consortium is selected.
bool IsName(void) const
Check if variant Name is selected.
bool IsSetInitials(void) const
first + middle initials Check if a value has been assigned to Initials data member.
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
const TConsortium & GetConsortium(void) const
Get the variant data.
const TName & GetName(void) const
Get the variant data.
bool IsSetFirst(void) const
Check if a value has been assigned to First data member.
list< CRef< CPub > > Tdata
@ e_Gen
general or generic unparsed
@ e_Proc
proceedings of a meeting
@ e_Man
manuscript, thesis, or letter
void SetPub(TPub &value)
Assign a value to Pub data member.
TPub & SetPub(void)
Select the variant.
@ e_Pub
a reference to the publication
Lightweight interface for getting lines of data with minimal memory copying.
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
wxString ToWxString(const string &s)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4