Example #1
0
void ezQtPropertyContainerWidget::OnElementButtonClicked()
{
  ezQtElementGroupButton* pButton = qobject_cast<ezQtElementGroupButton*>(sender());
  const ezAbstractProperty* pProp = pButton->GetGroupWidget()->GetProperty();
  ezHybridArray<ezPropertySelection, 8> items = pButton->GetGroupWidget()->GetSelection();

  switch (pButton->GetAction())
  {
    case ezQtElementGroupButton::ElementAction::MoveElementUp:
    {
      MoveItems(items, -1);
    }
    break;
    case ezQtElementGroupButton::ElementAction::MoveElementDown:
    {
      MoveItems(items, 2);
    }
    break;
    case ezQtElementGroupButton::ElementAction::DeleteElement:
    {
      DeleteItems(items);
    }
    break;
  }
}
Example #2
0
HRESULT CRomList::OnRescanRoms( char *szPath,  BOOL& bHandled )
{ 
	
 
	DeleteItems(0, m_ListData.size());
	 
	strcpy(szRoms, "GAME:\\ROMS\\");
	strcat(szRoms, "*.*");
  
	m_ListData.clear();

	HANDLE hFind;	
	WIN32_FIND_DATAA oFindData;

	hFind = FindFirstFile(szRoms, &oFindData);
	
	if (hFind != INVALID_HANDLE_VALUE)
	{
		do
		{					 
			m_ListData.push_back(_strlwr(oFindData.cFileName));			  

		} while (FindNextFile(hFind, &oFindData));

		std::sort(m_ListData.begin(),m_ListData.end());
		 	
	}
	 
	InsertItems( 0, m_ListData.size() );

	bHandled = TRUE;	
    return( S_OK );
}
// Dtor
ctConfigToolDoc::~ctConfigToolDoc()
{
    DeleteItems();
    ClearClipboard();
    if (GetCommandProcessor())
        GetCommandProcessor()->SetEditMenu(NULL);
}
Example #4
0
/*!
 * \brief Close the document.
 *
 * \return true on success, otherwise false is returned.
 */
bool CNutConfDoc::OnCloseDocument()
{
    if (wxDocument::OnCloseDocument()) {
        DeleteItems();
        return true;
    }
    return false;
}
Example #5
0
/*!
 * \brief Destructor.
 */
CNutConfDoc::~CNutConfDoc()
{
    if (m_repository) {
        CloseRepository(m_repository);
    }
    ReleaseRepository();
    DeleteItems();
}
/**
*  @brief
*    Destructor
*/
SceneHierarchyNode::~SceneHierarchyNode()
{
	// Update the total number of scene hierarchy nodes and free the unique node ID
	m_pHierarchy->m_nTotalNumOfNodes--;

	// Delete the items
	DeleteItems();
}
// Closes and clears the document
bool ctConfigToolDoc::OnCloseDocument()
{
    if (wxDocument::OnCloseDocument())
    {
        ctConfigToolHint hint(NULL, ctClear);
        UpdateAllViews (NULL, & hint);

        DeleteItems();
        return true;
    }
    else
    {
        return false;
    }
}
HRESULT CXlinkBuddyList::LoadBuddyList(void)
{
	// Our list is swapping, let's block out changes
	bIsLoaded = false;
	
	// Refresh our copy of the arena item
	CKaiBuddyManager::getInstance().getBuddyInfo(&m_pBuddyList);
	CKaiBuddyManager::getInstance().getBuddyLookupInfo(&m_BuddyNames);

	int nSize = m_nCurrentListSize = (int)m_pBuddyList.size();

	// Local Variables
	unsigned int nCurrentSel = 0;
	unsigned int nCurrentTop = 0;

	// Set our current selection 
	if( nSize > 0 && GetCurSel() == -1 )
		nCurrentSel = 0;
	else
		nCurrentSel = GetCurSel();

	// Set our top most item
	nCurrentTop = GetTopItem();

	// Now let's clear our entire list, so we can update it
	DeleteItems(0, GetItemCount());

	// Now let's add in our new list items
	if( nSize > 0 ) {
		InsertItems( 0, nSize );
		if( bInitializeList == true ) {
			nCurrentTop = 0;
			bInitializeList = false;
		} else if( (int)nCurrentTop > nSize ) {
			nCurrentTop = nSize;
		}
	}

	// Restore list position
	SetTopItem(nCurrentTop);
	SetCurSel(nCurrentSel);

	// Notify that the list has been loaded
	if(nSize > 0 ) bIsLoaded = true;

	// Return Successfully
	return S_OK;
}
Example #9
0
HRESULT CGamesList::OnSetListContent(FSDMessageSetListContent * pSetListContent, BOOL &bHandled )
{
	// Unpack the message and store into local vector
	m_vListContent = pSetListContent->pVec;
	
	if(m_vListContent != NULL)
		SetListSize((int)m_vListContent->size());

	// Local variables used 
	unsigned int nCurrentSel = 0;
	int nCurrentTop = 0;

	// If interested, save current list position for later use
	if(pSetListContent->bRetainSelection){
		
		if(GetListSize() > 0 && GetCurSel() == -1)
			nCurrentSel = 0;
		else
			nCurrentSel = GetCurSel();
		nCurrentTop = GetTopItem();
		if (nCurrentTop == -1)
			nCurrentTop = 0;
	}

	// Clear the current list and prepare the list to use a new data vector
	DeleteItems(0, GetItemCount());
	if(pSetListContent->pVec != NULL){
		InsertItems(0, pSetListContent->pVec->size());
		if( nCurrentTop > pSetListContent->pVec->size() )
			nCurrentTop = pSetListContent->pVec->size();
	}

	// Restore list position
	SetTopItem(nCurrentTop);
	SetCurSel(nCurrentSel);

	if(pSetListContent->pVec != NULL)
		GameContentManager::getInstance().RefreshCurrentContent(m_CurrentGame, nCurrentSel, pSetListContent->pVec->size());

	// Return Successfully
	bHandled = TRUE;
	return S_OK;
}
Example #10
0
		~Vector()
		{
			DeleteItems(Items,Count);
			delete [] Items;
			Items=nullptr;
		}
