本文整理汇总了C++中wxMouseEvent::GetEventObject方法的典型用法代码示例。如果您正苦于以下问题:C++ wxMouseEvent::GetEventObject方法的具体用法?C++ wxMouseEvent::GetEventObject怎么用?C++ wxMouseEvent::GetEventObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxMouseEvent
的用法示例。
在下文中一共展示了wxMouseEvent::GetEventObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTextureClicked
/* SectorPropsPanel::onTextureClicked
* Called when a texture canvas is clicked
*******************************************************************/
void SectorPropsPanel::onTextureClicked(wxMouseEvent& e)
{
// Get canvas
FlatTexCanvas* tc = NULL;
FlatComboBox* cb = NULL;
if (e.GetEventObject() == gfx_floor)
{
tc = gfx_floor;
cb = fcb_floor;
}
else if (e.GetEventObject() == gfx_ceiling)
{
tc = gfx_ceiling;
cb = fcb_ceiling;
}
if (!tc)
{
e.Skip();
return;
}
// Browse
MapTextureBrowser browser(this, 1, tc->getTexName(), &(theMapEditor->mapEditor().getMap()));
if (browser.ShowModal() == wxID_OK)
cb->SetValue(browser.getSelectedItem()->getName());
}
示例2: ShowContextMenu
void HexEditorCtrl::ShowContextMenu( const wxMouseEvent& event ){
wxMenu menu;
unsigned TagPosition=0;
if( event.GetEventObject() == hex_ctrl )
TagPosition = page_offset + (hex_ctrl->PixelCoordToInternalPosition( event.GetPosition() ) / 2);
if( event.GetEventObject() == text_ctrl )
TagPosition = page_offset + text_ctrl->PixelCoordToInternalPosition( event.GetPosition() );
TagElement *TAG;
for( unsigned i = 0 ; i < MainTagArray.Count() ; i++ ){
TAG = MainTagArray.Item(i);
if( TAG->isCover( TagPosition ) ){ //end not included!
menu.Append(idTagEdit, _T("Tag Edit"));
break;
}
}
if( select->GetState() ){
menu.Append(idTagAddSelection, _T("Tag Selection"));
menu.Append(idTagQuick, _T("Tag Selection"));
}
// menu.AppendSeparator();
wxPoint pos = event.GetPosition();
wxWindow *scr = static_cast<wxWindow*>( event.GetEventObject() );
pos += scr->GetPosition();
PopupMenu(&menu, pos);
}
示例3: OnMouseMove
void HexEditorCtrl::OnMouseMove( wxMouseEvent& event ){
if(event.m_leftDown){ //if left button is pressed
int new_hex_location=0; // initialize new_hex_location variable
if( event.GetEventObject() == hex_ctrl ) // if this event from hex_ctrl area
new_hex_location = hex_ctrl->PixelCoordToInternalPosition( event.GetPosition() ); //than take it's location on hex chars
else if ( event.GetEventObject() == text_ctrl ) //if we got this event from text area
new_hex_location = 2*(text_ctrl->PixelCoordToInternalPosition( event.GetPosition() )); //Than we needed to multiply with 2 for take it's hex location.
int old_hex_location = GetLocalHexInsertionPoint(); //requesting old hex location
if( new_hex_location != old_hex_location ){ //if hex selection addresses are different, start selection routine
if( not select->GetState() ) //if this is new selection start
if( Selector() == false ) //and select without focus
return; //don't make anything.
SetLocalHexInsertionPoint( new_hex_location ); //Moving cursor to new location.
Selector(); //Making actual selection.
PaintSelection();
}
}
else{
if( event.GetEventObject() == hex_ctrl or
event.GetEventObject() == text_ctrl or
event.GetEventObject() == offset_ctrl ){
TagElement* tg = static_cast<wxHexCtrl*>(event.GetEventObject())->GetTagByPix( event.GetPosition() );
if( (tg == NULL and TAGMutex==true) or //If there is no Tag at under and tag mutex available
(tg != NULL and not tg->visible) ) // or Changed to new tag
TagHideAll();
}
event.Skip(); //enable tags but problems with paint?
}
}
示例4: OnMotion
void cbAuiNotebook::OnMotion(wxMouseEvent& event)
{
event.Skip();
wxAuiTabCtrl* tabCtrl = (wxAuiTabCtrl*)event.GetEventObject();
if (!tabCtrl)
return;
cbAuiNotebook* nb = (cbAuiNotebook*)tabCtrl->GetParent();
if (!nb || !nb->m_HasToolTip)
return;
wxWindow* win = nullptr;
if (event.Moving() && tabCtrl->TabHitTest(event.m_x, event.m_y, &win))
{
if (!win)
{
tabCtrl->UnsetToolTip();
return;
}
wxString text(win->GetName());
// If the text changes, set it else, keep old, to avoid
// 'moving tooltip' effect
wxToolTip* tooltip = tabCtrl->GetToolTip();
if (!tooltip || tooltip->GetTip() != text)
tabCtrl->SetToolTip(text);
}
else
tabCtrl->UnsetToolTip();
}
示例5: DoubleValueFromString
void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
double step = OFFSET_INCREMENT_MM;
if( event.ShiftDown( ) )
step = OFFSET_INCREMENT_MM_FINE;
if( m_userUnits == INCHES )
{
step = OFFSET_INCREMENT_MIL/1000.0;
if( event.ShiftDown( ) )
step = OFFSET_INCREMENT_MIL_FINE/1000.0;
}
if( event.GetWheelRotation() >= 0 )
step = -step;
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
curr_value += step;
curr_value = std::max( -MAX_OFFSET, curr_value );
curr_value = std::min( curr_value, MAX_OFFSET );
textCtrl->SetValue( formatOffsetValue( curr_value ) );
}
示例6: OnMouseWheelEvent
// ----------------------------------------------------------------------------
void ThreadSearchLoggerTree::OnMouseWheelEvent(wxMouseEvent& event)
// ----------------------------------------------------------------------------
{
// Ctrl-MouseWheel rotation changes treeCtrl font
//-wxWindow* pParent = m_pListLog->GetParent();
wxWindow* pParent = (wxWindow*)event.GetEventObject();
//-wxWindow* pParent = m_pListLog;
if ( not pParent ) return;
bool mouseCtrlKeyDown = event.ControlDown();
#ifdef LOGGING
//LOGIT(wxT("treeCtrl:OnMouseWheel[%s]"), m_MouseCtrlKeyDown?wxT("Down"):wxT("UP") );
#endif
if (not mouseCtrlKeyDown) {event.Skip(); return;}
int nRotation = event.GetWheelRotation();
wxFont ctrlFont = pParent->GetFont();
if ( nRotation > 0)
ctrlFont.SetPointSize( ctrlFont.GetPointSize()-1);
else
ctrlFont.SetPointSize( ctrlFont.GetPointSize()+1);
pParent->SetFont(ctrlFont);
pParent->Refresh();
pParent->Update();
return;
}
示例7: OnNMRclickChatTab
void CChatWnd::OnNMRclickChatTab(wxMouseEvent& evt)
{
// Only handle events from the chat-notebook
if (evt.GetEventObject() != (wxObject*)chatselector)
return;
if (chatselector->GetSelection() == -1) {
return;
}
// Avoid opening another menu when it's already open
if (m_menu == NULL) {
m_menu = new wxMenu(_("Chat"));
m_menu->Append(MP_CLOSE_TAB, wxString(_("Close tab")));
m_menu->Append(MP_CLOSE_ALL_TABS, wxString(_("Close all tabs")));
m_menu->Append(MP_CLOSE_OTHER_TABS, wxString(_("Close other tabs")));
m_menu->AppendSeparator();
wxMenuItem * addFriend = m_menu->Append(MP_ADDFRIEND, _("Add to Friends"));
// Disable this client if it is already a friend
CClientRef client;
if (chatselector->GetCurrentClient(client) && client.IsFriend()) {
addFriend->Enable(false);
}
PopupMenu(m_menu, evt.GetPosition());
delete m_menu;
m_menu = NULL;
}
}
示例8: handleMouseClick
void UserEvaluationFrame::handleMouseClick(wxMouseEvent& event)
{
for (int a=0;a<8;a++)
{
if (event.GetEventObject()==evaluationPanels[a])
{
cout_ << "CLICKED ON PANEL " << a << endl;
networkPanel->setTarget(evaluationPanels[a]->getIndividual());
new thread(
boost::bind(
&EvaluationPanel::setTarget,
highResPanel,
experimentRun->getExperiment(),
evaluationPanels[a]->getIndividual()
)
);
//new thread( boost::bind(&UserEvaluationFrame::processHighResImage,this,evaluationPanels[a]->getIndividual()) );
//processHighResImage(evaluationPanels[a]->getIndividual());
}
}
cout_ << "Clicked!\n";
event.Skip();
}
示例9: OnMouseLeft
//------EVENTS---------//
void HexEditorCtrl::OnMouseLeft(wxMouseEvent& event){
select->SetState( false );
ClearPaint();
if( event.GetEventObject() == hex_ctrl ){
hex_ctrl->SetFocus();
focus=HEX_CTRL;
SetLocalHexInsertionPoint( hex_ctrl->PixelCoordToInternalPosition( event.GetPosition() ) );
}
else if( event.GetEventObject() == text_ctrl ){
text_ctrl->SetFocus();
focus=TEXT_CTRL;
SetLocalHexInsertionPoint( 2 * text_ctrl->PixelCoordToInternalPosition( event.GetPosition() ) + 1);
}
else if( event.GetEventObject() == offset_ctrl ){
event.Skip(); //to lower level for copy offset to clipboard
}
}
示例10: m_hyperlinkContextMenu
void TrackPropDlg::m_hyperlinkContextMenu( wxMouseEvent &event )
{
m_pEditedLink = (wxHyperlinkCtrl*) event.GetEventObject();
m_scrolledWindowLinks->PopupMenu( m_menuLink,
m_pEditedLink->GetPosition().x + event.GetPosition().x,
m_pEditedLink->GetPosition().y + event.GetPosition().y );
}
示例11: OnMouseDown
void ImageButton::OnMouseDown(wxMouseEvent& evt) {
wxWindow* w = static_cast<wxWindow*>(evt.GetEventObject());
w->CaptureMouse();
pressed_ = true;
SetState(_T("Down"));
Update();
}
示例12: OnStcLeftDown
void wxCodeCompletionBoxManager::OnStcLeftDown(wxMouseEvent& event)
{
if(m_box && m_stc && m_box->IsShown() && event.GetEventObject() == m_stc) {
m_box->StcLeftDown(event);
} else {
event.Skip();
}
}
示例13: OnLeave
void CRenderWnd::OnLeave( wxMouseEvent &event )
{
TRACEUSER( "Luke", _T("OnLeave %p\n"), event.GetEventObject() );
// if( event.GetEventObject() != m_pFrame )
// return;
::wxSetCursor( *wxSTANDARD_CURSOR );
}
示例14: OnMouseOver
void ImageButton::OnMouseOver(wxMouseEvent& evt) {
wxWindow* w = static_cast<wxWindow*>(evt.GetEventObject());
if (pressed_) {
SetState(_T("Down"));
} else {
SetState(_T("Over"));
}
}
示例15: OnSelectFunction
void ModifyFunctionsWindow::OnSelectFunction(wxMouseEvent& event)
{
this->mainPanel->Hide();
this->secondaryPanel->Show();
auto* selectedButton = dynamic_cast<wxButton*>(event.GetEventObject());
auto* nameText = new wxStaticText(secondaryPanel, wxID_ANY, "Name");
this->functionName->SetLabel(selectedButton->GetLabel().ToStdString());
auto* parametersText = new wxStaticText(secondaryPanel, wxID_ANY, "Parameters");
this->parametersEntry->SetValue(this->mathData->functions.at(selectedButton->GetLabel().ToStdString()).first);
auto* bodyText = new wxStaticText(secondaryPanel, wxID_ANY, "Body");
this->bodyEntry->SetValue(this->mathData->functions.at(selectedButton->GetLabel().ToStdString()).second);
auto* modifyButton = new wxButton(secondaryPanel, wxID_ANY, "Modify");
auto* deleteButton = new wxButton(secondaryPanel, wxID_DELETE);
auto* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
buttonSizer->Add(modifyButton, 0u, wxALIGN_CENTER | wxALL, 5u);
buttonSizer->Add(deleteButton, 0u, wxALIGN_CENTER | wxALL, 5u);
auto* bottomSizer = new wxBoxSizer(wxVERTICAL);
bottomSizer->Add(nameText, 0u, wxALL, 3u);
bottomSizer->Add(functionName, 0u, wxEXPAND | wxALL, 5u);
bottomSizer->Add(parametersText, 0u, wxALL, 5u);
bottomSizer->Add(parametersEntry, 0u, wxEXPAND | wxALL, 5u);
bottomSizer->Add(bodyText, 0u, wxALL, 5u);
bottomSizer->Add(bodyEntry, 0u, wxALL, 5u);
bottomSizer->Add(buttonSizer, 0u, wxALIGN_CENTER | wxALL, 5u);
this->secondaryPanel->SetSizer(bottomSizer);
auto& font = wxFont(8u, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
nameText->SetFont(font);
parametersText->SetFont(font);
bodyText->SetFont(font);
this->mainSizer->Add(secondaryPanel);
this->secondaryPanel->FitInside();
this->mainSizer->Fit(this);
this->mainSizer->SetSizeHints(this);
modifyButton->Bind(wxEVT_LEFT_DOWN, &ModifyFunctionsWindow::OnModifyFunction, this);
deleteButton->Bind(wxEVT_LEFT_DOWN, &ModifyFunctionsWindow::OnDeleteFunction, this);
}