32 #include "wx/imaglist.h"
35 #include <wx/msgdlg.h>
37 #include <wx/button.h>
76 : m_SequenceId(select), m_Seqs(&seqs)
91 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
92 CDialog::Create( parent,
id, caption, pos,
size, style );
97 GetSizer()->SetSizeHints(
this);
129 DECLARE_EVENT_TABLE()
139 void OnSize(wxSizeEvent& event);
141 void SetSeqs(vector<CFlatFileSeq>& seqs);
153 : wxListCtrl(parent,
id, pos,
size, style)
155 AppendColumn(
wxT(
"Sequence Id"));
160 wxRect rect = GetClientRect();
161 SetColumnWidth(0, rect.GetWidth());
168 SetItemCount((
long)
m_Seqs->size());
174 return wxEmptyString;
189 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
190 itemCDialog1->SetSizer(itemBoxSizer2);
192 m_SeqList =
new CListCtrlSeqs( itemCDialog1,
ID_LISTCTRL, wxDefaultPosition, itemCDialog1->ConvertDialogToPixels(wxSize(100, 150)), wxLC_REPORT|wxLC_VIRTUAL|wxLC_SINGLE_SEL );
193 itemBoxSizer2->Add(
m_SeqList, 1, wxGROW|wxALL, 5);
195 wxStdDialogButtonSizer* itemStdDialogButtonSizer4 =
new wxStdDialogButtonSizer;
197 itemBoxSizer2->Add(itemStdDialogButtonSizer4, 0, wxALIGN_RIGHT|wxALL, 5);
198 wxButton* itemButton5 =
new wxButton( itemCDialog1, wxID_OK,
_(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
199 itemStdDialogButtonSizer4->AddButton(itemButton5);
201 wxButton* itemButton6 =
new wxButton( itemCDialog1, wxID_CANCEL,
_(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
202 itemStdDialogButtonSizer4->AddButton(itemButton6);
204 itemStdDialogButtonSizer4->Realize();
210 for (
size_t i = 0;
i <
m_Seqs->size(); ++
i) {
212 m_SeqList->SetItemState((
long)
i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
221 if (
m_SeqList->GetSelectedItemCount() != 1) {
222 wxMessageBox(
wxT(
"Please, select sequence id."),
wxT(
"Error"),
223 wxOK | wxICON_ERROR,
this);
228 item =
m_SeqList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
230 return CDialog::TransferDataFromWindow();
virtual void EndModal(int retCode)
void OnSize(wxSizeEvent &event)
vector< CFlatFileSeq > * m_Seqs
virtual wxString OnGetItemText(long item, long column) const
void SetSeqs(vector< CFlatFileSeq > &seqs)
CListCtrlSeqs(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
CListCtrlSeqs * m_SeqList
void CreateControls()
Creates the controls and sizers.
bool Create(wxWindow *parent, wxWindowID id=ID_CSELECTSEQUENCEDLG, const wxString &caption=_("Select Sequence to View"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(266, 184), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
virtual bool TransferDataFromWindow()
CSelectSequenceDlg()
Constructors.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void Init()
Initialises member variables.
~CSelectSequenceDlg()
Destructor.
void OnListctrlItemActivated(wxListEvent &event)
wxEVT_COMMAND_LIST_ITEM_ACTIVATED event handler for ID_LISTCTRL
vector< CFlatFileSeq > * m_Seqs
static bool ShowToolTips()
Should we show tooltips?
static const char * column
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CSELECTSEQUENCEDLG_POSITION
#define SYMBOL_CSELECTSEQUENCEDLG_TITLE
#define SYMBOL_CSELECTSEQUENCEDLG_SIZE
#define SYMBOL_CSELECTSEQUENCEDLG_IDNAME
#define SYMBOL_CSELECTSEQUENCEDLG_STYLE
wxString ToWxString(const string &s)