<< id); \
97wxWindow* parent, wxWindowID
id,
constwxString& title,
constwxPoint& pos) :
98wxDialog(parent,
id, title, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
99sSet(structureSet), dialogHandle(handle), selectItem(0)
101 if(!structureSet || !(descrSet = structureSet->GetCDDDescrSet())) {
102 ERRORMSG(
"CDDRefDialog::CDDRefDialog() - error getting descr set data");
120bAdd->Enable(!readOnly);
121bEdit->Enable(!readOnly);
122bDelete->Enable(!readOnly);
123bUp->Enable(!readOnly);
124bDown->Enable(!readOnly);
127topSizer->Fit(
this);
128topSizer->SetSizeHints(
this);
135 TRACEMSG(
"CDD references dialog destroyed");
149wxArrayInt selections;
150 intnSelected = listbox->GetSelections(selections);
151 selectItem= (nSelected > 0) ? selections.Item(selections.GetCount() - 1) : -1;
156 if(event.GetId() ==
ID_B_LAUNCH&& nSelected > 0) {
157 stringurl(
"https://www.ncbi.nlm.nih.gov/pubmed/");
158 for(
int i=0;
i<nSelected; ++
i) {
159descr =
dynamic_cast<CCdd_descr*
>(
reinterpret_cast<CObject*
>(listbox->GetClientData(selections.Item(
i))));
168 else if(event.GetId() ==
ID_B_ADD) {
169wxString ids = wxGetTextFromUser(
"Enter a list of PubMed IDs:",
"Input PMIDs",
"",
this);
170wxStringTokenizer tkz(ids,
" ,;\t\r\n", wxTOKEN_STRTOK);
172 while(tkz.HasMoreTokens()) {
173wxString
id= tkz.GetNextToken();
174 if(
id.
size() > 0 &&
id.ToLong(&pmidVal) && pmidVal > 0) {
176ref->SetReference().SetPmid().Set((
int) pmidVal);
177CCdd_descr_set::Tdata::iterator d, de =
descrSet->Set().end();
178 for(d=
descrSet->Set().begin(); d!=de; ++d) {
179 if(d->GetPointer() == descr) {
189 ERRORMSG(
"Invalid PMID: '"<<
id.c_str() <<
"'");
194 else if(event.GetId() ==
ID_B_EDIT&& nSelected == 1) {
197wxString pmidStr = wxGetTextFromUser(
"Enter/edit the PubMed ID:",
"Edit PMID",
init,
this);
198 unsigned longpmidVal;
199 if(pmidStr.size() > 0 && pmidStr.ToULong(&pmidVal)) {
207 else if(event.GetId() ==
ID_B_DELETE&& nSelected > 0) {
209CCdd_descr_set::Tdata::iterator d, de =
descrSet->Set().end();
210 for(d=
descrSet->Set().begin(); d!=de; ++d) {
212 for(
i=0;
i<nSelected; ++
i)
213 if(d->GetPointer() ==
214 dynamic_cast<CCdd_descr*
>(
reinterpret_cast<CObject*
>(listbox->GetClientData(selections.Item(
i)))))
217keepDescrs.
Set().push_back(*d);
219 if(keepDescrs.
Get().size() !=
descrSet->Get().size()) {
226 else if((event.GetId() ==
ID_B_UP|| event.GetId() ==
ID_B_DOWN) && nSelected == 1) {
227CCdd_descr_set::Tdata::iterator d, de =
descrSet->Set().end(), p =
descrSet->Set().end(),
n;
228 for(d=
descrSet->Set().begin(); d!=de; ++d) {
229 if(d->GetPointer() == descr) {
234}
while(
n!=
descrSet->Set().end() && !((*n)->IsReference() && (*n)->GetReference().IsPmid()));
249 if((*d)->IsReference() && (*d)->GetReference().IsPmid())
264CCdd_descr_set::Tdata::iterator d, de =
descrSet->Set().end();
265 for(d=
descrSet->Set().begin(); d!=de; ++d) {
266 if((*d)->IsReference() && (*d)->GetReference().IsPmid()) {
268title.Printf(
"%i", (*d)->GetReference().GetPmid().Get());
270listbox->Append(title, d->GetPointer());
286wxBoxSizer *item0 =
newwxBoxSizer( wxVERTICAL );
288wxStaticBox *item2 =
newwxStaticBox( parent, -1,
wxT(
"PubMed IDs") );
289wxStaticBoxSizer *item1 =
newwxStaticBoxSizer( item2, wxVERTICAL );
291wxFlexGridSizer *item3 =
newwxFlexGridSizer( 1, 0, 0 );
293wxString *strs4 = (wxString*)
NULL;
294wxListBox *item4 =
newwxListBox( parent,
ID_L_REFS, wxDefaultPosition, wxSize(80,100), 0, strs4, wxLB_EXTENDED|wxLB_NEEDED_SB );
295item3->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
297wxGridSizer *item5 =
newwxGridSizer( 2, 0, 0 );
299wxButton *item6 =
newwxButton( parent,
ID_B_LAUNCH,
wxT(
"Launch"), wxDefaultPosition, wxDefaultSize, 0 );
300item5->Add( item6, 0, wxALIGN_CENTRE|wxALL, 5 );
302wxButton *item7 =
newwxButton( parent,
ID_B_UP,
wxT(
"Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
303item5->Add( item7, 0, wxALIGN_CENTRE|wxALL, 5 );
305wxButton *item8 =
newwxButton( parent,
ID_B_EDIT,
wxT(
"Edit"), wxDefaultPosition, wxDefaultSize, 0 );
306item5->Add( item8, 0, wxALIGN_CENTRE|wxALL, 5 );
308wxButton *item9 =
newwxButton( parent,
ID_B_DOWN,
wxT(
"Move Down"), wxDefaultPosition, wxDefaultSize, 0 );
309item5->Add( item9, 0, wxALIGN_CENTRE|wxALL, 5 );
311wxButton *item10 =
newwxButton( parent,
ID_B_ADD,
wxT(
"Add"), wxDefaultPosition, wxDefaultSize, 0 );
312item5->Add( item10, 0, wxALIGN_CENTRE|wxALL, 5 );
314wxButton *item11 =
newwxButton( parent,
ID_B_DELETE,
wxT(
"Delete"), wxDefaultPosition, wxDefaultSize, 0 );
315item5->Add( item11, 0, wxALIGN_CENTRE|wxALL, 5 );
317item3->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
319item1->Add( item3, 0, wxALIGN_CENTRE, 5 );
321item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
323wxBoxSizer *item12 =
newwxBoxSizer( wxHORIZONTAL );
325wxButton *item13 =
newwxButton( parent,
ID_B_DONE,
wxT(
"Done"), wxDefaultPosition, wxDefaultSize, 0 );
326item12->Add( item13, 0, wxALIGN_CENTRE|wxALL, 5 );
328item0->Add( item12, 0, wxALIGN_CENTRE|wxALL, 5 );
332parent->SetAutoLayout(
TRUE);
333parent->SetSizer( item0 );
336item0->Fit( parent );
337item0->SetSizeHints( parent );
User-defined methods of the data storage class.
User-defined methods of the data storage class.
#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type)
wxSizer * SetupReferencesDialog(wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
void OnCloseWindow(wxCloseEvent &event)
CDDRefDialog ** dialogHandle
ncbi::objects::CCdd_descr_set * descrSet
void OnButton(wxCommandEvent &event)
static const unsigned int eCDDData
void SetDataChanged(unsigned int what) const
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
const TPrim & Get(void) const
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
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.
const Tdata & Get(void) const
Get the member data.
TReference & SetReference(void)
Select the variant.
Tdata & Set(void)
Assign a value to data member.
const TReference & GetReference(void) const
Get the variant data.
TPmid & SetPmid(void)
Select the variant.
const TPmid & GetPmid(void) const
Get the variant data.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define TRUE
bool replacment for C indicating true.
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