Example #11
0
void ShowProcessList()
{
	static bool Active = false;
	if (Active)
		return;
	Active = true;

	auto ProcList = VMenu2::create(MSG(MProcessListTitle), nullptr, 0, ScrY - 4);
	ProcList->SetMenuFlags(VMENU_WRAPMODE);
	ProcList->SetPosition(-1,-1,0,0);
	static bool bShowImage = false;

	ProcInfo pi = {ProcList.get(), bShowImage};

	if (EnumWindows(EnumWindowsProc,(LPARAM)&pi))
	{
		ProcList->AssignHighlights(FALSE);
		ProcList->SetBottomTitle(MSG(MProcessListBottom));
		ProcList->SortItems(TaskSort);

		ProcList->Run([&](const Manager::Key& RawKey)->int
		{
			const auto Key=RawKey.FarKey();
			int KeyProcessed = 1;
			switch (Key)
			{
				case KEY_F1:
				{
					Help::create(L"TaskList");
					break;
				}

				case KEY_NUMDEL:
				case KEY_DEL:
				{
					auto ProcWnd = *static_cast<HWND*>(ProcList->GetUserData(nullptr, 0));

					if (ProcWnd)
					{
						wchar_t_ptr Title;
						int LenTitle=GetWindowTextLength(ProcWnd);

						if (LenTitle)
						{
							Title.reset(LenTitle + 1);

							if (Title && (LenTitle=GetWindowText(ProcWnd, Title.get(), LenTitle+1)))
								Title[LenTitle]=0;
						}

						DWORD ProcID;
						GetWindowThreadProcessId(ProcWnd,&ProcID);

						if (!Message(MSG_WARNING,2,MSG(MKillProcessTitle),MSG(MAskKillProcess),
									NullToEmpty(Title.get()),MSG(MKillProcessWarning),MSG(MKillProcessKill),MSG(MCancel)))
						{
							if (KillProcess(ProcID))
								Sleep(500);
							else
							{
								Global->CatchError();
								Message(MSG_WARNING|MSG_ERRORTYPE,1,MSG(MKillProcessTitle),MSG(MCannotKillProcess),MSG(MOk));
							}
						}
					}
				}
				case KEY_CTRLR:
				case KEY_RCTRLR:
				{
					ProcList->DeleteItems();

					if (!EnumWindows(EnumWindowsProc,(LPARAM)&pi))
						ProcList->Close(-1);
					else
						ProcList->SortItems(TaskSort);
					break;
				}
				case KEY_F2:
				{
					pi.bShowImage=(bShowImage=!bShowImage);
					int SelectPos=ProcList->GetSelectPos();
					ProcList->DeleteItems();

					if (!EnumWindows(EnumWindowsProc,(LPARAM)&pi))
						ProcList->Close(-1);
					else
					{
						ProcList->SortItems(TaskSort);
						ProcList->SetSelectPos(SelectPos);
					}
					break;
				}


				default:
					KeyProcessed = 0;
			}
			return KeyProcessed;
		});

		if (ProcList->GetExitCode()>=0)
		{
			auto ProcWnd = *static_cast<HWND*>(ProcList->GetUserData(nullptr, 0));

			if (ProcWnd)
			{
				//SetForegroundWindow(ProcWnd);
				// Allow SetForegroundWindow on Win98+.
				DWORD dwMs;
				// Remember the current value.
				BOOL bSPI = SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &dwMs, 0);

				if (bSPI) // Reset foreground lock timeout
					bSPI = SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, 0, 0);

				SetForegroundWindow(ProcWnd);

				if (bSPI) // Restore old value
					SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, ToPtr(dwMs), 0);

				WINDOWPLACEMENT wp = { sizeof(wp) };
				if (!GetWindowPlacement(ProcWnd,&wp) || wp.showCmd!=SW_SHOWMAXIMIZED)
					ShowWindowAsync(ProcWnd,SW_RESTORE);
			}
		}
	}
	Active = false;
}
Example #12
0
CMyTreeView::~CMyTreeView()
{
    DeleteItems();
}