A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/relaxed__lookup__dlg_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/edit/relaxed_lookup_dlg.cpp Source File

52 #include <wx/radiobut.h> 53 #include <wx/stattext.h> 54 #include <wx/statbox.h> 93  Create

(parent,

id

, caption, pos,

size

, style);

104 

SetExtraStyle(wxWS_EX_BLOCK_EVENTS);

105

wxDialog::Create( parent,

id

, caption, pos,

size

, style );

110

GetSizer()->SetSizeHints(

this

);

169

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxVERTICAL);

170

itemDialog1->SetSizer(itemBoxSizer2);

172

wxBoxSizer* itemBoxSizer3 =

new

wxBoxSizer(wxHORIZONTAL);

173

itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

175

wxStaticText* itemStaticText4 =

new

wxStaticText( itemDialog1, wxID_STATIC,

_

(

"Number of potential matches (Max 20):"

), wxDefaultPosition, wxDefaultSize, 0 );

176

itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

179

itemBoxSizer3->Add(

m_MaxMatchTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

181

wxStaticBox* itemStaticBoxSizer6Static =

new

wxStaticBox(itemDialog1,

wxID_ANY

,

_

(

"Available information on this in-press citation:"

));

182

wxStaticBoxSizer* itemStaticBoxSizer6 =

new

wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);

183

