本文整理汇总了C++中wxMouseEvent::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ wxMouseEvent::GetId方法的具体用法?C++ wxMouseEvent::GetId怎么用?C++ wxMouseEvent::GetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxMouseEvent
的用法示例。
在下文中一共展示了wxMouseEvent::GetId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMenuToolItem
//----------------------------------------------------------------------------
void E_MainFrame::OnMenuToolItem(wxMouseEvent &e)
{
int id = e.GetId();
std::map<int, std::string>::iterator it = mIDScripts.find(id);
if (it != mIDScripts.end())
{
if (mToolMenu)
{
delete mToolMenu;
mToolMenu = 0;
}
mToolMenu = new wxMenu();
NirMan::GetSingleton().SetCurMenu(mToolMenu);
std::string callStr = it->second;
PX2_SM.CallString(callStr);
int idx = mToolBarMenu->GetToolPos(id);
wxRect parentRect = mToolBarMenu->GetRect();
wxRect rect = mToolBarMenu->GetItems().Item(idx).GetSizerItem()->GetRect();
if (mToolMenu)
{
PopupMenu(mToolMenu, parentRect.x + rect.x, parentRect.y + parentRect.height - rect.y);
}
}
}
示例2: onMouseDown
void InstallPrompt::onMouseDown( wxMouseEvent& event )
{
#ifdef WIN32
if (event.GetId() == textA->GetId())
{
m_rbInstallRemove->SetValue(true);
}
else if (event.GetId() == textB->GetId())
{
m_rbInstallLeave->SetValue(true);
}
else if (event.GetId() == textC->GetId())
{
m_rbInstallVerify->SetValue(true);
}
#endif
}
示例3: SetTurboFalse
void TASInputDlg::SetTurboFalse(wxMouseEvent& event)
{
switch (event.GetId())
{
case ID_A:
A_turbo = false;
break;
case ID_B:
B_turbo = false;
break;
case ID_X:
X_turbo = false;
break;
case ID_Y:
Y_turbo = false;
break;
case ID_Z:
Z_turbo = false;
break;
case ID_L:
L_turbo = false;
break;
case ID_R:
R_turbo = false;
break;
case ID_START:
START_turbo = false;
break;
case ID_UP:
DU_turbo = false;
break;
case ID_DOWN:
DD_turbo = false;
break;
case ID_LEFT:
DL_turbo = false;
break;
case ID_RIGHT:
DR_turbo = false;
break;
default:
return;
}
event.Skip(true);
}
示例4: OnMouseEvent
void Canvas::OnMouseEvent(wxMouseEvent& event)
{
if(m_controller)
m_controller->OnMouseEvent(event);
if(event.GetId() == wxEVT_LEFT_DOWN) {
event.Skip(); // let the window get focus
}
}
示例5: OnMouseDownL
void TASInputDlg::OnMouseDownL(wxMouseEvent& event)
{
if (event.GetEventType() == wxEVT_MOTION && !event.LeftIsDown())
return;
wxSlider *sliderX,*sliderY;
wxStaticBitmap *sbitmap;
wxTextCtrl *textX, *textY;
int *x,*y;
switch (event.GetId())
{
case ID_MAIN_STICK:
sliderX = wx_mainX_s;
sliderY = wx_mainY_s;
textX = wx_mainX_t;
textY = wx_mainY_t;
sbitmap = static_bitmap_main;
x = &xaxis;
y = &yaxis;
break;
case ID_C_STICK:
sliderX = wx_cX_s;
sliderY = wx_cY_s;
textX = wx_cX_t;
textY = wx_cY_t;
sbitmap = static_bitmap_c;
x = &c_xaxis;
y = &c_yaxis;
break;
default:
return;
}
wxPoint ptM(event.GetPosition());
*x = ptM.x *2;
*y = ptM.y * 2;
if (*x > 255)
*x = 255;
if (*y > 255)
*y = 255;
sbitmap->SetBitmap(TASInputDlg::CreateStickBitmap(*x,*y));
textX->SetValue(wxString::Format("%i", *x));
textY->SetValue(wxString::Format("%i", 256 - *y));
sliderX->SetValue(*x);
sliderY->SetValue(256 - *y);
event.Skip(true);
}
示例6: continueDragHdl
void SerialConfigurator::continueDragHdl( wxMouseEvent& event )
{
if (event.Dragging()){
char buf[5];
sprintf(buf,"%d ", event.GetId());
m_Text->AppendText(buf);
}
event.Skip();
}
示例7: OnColorRightDown
void PalettePanel::OnColorRightDown(wxMouseEvent& event)
{
int i;
for (i = 0; i < 16; i++)
{
if (m_apPanelColor[i]->GetId() == event.GetId())
{
SelectColor(i, true);
break;
}
}
}
示例8: OnCustomColourMouseClick
void wxGenericColourDialog::OnCustomColourMouseClick(wxMouseEvent& event)
{
// Find index of custom colour
// and call the handler.
for (int i = 0; i < WXSIZEOF(m_customColoursBmp); i++)
{
if ( m_customColoursBmp[i]->GetId() == event.GetId() )
{
OnCustomColourClick(i);
return;
}
}
event.Skip();
}
示例9: OnMouseUpR
void TASInputDlg::OnMouseUpR(wxMouseEvent& event)
{
wxSlider *sliderX,*sliderY;
wxStaticBitmap *sbitmap;
wxTextCtrl *textX, *textY;
int *x,*y;
switch (event.GetId())
{
case ID_MAIN_STICK:
sliderX = wx_mainX_s;
sliderY = wx_mainY_s;
textX = wx_mainX_t;
textY = wx_mainY_t;
sbitmap = static_bitmap_main;
x = &xaxis;
y = &yaxis;
break;
case ID_C_STICK:
sliderX = wx_cX_s;
sliderY = wx_cY_s;
textX = wx_cX_t;
textY = wx_cY_t;
sbitmap = static_bitmap_c;
x = &c_xaxis;
y = &c_yaxis;
break;
default:
return;
}
*x = 128;
*y = 128;
sbitmap->SetBitmap(TASInputDlg::CreateStickBitmap(*x,*y));
textX->SetValue(wxString::Format("%i", *x));
textY->SetValue(wxString::Format("%i", 256 - *y));
sliderX->SetValue(*x);
sliderY->SetValue(256 - *y);
event.Skip(true);
}
示例10: OnMouseLeftDown
void mmBudgetingPanel::OnMouseLeftDown(wxMouseEvent& event)
{
// depending on the clicked control's window id.
switch (event.GetId())
{
case ID_PANEL_BUDGETENTRY_STATIC_BITMAP_VIEW :
{
wxMenu menu;
menu.Append(MENU_VIEW_ALLBUDGETENTRIES, wxGetTranslation(VIEW_ALL));
menu.Append(MENU_VIEW_PLANNEDBUDGETENTRIES, wxGetTranslation(VIEW_PLANNED));
menu.Append(MENU_VIEW_NONZEROBUDGETENTRIES, wxGetTranslation(VIEW_NON_ZERO));
menu.Append(MENU_VIEW_INCOMEBUDGETENTRIES, wxGetTranslation(VIEW_INCOME));
menu.Append(MENU_VIEW_EXPENSEBUDGETENTRIES, wxGetTranslation(VIEW_EXPENSE));
menu.AppendSeparator();
menu.Append(MENU_VIEW_SUMMARYBUDGETENTRIES, wxGetTranslation(VIEW_SUMM));
PopupMenu(&menu, event.GetPosition());
break;
}
}
event.Skip();
}
示例11: OnMouseDClick
void ScrolledPanel::OnMouseDClick(wxMouseEvent & event) {
cout << "ScrolledPanel::OnMouseDClick::event.GetId() : " << event.GetId() << endl;
}
示例12: OnMouseLeftUp
void ScrolledPanel::OnMouseLeftUp(wxMouseEvent & event) {
cout << "ScrolledPanel::OnMouseUp::event.GetId() : " << event.GetId() << endl;
}
示例13: SetTurbo
void TASInputDlg::SetTurbo(wxMouseEvent& event)
{
wxCheckBox* placeholder;
switch (event.GetId())
{
case ID_A:
placeholder = wx_a_button;
A_turbo = !A_turbo;
break;
case ID_B:
placeholder = wx_b_button;
B_turbo = !B_turbo;
break;
case ID_X:
placeholder = wx_x_button;
X_turbo = !X_turbo;
break;
case ID_Y:
placeholder = wx_y_button;
Y_turbo = !Y_turbo;
break;
case ID_Z:
placeholder = wx_z_button;
Z_turbo = !Z_turbo;
break;
case ID_L:
placeholder = wx_l_button;
L_turbo = !L_turbo;
break;
case ID_R:
placeholder = wx_r_button;
R_turbo = !R_turbo;
break;
case ID_START:
placeholder = wx_start_button;
START_turbo = !START_turbo;
break;
case ID_UP:
placeholder = wx_up_button;
DU_turbo = !DU_turbo;
break;
case ID_DOWN:
placeholder = wx_down_button;
DD_turbo = !DD_turbo;
break;
case ID_LEFT:
placeholder = wx_left_button;
DL_turbo = !DL_turbo;
break;
case ID_RIGHT:
placeholder = wx_right_button;
DR_turbo = !DR_turbo;
break;
default:
return;
}
placeholder->SetValue(true);
}
示例14: SetTurbo
void TASInputDlg::SetTurbo(wxMouseEvent& event)
{
wxCheckBox* placeholder;
switch(event.GetId())
{
case ID_A:
placeholder = wx_a_button;
if(A_turbo)
A_turbo = false;
else
A_turbo = true;
break;
case ID_B:
placeholder = wx_b_button;
if(B_turbo)
B_turbo = false;
else
B_turbo = true;
break;
case ID_X:
placeholder = wx_x_button;
if(X_turbo)
X_turbo = false;
else
X_turbo = true;
break;
case ID_Y:
placeholder = wx_y_button;
if(Y_turbo)
Y_turbo = false;
else
Y_turbo = true;
break;
case ID_Z:
placeholder = wx_z_button;
if(Z_turbo)
Z_turbo = false;
else
Z_turbo = true;
break;
case ID_L:
placeholder = wx_l_button;
if(L_turbo)
L_turbo = false;
else
L_turbo = true;
break;
case ID_R:
placeholder = wx_r_button;
if(R_turbo)
R_turbo = false;
else
R_turbo = true;
break;
case ID_START:
placeholder = wx_start_button;
if(START_turbo)
START_turbo = false;
else
START_turbo = true;
break;
case ID_UP:
placeholder = wx_start_button;
if(DU_turbo)
DU_turbo = false;
else
DU_turbo = true;
break;
case ID_DOWN:
placeholder = wx_start_button;
if(DD_turbo)
DD_turbo = false;
else
DD_turbo = true;
break;
case ID_LEFT:
placeholder = wx_left_button;
if(DL_turbo)
DL_turbo = false;
else
DL_turbo = true;
break;
case ID_RIGHT:
placeholder = wx_right_button;
if(DR_turbo)
DR_turbo = false;
else
//.........这里部分代码省略.........
示例15: OnMouseEvent
void CursorData::OnMouseEvent( wxMouseEvent &event )
{
if( event.RightDown() ) {
if( m_DialogStyle >> 1 == ATTACHED ) {
wxMouseEvent evt(event);
m_gparent.OnMouseEvent( evt );
}
return;
}
static wxPoint s_gspt;
int x, y;
event.GetPosition( &x, &y );
wxPoint spt = wxPoint( x, y );
if( event.GetId() != 1000 )
spt = ClientToScreen( spt );
else
spt = GetParent()->ClientToScreen( spt );
#ifdef __WXOSX__
if (!m_bLeftDown && event.LeftIsDown())
{
m_bLeftDown = true;
s_gspt = spt;
if (!HasCapture()) CaptureMouse();
}
else if (m_bLeftDown && !event.LeftIsDown())
{
// GetParent()->Move( GetParent()->GetPosition() );
m_bLeftDown = false;
if (HasCapture()) ReleaseMouse();
}
#else
if( event.LeftDown() ) {
s_gspt = spt;
CaptureMouse();
}
if( event.LeftUp() ) {
//GetParent()->Move( GetParent()->GetPosition() );
if( HasCapture() ) ReleaseMouse();
}
#endif
if( event.Dragging() ) {
wxPoint par_pos_old = GetParent()->GetPosition();
wxPoint par_pos = par_pos_old;
par_pos.x += spt.x - s_gspt.x;
par_pos.y += spt.y - s_gspt.y;
wxPoint pos_in_parent = GetOCPNCanvasWindow()->ScreenToClient( par_pos );
wxPoint pos_in_parent_old = GetOCPNCanvasWindow()->ScreenToClient( par_pos_old );
// X
if( pos_in_parent.x < pos_in_parent_old.x ) { // moving left
if( pos_in_parent.x < 10 ) {
pos_in_parent.x = 0;
}
} else
if( pos_in_parent.x > pos_in_parent_old.x ) { // moving right
int max_right = GetOCPNCanvasWindow()->GetClientSize().x - GetParent()->GetSize().x;
if( pos_in_parent.x > ( max_right - 10 ) ) {
pos_in_parent.x = max_right;
}
}
// Y
if( pos_in_parent.y < pos_in_parent_old.y ) { // moving up
if( pos_in_parent.y < 10 ) {
pos_in_parent.y = 0;
}
} else
if( pos_in_parent.y > pos_in_parent_old.y ) { // moving dow
int max_down = GetOCPNCanvasWindow()->GetClientSize().y - GetParent()->GetSize().y;
if( pos_in_parent.y > ( max_down - 10 ) ) {
pos_in_parent.y = max_down;
}
}
wxPoint final_pos = GetOCPNCanvasWindow()->ClientToScreen( pos_in_parent );
GetParent()->Move( final_pos );
s_gspt = spt;
}
}