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


C++ GetSelected函数代码示例

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


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

示例1: GetSize

void SystemInfoView::BodyIcon::Draw()
{
	Gui::ImageRadioButton::Draw();
	if (!GetSelected() && !HasStarport()) return;
	float size[2];
	GetSize(size);
	if (HasStarport()) {
	    Color portColor = Color(64, 128, 128, 255);
	    // The -0.1f offset seems to be the best compromise to make the circles closed (e.g. around Mars), symmetric, fitting with selection
	    // and not overlapping to much with asteroids
	    Graphics::Drawables::Circle circle =
			Graphics::Drawables::Circle(size[0]*0.5f, size[0]*0.5f-0.1f, size[1]*0.5f, 0.f,
			portColor, m_renderState);
	    circle.Draw(m_renderer);
	}
	if (GetSelected()) {
	    const vector2f vts[] = {
		    vector2f(0.f, 0.f),
		    vector2f(size[0], 0.f),
		    vector2f(size[0], size[1]),
		    vector2f(0.f, size[1]),
	    };
	    m_renderer->DrawLines2D(COUNTOF(vts), vts, m_selectColor, m_renderState, Graphics::LINE_LOOP);
	}
}
开发者ID:Wuzzy2,项目名称:pioneer,代码行数:25,代码来源:SystemInfoView.cpp

示例2: CMDTARGET_RELEASE