itemBoxSizer2->Add(itemStaticBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

185

wxBoxSizer* itemBoxSizer7 =

new

wxBoxSizer(wxHORIZONTAL);

186

itemStaticBoxSizer6->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

193

itemBoxSizer7->Add(

m_FirstAuthorTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

200

itemBoxSizer7->Add(

m_LastAuthorTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

202

wxBoxSizer* itemBoxSizer12 =

new

wxBoxSizer(wxHORIZONTAL);

203

itemStaticBoxSizer6->Add(itemBoxSizer12, 0, wxGROW|wxALL, 5);

207

itemBoxSizer12->Add(

m_UseJournalBtn

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

209  m_JournalTxt

=

new

wxTextCtrl( itemStaticBoxSizer6->GetStaticBox(),

ID_JOURNAL_TXT

, wxEmptyString, wxDefaultPosition, wxSize(500, -1), 0 );

210

itemBoxSizer12->Add(

m_JournalTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

212

wxBoxSizer* itemBoxSizer15 =

new

wxBoxSizer(wxHORIZONTAL);

213

itemStaticBoxSizer6->Add(itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

215  m_UseYearBtn

=

new

wxCheckBox( itemStaticBoxSizer6->GetStaticBox(),

ID_USE_YEAR_BTN

,

_

(

"Year"

), wxDefaultPosition, wxDefaultSize, 0 );

217

itemBoxSizer15->Add(

m_UseYearBtn

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

219  m_YearTxt

=

new

wxTextCtrl( itemStaticBoxSizer6->GetStaticBox(),

ID_YEAR_TXT

, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );

220

itemBoxSizer15->Add(

m_YearTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

222  m_YearFuzzBtn

=

new

wxCheckBox( itemStaticBoxSizer6->GetStaticBox(),

ID_YEAR_FUZZ_BTN

,

_

(

"+/- 1 Year"

), wxDefaultPosition, wxDefaultSize, 0 );

224

itemBoxSizer15->Add(

m_YearFuzzBtn

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

228

itemBoxSizer15->Add(

m_UseVolumeBtn

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

231

itemBoxSizer15->Add(

m_UseVolumeTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

233  m_UsePageBtn

=

new

wxCheckBox( itemStaticBoxSizer6->GetStaticBox(),

ID_USE_PAGE_BTN

,

_

(

"Page"

), wxDefaultPosition, wxDefaultSize, 0 );

235

itemBoxSizer15->Add(

m_UsePageBtn

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

237  m_UsePageTxt

=

new

wxTextCtrl( itemStaticBoxSizer6->GetStaticBox(),

ID_PAGE_TXT

, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );

238

itemBoxSizer15->Add(

m_UsePageTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

240

wxBoxSizer* itemBoxSizer23 =

new

wxBoxSizer(wxHORIZONTAL);

241

itemStaticBoxSizer6->Add(itemBoxSizer23, 0, wxGROW|wxALL, 5);

243

wxStaticText* itemStaticText24 =

new

wxStaticText( itemStaticBoxSizer6->GetStaticBox(), wxID_STATIC,

_

(

"Article Title:"

), wxDefaultPosition, wxDefaultSize, 0 );

244

itemBoxSizer23->Add(itemStaticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

249

wxBoxSizer* itemBoxSizer26 =

new

wxBoxSizer(wxHORIZONTAL);

250

itemBoxSizer2->Add(itemBoxSizer26, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

257

itemBoxSizer26->Add(

m_ExtraTermsTxt

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

259

wxBoxSizer* itemBoxSizer29 =

new

wxBoxSizer(wxHORIZONTAL);

260

itemBoxSizer2->Add(itemBoxSizer29, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

262

wxStaticText* itemStaticText30 =

new

wxStaticText( itemDialog1, wxID_STATIC,

_

(

"New query option:"

), wxDefaultPosition, wxDefaultSize, 0 );

263

itemBoxSizer29->Add(itemStaticText30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

265

wxArrayString m_NewQueryChoiceStrings;

266

m_NewQueryChoiceStrings.Add(

_

(

"default: use all fields"

));

267

m_NewQueryChoiceStrings.Add(

_

(

"customize: use checked fields"

));

270

itemBoxSizer29->Add(

m_NewQueryChoice

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

272

wxButton* itemButton32 =

new

wxButton( itemDialog1,

ID_SEND_QUERY

,

_

(

"Send Modified Query"

), wxDefaultPosition, wxDefaultSize, 0 );

273

itemBoxSizer29->Add(itemButton32, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

275

wxStaticText* itemStaticText33 =

new

wxStaticText( itemDialog1, wxID_STATIC,

_

(

"Summary of potential matches, highlight one to use in update"

), wxDefaultPosition, wxDefaultSize, 0 );

276

itemBoxSizer2->Add(itemStaticText33, 0, wxALIGN_LEFT|wxALL, 5);

281  m_Sizer

=

new

wxBoxSizer(wxVERTICAL);

286

wxBoxSizer* itemBoxSizer36 =

new

wxBoxSizer(wxHORIZONTAL);

287

itemBoxSizer2->Add(itemBoxSizer36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

289

wxButton* itemButton37 =

new

wxButton( itemDialog1, wxID_OK,

_

(

"OK"

), wxDefaultPosition, wxDefaultSize, 0 );

290

itemBoxSizer36->Add(itemButton37, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

292

wxButton* itemButton38 =

new

wxButton( itemDialog1, wxID_CANCEL,

_

(

"Cancel"

), wxDefaultPosition, wxDefaultSize, 0 );

293

itemBoxSizer36->Add(itemButton38, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

348

wxStaticText* item = (wxStaticText*)event.GetEventObject();

349

wxWindow*

prev

= item->GetPrevSibling();

351

wxRadioButton* btn =

dynamic_cast<

wxRadioButton*

>

(

prev

);

353

btn->SetValue(

true

);

365

wxStaticText* pubitem = (wxStaticText*)event.GetEventObject();

370

wxSizerItemList::iterator node =

m_Sizer

->GetChildren().begin();

371

vector<CRef<CPubdesc> >::iterator pub_it =

m_Pubs

.begin();

372  while

(pub_it !=

m_Pubs

.end() && !(*pub_it)) {

379  if

((*node)->IsSizer()) {

380

wxStaticText *w =

dynamic_cast<

wxStaticText *

>

((*node)->GetSizer()->GetItem((

size_t

)1)->GetWindow());

381  if

(w && w == pubitem) {

383  if

((*pit)->IsPmid()) {

384

pmid.

Set

((*pit)->GetPmid().Get());

390  while

(pub_it !=

m_Pubs

.end() && !(*pub_it)) {

396  string

url =

"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  string

title =

journal

.GetTitle().GetTitle();

487

}

catch

(

CException

&) {}

catch

(exception&) {}

523

terms +=

"["

+

key

+

"]"

;

533  bool

use_all =

false

;

543  string

other_author =

""

;

578  string

year_text =

""

;

589

terms +=

" AND "

+ year_text;

591

}

catch

(

CException

&) {}

catch

(exception&) {}

600

vector<string> terms;

615

terms.assign(tokens.begin(), tokens.end());

620

terms.push_back(name);

628

vector<TEntrezId> pmids;

633

edit::CEUtilsUpdater::DoPubSearch(search_terms, pmids);

638  catch

(

const

exception& e) {

642  if

(pmids.size() == 1) {

643  m_Ids

.push_back(pmids.front());

657

edit::CRemoteUpdater updater(pMessageListener);

659

updater.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  string

db =

"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  int

one_row_height = 0;

713  int

total_height = 0;

716  int

max_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"

),

746

wxDefaultPosition, wxDefaultSize, 0 );

753

wxSizer*

row

=

new

wxBoxSizer(wxHORIZONTAL);

754  m_Sizer

->Add(

row

, 0, wxALIGN_LEFT|wxALL, 0);

756

wxRadioButton* btn =

new

wxRadioButton(

m_ScrolledWindow

,

wxID_ANY

, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );

757  row

->Add(btn, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);

760

btn->SetValue(

true

);

765  row

->Add(

label

, 0, wxALIGN_LEFT|wxALL, 0);

769  int

row_height, row_width;

770  int

btn_height, btn_width;

771  int

label_height, label_width;

772

btn->GetClientSize(&btn_width, &btn_height);

773  label

->GetClientSize(&label_width, &label_height);

774

row_height = btn_height;

775  if

(label_height > row_height) {

776

row_height = label_height;

778

row_width = btn_width + label_width;

780  if

(row_width > total_width) {

781

total_width = row_width;

783  if

(num_rows < max_rows_displayed) {

784

total_height += row_height;

787  if

(one_row_height == 0 || one_row_height > row_height) {

788

one_row_height = row_height;

806

wxSizerItemList::iterator node =

m_Sizer

->GetChildren().begin();

807

vector<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()) {

814

wxRadioButton *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