32 #include <wx/platform.h>
55 #include <OpenGL/OpenGL.h>
76 const wxPoint& pos,
const wxSize&
size,
long style )
80 m_ForwardKeyEvents(
false),
90 CGLPixelFormatAttribute attribs[1];
91 attribs[0] =
static_cast<CGLPixelFormatAttribute
>(0);
92 GLint num_pixel_formats = 0;
93 CGLChoosePixelFormat(attribs, &
format, &num_pixel_formats);
94 _TRACE(
"OpenGL context created!");
96 EnableFullScreenView(
false);
115 if (manager !=
NULL) {
127 static wxEventType inEvent = wxEVT_NULL;
128 if (inEvent == event.GetEventType())
130 inEvent =
event.GetEventType();
135 wxEventType
type =
event.GetEventType();
139 if (event.GetId() == wxID_SELECTALL) {
140 wxWindow* focused = wxWindow::FindFocus();
141 if (focused !=
NULL) {
142 res = focused->GetEventHandler()->ProcessEvent(event);
151 res =
handler->ProcessEvent(event);
157 res = TParent::ProcessEvent(event);
160 inEvent = wxEVT_NULL;
168 if(event.CanVeto()) {
180 SetEvtHandlerEnabled(
false);
216 #ifndef NCBI_OS_DARWIN
226 #if(wxMAJOR_VERSION==2 && wxMINOR_VERSION<9)
227 if ( !wxGetMouseState().LeftDown() ) {
229 if ( !wxGetMouseState().LeftIsDown() ) {
232 #ifndef NCBI_OS_DARWIN
248 int mbar_height, maxy, maxx;
250 wxPoint pos = this->GetPosition();
251 if (pos.y < mbar_height) {
253 this->SetPosition(pos);
269 class CPagerSlot :
public wxPanel
271 DECLARE_EVENT_TABLE()
276 void OnPaint(wxPaintEvent& event);
277 void OnMouseDown(wxMouseEvent& event);
278 void OnMouseEnter(wxMouseEvent& event);
279 void OnMouseLeave(wxMouseEvent& event);
283 wxSizerItem* m_IconItem =
nullptr;
288 BEGIN_EVENT_TABLE(CPagerSlot, wxPanel)
289 EVT_LEFT_DOWN(CPagerSlot::OnMouseDown)
290 EVT_ENTER_WINDOW(CPagerSlot::OnMouseEnter)
291 EVT_LEAVE_WINDOW(CPagerSlot::OnMouseLeave)
292 EVT_PAINT(CPagerSlot::OnPaint)
299 long style = wxBORDER_NONE;
301 if (!wxPanel::Create(parent,
wxID_ANY, wxDefaultPosition, wxDefaultSize, style))
306 wxSizer* sizer =
new wxBoxSizer(wxHORIZONTAL);
308 m_Icon = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, wxSize(16, 16));
309 m_IconItem = sizer->Add(16, 16, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 5);
317 void CPagerSlot::OnPaint(wxPaintEvent& event)
324 dc.SetPen(*wxTRANSPARENT_PEN);
325 wxRect rc = GetClientRect();
326 dc.DrawRectangle(rc);
329 wxRect rc = m_IconItem->GetRect();
330 dc.DrawIcon(m_Icon, rc.GetLeftTop());
333 void CPagerSlot::OnMouseDown(wxMouseEvent& )
335 m_Frame->SetShowPagerMessage();
338 void CPagerSlot::OnMouseEnter(wxMouseEvent& event)
344 void CPagerSlot::OnMouseLeave(wxMouseEvent& event)
367 CPagerSlot* slot =
new CPagerSlot();
368 if (slot->Create(
this)) {
371 int width = slot->GetSize().x;
373 int width = slot->GetSize().x + 5;
377 slot->SetToolTip(
wxT(
"View Genome Workbench message"));
386 if (::wxFileExists(md5file)) {
413 bool doNotShowAgain =
false;
415 if (::wxFileExists(md5file)) {
423 doNotShowAgain = (
md5 == md5saved);
438 ::wxRemoveFile(md5file);
Checksum and hash calculation classes.
CChecksum – Checksum calculator.
CDockManager CDockManager sends requests to Window Manager, Window Manager makes decisions about dele...
void OnKeyDown(wxKeyEvent &event)
void OnKeyUp(wxKeyEvent &event)
void RaiseFloatingInZOrder()
CMainFrame Base class for Application Main Frame, derive your frames from this one.
static wxColour GetBackColor(bool hot)
static wxString ResolvePath(const wxString &path, const wxString &rel_name)
Utility function to hide the platform specifics of locating our standard directories and files.
CWorkbenchFrame Main Application Frame for Workbench-based applications.
IWorkbench is the central interface in the application framework.
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
std::ofstream out("events_result.xml")
main entry point for tests
void ShowFeedbackURL()
Open the feedback URL, using the default browser.
static void md5(const char *src, const char *out)
string GetHexSum(void) const
Return string with checksum in hexadecimal form.
void AddLine(const char *line, size_t len)
#define NCBI_CATCH(message)
Catch CExceptions as well This macro is deprecated - use *_X or *_XX variant instead of it.
CDockManager * m_DockManager
virtual IMenuService * GetMenuService()=0
void SetPagerMessage(const string &message)
virtual bool CanShutDown()=0
void OnKeyUp(wxKeyEvent &event)
virtual void ForwardKeyEventsTo(CDockManager *manager)
IDockManagerKeyHook implementation.
virtual IStatusBarService * GetStatusBarService()=0
void OnActivate(wxActivateEvent &event)
void OnKeyDown(wxKeyEvent &event)
virtual void SetWorkbench(IWorkbench *workbench)
virtual void ShutDown()=0
CWorkbenchFrame()
Constructors.
void x_ShowPagerMessage()
virtual void ResetMenuBar()=0
bool ProcessEvent(wxEvent &event)
void OnCloseWindow(wxCloseEvent &event)
handle request to close window
void OnIdle(wxIdleEvent &event)
virtual void InsertSlot(int index, wxWindow *slot, int width=50)=0
void OnMove(wxMoveEvent &event)
@ eCmdParentActivate
tool tip cmd indicating a main-window docking update
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
const struct ncbi::grid::netcache::search::fields::SIZE size
wxEVT_COMMAND_MENU_SELECTED
void SetFocus(CRef< objects::CSeq_entry > entry)
static const wxChar * kPagerFile
void GetMacDragWindowBounds(wxTopLevelWindow *win, int &menubar_height, int &maxy, int &maxx)
Returns window boundaries for mac (top menubar width and max height)
void BroadcastCommandToChildWindows(wxWindow *window, int cmd_id, int cmd_data=0)
Sends command event with id 'cmd_id' to window and all its children.