36 #include <wx/stattext.h>
37 #include <wx/textctrl.h>
38 #include <wx/button.h>
39 #include <wx/bitmap.h>
60 DEFINE_EVENT_TYPE(wxEVT_COMMAND_SEQ_GOTO)
61 DEFINE_EVENT_TYPE(wxEVT_COMMAND_SEQ_GOTO_CLOSE)
100 wxEvtHandler* eventHandler,
101 wxWindowID
id,
const wxString& caption,
102 const wxPoint& pos,
const wxSize&
size,
long style )
107 Create(parent,
id, caption, pos,
size, style);
116 const wxString& caption,
const wxPoint& pos,
117 const wxSize&
size,
long style )
120 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
121 wxDialog::Create( parent,
id, caption, pos,
size, style );
126 GetSizer()->SetSizeHints(
this);
131 wxSize maxSize = this->GetSize();
132 maxSize.SetWidth(-1);
133 this->SetMaxSize(maxSize);
174 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
175 itemDialog1->SetSizer(itemBoxSizer2);
177 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
178 itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
180 wxStaticText* itemStaticText4 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Sequence Position/Range:"), wxDefaultPosition, wxDefaultSize, 0 );
181 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
183 m_InputBox =
new wxTextCtrl( itemDialog1,
ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
184 itemBoxSizer3->Add(
m_InputBox, 1, wxGROW|wxALL, 5);
186 wxButton* itemButton6 =
new wxButton( itemDialog1, wxID_OK,
_(
"Go!"), wxDefaultPosition, wxDefaultSize, 0 );
187 itemButton6->SetDefault();
188 itemBoxSizer3->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
190 wxBoxSizer* itemBoxSizer7 =
new wxBoxSizer(wxHORIZONTAL);
191 itemBoxSizer2->Add(itemBoxSizer7, 0, wxGROW|wxALL, 5);
193 wxStaticText* itemStaticText8 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Range examples: 1000; 1000-2000; 1000..2000;\n 10,000:2,000,000; 100k:1m;\n 1000 2000; 1000[tab]2000"), wxDefaultPosition, wxDefaultSize, 0 );
194 itemBoxSizer7->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
196 itemBoxSizer7->Add(7, 8, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
198 wxButton* itemButton10 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Close"), wxDefaultPosition, wxDefaultSize, 0 );
199 itemBoxSizer7->Add(itemButton10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
202 m_InputBox->SetValidator(
CRegexpValidator(
"^[ \t]*[1-9][0-9,]*[ \t]*[kKmM]?((([ \t]*([-:]|\\.\\.)[ \t]*)|([ \t]+))[1-9][0-9,]*[ \t]*[kKmM]?)?[ \t]*$",
"1000\n1000-2000\n1000..2000\n10,000:2,000,000\n100k:1m\n1000 2000\n1000 2000" , &
m_SeqPos) );
251 #ifdef __WXOSX_COCOA__
253 wxWindow* pp = GetParent();
255 f =
dynamic_cast<wxFrame*
>(pp);
256 pp = pp->GetParent();
267 return wxWindow::Show(show);
279 if (Validate() && TransferDataFromWindow()) {
void SetPositionString(const wxString &str)
const wxString & GetPositionString()
bool GetRange(long &from, long &to) const
void CreateControls()
Creates the controls and sizers.
void OnCancelClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnOkClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
wxEvtHandler * m_EventHandler
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CSequenceGotoDlg()
Destructor.
void SetFocusToInputBox()
void OnCloseWindow(wxCloseEvent &event)
wxEVT_CLOSE_WINDOW event handler for ID_CSEQUENCEGOTODLG
virtual bool Show(bool show=true)
CSequenceGotoData * m_Data
void OnTextctrl1Enter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_TEXTCTRL1
CSequenceGotoDlg()
Constructors.
bool Create(wxWindow *parent, wxWindowID id=ID_CSEQUENCEGOTODLG, const wxString &caption=_("Go to sequence"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void Send(CSequenceGotoEvent &event)
void SetPositionString(const wxString &str)
static bool StringToRange(const string &range_str, long &from, long &to)
Convert a range string to a range.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
#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
void RemoveChildWindow(wxFrame *parent, wxWindow *child)
For OSX Cocoa, removes child window connection (for layering) to parent.
string ToStdString(const wxString &s)
void AddChildWindowAbove(wxFrame *parent, wxWindow *child)
For OSX Cocoa, puts child window in front of (visually) parent.