void wxSplitterWindow::Init() { WX_INIT_CONTROL_CONTAINER(); m_splitMode = wxSPLIT_VERTICAL; m_permitUnsplitAlways = true; m_windowOne = NULL; m_windowTwo = NULL; m_dragMode = wxSPLIT_DRAG_NONE; m_oldX = 0; m_oldY = 0; m_sashStart = 0; m_sashPosition = m_requestedSashPosition = 0; m_sashGravity = 0.0; m_sashSize = -1; // -1 means use the native sash size m_lastSize = wxSize(0,0); m_checkRequestedSashPosition = false; m_minimumPaneSize = 0; m_sashCursorWE = wxCursor(wxCURSOR_SIZEWE); m_sashCursorNS = wxCursor(wxCURSOR_SIZENS); m_sashTrackerPen = new wxPen(*wxBLACK, 2, wxPENSTYLE_SOLID); m_needUpdating = false; m_isHot = false; }
void wxSplitterWindow::Init() { m_container.SetContainerWindow(this); m_splitMode = wxSPLIT_VERTICAL; m_permitUnsplitAlways = true; m_windowOne = (wxWindow *) NULL; m_windowTwo = (wxWindow *) NULL; m_dragMode = wxSPLIT_DRAG_NONE; m_oldX = 0; m_oldY = 0; m_firstX = 0; m_firstY = 0; m_sashPosition = m_requestedSashPosition = 0; m_sashGravity = 0.0; m_sashSize = -1; // -1 means use the native sash size m_lastSize = wxSize(0,0); m_checkRequestedSashPosition = false; m_minimumPaneSize = 0; m_sashCursorWE = wxCursor(wxCURSOR_SIZEWE); m_sashCursorNS = wxCursor(wxCURSOR_SIZENS); m_sashTrackerPen = new wxPen(*wxBLACK, 2, wxSOLID); m_needUpdating = false; m_isHot = false; }
/**< select a CIRCLE/ELLIPSE/SQUARE/RECTANGLE in image */ bool ImagePanel::SelTools(IMGPL_CMD cmd, const wxString& imgFile /*= wxEmptyString*/, int hx /*= 0*/, int hy /*= 0*/) { if (!m_img.IsOk()) return false; if (cmd == IMGPL_CMD::NONE) { // mouse function is none m_stMP.emFuc = IMGPL_CMD::NONE; // set mouse cur SetCursor(wxCursor(wxCURSOR_ARROW)); return true; } if ( cmd != IMGPL_CMD::SEL_CIRCLE && cmd != IMGPL_CMD::SEL_ELLIPSE && cmd != IMGPL_CMD::SEL_SQUARE && cmd != IMGPL_CMD::SEL_RECTANGLE) return false; // mouse function is sel a circle m_stMP.emFuc = cmd; // set mouse cur if (imgFile.IsEmpty()) SetCursor(wxCursor(wxCURSOR_CROSS)); else { wxImage img(imgFile, wxBITMAP_TYPE_PNG); img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hx); img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, hy); SetCursor(wxCursor(img)); } return true; }
// ----------------------------------------------------------------------------- // Called when the mouse pointer is moved within the canvas // ----------------------------------------------------------------------------- void GfxCanvas::onMouseMovement(wxMouseEvent& e) { bool refresh = false; // Check if the mouse is over the image int x = e.GetPosition().x; int y = e.GetPosition().y - 2; bool on_image = onImage(x, y); cursor_pos_ = imageCoords(x, y); if (on_image && editing_mode_ != EditMode::None) { if (cursor_pos_ != prev_pos_) generateBrushShadow(); prev_pos_ = cursor_pos_; } if (on_image != image_hilight_) { image_hilight_ = on_image; refresh = true; // Update cursor if drag allowed if (on_image) { if (editing_mode_ != EditMode::None) SetCursor(wxCursor(wxCURSOR_PENCIL)); else if (allow_drag_) SetCursor(wxCursor(wxCURSOR_SIZING)); } else if (allow_drag_ && !e.LeftIsDown()) SetCursor(wxNullCursor); } // Drag if (e.LeftIsDown()) { if (editing_mode_ != EditMode::None) { brushCanvas(x, y); } else { drag_pos_.set(e.GetPosition().x, e.GetPosition().y); refresh = true; } } else if (e.MiddleIsDown()) { offset_ = offset_ + Vec2d(e.GetPosition().x - mouse_prev_.x, e.GetPosition().y - mouse_prev_.y); refresh = true; } // Right mouse down if (e.RightIsDown() && on_image) pickColour(x, y); if (refresh) Refresh(); mouse_prev_.set(e.GetPosition().x, e.GetPosition().y); }
void View2D::UpdateCursor() { char cur=0; if(cur_action==V2D_ACTION_BC)cur=10; if(cur_action==V2D_ACTION_ZOOM)cur=2; if(cur_action==V2D_ACTION_TRANSLATE)cur=1; if(sel_obj==V2D_SELECTION_OBJECT_BB) { if(sel_part==V2D_SELECTION_PART_FACE)cur=7; if(sel_part==V2D_SELECTION_PART_EDGE) { cur = sel_id<=1?4:5; } if(sel_part==V2D_SELECTION_PART_POINT) { cur = (sel_id==1 || sel_id==2)?8:9; if(mirror.x*mirror.y<0)cur = 8+9-cur; } } if(sel_obj==V2D_SELECTION_OBJECT_CENTER) { if(V2D_SELECTION_PART_X==sel_part)cur=4; if(V2D_SELECTION_PART_Y==sel_part)cur=5; if(V2D_SELECTION_PART_CENTER==sel_part)cur=7; } /* if(mouse_left_is_down&&selected_obj==V2D_SELECTION_OBJECT_BB&&(selected_part==V2D_SELECTION_PART_FACE||selected_part==V2D_SELECTION_PART_POINT))cur=7;else if(mouse_left_is_down&&selected_obj==V2D_SELECTION_OBJECT_BB&&(selected_part==V2D_SELECTION_PART_FACE||selected_part==V2D_SELECTION_PART_POINT))cur=7;else if(mouse_left_is_down&&selected_obj==V2D_SELECTION_OBJECT_BB&&selected_part==V2D_SELECTION_PART_EDGE&&(selected_id<=1))cur=4;else if(mouse_left_is_down&&selected_obj==V2D_SELECTION_OBJECT_BB&&selected_part==V2D_SELECTION_PART_EDGE)cur=5;else */ if(old_cur==cur)return; old_cur=cur; wxCursor c; switch(cur) { case 0: c = wxCursor(wxCURSOR_ARROW);break; case 1: c = wxCursor(wxImage("Images/translate.png",wxBITMAP_TYPE_PNG));break; case 2: c = wxCursor(wxImage("Images/zoom.png",wxBITMAP_TYPE_PNG));break; case 3: c = wxCursor(wxImage("Images/add.png",wxBITMAP_TYPE_PNG));break; case 4: c = wxCursor(wxCURSOR_SIZENS);break; case 5: c = wxCursor(wxCURSOR_SIZEWE);break; case 7: c = wxCursor(wxCURSOR_SIZING);break; case 8: c = wxCursor(wxCURSOR_SIZENESW);break; case 9: c = wxCursor(wxCURSOR_SIZENWSE);break; case 10: c = wxCursor(wxImage("Images/BC.png",wxBITMAP_TYPE_PNG));break; } SetCursor(c); }
wxCursor CParameter::CPoint::GetCursor() { switch(m_sizing) { case SIZE_VALUE: return wxCursor(wxCURSOR_SIZENS); case SIZE_OFFSET: return wxCursor(wxCURSOR_SIZEWE); case SIZE_ALL: return wxCursor(wxCURSOR_SIZING); default: return wxCursor(wxCURSOR_ARROW); } }
wxDropSource::wxDropSource( wxWindow *win ) { #if 0 m_window = win; m_data = (wxDataObject *) NULL; m_retValue = wxDragCancel; m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY ); m_goaheadCursor = wxCursor( wxCURSOR_HAND ); #endif }
wxCursor SplitterWindow2::sizeCursor() const { switch (m_splitMode) { case SplitMode_Horizontal: return wxCursor(wxCURSOR_SIZENS); case SplitMode_Vertical: return wxCursor(wxCURSOR_SIZEWE); case SplitMode_Unset: return wxCursor(); switchDefault() } }
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win ) { #if 0 g_blockEventsOnDrag = true; m_window = win; m_widget = win->m_widget; if (win->m_wxwindow) m_widget = win->m_wxwindow; m_retValue = wxDragCancel; m_data = &data; m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY ); m_goaheadCursor = wxCursor( wxCURSOR_HAND ); #endif }
void MapGridCtrl::OnLeftDown(wxMouseEvent& event) { SetCursor(wxCursor(wxCURSOR_HAND)); m_first_mouse_pos = event.GetPosition(); m_last_mouse_pos = event.GetPosition(); m_in_mouse_drag = true; }
bool ImagePanel::MLUImgMove(wxMouseEvent& event) { if (m_stMP.iState == 2) { m_stMP.iState = 0; // new point & move incremention m_stMP.ptE.x = event.m_x; m_stMP.ptE.y = event.m_y; m_stMP.szMv.x = m_stMP.ptE.x - m_stMP.ptB.x; m_stMP.szMv.y = m_stMP.ptE.y - m_stMP.ptB.y; // Notify Parent: IMG_MOVE wxImgplEvent evt(wxEVT_IMGPL, GetId()); evt.SetCMD(IMGPL_CMD::IMG_MOVE); evt.SetParam((void*)&m_stMP.szMv); GetParent()->GetEventHandler()->ProcessEvent(evt); // move the image m_rcDest = m_stMP.rcDO; m_rcSrc = m_stMP.rcSO; ImgMove(m_stMP.szMv); } m_stMP.iState = 0; // cursor SetCursor(wxCursor(_T("./skin/HandOpen.cur"), wxBITMAP_TYPE_CUR)); // release mouse ReleaseMouse(); return true; }
bool CLinkButton::Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name ) { bool bRetVal = wxBitmapButton::Create(parent, id, bitmap, pos, size, style, validator, name); m_HandCursor = wxCursor(wxCURSOR_HAND); return bRetVal; }
void wxListSelection::Init(const StringArray &array, const wxString &data) { // Initialize the data fields. for(size_t i = 0; i < array.size(); ++i) { mpImpl->mFields[array[i]] = swEmpty; } // Set the primary data. mpImpl->mFields[array[0]] = data; // If the primary information is empty, add some temp text for calculating // the height correctly. if(true == data.IsEmpty()) { mpImpl->mFields[array[0]] = swAy; } // Grab skin values. OnSkin(); if(true == data.IsEmpty()) { mpImpl->mFields[array[0]] = swEmpty; } SetCursor(wxCursor(wxCURSOR_HAND)); }
void GSPanel::OnFocus( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = true; if( g_Conf->GSWindow.AlwaysHideMouse ) { SetCursor( wxCursor(wxCURSOR_BLANK) ); m_CursorShown = false; } else DoShowMouse(); #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 9}; // X equivalent of FocusIn; PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus set"); UpdateScreensaver(); }
CScrollBar::CScrollBar( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size) :wxPanel( parent, id, pos, size, wxTAB_TRAVERSAL | wxBORDER, "panel" ) { m_pParent = parent; m_SBLA = wxImage("bitmaps/sb_la.bmp"); m_SBRA = wxImage("bitmaps/sb_ra.bmp"); m_SBLC = wxImage("bitmaps/sb_lc.bmp"); m_SBRC = wxImage("bitmaps/sb_rc.bmp"); m_SBT = wxImage("bitmaps/sb_t.bmp"); m_rcSBT.x = -1; m_rcSBT.y = -1; m_rcSBLA.height = -1; m_min_pos = 0; m_max_pos = 100; m_pos = m_min_pos; m_range = m_max_pos - m_min_pos; this->SetCursor( wxCursor( wxCURSOR_HAND ) ); m_ld = false; }
bool wxHyperLink::Create (wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name) { bool okay = FALSE; // create static text okay = wxStaticText::Create (parent, id, label, pos, size, style, name); wxASSERT_MSG (okay, wxT("Failed to create wxStaticText, needed by wxHyperLink!")); // initialize variables m_URL = wxEmptyString; m_Marked = false; m_Visited = false; m_MarkedColour = wxColour (wxT("DARK GREY")); m_NormalColour = wxColour (wxT("BLUE")); m_VisitedColour = wxColour (wxT("PURPLE")); m_HoverCursor = wxCursor (wxCURSOR_HAND); // set foreground colour SetForegroundColour (m_NormalColour); wxFont font = GetFont(); font.SetUnderlined (true); SetFont (font); // get background colour m_BackgroundColour = GetBackgroundColour (); return okay; } // Create
void wxHeaderCtrl::StartOrContinueResizing(unsigned int col, int xPhysical) { wxHeaderCtrlEvent event(IsResizing() ? wxEVT_COMMAND_HEADER_RESIZING : wxEVT_COMMAND_HEADER_BEGIN_RESIZE, GetId()); event.SetEventObject(this); event.SetColumn(col); event.SetWidth(ConstrainByMinWidth(col, xPhysical)); if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() ) { if ( IsResizing() ) { ReleaseMouse(); CancelDragging(); } //else: nothing to do -- we just don't start to resize } else // go ahead with resizing { if ( !IsResizing() ) { m_colBeingResized = col; SetCursor(wxCursor(wxCURSOR_SIZEWE)); CaptureMouse(); } //else: we had already done the above when we started } }
void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) { // Make another frame, containing a canvas MyChild *subframe = new MyChild(frame, _T("Canvas Frame")); wxString title; title.Printf(_T("Canvas Frame %d"), ++gs_nFrames); subframe->SetTitle(title); // Give it an icon #ifdef __WXMSW__ subframe->SetIcon(wxIcon(_T("chrt_icn"))); #else subframe->SetIcon(wxIcon( mondrian_xpm )); #endif // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(MDI_NEW_WINDOW, _T("&New window")); file_menu->Append(MDI_CHILD_QUIT, _T("&Close child"), _T("Close this window")); file_menu->Append(MDI_QUIT, _T("&Exit")); wxMenu *option_menu = new wxMenu; option_menu->Append(MDI_REFRESH, _T("&Refresh picture")); option_menu->Append(MDI_CHANGE_TITLE, _T("Change &title...\tCtrl-T")); option_menu->AppendSeparator(); option_menu->Append(MDI_CHANGE_POSITION, _T("Move frame\tCtrl-M")); option_menu->Append(MDI_CHANGE_SIZE, _T("Resize frame\tCtrl-S")); wxMenu *help_menu = new wxMenu; help_menu->Append(MDI_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _T("&File")); menu_bar->Append(option_menu, _T("&Child")); menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); #if wxUSE_STATUSBAR subframe->CreateStatusBar(); subframe->SetStatusText(title); #endif // wxUSE_STATUSBAR int width, height; subframe->GetClientSize(&width, &height); MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height)); canvas->SetCursor(wxCursor(wxCURSOR_PENCIL)); subframe->canvas = canvas; // Give it scrollbars canvas->SetScrollbars(20, 20, 50, 50); subframe->Show(true); }
wxFrame *MyApp::CreateFrame() { MyChild *subframe = new MyChild(NULL, _T("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE); subframe->SetTitle(_T("wxWidgets canvas frame")); // Give it a status line subframe->CreateStatusBar(); // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(HELLO_NEW, _T("&New MFC Window")); file_menu->Append(HELLO_QUIT, _T("&Close")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _T("&File")); // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); int width, height; subframe->GetClientSize(&width, &height); MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height)); canvas->SetCursor(wxCursor(wxCURSOR_PENCIL)); subframe->canvas = canvas; subframe->Show(true); // Return the main frame window return subframe; }
void KeyListCtrl::OnEndDrag(wxMouseEvent& event) { SetCursor(wxCursor(*wxSTANDARD_CURSOR)); Disconnect(wxEVT_MOTION, wxMouseEventHandler(KeyListCtrl::OnDragging)); Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(KeyListCtrl::OnEndDrag)); Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(KeyListCtrl::OnEndDrag)); m_dragging_to_item = -1; }
void GSPanel::OnHideMouseTimeout( wxTimerEvent& evt ) { if( IsBeingDeleted() || !m_HasFocus ) return; if( CoreThread.GetExecutionMode() != SysThreadBase::ExecMode_Opened ) return; SetCursor( wxCursor( wxCURSOR_BLANK ) ); m_CursorShown = false; }
void MIDIEventKeyDialog::Listen(bool enable) { if (enable) { this->SetCursor(wxCursor(wxCURSOR_WAIT)); m_listen->GetEventHandler()->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MIDIEventKeyDialog::OnKeyDown), NULL, this); if (m_minuslisten) m_minuslisten->GetEventHandler()->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MIDIEventKeyDialog::OnKeyDown), NULL, this); } else { m_listen->GetEventHandler()->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(MIDIEventKeyDialog::OnKeyDown), NULL, this); if (m_minuslisten) m_minuslisten->GetEventHandler()->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(MIDIEventKeyDialog::OnKeyDown), NULL, this); this->SetCursor(wxCursor(wxCURSOR_ARROW)); } }
wxCursor InsertBrickTask::Start() { switch ( m_tool ) { case NassiView::NASSI_TOOL_CONTINUE: return wxCursor(continuecur_xpm); case NassiView::NASSI_TOOL_BREAK: return wxCursor(breakcur_xpm); case NassiView::NASSI_TOOL_RETURN: return wxCursor(returncur_xpm); case NassiView::NASSI_TOOL_WHILE: return wxCursor(whilecur_xpm); case NassiView::NASSI_TOOL_DOWHILE: return wxCursor(dowhilecur_xpm); case NassiView::NASSI_TOOL_FOR: return wxCursor(forcur_xpm); case NassiView::NASSI_TOOL_BLOCK: return wxCursor(blockcur_xpm); case NassiView::NASSI_TOOL_IF: return wxCursor(wxImage(ifcur_xpm)); case NassiView::NASSI_TOOL_SWITCH: return wxCursor(switchcur_xpm); default: case NassiView::NASSI_TOOL_INSTRUCTION: return wxCursor(instrcur_xpm); } }
/**< stop drag */ bool ImagePanel::EndDrag(bool bFuc /*= true*/) { switch(m_stMP.emFuc) { case IMGPL_CMD::IMG_MOVE: // iamge move { if (m_stMP.iState != 0) { ReleaseMouse(); m_stMP.iState = 0; } if (bFuc) SetCursor(wxCursor(_T("./skin/HandOpen.cur"), wxBITMAP_TYPE_CUR)); else { m_stMP.emFuc = IMGPL_CMD::NONE; SetCursor(wxCursor(wxCURSOR_ARROW)); } } break; case IMGPL_CMD::IMG_ZRECT: // zoom rect case IMGPL_CMD::SEL_CIRCLE: case IMGPL_CMD::SEL_ELLIPSE: case IMGPL_CMD::SEL_SQUARE: case IMGPL_CMD::SEL_RECTANGLE: { if (m_stMP.iState != 0) { m_stMP.iState = 0; ReleaseMouse(); Refresh(false); } if (!bFuc) { m_stMP.emFuc = IMGPL_CMD::NONE; SetCursor(wxCursor(wxCURSOR_ARROW)); } } break; default: break; } return true; }
void WxWindow::setCursorVisible(bool state) { cursorVisible = state; if( !cursorVisible ) canvas->SetCursor( wxCursor(wxCURSOR_BLANK) ); else canvas->SetCursor( wxNullCursor ); }
void MapGridCtrl::OnLeftUp(wxMouseEvent& event) { SetCursor(wxCursor(wxCURSOR_ARROW)); m_in_mouse_drag = false; if (wxPoint2DInt(event.GetPosition() - m_first_mouse_pos).GetVectorLength() <= 3) { SelectMap(m_mouseover_map); } }
// abort dragging a list item because user has left window void xLightsFrame::OnGridNetworkDragQuit(wxMouseEvent& event) { // restore cursor and disconnect unconditionally GridNetwork->SetCursor(wxCursor(*wxSTANDARD_CURSOR)); GridNetwork->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(xLightsFrame::OnGridNetworkDragEnd)); GridNetwork->Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(xLightsFrame::OnGridNetworkDragQuit)); }
ddMinMaxTableButtonHandle::ddMinMaxTableButtonHandle(hdIFigure *owner, hdILocator *buttonLocator , wxBitmap &buttonImage, wxBitmap &buttonSecondImage, wxSize &size): hdButtonHandle(owner, buttonLocator, buttonImage, size) { handleCursorImage = wxBitmap(*ddMinMaxCursor_png_img).ConvertToImage(); handleCursor = wxCursor(handleCursorImage); buttonMaximizeImage = buttonSecondImage; tmpImage = buttonImage; showFirst = true; }
void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) { // Make another frame, containing a canvas MyChild *subframe = new MyChild(frame, wxT("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); subframe->SetTitle(wxString::Format(wxT("Canvas Frame %d"), winNumber)); winNumber ++; // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ subframe->SetIcon(wxIcon(wxT("sashtest_icn"))); #endif #if wxUSE_STATUSBAR // Give it a status line subframe->CreateStatusBar(); #endif // wxUSE_STATUSBAR // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window")); file_menu->Append(SASHTEST_CHILD_QUIT, wxT("&Close child")); file_menu->Append(SASHTEST_QUIT, wxT("&Exit")); wxMenu *option_menu = new wxMenu; // Dummy option option_menu->Append(SASHTEST_REFRESH, wxT("&Refresh picture")); wxMenu *help_menu = new wxMenu; help_menu->Append(SASHTEST_ABOUT, wxT("&About")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, wxT("&File")); menu_bar->Append(option_menu, wxT("&Options")); menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); int width, height; subframe->GetClientSize(&width, &height); MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height)); canvas->SetCursor(wxCursor(wxCURSOR_PENCIL)); subframe->canvas = canvas; // Give it scrollbars canvas->SetScrollbars(20, 20, 50, 50); subframe->Show(true); }
void GLIBitmapNotebook::UpdateCursorDisplay(wxWindow *updateWindow) const { if(!updateWindow) { return; } // Assign the cursor based on the tool state switch(toolState) { case(TS_Select): updateWindow->SetCursor(wxCursor(wxCURSOR_CROSS)); break; case(TS_Zoom): updateWindow->SetCursor(wxCursor(wxCURSOR_MAGNIFIER)); break; }; }