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

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

66 #include <wx/bitmap.h> 68 #include <wx/scrolwin.h> 69 #include <wx/hyperlink.h> 70 #include <wx/statline.h> 72 #include <wx/stattext.h> 73 #include <wx/notebook.h> 121

wxWindowID

id

,

const

wxPoint& pos,

const

wxSize&

size

,

long

style ) :

141 

SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);

142

wxPanel::Create( parent,

id

, pos,

size

, style );

147

GetSizer()->SetSizeHints(

this

);

188

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxVERTICAL);

189

itemPanel1->SetSizer(itemBoxSizer2);

191

wxBoxSizer* itemBoxSizer3 =

new

wxBoxSizer(wxHORIZONTAL);

192

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

194

wxHyperlinkCtrl* itemHyperlinkCtrl4 =

new

wxHyperlinkCtrl( itemPanel1,

ID_ADDAUTH

,

_

(

"Add Author"

), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );

195

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

197

wxHyperlinkCtrl* itemHyperlinkCtrl5 =

new

wxHyperlinkCtrl( itemPanel1,

ID_ADDCONSORTIUM

,

_

(

"Add Consortium"

), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );

198

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

200

wxHyperlinkCtrl* itemHyperlinkCtrl6 =

new

wxHyperlinkCtrl( itemPanel1,

ID_IMPORT_AUTHORS

,

_

(

"Import Authors"

), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );

201

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

203

wxHyperlinkCtrl* itemHyperlinkCtrl7 =

new

wxHyperlinkCtrl( itemPanel1,

ID_IMPORT_AUTHORS_AFFILIATION

,

_

(

"Import Authors and Affiliation"

), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );

204

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

206

wxStaticLine* itemStaticLine8 =

new

wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );

207

itemBoxSizer2->Add(itemStaticLine8, 0, wxGROW|wxALL, 5);

209

wxBoxSizer* itemBoxSizer10 =

new

wxBoxSizer(wxVERTICAL);

210

itemBoxSizer2->Add(itemBoxSizer10, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);

212

wxBoxSizer* itemBoxSizer9 =

new

wxBoxSizer(wxHORIZONTAL);

213

itemBoxSizer10->Add(itemBoxSizer9, 0, wxALIGN_LEFT|wxALL, 5);

215

wxStaticText* itemStaticText10 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"First Name"

), wxDefaultPosition, wxSize(90, -1), wxALIGN_CENTRE );

216

itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

218

wxStaticText* itemStaticText11 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"M.I."

), wxDefaultPosition, wxSize(90, -1), wxALIGN_CENTRE );

219

itemBoxSizer9->Add(itemStaticText11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

221

wxStaticText* itemStaticText12 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Last Name"

), wxDefaultPosition, wxSize(90, -1), wxALIGN_CENTRE );

222

itemBoxSizer9->Add(itemStaticText12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

224

wxStaticText* itemStaticText13 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Suffix"

), wxDefaultPosition, wxSize(50, -1), wxALIGN_CENTRE );

225

