当前位置: 首页>>代码示例>>C++>>正文


C++ wxCursor函数代码示例

本文整理汇总了C++中wxCursor函数的典型用法代码示例。如果您正苦于以下问题:C++ wxCursor函数的具体用法?C++ wxCursor怎么用?C++ wxCursor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wxCursor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WX_INIT_CONTROL_CONTAINER

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;
}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:25,代码来源:splitter.cpp

示例2: SetCursor

/**< 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;
}
开发者ID:gxcast,项目名称:GEIM,代码行数:36,代码来源:ImagePanel.cpp

示例3: onImage

// -----------------------------------------------------------------------------
// 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);
}
开发者ID:SteelTitanium,项目名称:SLADE,代码行数:61,代码来源:GfxCanvas.cpp

示例4: switch

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);
}
开发者ID:hksonngan,项目名称:invols,代码行数:57,代码来源:View2D.cpp

示例5: switch

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);
	}
}
开发者ID:sqba,项目名称:floopy,代码行数:10,代码来源:parameter.cpp

示例6: wxCursor

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
}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:11,代码来源:dnd.cpp

示例7: switch

 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()
     }
 }
开发者ID:Gustavo6046,项目名称:TrenchBroom,代码行数:11,代码来源:SplitterWindow2.cpp

示例8: SetCursor

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;
}
开发者ID:springlobby,项目名称:springlobby,代码行数:7,代码来源:mapgridctrl.cpp

示例9: evt

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;
}
开发者ID:gxcast,项目名称:GEIM,代码行数:29,代码来源:ImagePanel.cpp

示例10: wxCursor

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;
}
开发者ID:DanAurea,项目名称:boinc,代码行数:7,代码来源:sg_CustomControls.cpp

示例11: OnSkin

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));
}
开发者ID:Dangr8,项目名称:Cities3D,代码行数:28,代码来源:ListSelection.cpp

示例12: SetCursor

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();
}
开发者ID:jerrys123111,项目名称:pcsx2,代码行数:25,代码来源:FrameForGS.cpp

示例13: wxImage

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;
}
开发者ID:amichaelt,项目名称:VideoSubFinder,代码行数:30,代码来源:ScrollBar.cpp

示例14: wxASSERT_MSG

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
开发者ID:Rytiss,项目名称:native-boinc-for-android,代码行数:33,代码来源:hyperlink.cpp

示例15: event

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

    }
}
开发者ID:Toonerz,项目名称:project64,代码行数:31,代码来源:headerctrlg.cpp


注:本文中的wxCursor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。