BOOL CXTPRibbonGroupControlPopup::OnSetPopup(BOOL bPopup)
{
    m_bPopup = bPopup;
    if (bPopup)
    {
        CMDTARGET_RELEASE(m_pCommandBar);

        CXTPCommandBars* pCommandBars = m_pParent->GetCommandBars();
        ASSERT(pCommandBars);

        if (!m_pPopupGroup)
        {
            m_pCommandBar = new CXTPPopupToolBar();
            m_pCommandBar->SetCommandBars(pCommandBars);
            m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
        }
        else
        {

            m_pCommandBar = new CXTPRibbonGroupPopupToolBar(m_pPopupGroup);
            m_pCommandBar->SetCommandBars(pCommandBars);

            m_pCommandBar->EnableCustomization(FALSE);
            m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
        }
    }
    else
    {
        ASSERT(m_pCommandBar);
        if (m_pCommandBar) m_pCommandBar->SetTrackingMode(FALSE);

    }
    RedrawParent();
    return TRUE;
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:35,代码来源:XTPRibbonGroup.cpp

示例3: GetSelected

void CashListView::SelectItemAndNotify(int index) {
  int oldSel = GetSelected();
  SelectItem(index);
  int curSel = GetSelected();
  if (oldSel != curSel) {
    CWnd *parent = GetParent();
    if (parent != NULL) {
      parent->SendMessage(WM_COMMAND, MAKELPARAM(GetDlgCtrlID(), LBN_SELCHANGE), (LPARAM)m_hWnd);
    }
  }
}
开发者ID:Echo-M,项目名称:producingManagementAK47,代码行数:11,代码来源:cash_list_view.cpp

示例4: Update

void Window_Keyboard::Update() {
	Window_Base::Update();

	if (active) {
		if (Input::IsRepeated(Input::DOWN)) {
			play_cursor = true;
			row = (row + 1) % row_max;

			if(col > 0 && GetSelected().empty() && !items[mode][row][col - 1].empty()) {
				col--;
			}
		}
		if (Input::IsRepeated(Input::UP)) {
			play_cursor = true;
			row = (row + row_max - 1) % row_max;

			if(col > 0 && GetSelected().empty() && !items[mode][row][col - 1].empty()) {
				col--;
			}
		}
		if (Input::IsRepeated(Input::RIGHT)) {
			play_cursor = true;
			col += 1;
			if (col >= col_max) {
				col = 0;
				if(mode == Letter) { row = (row + 1) % row_max; }
			}
		}
		if (Input::IsRepeated(Input::LEFT)) {
			play_cursor = true;
			col -= 1;
			if (col < 0) {
				col = col_max - 1;
				if(mode == Letter) { row = (row + row_max - 1) % row_max; }
			}
		}

	}

	if(GetSelected().empty()) {
		Update();
		return;
	}

	if(play_cursor) {
		Game_System::SePlay(Game_System::GetSystemSE(Game_System::SFX_Cursor));
		play_cursor = false;
	}
	UpdateCursorRect();
}
开发者ID:FaithFeather,项目名称:Player,代码行数:50,代码来源:window_keyboard.cpp

示例5: tvItemsAfterSelectionChange

void __fastcall TItemList::tvItemsAfterSelectionChange(TObject *Sender)
{
	if (IsLocked()) return;
    // hack, нода не должна была быть выделенной
    for (TElTreeItem* item = tvItems->GetNextSelected(0); item; item = tvItems->GetNextSelected(item))
        if (item->Hidden)	item->Selected	= false;
    // получаем выделение и обрабатываем ивенты
    ListItemsVec sel_items;
    GetSelected	(0,sel_items,false);
    if (!OnItemFocusedEvent.empty())	OnItemFocusedEvent(GetSelected());
    if (!OnItemsFocusedEvent.empty()) 	OnItemsFocusedEvent(sel_items);
    for (ListItemsIt it=sel_items.begin(); it!=sel_items.end(); it++){
        if (!(*it)->OnItemFocused.empty())(*it)->OnItemFocused(*it);
    }
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:15,代码来源:ItemList.cpp

示例6: GetSelected

bool TopMenuItem::OnKey(int key, int mod)
{
	auto selected = GetSelected();
	switch(key)
	{
		case SDLK_UP:
			break;
		case SDLK_DOWN:
			menu_ActivateMenuItem(selected);
			break;
		case SDLK_LEFT:
			SetSelection(GetPos() - 1);
			break;
		case SDLK_RIGHT:
			SetSelection(GetPos() + 1);
			break;
		case SDLK_RETURN:
			menu_ActivateMenuItem(selected);
			break;
		case SDLK_BACKSPACE:
			menu_DeactivateMenuItem();
			break;
		default:
			break;
	}
	return true;
}
开发者ID:RhineW,项目名称:hypertexture,代码行数:27,代码来源:menu.cpp

示例7: ASSERT

BOOL CXTPRibbonControlTab::OnSetPopup(BOOL bPopup)
{
	m_bPopup = bPopup;
	if (bPopup)
	{
		ASSERT(GetSelectedItem());
		CXTPRibbonTab* pSelectedTab = (CXTPRibbonTab*)GetSelectedItem();
		if (!pSelectedTab || !GetRibbonBar()->IsRibbonMinimized())
		{
			m_bPopup = FALSE;
			return FALSE;
		}

		if (m_pCommandBar)
			m_pCommandBar->InternalRelease();

		CXTPCommandBars* pCommandBars = GetRibbonBar()->GetCommandBars();
		ASSERT(pCommandBars);

		m_pCommandBar = GetRibbonBar()->CreateTabPopupToolBar(pSelectedTab);
		m_pCommandBar->SetCommandBars(pCommandBars);

		m_pCommandBar->EnableCustomization(FALSE);
		m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
	}
	else if (m_pCommandBar)
	{
		ASSERT(m_pCommandBar);
		m_pCommandBar->SetTrackingMode(FALSE);
	}
	RedrawParent();
	return TRUE;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:33,代码来源:XTPRibbonControlTab.cpp

示例8: RemoveSelItems

void TItemList::RemoveSelItems(TOnItemRemove on_remove)
{
	if (mrYes==MessageDlg("Remove selected item(s)?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0)){
        on_remove 	= on_remove.empty()?OnItemRemoveEvent:on_remove;
        VERIFY		(!on_remove.empty());
        RStringVec sel_items;
        if (GetSelected(sel_items)){
            tvItems->IsUpdating = true; // LockUpdating нельзя
            DeselectAll					();
            tvItemsAfterSelectionChange	(0);
            bool bSelChanged=false;
            bool bRes=false;
            for (RStringVecIt it=sel_items.begin(); it!=sel_items.end(); it++){
                TElTreeItem* pNode	= FHelper.FindItem(tvItems,**it);
                if (!FHelper.RemoveItem(tvItems,pNode,on_remove.empty()?OnItemRemoveEvent:on_remove)){
                    SelectItem(**it,true,true,false);
                    bSelChanged=true;
                }else{
                    bRes = true;
                }
            }
            if (bSelChanged||bRes){
                tvItemsAfterSelectionChange	(0);
                if (bRes&&!OnModifiedEvent.empty())	OnModifiedEvent(); 
            }
            tvItems->IsUpdating 		= false;
        }
    }
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:29,代码来源:ItemList.cpp

示例9: GetActiveProject

bool Track::IsSyncLockSelected() const
{
#ifdef EXPERIMENTAL_SYNC_LOCK
   AudacityProject *p = GetActiveProject();
   if (!p || !p->IsSyncLocked())
      return false;

   auto pList = mList.lock();
   if (!pList)
      return false;

   auto shTrack = this->SubstituteOriginalTrack();
   if (!shTrack)
      return false;
   
   const auto pTrack = shTrack.get();
   auto trackRange = TrackList::SyncLockGroup( pTrack );

   if (trackRange.size() <= 1) {
      // Not in a sync-locked group.
      // Return true iff selected and of a sync-lockable type.
      return (IsSyncLockableNonLabelTrack( pTrack ) ||
              track_cast<const LabelTrack*>( pTrack )) && GetSelected();
   }

   // Return true iff any track in the group is selected.
   return *(trackRange + &Track::IsSelected).begin();
#endif

   return false;
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:31,代码来源:Track.cpp

示例10: SetSelected

static void SetSelected(struct AHIAudioModeRequesterExt *req, BOOL all)
{
  LONG sliderlevels,sliderlevel,selected;

  if(all)
  {
    //Set listview
    selected=GetSelected(req);
      GT_SetGadgetAttrs(req->listviewgadget, req->Window, NULL,
          ((selected == ~0) || (GadToolsBase->lib_Version >= 39) ? TAG_IGNORE : GTLV_Top),selected,
          (selected == ~0 ? TAG_IGNORE : GTLV_MakeVisible),selected,
          GTLV_Selected,selected,
          TAG_DONE);
  }

  //Set slider
  GetSliderAttrs(req,&sliderlevels,&sliderlevel);
  GT_SetGadgetAttrs(req->slidergadget, req->Window, NULL,
      GTSL_Max,sliderlevels-1,
      GTSL_Level, sliderlevel,
      GA_Disabled,!sliderlevels || (req->tempAudioID == AHI_DEFAULT_ID),
      TAG_DONE);

  UpdateInfoWindow(req);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:25,代码来源:requester.c

示例11: FATAL

void TItemList::ClearParams(TElTreeItem* node)
{
	if (node){
    	FATAL("ClearParams - node");
    }else{
        // save last selected items
        last_selected_items.clear();
        GetSelected		(last_selected_items);
        // store
        if (m_Flags.is(ilFolderStore)&&tvItems->Items->Count){
	        FolderStore.clear();
            for (TElTreeItem* item=tvItems->Items->GetFirstNode(); item; item=item->GetNext()){
            	if (item->ChildrenCount){
                	AnsiString nm;
                	FHelper.MakeFullName(item,0,nm);
                    SFolderStore 		st_item;
                    st_item.expand		= item->Expanded;
                    FolderStore[nm]		= st_item;
                }
            }
        }
        // real clear
	    for (ListItemsIt it=m_Items.begin(); it!=m_Items.end(); it++)
    		xr_delete			(*it);
		m_Items.clear();
        // fill list
        LockUpdating			();
	    tvItems->Items->Clear	();
        UnlockUpdating			();
    }
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:31,代码来源:ItemList.cpp

示例12: GetSelected

int cListBox::ArrowUpList()
{
	int selection = GetSelected();
	cListItem* current = m_Items;

	if (m_Items == 0) return -1;
	if (selection == -1)
	{
		current = m_LastItem;
		SetSelected(current->m_ID);
		return current->m_ID;
	}

	while (1)
	{
		if (current->m_ID == selection)
		{
			current = m_LastItem;
			SetSelected(current->m_ID);
			break;
		}

		if (current->m_Next->m_ID == selection)
		{
			SetSelected(current->m_ID);
			break;
		}
		current = current->m_Next;
		if (current == 0) return -1;
	}

	return current->m_ID;
}
开发者ID:Jenocke,项目名称:test,代码行数:33,代码来源:cListBox.cpp

示例13: GetSelected

LRESULT CXTPDockingPaneTabbedContainer::OnHelpHitTest(WPARAM, LPARAM lParam)
{
	CXTPDockingPane* pPane = GetSelected();
	CPoint point((DWORD)lParam);

	int nHit = HitTest(point);

	if (nHit >= 0)
	{
		pPane = GetItemPane(nHit);
	}

	if (!pPane)
		return 0;

	int nIDHelp = pPane->m_nIDHelp;

	if (nIDHelp == 0)
	{
		pPane->m_hwndChild ? (int)::GetDlgCtrlID(pPane->m_hwndChild): 0;
	}

	if (nIDHelp == 0)
	{
		nIDHelp = pPane->GetID();
	}

	return HID_BASE_RESOURCE + nIDHelp;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:29,代码来源:XTPDockingPaneTabbedContainer.cpp

示例14: GetSelected

void CUIListBox::MoveSelectedUp()
{
	CUIWindow* w			= GetSelected();
	if(!w)					return;
//.	R_ASSERT(!m_flags.test(CUIScrollView::eMultiSelect));

	WINDOW_LIST::reverse_iterator it		= m_pad->GetChildWndList().rbegin();
	WINDOW_LIST::reverse_iterator it_e		= m_pad->GetChildWndList().rend();
	WINDOW_LIST::reverse_iterator it_prev	= it;

	for(; it!=it_e; ++it)
	{
		if(*it==w)
		{
			it_prev				= it;
			++it_prev;
			if(it_prev==it_e)	break;

			std::swap			(*it, *it_prev);
			ForceUpdate			();
			break;
		}

	}
}
开发者ID:2asoft,项目名称:xray,代码行数:25,代码来源:UIListBox.cpp

示例15: HitTest

void CXTPDockingPaneTabbedContainer::OnLButtonDblClk(UINT /*nFlags*/, CPoint point)
{
	if (PerformClick(m_hWnd, point, TRUE))
		return;

	if (HitTestCaptionButton(point))
		return;

	int nHit = HitTest(point);
	if (nHit == DOCKINGPANE_HITCAPTION)
	{
		CXTPDockingPane* pSelected = GetSelected();

		if (IsHidden() && pSelected && ((pSelected->GetOptions() & xtpPaneNoHideable) != 0))
			return;

		if (!IsHidden() && pSelected && ((pSelected->GetOptions() & xtpPaneNoFloatableByCaptionDoubleClick) != 0))
			return;

		GetDockingPaneManager()->ToggleDocking(this);
	}
	else if (nHit >= 0)
	{
		CXTPDockingPane* pPane = GetItemPane(nHit);

		if ((pPane->GetOptions() & xtpPaneNoFloatableByTabDoubleClick) == 0)
		{
			GetDockingPaneManager()->ToggleDocking(pPane);
		}
	}

}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:32,代码来源:XTPDockingPaneTabbedContainer.cpp


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