(parent,
id, caption, pos,
size, style);
104SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
105wxDialog::Create( parent,
id, caption, pos,
size, style );
110GetSizer()->SetSizeHints(
this);
169wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
170itemDialog1->SetSizer(itemBoxSizer2);
172wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
173itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
175wxStaticText* itemStaticText4 =
newwxStaticText( itemDialog1, wxID_STATIC,
_(
"Number of potential matches (Max 20):"), wxDefaultPosition, wxDefaultSize, 0 );
176itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
179itemBoxSizer3->Add(
m_MaxMatchTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
181wxStaticBox* itemStaticBoxSizer6Static =
newwxStaticBox(itemDialog1,
wxID_ANY,
_(
"Available information on this in-press citation:"));
182wxStaticBoxSizer* itemStaticBoxSizer6 =
newwxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);
183itemBoxSizer2->Add(itemStaticBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
185wxBoxSizer* itemBoxSizer7 =
newwxBoxSizer(wxHORIZONTAL);
186itemStaticBoxSizer6->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
193itemBoxSizer7->Add(
m_FirstAuthorTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
200itemBoxSizer7->Add(
m_LastAuthorTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
202wxBoxSizer* itemBoxSizer12 =
newwxBoxSizer(wxHORIZONTAL);
203itemStaticBoxSizer6->Add(itemBoxSizer12, 0, wxGROW|wxALL, 5);
207itemBoxSizer12->Add(
m_UseJournalBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
209 m_JournalTxt=
newwxTextCtrl( itemStaticBoxSizer6->GetStaticBox(),
ID_JOURNAL_TXT, wxEmptyString, wxDefaultPosition, wxSize(500, -1), 0 );
210itemBoxSizer12->Add(
m_JournalTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
212wxBoxSizer* itemBoxSizer15 =
newwxBoxSizer(wxHORIZONTAL);
213itemStaticBoxSizer6->Add(itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
215 m_UseYearBtn=
newwxCheckBox( itemStaticBoxSizer6->GetStaticBox(),
ID_USE_YEAR_BTN,
_(
"Year"), wxDefaultPosition, wxDefaultSize, 0 );
217itemBoxSizer15->Add(
m_UseYearBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
219 m_YearTxt=
newwxTextCtrl( itemStaticBoxSizer6->GetStaticBox(),
ID_YEAR_TXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
220itemBoxSizer15->Add(
m_YearTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
222 m_YearFuzzBtn=
newwxCheckBox( itemStaticBoxSizer6->GetStaticBox(),
ID_YEAR_FUZZ_BTN,
_(
"+/- 1 Year"), wxDefaultPosition, wxDefaultSize, 0 );
224itemBoxSizer15->Add(
m_YearFuzzBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
228itemBoxSizer15->Add(
m_UseVolumeBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
231itemBoxSizer15->Add(
m_UseVolumeTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
233 m_UsePageBtn=
newwxCheckBox( itemStaticBoxSizer6->GetStaticBox(),
ID_USE_PAGE_BTN,
_(
"Page"), wxDefaultPosition, wxDefaultSize, 0 );
235itemBoxSizer15->Add(
m_UsePageBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
237 m_UsePageTxt=
newwxTextCtrl( itemStaticBoxSizer6->GetStaticBox(),
ID_PAGE_TXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
238itemBoxSizer15->Add(
m_UsePageTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
240wxBoxSizer* itemBoxSizer23 =
newwxBoxSizer(wxHORIZONTAL);
241itemStaticBoxSizer6->Add(itemBoxSizer23, 0, wxGROW|wxALL, 5);
243wxStaticText* itemStaticText24 =
newwxStaticText( itemStaticBoxSizer6->GetStaticBox(), wxID_STATIC,
_(
"Article Title:"), wxDefaultPosition, wxDefaultSize, 0 );
244itemBoxSizer23->Add(itemStaticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
249wxBoxSizer* itemBoxSizer26 =
newwxBoxSizer(wxHORIZONTAL);
250itemBoxSizer2->Add(itemBoxSizer26, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
257itemBoxSizer26->Add(
m_ExtraTermsTxt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
259wxBoxSizer* itemBoxSizer29 =
newwxBoxSizer(wxHORIZONTAL);
260itemBoxSizer2->Add(itemBoxSizer29, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
262wxStaticText* itemStaticText30 =
newwxStaticText( itemDialog1, wxID_STATIC,
_(
"New query option:"), wxDefaultPosition, wxDefaultSize, 0 );
263itemBoxSizer29->Add(itemStaticText30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
265wxArrayString m_NewQueryChoiceStrings;
266m_NewQueryChoiceStrings.Add(
_(
"default: use all fields"));
267m_NewQueryChoiceStrings.Add(
_(
"customize: use checked fields"));
270itemBoxSizer29->Add(
m_NewQueryChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
272wxButton* itemButton32 =
newwxButton( itemDialog1,
ID_SEND_QUERY,
_(
"Send Modified Query"), wxDefaultPosition, wxDefaultSize, 0 );
273itemBoxSizer29->Add(itemButton32, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
275wxStaticText* itemStaticText33 =
newwxStaticText( itemDialog1, wxID_STATIC,
_(
"Summary of potential matches, highlight one to use in update"), wxDefaultPosition, wxDefaultSize, 0 );
276itemBoxSizer2->Add(itemStaticText33, 0, wxALIGN_LEFT|wxALL, 5);
281 m_Sizer=
newwxBoxSizer(wxVERTICAL);
286wxBoxSizer* itemBoxSizer36 =
newwxBoxSizer(wxHORIZONTAL);
287itemBoxSizer2->Add(itemBoxSizer36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
289wxButton* itemButton37 =
newwxButton( itemDialog1, wxID_OK,
_(
"OK"), wxDefaultPosition, wxDefaultSize, 0 );
290itemBoxSizer36->Add(itemButton37, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
292wxButton* itemButton38 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
293itemBoxSizer36->Add(itemButton38, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
348wxStaticText* item = (wxStaticText*)event.GetEventObject();
349wxWindow*
prev= item->GetPrevSibling();
351wxRadioButton* btn =
dynamic_cast<wxRadioButton*
>(
prev);
353btn->SetValue(
true);
365wxStaticText* pubitem = (wxStaticText*)event.GetEventObject();
370wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
371vector<CRef<CPubdesc> >::iterator pub_it =
m_Pubs.begin();
372 while(pub_it !=
m_Pubs.end() && !(*pub_it)) {
379 if((*node)->IsSizer()) {
380wxStaticText *w =
dynamic_cast<wxStaticText *
>((*node)->GetSizer()->GetItem((
size_t)1)->GetWindow());
381 if(w && w == pubitem) {
383 if((*pit)->IsPmid()) {
384pmid.
Set((*pit)->GetPmid().Get());
390 while(pub_it !=
m_Pubs.end() && !(*pub_it)) {
396 stringurl =
"https://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids="+
442 if((*pub_it)->IsArticle()) {
445 const CCit_art& article = (*pub_it)->GetArticle();
450}
catch(
CException&) {}
catch(exception&) {}
452 if((*pub_it)->IsSetAuthors()
453&& (*pub_it)->GetAuthors().IsSetNames()
454&& (*pub_it)->GetAuthors().GetNames().IsStd()
455&& (*pub_it)->GetAuthors().GetNames().GetStd().size() > 0) {
456 const CAuthor& first_auth = *((*pub_it)->GetAuthors().GetNames().GetStd().front());
462 const CAuthor& last_auth = *((*pub_it)->GetAuthors().GetNames().GetStd().back());
468 for(
const auto&author : (*pub_it)->GetAuthors().GetNames().GetStd())
482 stringtitle =
journal.GetTitle().GetTitle();
487}
catch(
CException&) {}
catch(exception&) {}
523terms +=
"["+
key+
"]";
533 booluse_all =
false;
543 stringother_author =
"";
578 stringyear_text =
"";
589terms +=
" AND "+ year_text;
591}
catch(
CException&) {}
catch(exception&) {}
600vector<string> terms;
615terms.assign(tokens.begin(), tokens.end());
620terms.push_back(name);
628vector<TEntrezId> pmids;
633edit::CEUtilsUpdater::DoPubSearch(search_terms, pmids);
638 catch(
constexception& e) {
642 if(pmids.size() == 1) {
643 m_Ids.push_back(pmids.front());
657edit::CRemoteUpdater updater(pMessageListener);
659updater.UpdatePubReferences(*desc);
662 if(pub_it->IsPmid()) {
663 m_Ids.push_back(pub_it->GetPmid().Get());
669 LOG_POST(
Error<<
"CRelaxedLookupDlg::x_GetPubIdsEutils(): error executing MedLine Lookup "+ e.
GetMsg());
681 if(max < 1 || max > 20) {
685 catch(
CException&) {}
catch(exception&) {}
688 stringdb =
"PubMed";
697 LOG_POST(
Error<<
"CRelaxedLookupDlg::x_GetPubIds(): error executing search Entrez query: "<< terms <<
": "<< e.
GetMsg());
706 while(
m_Sizer->GetItemCount() > 0) {
708 m_Sizer->GetItem(pos)->DeleteWindows();
712 intone_row_height = 0;
713 inttotal_height = 0;
716 intmax_rows_displayed = 6;
718 if(use_pubmed_citmatch) {
739 m_Pubs.push_back(pubdesc);
745 wxT(
"No match was found, hints for a modified query:\n Leave out one author\n Leave out year field (or increase it by 1) \n Leave out Volume field \n Modify the fields as you deem sensible"),
746wxDefaultPosition, wxDefaultSize, 0 );
753wxSizer*
row=
newwxBoxSizer(wxHORIZONTAL);
754 m_Sizer->Add(
row, 0, wxALIGN_LEFT|wxALL, 0);
756wxRadioButton* btn =
newwxRadioButton(
m_ScrolledWindow,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
757 row->Add(btn, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);
760btn->SetValue(
true);
765 row->Add(
label, 0, wxALIGN_LEFT|wxALL, 0);
769 introw_height, row_width;
770 intbtn_height, btn_width;
771 intlabel_height, label_width;
772btn->GetClientSize(&btn_width, &btn_height);
773 label->GetClientSize(&label_width, &label_height);
774row_height = btn_height;
775 if(label_height > row_height) {
776row_height = label_height;
778row_width = btn_width + label_width;
780 if(row_width > total_width) {
781total_width = row_width;
783 if(num_rows < max_rows_displayed) {
784total_height += row_height;
787 if(one_row_height == 0 || one_row_height > row_height) {
788one_row_height = row_height;
806wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
807vector<CRef<CPubdesc> >::iterator pub_it =
m_Pubs.begin();
808 while(pub_it !=
m_Pubs.end() && !(*pub_it)) {
812 for(; node !=
m_Sizer->GetChildren().end() && pub_it !=
m_Pubs.end(); ++node) {
813 if((*node)->IsSizer()) {
814wxRadioButton *w =
dynamic_cast<wxRadioButton *
>((*node)->GetSizer()->GetItem((
size_t)0)->GetWindow());
820 while(pub_it !=
m_Pubs.end() && !(*pub_it)) {
User-defined methods of the data storage class.
void SetMaxReturn(int ret_max)
Uint8 Search(const string &db, const string &term, vector< objects::CSeq_id_Handle > &uids, const string &xml_path=kEmptyStr)
@Pubdesc.hpp User-defined methods of the data storage class.
static bool ShowToolTips()
Should we show tooltips?
void OnPubTextClick(wxMouseEvent &event)
void OnPubTextDClick(wxMouseEvent &event)
wxCheckBox * m_UseVolumeBtn
void CreateControls()
Creates the controls and sizers.
wxCheckBox * m_UseYearBtn
wxTextCtrl * m_MaxMatchTxt
wxTextCtrl * m_FirstAuthorTxt
wxCheckBox * m_UsePageBtn
wxTextCtrl * m_LastAuthorTxt
CRef< objects::CPubdesc > GetPubdesc()
CRelaxedLookupDlg()
Constructors.
string x_GetSearchTerms()
wxChoice * m_NewQueryChoice
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxCheckBox * m_UseJournalBtn
wxScrolledWindow * m_ScrolledWindow
bool Create(wxWindow *parent, wxWindowID id=10092, const wxString &caption=_("In-press citation update"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
vector< string > x_GetCitMatchSearchTerms() const
void SetPubdesc(const objects::CPubdesc &pubdesc)
void SendQuery(bool use_pubmed_citmatch=false)
void OnSendQueryClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SEND_QUERY
vector< CRef< objects::CPubdesc > > m_Pubs
wxTextCtrl * m_UseVolumeTxt
wxTextCtrl * m_ExtraTermsTxt
set< string > m_AuthorsExist
vector< TEntrezId > m_Ids
void x_GetPubIdsCitMatch()
wxCheckBox * m_UseLastAuthorBtn
wxTextCtrl * m_JournalTxt
void x_GetPubIds(const string &terms)
wxCheckBox * m_YearFuzzBtn
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxTextCtrl * m_UsePageTxt
void Init()
Initialises member variables.
wxTextCtrl * m_ArticleTitleTxt
wxCheckBox * m_UseFirstAuthorBtn
CRef< objects::CPub > m_CitMatch
wxCheckBox * m_UseExtraTermsBtn
vector< string > m_Authors
~CRelaxedLookupDlg()
Destructor.
const string & GetTitle(C_E::E_Choice type=C_E::e_not_set) const
If the internal list contains a title (of the specified type, if given), returns the corresponding st...
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
static bool PopupURL(const string &url)
launch an application to handle a URL
const TPrim & Get(void) const
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static string Sanitize(CTempString str, TSS_Flags flags=fSS_print)
Sanitize a string, allowing only specified classes of characters.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
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.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
static const char label[]
bool IsSetVolume(void) const
Check if a value has been assigned to Volume data member.
const TJournal & GetJournal(void) const
Get the variant data.
const TVolume & GetVolume(void) const
Get the Volume member data.
const TPages & GetPages(void) const
Get the Pages member data.
const TFrom & GetFrom(void) const
Get the From member data.
bool IsSetTitle(void) const
title of paper (ANSI requires) Check if a value has been assigned to Title data member.
const TTitle & GetTitle(void) const
Get the Title member data.
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetDate(void) const
date of publication Check if a value has been assigned to Date data member.
bool IsSetName(void) const
Author, Primary or Secondary Check if a value has been assigned to Name data member.
bool IsJournal(void) const
Check if variant Journal is selected.
const TDate & GetDate(void) const
Get the Date member data.
bool IsSetPages(void) const
Check if a value has been assigned to Pages data member.
bool IsSetYear(void) const
full year (including 1900) Check if a value has been assigned to Year data member.
bool IsStd(void) const
Check if variant Std is selected.
bool IsName(void) const
Check if variant Name is selected.
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
TYear GetYear(void) const
Get the Year member data.
const TLast & GetLast(void) const
Get the Last member data.
const TName & GetName(void) const
Get the variant data.
const TStd & GetStd(void) const
Get the variant data.
list< CRef< CPub > > Tdata
const Tdata & Get(void) const
Get the member data.
void SetPub(TPub &value)
Assign a value to Pub data member.
TPub & SetPub(void)
Select the variant.
const TPub & GetPub(void) const
Get the variant data.
bool IsSetPub(void) const
the citation(s) Check if a value has been assigned to Pub data member.
const TPub & GetPub(void) const
Get the Pub member data.
This file contains the definition of the xml::document class.
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
#define ID_SCROLLEDWINDOW
CRef< CPub > journal(ParserPtr pp, char *bptr, char *eptr, CRef< CAuth_list > &auth_list, CRef< CTitle::C_E > &title, bool has_muid, CRef< CCit_art > &cit_art, Int4 er)
void s_AddToTerms(string &terms, const string &key, const string &val)
string s_GetStringFromAuthor(const CAuthor &auth)
#define ID_USE_FIRST_AUTHOR_BTN
#define ID_USE_EXTRA_TERMS_BTN
#define ID_ARTICLE_TITLE_TXT
#define ID_USE_JOURNAL_BTN
#define ID_USE_LAST_AUTHOR_BTN
#define ID_USE_VOLUME_TXT
#define ID_LAST_AUTHOR_TXT
#define ID_NEW_QUERY_CHOICE
#define ID_FIRST_AUTHOR_TXT
#define ID_EXTRA_TERMS_TXT
#define ID_USE_VOLUME_BTN
#define row(bind, expected)
wxString ToWxString(const string &s)
string ToStdString(const wxString &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