itemBoxSizer9->Add(itemStaticText13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

227

wxStaticText* itemStaticText14 =

new

wxStaticText( itemPanel1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );

228

itemBoxSizer9->Add(itemStaticText14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

230  m_ScrolledWindow

=

new

wxScrolledWindow( itemPanel1,

ID_PANEL

, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );

235  m_Sizer

=

new

wxFlexGridSizer(0, 2, 0, 0);

240  if

(name_list_exists)

242

wxBoxSizer* itemBoxSizer4 =

new

wxBoxSizer(wxHORIZONTAL);

243

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

245

wxButton* itemButton1 =

new

wxButton( itemPanel1,

ID_REPLACE_ALL_AUTHORS

,

_

(

"Replace All Authors"

), wxDefaultPosition, wxDefaultSize, 0 );

246

itemBoxSizer4->Add(itemButton1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

248

wxButton* itemButton2 =

new

wxButton( itemPanel1,

ID_REPLACE_SAME_AUTHORS

,

_

(

"Replace Same Authors"

), wxDefaultPosition, wxDefaultSize, 0 );

249

itemBoxSizer4->Add(itemButton2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

261  while

(

m_Sizer

->GetItemCount() > 0) {

263  m_Sizer

->GetItem(pos)->DeleteWindows();

268  int

total_height = 0;

271  int

max_rows_displayed = 6;

276

auth != 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);

284

itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());

285  m_Sizer

->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);

287  int

row_height, row_width;

288  row

->GetClientSize(&row_width, &row_height);

289  if

(row_width > total_width) {

290

total_width = row_width;

292  if

(num_rows < max_rows_displayed) {

293

total_height += row_height;

299

}

else if

((*auth)->GetName().IsConsortium()) {

301  m_Sizer

->Add(

row

, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);

303

itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());

304  m_Sizer

->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);

306  int

row_height, row_width;

307  row

->GetClientSize(&row_width, &row_height);

308  if

(row_width > total_width) {

309

total_width = row_width;

311  if

(num_rows < max_rows_displayed) {

312

total_height += row_height;

325

edited_auth_list.

SetNames

().SetStd().push_back(auth);

328  int

row_height, row_width;

329  row

->GetClientSize(&row_width, &row_height);

330  if

(row_width > total_width) {

331

total_width = row_width;

333  if

(num_rows < max_rows_displayed) {

334

total_height += row_height;

348  if

(!wxPanel::TransferDataToWindow())

357  bool

is_empty =

true

;

380  if

(!wxPanel::TransferDataFromWindow())

386

wxSizerItemList::iterator node =

m_Sizer

->GetChildren().begin();

387  for

(; node !=

m_Sizer

->GetChildren().end(); ++node) {

388

wxWindow *w = (*node)->GetWindow();

394  if

(singleauth_panel) {

395

edited_auth = singleauth_panel->

GetAuthor

();

399

edited_auth = consort_panel->

GetAuthor

();

403  if

(edited_auth && (keep_blank || !

IsAuthorEmpty

(*edited_auth))) {

405

new_auth->

Assign

(*edited_auth);

406

edited_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())

415

new_auth->

SetName

().SetName().SetLast(

"?"

);

416

edited_auth_list.

SetNames

().SetStd().push_back(new_auth);

443

edited_auth_list.

Assign

(auth_list);

454  for

(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it)

456

wxWindow* child = (**it).GetWindow();

473

wxSizerItem* auth =

NULL

;

477  for

(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it)

479

wxWindow* child = (**it).GetWindow();

497 static bool s_IsLastRow

(wxWindow* wnd, wxSizerItemList& itemList)

499  bool

is_last =

false

;

503  for

(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it)

505

wxWindow* child = (**it).GetWindow();

516  if

((auth1 || auth2) && is_last)

532

wxSizerItemList& itemList =

m_Sizer

->GetChildren();

537

edited_auth_list.

SetNames

().SetStd().push_back(auth);

546  if

(event.GetURL() !=

wxT

(

"delete"

)) {

550  DeleteRow

((wxWindow*)event.GetEventObject());

559

wxSizerItemList& itemList =

m_Sizer

->GetChildren();

562

wxSizerItemList::iterator it = itemList.begin();

563

wxSizerItemList::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())

582

wxSizerItemList::iterator after = before;

584  while

(after != itemList.end())

593  if

(after != itemList.end())

595  swap

(*before, *after);

596

(**before).GetWindow()->MoveBeforeInTabOrder((**after).GetWindow());

609

wxSizerItemList& itemList =

m_Sizer

->GetChildren();

612

wxSizerItemList::iterator it = itemList.begin();

613  while

(it != itemList.end())

615

wxWindow *win = (**it).GetWindow();

618  if

((auth1 || auth2) && link == win)

629  row

->MoveBeforeInTabOrder(link);

637

wxSizerItemList& itemList =

m_Sizer

->GetChildren();

640

wxSizerItemList::iterator it = itemList.begin();

641  while

(it != itemList.end())

643

wxWindow *win = (**it).GetWindow();

646  if

((auth1 || auth2) && link == win)

653  while

(it != itemList.end())

655

wxWindow *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);

682

itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());

683  m_Sizer

->Insert(index + 1, itemHyperLink, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 0);

727

edited_auth_list.

SetNames

().SetStd().push_back(auth);

752

edited_auth_list.

SetNames

().SetStd().push_back(auth);

763  m_Sizer

->Add(

row

, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0);

765

itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());

766  m_Sizer

->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);

774  row

->GetClientSize(0, &row_height);

808

wxFileDialog asn_open_file(

this

,

wxT

(

"Import authors and affiliation from file"

),

m_WorkDir

, wxEmptyString,

811

wxFD_OPEN | wxFD_FILE_MUST_EXIST);

813  if

(asn_open_file.ShowModal() == wxID_OK) {

814

wxString path = asn_open_file.GetPath();

815  if

(path.IsEmpty())

return

;

824  string msg

=

"Authors and affiliation could not be imported"

;

857

wxNotebook* notebook =

dynamic_cast<

wxNotebook*

>

(this->GetParent());

864  for

(

size_t i

= 0;

i

< notebook->GetPageCount(); ++

i

) {

887

wxWindow *win = GetParent();

902

win = win->GetParent();

905  return

cmd_processor;

911

wxWindow *win = GetParent();

920

win = win->GetParent();

948  bool

modified =

false

;

954

replacement->

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

996

cmd_processor->

Execute

(comp_cmd);

998

new_names->Assign(edited_names);

1024  bool

modified =

false

;

1030

replacement->

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

1103

cmd_processor->

Execute

(comp_cmd);

1105

new_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