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/cdd__book__ref__dialog_8cpp_source.html below:

NCBI C++ ToolKit: src/app/cn3d/cdd_book_ref_dialog.cpp Source File

49 #include <wx/clipbrd.h> 50 #include <wx/tokenzr.h> 57 #include <wx/statline.h> 58 #include <wx/spinbutt.h> 59 #include <wx/spinctrl.h> 60 #include <wx/splitter.h> 61 #include <wx/listctrl.h> 62 #include <wx/treectrl.h> 63 #include <wx/notebook.h> 68 #define ID_LISTBOX 10000 70 #define ID_B_LAUNCH 10002 71 #define ID_B_NEW 10003 72 #define ID_B_SAVE 10004 73 #define ID_B_DOWN 10005 74 #define ID_B_EDIT 10006 75 #define ID_B_PASTE 10007 76 #define ID_B_DELETE 10008 79 #define ID_T_NAME 10011 80 #define ID_C_TYPE 10012 81 #define ID_T_ADDRESS 10013 82 #define ID_T_SUBADDRESS 10014 83 #define ID_B_DONE 10015 94 #define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type) \ 96  var = wxDynamicCast(FindWindow(id), type); \ 98  ERRORMSG("Can't find window with id "

<< id); \

111

wxWindow* parent, wxWindowID

id

,

const

wxString& title,

const

wxPoint& pos) :

112

wxDialog(parent,

id

, title, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE),

113

sSet(structureSet), dialogHandle(handle), selectedItem(-1), editOn(

false

), isNew(

false

)

128  if

