//#PROTECTED SETTER void QmitkDataStorageComboBox::OnCurrentIndexChanged(int index) { if (index >= 0 && index < this->count()) emit OnSelectionChanged(this->GetSelectedNode()); if (index == -1) emit OnSelectionChanged(nullptr); }
void CXTPReportInplaceList::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { switch (nChar) { case VK_UP: case VK_DOWN: case VK_PRIOR: case VK_NEXT: case VK_HOME: case VK_END: m_strHotSearchContext.Empty(); } //---------------------------------------------- if (nChar == VK_ESCAPE) { Cancel(); } else if (nChar == VK_RETURN || nChar == VK_F4) { Apply(); } else { int nPrevSel = CListBox::GetCurSel(); CListBox::OnKeyDown(nChar, nRepCnt, nFlags); int nActualSel = CListBox::GetCurSel(); if (nPrevSel != nActualSel) OnSelectionChanged(nActualSel); } }
QmitkContourModelToImageWidget::QmitkContourModelToImageWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent) : QmitkSegmentationUtilityWidget(timeNavigationController, parent), d_ptr(new QmitkContourModelToImageWidgetPrivate()) { Q_D(QmitkContourModelToImageWidget); // Set up UI d->m_Controls.setupUi(this); d->m_Controls.dataSelectionWidget->AddDataStorageComboBox(QmitkDataSelectionWidget::ImageAndSegmentationPredicate); d->m_Controls.dataSelectionWidget->AddDataStorageComboBox(QmitkDataSelectionWidget::ContourModelPredicate); d->m_Controls.dataSelectionWidget->SetHelpText(HelpText); d->EnableButtons(false); // Create connections connect (d->m_Controls.btnProcess, SIGNAL(pressed()), this, SLOT(OnProcessPressed())); connect(d->m_Controls.dataSelectionWidget, SIGNAL(SelectionChanged(unsigned int, const mitk::DataNode*)), this, SLOT(OnSelectionChanged(unsigned int, const mitk::DataNode*))); connect(&d->m_Watcher, SIGNAL(finished()), this, SLOT(OnProcessingFinished())); if( d->m_Controls.dataSelectionWidget->GetSelection(0).IsNotNull() && d->m_Controls.dataSelectionWidget->GetSelection(1).IsNotNull() ) { OnSelectionChanged( 0, d->m_Controls.dataSelectionWidget->GetSelection(0)); } }
void CXTPReportInplaceList::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { UNREFERENCED_PARAMETER(nRepCnt); UNREFERENCED_PARAMETER(nFlags); const DWORD cwdHotSearchTomeOut_ms = 1300; DWORD dwTime = GetTickCount(); if (dwTime - m_dwLastKeyDownTime > cwdHotSearchTomeOut_ms) m_strHotSearchContext.Empty(); m_dwLastKeyDownTime = dwTime; //---------------------------------------------- m_strHotSearchContext += (TCHAR)nChar; int nIndex = GetCurSel(); if (nIndex == LB_ERR) nIndex = 0; int nFindIdx = FindString(nIndex, m_strHotSearchContext); if (nFindIdx == LB_ERR && nIndex > 0) nFindIdx = FindString(0, m_strHotSearchContext); if (nFindIdx != LB_ERR) { SetCurSel(nFindIdx); if (nIndex != nFindIdx) OnSelectionChanged(nFindIdx); } }
void wxTreeViewComboPopup::OnSelectionChanged(wxGxSelectionEvent& event) { if(event.GetInitiator() == GetId()) return; long nSelID = m_pSelection->GetLastSelectedObjectId(); wxTreeItemId ItemId = m_TreeMap[nSelID]; if(ItemId.IsOk()) { SelectItem(ItemId); } else { wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(nSelID); wxGxObject* pParentGxObj = pGxObject->GetParent(); while(pParentGxObj) { wxTreeItemId ItemId = m_TreeMap[pParentGxObj->GetId()]; if(ItemId.IsOk()) { Expand(ItemId); break; } else pParentGxObj = pParentGxObj->GetParent(); } OnSelectionChanged(event); } //set combo text wxString sText = GetStringValue(); m_combo->SetText(sText); }
bool C4EditCursor::RightButtonDown(DWORD dwKeyState) { switch (Mode) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case C4CNS_ModeEdit: if ( (dwKeyState & MK_CONTROL) == 0) { // Check whether cursor is on anything in the selection bool fCursorIsOnSelection = false; for (C4ObjectLink *pLnk = Selection.First; pLnk; pLnk = pLnk->Next) if (pLnk->Obj->At(X,Y)) { fCursorIsOnSelection = true; break; } if (!fCursorIsOnSelection) { // Click on unselected if (Target && !Selection.GetLink(Target)) { ClearSelection(); AddToSelection(Target); } // Click on nothing if (!Target) ClearSelection(); } } break; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } OnSelectionChanged(); return true; }
qtDLGHeapView::qtDLGHeapView(QWidget *parent, Qt::WFlags flags,int processID) : QWidget(parent, flags), m_processID(processID), m_processCountEntry(0), m_selectedRow(-1) { setupUi(this); this->setAttribute(Qt::WA_DeleteOnClose,true); this->setLayout(verticalLayout); connect(tblHeapBlocks,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(OnCustomContextMenuRequested(QPoint))); connect(tblHeapView,SIGNAL(itemSelectionChanged()),this,SLOT(OnSelectionChanged())); connect(new QShortcut(QKeySequence("F5"),this),SIGNAL(activated()),this,SLOT(DisplayHeap())); connect(new QShortcut(Qt::Key_Escape,this),SIGNAL(activated()),this,SLOT(close())); tblHeapView->horizontalHeader()->resizeSection(0,75); tblHeapView->horizontalHeader()->resizeSection(1,75); tblHeapView->horizontalHeader()->resizeSection(2,135); tblHeapView->horizontalHeader()->resizeSection(3,135); tblHeapView->horizontalHeader()->resizeSection(4,135); tblHeapView->horizontalHeader()->setFixedHeight(21); tblHeapBlocks->horizontalHeader()->setFixedHeight(21); m_pMainWindow = qtDLGNanomite::GetInstance(); m_processCountEnd = m_pMainWindow->coreDebugger->PIDs.size(); for(size_t i = 0; i < m_pMainWindow->coreDebugger->PIDs.size(); i++) { if(m_pMainWindow->coreDebugger->PIDs[i].dwPID == m_processID) m_processCountEntry = i; m_processCountEnd = i + 1; } DisplayHeap(); }
void CGameGUIList::OnMouseDown(int nButton,double x,double y) { CGameWindowBase::OnMouseDown(nButton,x,y); SGamePos pos(x,y); if(m_nVisibleCount<(int)m_vElements.size() && x>=m_rScroll.x) { if(m_rScrollUp.Contains(pos)){SelectPrevious();} else if(m_rScrollDown.Contains(pos)){SelectNext();} else if(m_rScrollThumb.Contains(pos)) { if(DetectDrag(x,y)) { m_piGUIManager->SetMouseCapture(this); m_ptScrollThumbDragStart=pos; m_nScrollThumbDragStartFirstVisible=m_nFirstVisible; } } else if(m_rScroll.Contains(pos)) { if(y<m_rScrollThumb.y){SelectNextPage();} else if(y>(m_rScrollThumb.y+m_rScrollThumb.h)){SelectPreviousPage();} } } else { m_nSelectedElement=m_nFirstVisible+(int)((m_rRealRect.h-y)/m_dFontPixelHeight); if(m_nSelectedElement<0){m_nSelectedElement=-1;} if(m_nSelectedElement>=(int)m_vElements.size()){m_nSelectedElement=-1;} std::string sElement=(m_nSelectedElement!=-1)?m_vElements[m_nSelectedElement]:""; NOTIFY_EVENT(IGameGUIListEvents,OnSelectionChanged(this,m_nSelectedElement,sElement)); } }
void ElementsCtrlBase::OnDelete( wxCommandEvent& ) { if( m_selels.size() == 0 ) return; OptionalMessageDialog dlg(wxT("dlg_reset"), wxID_YES, wxID_NO); dlg.add_button_yesno(); wxString msg = _("This will delete all selected elements:\n\n"); for( cit_elements cit = m_selels.begin(); cit != m_selels.end(); ++cit ) msg += (*cit)->name() + wxT("\n"); msg += wxT("\n"); msg += _("Proceed?"); dlg.Create(0, msg, _("Remove elements?")); if( dlg.ShowModal() != wxID_YES ) return; wxGetApp().hudfile()->set_modified(); // delete all notuniq elements for( it_elements it = m_selels.begin(); it != m_selels.end(); ++it ) { if( (*it)->is_removable() ) { if( m_copyfrom == (*it) ) m_copyfrom = 0; wxGetApp().hudfile()->remove( *it ); } } wxGetApp().mainframe()->update_elementsctrl(); OnSelectionChanged(); }
TSharedRef<SWidget> UJavascriptTileView::RebuildWidget() { MyTileView = SNew(STileView< UObject* >) .SelectionMode(SelectionMode) .ListItemsSource(&Items) .ItemHeight(ItemHeight) .OnGenerateTile(BIND_UOBJECT_DELEGATE(STileView< UObject* >::FOnGenerateRow, HandleOnGenerateTile)) .OnSelectionChanged_Lambda([this](UObject* Object, ESelectInfo::Type SelectInfo){ OnSelectionChanged(Object, SelectInfo); }) .OnMouseButtonDoubleClick_Lambda([this](UObject* Object){ OnDoubleClick(Object); }) //.OnContextMenuOpening(this, &SSocketManager::OnContextMenuOpening) //.OnItemScrolledIntoView(this, &SSocketManager::OnItemScrolledIntoView) // .HeaderRow // ( // SNew(SHeaderRow) // .Visibility(EVisibility::Collapsed) // + SHeaderRow::Column(TEXT("Socket")) // ); ; return BuildDesignTimeWidget(MyTileView.ToSharedRef()); }
TLMapWidget::TLMapWidget(QWidget *parent, Configuration *config):QGraphicsView(parent),configuration(config),UAV(0),GPS(0),Home(0) ,followmouse(true),compassRose(0),windCompass(0),showuav(false),showhome(false),diagTimer(0),diagGraphItem(0),showDiag(false),overlayOpacity(1) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); core=new internals::Core; map=new MapGraphicItem(core,config); mscene.addItem(map); this->setScene(&mscene); Home=new HomeItem(map,this); Home->setParentItem(map); Home->setZValue(-1); setStyleSheet("QToolTip {font-size:8pt; color:blue;opacity: 223; padding:2px; border-width:2px; border-style:solid; border-color: rgb(170, 170, 127);border-radius:4px }"); this->adjustSize(); connect(map,SIGNAL(zoomChanged(double,double,double)),this,SIGNAL(zoomChanged(double,double,double))); connect(map->core,SIGNAL(OnCurrentPositionChanged(internals::PointLatLng)),this,SIGNAL(OnCurrentPositionChanged(internals::PointLatLng))); connect(map->core,SIGNAL(OnEmptyTileError(int,core::Point)),this,SIGNAL(OnEmptyTileError(int,core::Point))); connect(map->core,SIGNAL(OnMapDrag()),this,SIGNAL(OnMapDrag())); connect(map->core,SIGNAL(OnMapTypeChanged(MapType::Types)),this,SIGNAL(OnMapTypeChanged(MapType::Types))); connect(map->core,SIGNAL(OnMapZoomChanged()),this,SIGNAL(OnMapZoomChanged())); connect(map->core,SIGNAL(OnTileLoadComplete()),this,SIGNAL(OnTileLoadComplete())); connect(map->core,SIGNAL(OnTileLoadStart()),this,SIGNAL(OnTileLoadStart())); connect(map->core,SIGNAL(OnTilesStillToLoad(int)),this,SIGNAL(OnTilesStillToLoad(int))); connect(map,SIGNAL(wpdoubleclicked(WayPointItem*)),this,SIGNAL(OnWayPointDoubleClicked(WayPointItem*))); connect(&mscene,SIGNAL(selectionChanged()),this,SLOT(OnSelectionChanged())); SetShowDiagnostics(showDiag); this->setMouseTracking(followmouse); SetShowCompassRose(true); SetShowWindCompass(false); QPixmapCache::setCacheLimit(64*1024); }
void C4EditCursor::DoContextObjsel(C4Object * obj, bool clear) { if(clear) Selection.Clear(); Selection.Add(obj, C4ObjectList::stNone); OnSelectionChanged(); }
void InfoBox::OnSelectionChanged( const Combatant::Character::list_t& selected_list ) { Combatant::Character::pointer_t ch; if( selected_list.size() == 1 ) { ch = selected_list[0]; } OnSelectionChanged( ch ); }
bool C4EditCursor::LeftButtonDown(DWORD dwKeyState) { // Hold Hold=true; switch (Mode) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case C4CNS_ModeEdit: if (dwKeyState & MK_CONTROL) { // Toggle target if (Target) if (!RemoveFromSelection(Target)) AddToSelection(Target); } else { // Click on unselected: select single if (Target) { C4ObjectLink * it; for(it = Selection.First; it; it = it->Next){ if(it->Obj->At(X, Y)) break; } if(!it) // means loop didn't break { ClearSelection(); AddToSelection(Target); } } // Click on nothing: drag frame if (!Target) { ClearSelection(); DragFrame=true; X2=X; Y2=Y; } } break; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case C4CNS_ModeDraw: switch (Console.ToolsDlg.Tool) { case C4TLS_Brush: ApplyToolBrush(); break; case C4TLS_Line: DragLine=true; X2=X; Y2=Y; break; case C4TLS_Rect: DragFrame=true; X2=X; Y2=Y; break; case C4TLS_Fill: if (Game.HaltCount) { Hold=false; Console.Message(LoadResStr("IDS_CNS_FILLNOHALT")); return false; } break; case C4TLS_Picker: ApplyToolPicker(); break; } break; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } DropTarget=NULL; OnSelectionChanged(); return true; }
KingaFileManager::KingaFileManager(QWidget* parent) : QWidget(parent) { // Main file manager QListWidget* file_list_widget = new QListWidget(this); // Change selection style for the list of files file_list_widget->setSelectionMode(QAbstractItemView::ContiguousSelection); // Enable drag and drop file_list_widget->setDragEnabled(true); file_list_widget->setDragDropMode(QAbstractItemView::InternalMove); file_list_widget->viewport()->setAcceptDrops(true); file_list_widget->setDropIndicatorShown(true); // Automatically scroll on drag file_list_widget->setAutoScroll(true); // Container for file actions, and buttons QWidget* box_file_buttons = new QWidget(this); QPushButton* button_add_files = new QPushButton(tr("Add Files"),this); QPushButton* button_add_recursively = new QPushButton(tr("Add Recursively"),this); QPushButton* button_file_move_up = new QPushButton(tr("Move Up"),this); QPushButton* button_file_move_down = new QPushButton(tr("Move Down"),this); QPushButton* button_file_remove = new QPushButton(tr("Remove"),this); // Layout: file action buttons QVBoxLayout* layout_file_buttons = new QVBoxLayout(box_file_buttons); layout_file_buttons->addWidget(button_add_files,0,Qt::AlignTop); layout_file_buttons->addWidget(button_add_recursively,0,Qt::AlignTop); layout_file_buttons->addWidget(button_file_move_up,0,Qt::AlignTop); layout_file_buttons->addWidget(button_file_move_down,0,Qt::AlignTop); layout_file_buttons->addWidget(button_file_remove,1,Qt::AlignTop); box_file_buttons->setLayout(layout_file_buttons); // Layout: main widget QHBoxLayout* layout_file_area = new QHBoxLayout(this); layout_file_area->addWidget(file_list_widget); layout_file_area->addWidget(box_file_buttons); setLayout(layout_file_area); // Assign create objects to private attributes FileListWidget = file_list_widget; AddFilesButton = button_add_files; AddRecursivelyButton = button_add_recursively; MoveUpButton = button_file_move_up; MoveDownButton = button_file_move_down; RemoveButton = button_file_remove; // Disable file buttons at creation MoveUpButton->setEnabled(false); MoveDownButton->setEnabled(false); RemoveButton->setEnabled(false); // Connections connect(FileListWidget,SIGNAL(itemSelectionChanged()),this,SLOT(OnSelectionChanged())); connect(AddFilesButton,SIGNAL(clicked()),this,SLOT(OnAddFilesClicked())); connect(AddRecursivelyButton,SIGNAL(clicked()),this,SLOT(OnAddRecursivelyClicked())); connect(MoveUpButton,SIGNAL(clicked()),this,SLOT(OnMoveUpClicked())); connect(MoveDownButton,SIGNAL(clicked()),this,SLOT(OnMoveDownClicked())); connect(RemoveButton,SIGNAL(clicked()),this,SLOT(OnRemoveClicked())); }
bool C4EditCursor::Delete() { if (!EditingOK()) return false; EMMoveObject(EMMO_Remove, Fix0, Fix0, NULL, &Selection); if (::Control.isCtrlHost()) { OnSelectionChanged(); } return true; }
void KingaFileManager::OnRemoveClicked(void) { int first_selected_index = FirstSelectedIndex; int last_selected_index = LastSelectedIndex; for(int i=first_selected_index;i<=last_selected_index;i++) { QListWidgetItem* item = FileListWidget->takeItem(first_selected_index); delete item; } // Trigger a selection change OnSelectionChanged(); }
void CGameGUIList::ValidateSelection() { if(m_nSelectedElement<0){m_nSelectedElement=0;} if(m_nSelectedElement>=(int)m_vElements.size()){m_nSelectedElement=m_vElements.size()-1;} if(m_nSelectedElement<m_nFirstVisible){m_nFirstVisible=m_nSelectedElement;} if(m_nSelectedElement>=(m_nFirstVisible+m_nVisibleCount)) { m_nFirstVisible=(m_nSelectedElement-(m_nVisibleCount-1)); } std::string sElement=(m_nSelectedElement!=-1)?m_vElements[m_nSelectedElement]:""; NOTIFY_EVENT(IGameGUIListEvents,OnSelectionChanged(this,m_nSelectedElement,sElement)); }
void C4EditCursor::GrabContents() { // Set selection C4Object *pFrom; if (!( pFrom = Selection.GetObject() )) return; Selection.Copy(pFrom->Contents); OnSelectionChanged(); Hold=true; // Exit all objects EMMoveObject(EMMO_Exit, Fix0, Fix0, NULL, &Selection); }
void C4EditCursor::FrameSelection() { ClearSelection(); C4Object *cobj; C4ObjectLink *clnk; for (clnk=::Objects.First; clnk && (cobj=clnk->Obj); clnk=clnk->Next) if (cobj->Status) if (cobj->OCF & OCF_NotContained) { if (Inside(cobj->GetX(),Min(X,X2),Max(X,X2)) && Inside(cobj->GetY(),Min(Y,Y2),Max(Y,Y2))) AddToSelection(cobj); } OnSelectionChanged(); }
void CustomDropDown::OnItemSelected() { auto pressedState = state["pressed"]; if (pressedState) *pressedState = false; Collapse(); onSelectedPos(mItemsList->GetSelectedItemPos()); onSelectedItem(mItemsList->GetSelectedItem()); OnSelectionChanged(); }
void wxGxTreeViewBase::OnSelectionChanged(wxGxSelectionEvent& event) { if(event.GetInitiator() == GetId()) return; long nSelId = m_pSelection->GetLastSelectedObjectId(); wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(nSelId); if(pGxObject == NULL) return; wxTreeItemId ItemId = m_TreeMap[nSelId]; if(ItemId.IsOk()) { //granted event fireing if(wxTreeCtrl::GetSelection() == ItemId) UpdateGxSelection(); else wxTreeCtrl::SelectItem(ItemId, true); SetFocus(); } else { wxGxObject* pParentGxObj = pGxObject->GetParent(); //check if parent has no visible children wxGxObjectContainer* pGxObjectContainer = wxDynamicCast(pParentGxObj, wxGxObjectContainer); if(pGxObjectContainer && !pGxObjectContainer->AreChildrenViewable()) { wxTreeItemId ParentItemId = m_TreeMap[pParentGxObj->GetId()]; //granted event fireing if(wxTreeCtrl::GetSelection() == ParentItemId) UpdateGxSelection(); else wxTreeCtrl::SelectItem(ParentItemId, true); SetFocus(); } while(pParentGxObj) { wxTreeItemId ItemId = m_TreeMap[pParentGxObj->GetId()]; if(ItemId.IsOk()) { wxTreeCtrl::SetItemHasChildren(ItemId); wxTreeCtrl::Expand(ItemId); break; } else pParentGxObj = pParentGxObj->GetParent(); } OnSelectionChanged(event); } }
void ImagesPanel::OnFocalLengthChanged(wxCommandEvent & e) { if (m_pano->getNrOfImages() == 0) { return; }; wxString text = m_focallength->GetValue(); if(text.IsEmpty()) { return; }; double val; if (!hugin_utils::str2double(text, val)) { return; } //no negative values, no zero input please if (val<0.1) { wxBell(); return; }; HuginBase::UIntSet images = m_images_tree->GetSelectedImages(); const HuginBase::SrcPanoImage& srcImg = m_pano->getImage(*(images.begin())); if (srcImg.getProjection() == HuginBase::SrcPanoImage::FISHEYE_ORTHOGRAPHIC) { double hfov=srcImg.calcHFOV(srcImg.getProjection(), val, srcImg.getCropFactor(), srcImg.getSize()); if(hfov>190) { if(wxMessageBox( wxString::Format(_("You have given a field of view of %.2f degrees.\n But the orthographic projection is limited to a field of view of 180 degress.\nDo you want still use that high value?"), hfov), #ifdef __WXMSW__ _("Hugin"), #else wxT(""), #endif wxICON_EXCLAMATION | wxYES_NO)==wxNO) { wxTreeEvent dummy; OnSelectionChanged(dummy); return; }; }; }; PanoCommand::GlobalCmdHist::getInstance().addCommand( new PanoCommand::UpdateFocalLengthCmd(*m_pano, images, val) ); }
//*************************************************************************** void CToolsList::OnAfterAddItem (int iItem) { CBCGPUserTool* pTool = m_pParent->CreateNewTool (); if (pTool == NULL) { RemoveItem (iItem); return; } ASSERT_VALID (pTool); pTool->m_strLabel = GetItemText (iItem); SetItemData (iItem, (DWORD_PTR) pTool); OnSelectionChanged (); }
ARCodeWidget::ARCodeWidget(const GameFile& game) : m_game(game), m_game_id(game.GetGameID().toStdString()), m_game_revision(game.GetRevision()) { CreateWidgets(); ConnectWidgets(); IniFile game_ini_local; // We don't use LoadLocalGameIni() here because user cheat codes that are installed via the UI // will always be stored in GS/${GAMEID}.ini game_ini_local.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini"); IniFile game_ini_default = SConfig::GetInstance().LoadDefaultGameIni(m_game_id, m_game_revision); m_ar_codes = ActionReplay::LoadCodes(game_ini_default, game_ini_local); UpdateList(); OnSelectionChanged(); }
void QmitkSegmentationView::Activated() { // should be moved to ::BecomesVisible() or similar if( m_Controls ) { m_Controls->m_ManualToolSelectionBox->setEnabled( true ); m_Controls->m_OrganToolSelectionBox->setEnabled( true ); m_Controls->m_LesionToolSelectionBox->setEnabled( true ); m_Controls->m_SlicesInterpolator->Enable3DInterpolation( m_Controls->widgetStack->currentWidget() == m_Controls->pageManual ); //TODO Remove Observer itk::ReceptorMemberCommand<QmitkSegmentationView>::Pointer command1 = itk::ReceptorMemberCommand<QmitkSegmentationView>::New(); command1->SetCallbackFunction( this, &QmitkSegmentationView::RenderingManagerReinitialized ); m_RenderingManagerObserverTag = mitk::RenderingManager::GetInstance()->AddObserver( mitk::RenderingManagerViewsInitializedEvent(), command1 ); //Adding observers for node visibility to existing segmentations mitk::TNodePredicateDataType<mitk::Image>::Pointer isImage = mitk::TNodePredicateDataType<mitk::Image>::New(); mitk::NodePredicateProperty::Pointer isBinary = mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true)); mitk::NodePredicateAnd::Pointer isSegmentation = mitk::NodePredicateAnd::New( isImage, isBinary ); mitk::DataStorage::SetOfObjects::ConstPointer segmentations = this->GetDefaultDataStorage()->GetSubset( isSegmentation ); mitk::DataStorage::SetOfObjects::ConstPointer image = this->GetDefaultDataStorage()->GetSubset( isImage ); if (!image->empty()) { OnSelectionChanged(*image->begin()); } for ( mitk::DataStorage::SetOfObjects::const_iterator iter = segmentations->begin(); iter != segmentations->end(); ++iter) { mitk::DataNode* node = *iter; itk::SimpleMemberCommand<QmitkSegmentationView>::Pointer command = itk::SimpleMemberCommand<QmitkSegmentationView>::New(); command->SetCallbackFunction(this, &QmitkSegmentationView::OnWorkingNodeVisibilityChanged); m_WorkingDataObserverTags.insert( std::pair<mitk::DataNode*, unsigned long>( node, node->GetProperty("visible")->AddObserver( itk::ModifiedEvent(), command ) ) ); } if(segmentations->Size() > 0) { FireNodeSelected(segmentations->ElementAt(0)); segmentations->ElementAt(0)->GetProperty("visible")->Modified(); } } }
BOOL ContentPane::OnNotify(_In_ WPARAM wParam, _In_ LPARAM lParam, _Out_ LRESULT* pResult) { BOOL bRes = CWnd::OnNotify(wParam, lParam, pResult); NMHDR* plHeader = (NMHDR*)lParam; switch(plHeader->code) { case NM_DBLCLK: OnDoubleClickedItem(_archivePane.GetSelectedItem()); break; case TVN_KEYDOWN: OnKeyDown((NMTVKEYDOWN*)lParam); break; case TVN_SELCHANGED: OnSelectionChanged(); break; default: break; } return bRes; }
void ImagesPanel::panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & _imgNr) { DEBUG_TRACE(""); // update text field if selected const HuginBase::UIntSet & selected = m_images_tree->GetSelectedImages(); DEBUG_DEBUG("nr of sel Images: " << selected.size()); if (pano.getNrOfImages() == 0) { DisableImageCtrls(); m_matchingButton->Disable(); } else { m_matchingButton->Enable(); wxTreeEvent ev; OnSelectionChanged(ev); }; //enable/disable optimize buttons XRCCTRL(*this, "images_optimize", wxButton)->Enable(pano.getNrOfImages()>0); XRCCTRL(*this, "images_photo_optimize", wxButton)->Enable(pano.getNrOfImages()>1); }
bool C4Menu::SetSelection(int32_t iSelection, bool fAdjustPosition, bool fDoCalls) { // Not active if (!IsActive()) return false; // Outside Limits / Selectable C4MenuItem *pNewSel = GetItem(iSelection); if ((iSelection==-1 && !ItemCount) || (pNewSel && pNewSel->IsSelectable)) { // Selection change if (iSelection!=Selection) { // calls C4MenuItem *pSel = GetSelectedItem(); if (pSel) pSel->SetSelected(false); // Set selection Selection=iSelection; // Reset time on selection TimeOnSelection=0; } // always recheck selection for internal refill C4MenuItem *pSel = GetSelectedItem(); if (pSel) pSel->SetSelected(true); // set main caption by selection if (Style == C4MN_Style_Normal) { if (pSel) SetTitle(*(pSel->Caption) ? pSel->Caption : " ", HasMouse()); else SetTitle(*Caption ? Caption : " ", HasMouse()); } } // adjust position, if desired if (fAdjustPosition) AdjustPosition(); // do selection callback if (fDoCalls) OnSelectionChanged(Selection); // Done return true; }
void CXTPCustomizeToolbarsPage::RefreshToolbarsList() { int nIndexSel = 0; int nIndex = m_checkList.GetCurSel(); if (nIndex != LB_ERR) { nIndexSel = (int)m_checkList.GetItemData(nIndex); } int nTopIndex = m_checkList.GetTopIndex(); m_checkList.ResetContent(); CXTPCommandBars* pCommandBars = m_pSheet->GetCommandBars(); int nCount = pCommandBars->GetCount(); for (int i = 0; i < nCount; i++) { CXTPToolBar* pToolBar = pCommandBars->GetAt(i); if (!pToolBar->IsCustomizeDialogPresent()) continue; if (!pToolBar->IsCloseable() && !pToolBar->IsVisible()) continue; nIndex = m_checkList.AddString(pToolBar->GetTitle()); m_checkList.SetCheck(nIndex, pToolBar->IsVisible()); m_checkList.SetItemData(nIndex, i); if (i == nIndexSel) m_checkList.SetCurSel(nIndex); } if (m_checkList.GetTopIndex() != nTopIndex) m_checkList.SetTopIndex(nTopIndex); OnSelectionChanged(); }