(!structureSet || !(descrSet = structureSet->GetCDDDescrSet())) {

129  ERRORMSG

(

"CDDBookRefDialog::CDDBookRefDialog() - error getting descr set data"

);

141

topSizer->Fit(

this

);

142

topSizer->SetSizeHints(

this

);

149  TRACEMSG

(

"CDD book references dialog destroyed"

);

157  int option

= wxYES_NO | wxYES_DEFAULT | wxICON_EXCLAMATION | wxCENTRE;

158  if

(event.CanVeto())

option

|= wxCANCEL;

159

wxMessageDialog dialog(

NULL

,

"Do you want to save your edited item?"

,

""

,

option

);

160  option

= dialog.ShowModal();

161  if

(

option

== wxID_CANCEL) {

165  if

(

option

== wxID_YES) {

166

wxCommandEvent fake(wxEVT_COMMAND_BUTTON_CLICKED,

ID_B_SAVE

);

179

paramWxStr.Printf(

"%s"

, paramStr.c_str());

195  ERRORMSG

(

"MakeBrParameterString() failed - neither elementid nor celementid is set"

);

198  ERRORMSG

(

"MakeBrParameterString() failed - both elementid and celementid are set"

);

201  ERRORMSG

(

"MakeBrParameterString() failed - both subelementid and csubelementid are set"

);

205

paramWxStr.Printf(

"%s"

, paramStr.c_str());

217

CCdd_descr_set::Tdata::iterator d, de =

descrSet

->Set().end();

218  for

(d=

descrSet

->Set().begin(); d!=de; ++d) {

219  if

((*d)->IsBook_ref()) {

227  if

(descrText.size() > 0)

228

listbox->Append(descrText, &(*d));

231  if

(selectedItem < 0 && listbox->GetCount() > 0)

251

tAddress->SetValue(s);

259

tSubaddress->SetValue(s);

262

cType->SetSelection(1);

264

tSubaddress->Clear();

268

listbox->Enable(!

editOn

);

271

tAddress->Enable(

editOn

);

272

tSubaddress->Enable(

editOn

);

284

bDown->Enable(!readOnly && !

editOn

&&

selectedItem

< (

int

) listbox->GetCount() - 1);

286

bSave->Enable(!readOnly &&

editOn

);

287

bNew->Enable(

false

);

289

bLaunch->Enable(!

editOn

&& (

int

) listbox->GetCount() > 0);

290

bPaste->Enable(!readOnly && !

editOn

);

295  if

(selectedItem < 0) {

300

CCdd_descr_set::Tdata::iterator d, de = descrSet->

Set

().end();

302  for

(d=descrSet->

Set

().begin(); d!=de; ++d) {

303  if

((*d)->IsBook_ref()) {

304  if

(s == selectedItem) {

312  ERRORMSG

(

"InsertAfter() - selectedItem = "

<< selectedItem <<

" but there aren't that many book refs"

);

321  string

brBookUrl =

WX_TO_STD

(

data

.GetText().Strip(wxString::both));

324

descr->SetBook_ref().Assign(*bookRef);

338  string

portalBookUrl =

WX_TO_STD

(

data

.GetText().Strip(wxString::both));

341

descr->SetBook_ref().Assign(*bookRef);

352  int

eventId =

event

.GetId();

375

url.Printf(

"https://www.ncbi.nlm.nih.gov/books/%s"

,

378

url.Printf(

"https://www.ncbi.nlm.nih.gov/bookshelf/br.fcgi?book=%s"

,

394  WARNINGMSG

(

"CDDBookRefDialog::OnClick() - invalid up/down request"

);

398

*switchWith = *selDescr;

414  if

(tAddress->GetValue().size() == 0) {

419  if

(selDescr && !

isNew

) {

432  long

address, subaddress;

433  if

(tAddress->GetValue().ToLong(&address)) {

440  if

(tSubaddress->GetValue().size() > 0) {

441  if

(tSubaddress->GetValue().ToLong(&subaddress)) {

456  else if

(event.GetId() ==

ID_B_NEW

) {

462  if

(wxTheClipboard->Open()) {

463  if

(wxTheClipboard->IsSupported(wxDF_TEXT)) {

465

wxTextDataObject

data

;

466

wxTheClipboard->GetData(

data

);

478  INFOMSG

(

"Book reference could not be created from pasted URL:\n"

<<

data

.GetText());

482

wxTheClipboard->Close();

487  if

(selDescr && !

isNew

) {

488

CCdd_descr_set::Tdata::iterator d, de =

descrSet

->Set().end();

489  for

(d=

descrSet

->Set().begin(); d!=de; ++d) {

490  if

(&(*d) == selDescr) {

519

wxBoxSizer *item0 =

new

wxBoxSizer( wxVERTICAL );

521

wxStaticBox *item2 =

new

wxStaticBox( parent, -1,

wxT

(

"Book References"

) );

522

wxStaticBoxSizer *item1 =

new

wxStaticBoxSizer( item2, wxVERTICAL );

524

wxString *strs3 = (wxString*)

NULL

;

525

wxListBox *item3 =

new

wxListBox( parent,

ID_LISTBOX

, wxDefaultPosition, wxSize(80,100), 0, strs3, wxLB_SINGLE );

526

item1->Add( item3, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

528

wxGridSizer *item4 =

new

wxGridSizer( 2, 0, 0, 0 );

530

wxButton *item5 =

new

wxButton( parent,

ID_B_UP

,

wxT

(

"Move Up"

), wxDefaultPosition, wxDefaultSize, 0 );

531

item4->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );

533

wxButton *item6 =

new

wxButton( parent,

ID_B_LAUNCH

,

wxT

(

"Launch"

), wxDefaultPosition, wxDefaultSize, 0 );

534

item4->Add( item6, 0, wxALIGN_CENTRE|wxALL, 5 );

536

wxButton *item7 =

new

wxButton( parent,

ID_B_NEW

,

wxT

(

"New"

), wxDefaultPosition, wxDefaultSize, 0 );

537

item4->Add( item7, 0, wxALIGN_CENTRE|wxALL, 5 );

539

wxButton *item8 =

new

wxButton( parent,

ID_B_SAVE

,

wxT

(

"Save"

), wxDefaultPosition, wxDefaultSize, 0 );

540

item4->Add( item8, 0, wxALIGN_CENTRE|wxALL, 5 );

542

wxButton *item9 =

new

wxButton( parent,

ID_B_DOWN

,

wxT

(

"Move Down"

), wxDefaultPosition, wxDefaultSize, 0 );

543

item4->Add( item9, 0, wxALIGN_CENTRE|wxALL, 5 );

545

wxButton *item10 =

new

wxButton( parent,

ID_B_EDIT

,

wxT

(

"Edit"

), wxDefaultPosition, wxDefaultSize, 0 );

546

item4->Add( item10, 0, wxALIGN_CENTRE|wxALL, 5 );

548

wxButton *item11 =

new

wxButton( parent,

ID_B_PASTE

,

wxT

(

"Paste"

), wxDefaultPosition, wxDefaultSize, 0 );

549

item4->Add( item11, 0, wxALIGN_CENTRE|wxALL, 5 );

551

wxButton *item12 =

new

wxButton( parent,

ID_B_DELETE

,

wxT

(

"Delete"

), wxDefaultPosition, wxDefaultSize, 0 );

552

item4->Add( item12, 0, wxALIGN_CENTRE|wxALL, 5 );

554

item1->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

556

wxStaticLine *item13 =

new

wxStaticLine( parent,

ID_LINE

, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );

557

item1->Add( item13, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

559

wxFlexGridSizer *item14 =

new

wxFlexGridSizer( 1, 0, 0, 0 );

560

item14->AddGrowableCol( 1 );

562

wxStaticText *item15 =

new

wxStaticText( parent,

ID_TEXT

,

wxT

(

"Name:"

), wxDefaultPosition, wxDefaultSize, 0 );

563

item14->Add( item15, 0, wxALIGN_CENTRE|wxALL, 5 );

565

wxTextCtrl *item16 =

new

wxTextCtrl( parent,

ID_T_NAME

,

wxT

(

""

), wxDefaultPosition, wxSize(80,-1), 0 );

566

item14->Add( item16, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

568

wxStaticText *item17 =

new

wxStaticText( parent,

ID_TEXT

,

wxT

(

"Type:"

), wxDefaultPosition, wxDefaultSize, 0 );

569

item14->Add( item17, 0, wxALIGN_CENTRE|wxALL, 5 );

573  wxT

(

"unassigned"

),

584

wxChoice *item18 =

new

wxChoice( parent,

ID_C_TYPE

, wxDefaultPosition, wxSize(100,-1), 10, strs18, 0 );

585

item14->Add( item18, 0, wxALIGN_CENTRE|wxALL, 5 );

587

item1->Add( item14, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

589

wxFlexGridSizer *item19 =

new

wxFlexGridSizer( 1, 0, 0, 0 );

590

item19->AddGrowableCol(3);

592

wxStaticText *item20 =

new

wxStaticText( parent,

ID_TEXT

,

wxT

(

"Address:"

), wxDefaultPosition, wxDefaultSize, 0 );

593

item19->Add( item20, 0, wxALIGN_CENTRE|wxALL, 5 );

595

wxTextCtrl *item21 =

new

wxTextCtrl( parent,

ID_T_ADDRESS

,

wxT

(

""

), wxDefaultPosition, wxSize(80,-1), 0 );

596

item19->Add( item21, 0, wxALIGN_CENTRE|wxALL, 5 );

598

wxStaticText *item22 =

new

wxStaticText( parent,

ID_TEXT

,

wxT

(

"Sub-address:"

), wxDefaultPosition, wxDefaultSize, 0 );

599

item19->Add( item22, 0, wxALIGN_CENTRE|wxALL, 5 );

601

wxTextCtrl *item23 =

new

wxTextCtrl( parent,

ID_T_SUBADDRESS

,

wxT

(

""

), wxDefaultPosition, wxSize(80,-1), 0 );

602

item19->Add( item23, 0, wxGROW

|wxALL, 5 );

604

item1->Add( item19, 0, wxGROW

|wxALL, 5 );

606

item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

608

wxButton *item24 =

new

wxButton( parent,

ID_B_DONE

,

wxT

(

"Done"

), wxDefaultPosition, wxDefaultSize, 0 );

609

item24->SetDefault();

610

item0->Add( item24, 0, wxALIGN_CENTRE|wxALL, 5 );

614

parent->SetAutoLayout(

TRUE

);

615

parent->SetSizer( item0 );

618

item0->Fit( parent );

619

item0->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)

bool BrURLToBookRef(wxTextDataObject &data, CRef< CCdd_descr > &descr)

static TypeStringAssociator< CCdd_book_ref::ETextelement > enum2str

static wxString MakePortalParameterString(const CCdd_book_ref &bref)

wxSizer * SetupBookRefDialog(wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)

static wxString MakeBrParameterString(const CCdd_book_ref &bref)

bool BookURLToBookRef(wxTextDataObject &data, CRef< CCdd_descr > &descr)

static void InsertAfter(int selectedItem, CCdd_descr_set *descrSet, CCdd_descr *descr)

CDDBookRefDialog ** dialogHandle

void SetWidgetStates(void)

ncbi::objects::CCdd_descr_set * descrSet

void OnCloseWindow(wxCloseEvent &event)

void OnClick(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.

bool BrBookURLToCCddBookRef(const string &brBookUrl, CRef< CCdd_book_ref > &bookRef)

bool IsPortalDerivedBookRef(const CCdd_book_ref &bookRef)

bool PortalBookURLToCCddBookRef(const string &portalBookUrl, CRef< CCdd_book_ref > &bookRef)

string CCddBookRefToPortalString(const CCdd_book_ref &bookRef)

string CCddBookRefToBrString(const CCdd_book_ref &bookRef)

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

bool NotEmpty(void) const THROWS_NONE

Check if CRef is not empty – pointing to an object and has a non-null value.

#define END_SCOPE(ns)

End the previously defined scope.

#define BEGIN_SCOPE(ns)

Define a new scope.

const TBookname & GetBookname(void) const

Get the Bookname member data.

bool IsSetCsubelementid(void) const

exact address, if character string Check if a value has been assigned to Csubelementid data member.

bool IsSetCelementid(void) const

address of the text element, if character string Check if a value has been assigned to Celementid dat...

void ResetElementid(void)

Reset Elementid data member.

void SetTextelement(TTextelement value)

Assign a value to Textelement data member.

bool IsSetElementid(void) const

numerical address of the text-element Check if a value has been assigned to Elementid data member.

void ResetCsubelementid(void)

Reset Csubelementid data member.

const TCelementid & GetCelementid(void) const

Get the Celementid member data.

void SetElementid(TElementid value)

Assign a value to Elementid data member.

TTextelement GetTextelement(void) const

Get the Textelement member data.

bool IsSetSubelementid(void) const

exact address, used with section Check if a value has been assigned to Subelementid data member.

void SetSubelementid(TSubelementid value)

Assign a value to Subelementid data member.

void ResetSubelementid(void)

Reset Subelementid data member.

Tdata & Set(void)

Assign a value to data member.

void SetBookname(const TBookname &value)

Assign a value to Bookname data member.

void SetCelementid(const TCelementid &value)

Assign a value to Celementid data member.

TElementid GetElementid(void) const

Get the Elementid member data.

TBook_ref & SetBook_ref(void)

Select the variant.

void ResetCelementid(void)

Reset Celementid data member.

const TCsubelementid & GetCsubelementid(void) const

Get the Csubelementid member data.

TSubelementid GetSubelementid(void) const

Get the Subelementid member data.

void SetCsubelementid(const TCsubelementid &value)

Assign a value to Csubelementid data member.

@ eTextelement_figgrp

a figure or set of figures

@ eTextelement_unassigned

type of element

@ eTextelement_biblist

a lisf of references

@ eTextelement_box

an inserted box

@ eTextelement_section

a section or paragraph

@ eTextelement_chapter

a whole chapter

@ eTextelement_glossary

glossary

@ eTextelement_appendix

appendix

@ eTextelement_table

a table

unsigned int

A callback function used to compare two keys in a database.

#define TRUE

bool replacment for C indicating true.

C++ wrappers for the Perl-compatible regular expression (PCRE) library.


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