示例#1
0
void BreakpointDlg::OnItemActivated(wxListEvent &e)
{
    wxString file = GetColumnText(m_listCtrlBreakpoints, e.m_itemIndex, m_listCtrlBreakpoints->GetFileColumn());
    wxString line = GetColumnText(m_listCtrlBreakpoints, e.m_itemIndex, m_listCtrlBreakpoints->GetLinenoColumn());
    long line_number;
    line.ToLong(&line_number);

    clMainFrame::Get()->GetMainBook()->OpenFile(file, wxEmptyString, line_number-1, wxNOT_FOUND, OF_AddJump, false);
}
示例#2
0
void SymbolsDialog::UpdateFileAndLine(wxListEvent &event)
{
	wxString line_number;
	m_file = GetColumnText(m_results, event.m_itemIndex, 2);
	line_number = GetColumnText(m_results, event.m_itemIndex, 3);
	m_pattern = GetColumnText(m_results, event.m_itemIndex, 4);
	line_number.ToLong( &m_line );
	m_project = ManagerST::Get()->GetProjectNameByFile(m_file);
}
示例#3
0
int64_t CQueueStorage::Impl::ParseFileFromRow(CFileItem** pItem)
{
	wxString sourceFile = GetColumnText(selectFilesQuery_, file_table_column_names::source_file);
	wxString targetFile = GetColumnText(selectFilesQuery_, file_table_column_names::target_file);

	int64_t localPathId = GetColumnInt64(selectFilesQuery_, file_table_column_names::local_path, false);
	int64_t remotePathId = GetColumnInt64(selectFilesQuery_, file_table_column_names::remote_path, false);

	const CLocalPath& localPath(GetLocalPath(localPathId));
	const CServerPath& remotePath(GetRemotePath(remotePathId));

	bool download = GetColumnInt(selectFilesQuery_, file_table_column_names::download) != 0;

	if (localPathId == -1 || remotePathId == -1)
	{
		// QueueItemType::Folder
		if ((download && localPath.empty()) ||
			(!download && remotePath.empty()))
		{
			return INVALID_DATA;
		}

		if (download)
			*pItem = new CFolderItem(0, true, localPath);
		else
			*pItem = new CFolderItem(0, true, remotePath, sourceFile);
	}
	else
	{
		int64_t size = GetColumnInt64(selectFilesQuery_, file_table_column_names::size);
		unsigned char errorCount = static_cast<unsigned char>(GetColumnInt(selectFilesQuery_, file_table_column_names::error_count));
		int priority = GetColumnInt(selectFilesQuery_, file_table_column_names::priority, static_cast<int>(QueuePriority::normal));

		bool ascii = GetColumnInt(selectFilesQuery_, file_table_column_names::ascii_file) != 0;
		int overwrite_action = GetColumnInt(selectFilesQuery_, file_table_column_names::default_exists_action, CFileExistsNotification::unknown);

		if (sourceFile.empty() || localPath.empty() ||
			remotePath.empty() ||
			size < -1 ||
			priority < 0 || priority >= static_cast<int>(QueuePriority::count))
		{
			return INVALID_DATA;
		}

		CFileItem* fileItem = new CFileItem(0, true, download, sourceFile, targetFile, localPath, remotePath, size);
		*pItem = fileItem;
		fileItem->SetAscii(ascii);
		fileItem->SetPriorityRaw(QueuePriority(priority));
		fileItem->m_errorCount = errorCount;

		if (overwrite_action > 0 && overwrite_action < CFileExistsNotification::ACTION_COUNT)
			fileItem->m_defaultFileExistsAction = (CFileExistsNotification::OverwriteAction)overwrite_action;
	}

	return GetColumnInt64(selectFilesQuery_, file_table_column_names::id);
}
示例#4
0
wxArrayString ReconcileProjectFiletypesDlg::GetRegexes() const
{
    wxArrayString array;
    for (int n = 0; n < m_listCtrlRegexes->GetItemCount(); ++n) {
        wxString regex = GetColumnText(m_listCtrlRegexes, n, 0);
        wxString VD = GetColumnText(m_listCtrlRegexes, n, 1);
        array.Add(VD + '|' + regex); // Store the data as a VD|regex string, as the regex might contain a '|' but the VD won't
    }
    return array;
}
示例#5
0
void WatchesTable::OnMenuCopyBoth(wxCommandEvent& event)
{
	wxUnusedVar(event);
	if (m_selectedId != wxNOT_FOUND) {
		wxString expr = GetColumnText(m_selectedId, 0);
		wxString value = GetColumnText(m_selectedId, 1);
		// copy expr + value to clipboard
		CopyToClipboard(expr + wxT(" ") + value);
	}
}
示例#6
0
void CompilerMainPage::SavePatterns()
{
    CHECK_PTR_RET(m_compiler);
    Compiler::CmpListInfoPattern errPatterns;
    for(int i = 0; i < m_listErrPatterns->GetItemCount(); ++i) {
        Compiler::CmpInfoPattern infoPattern;
        infoPattern.pattern = GetColumnText(m_listErrPatterns, i, 0);
        infoPattern.fileNameIndex = GetColumnText(m_listErrPatterns, i, 1);
        infoPattern.lineNumberIndex = GetColumnText(m_listErrPatterns, i, 2);
        infoPattern.columnIndex = GetColumnText(m_listErrPatterns, i, 3);
        errPatterns.push_back(infoPattern);
    }
    m_compiler->SetErrPatterns(errPatterns);

    Compiler::CmpListInfoPattern warnPatterns;
    for(int i = 0; i < m_listWarnPatterns->GetItemCount(); ++i) {
        Compiler::CmpInfoPattern infoPattern;
        infoPattern.pattern = GetColumnText(m_listWarnPatterns, i, 0);
        infoPattern.fileNameIndex = GetColumnText(m_listWarnPatterns, i, 1);
        infoPattern.lineNumberIndex = GetColumnText(m_listWarnPatterns, i, 2);
        infoPattern.columnIndex = GetColumnText(m_listWarnPatterns, i, 3);
        warnPatterns.push_back(infoPattern);
    }
    m_compiler->SetWarnPatterns(warnPatterns);
}
示例#7
0
void NewClassDlg::GetInheritance(std::vector<ClassParentInfo>& inheritVec)
{
    long item = -1;
    for(;;) {
        item = m_listCtrl1->GetNextItem(item);
        if(item == -1) break;

        ClassParentInfo info;
        info.name = GetColumnText(m_listCtrl1, item, 0);
        info.access = GetColumnText(m_listCtrl1, item, 1);
        info.fileName = GetColumnText(m_listCtrl1, item, 2);

        inheritVec.push_back(info);
    }
}
示例#8
0
void CompilerMainPage::DoUpdateErrPattern(long item)
{
    wxString pattern = GetColumnText(m_listErrPatterns, item, 0);
    wxString fileIdx = GetColumnText(m_listErrPatterns, item, 1);
    wxString lineIdx = GetColumnText(m_listErrPatterns, item, 2);
    wxString colIdx = GetColumnText(m_listErrPatterns, item, 3);
    CompilerPatternDlg dlg(wxGetTopLevelParent(this), _("Update compiler error pattern"));
    dlg.SetPattern(pattern, lineIdx, fileIdx, colIdx);
    if(dlg.ShowModal() == wxID_OK) {
        SetColumnText(m_listErrPatterns, item, 0, dlg.GetPattern());
        SetColumnText(m_listErrPatterns, item, 1, dlg.GetFileIndex());
        SetColumnText(m_listErrPatterns, item, 2, dlg.GetLineIndex());
        SetColumnText(m_listErrPatterns, item, 3, dlg.GetColumnIndex());
    }
}
void DebuggerSettingsDlg::OnOk(wxCommandEvent &e)
{
	wxUnusedVar(e);
	//go over the debuggers and set the debugger path
	for (size_t i=0; i<(size_t)m_book->GetPageCount(); i++) {
		DebuggerPage *page =  (DebuggerPage *)m_book->GetPage(i);

		//find the debugger
		DebuggerInformation info;
		DebuggerMgr::Get().GetDebuggerInformation(page->m_title, info);

		//populate the information and save it
		info.enableDebugLog           = page->m_checkBoxEnableLog->GetValue();
		info.enablePendingBreakpoints = page->m_checkBoxEnablePendingBreakpoints->GetValue();
		info.path                     = page->m_textCtrDbgPath->GetValue();
		info.name                     = page->m_title;
		info.breakAtWinMain           = page->m_checkBreakAtWinMain->IsChecked();
		info.showTerminal             = page->m_checkShowTerminal->IsChecked();
		info.consoleCommand           = EditorConfigST::Get()->GetOptions()->GetProgramConsoleCommand();
		info.useRelativeFilePaths     = page->m_checkUseRelativePaths->IsChecked();
		info.catchThrow               = page->m_catchThrow->IsChecked();
		info.showTooltips             = page->m_showTooltips->IsChecked();
		info.startupCommands          = page->m_textCtrlStartupCommands->GetValue();
		info.maxDisplayStringSize     = page->m_spinCtrlNumElements->GetValue();
		info.resolveLocals            = page->m_checkBoxExpandLocals->IsChecked();
#ifdef __WXMSW__
		info.debugAsserts             = page->m_checkBoxDebugAssert->IsChecked();
#endif
		info.autoExpandTipItems       = page->m_checkBoxAutoExpand->IsChecked();
		DebuggerMgr::Get().SetDebuggerInformation(page->m_title, info);
	}

	//copy the commands the serialized object m_data
	int count = m_listCtrl1->GetItemCount();
	std::vector<DebuggerCmdData> cmdArr;
	for(int i=0; i<count; i++){
		DebuggerCmdData cmd;
		cmd.SetName      ( GetColumnText(m_listCtrl1, i, 0) );
		cmd.SetCommand   ( GetColumnText(m_listCtrl1, i, 1) );
		cmd.SetDbgCommand( GetColumnText(m_listCtrl1, i, 2) );
		cmdArr.push_back(cmd);
	}
	m_data.SetCmds(cmdArr);

	//save the debugger commands
	DebuggerConfigTool::Get()->WriteObject(wxT("DebuggerCommands"), &m_data);
	EndModal(wxID_OK);
}
DebuggerPreDefinedTypes PreDefinedTypesPage::GetPreDefinedTypes()
{
	int count = m_listCtrl1->GetItemCount();
	DebuggerCmdDataVec cmdArr;
	
	for(int i=0; i<count; i++) {
		DebuggerCmdData cmd;
		cmd.SetName      ( GetColumnText(m_listCtrl1, i, 0) );
		cmd.SetCommand   ( GetColumnText(m_listCtrl1, i, 1) );
		cmd.SetDbgCommand( GetColumnText(m_listCtrl1, i, 2) );
		cmdArr.push_back(cmd);
	}
	
	m_data.SetCmds(cmdArr);
	return m_data;
}
void PreDefinedTypesPage::OnNewShortcut( wxCommandEvent& event )
{
	wxUnusedVar(event);
	DbgCommandDlg dlg(this);
    
	if (dlg.ShowModal() == wxID_OK) {
        
		//add new command to the table
		wxString name       = dlg.GetName();
		wxString expression = dlg.GetExpression();
		wxString dbgCmd     = dlg.GetDbgCommand();
		
		// Make sure that the expression does not exist
		int count = m_listCtrl1->GetItemCount();
		for(int i=0; i<count; i++) {
			wxString existingName = GetColumnText(m_listCtrl1, i, 0);
			if(name == existingName) {
				wxMessageBox(_("A Debugger type with that name already exists"), _("CodeLite"), wxOK | wxICON_INFORMATION);
				return;
			}
		}

		// Set the item display name
        long item = ::AppendListCtrlRow(m_listCtrl1);
        
		SetColumnText(m_listCtrl1, item, 0, name       );
		SetColumnText(m_listCtrl1, item, 1, expression );
		SetColumnText(m_listCtrl1, item, 2, dbgCmd);

		m_listCtrl1->SetColumnWidth(0, -1);
		m_listCtrl1->SetColumnWidth(1, -1);
		m_listCtrl1->SetColumnWidth(2, -1);
	}
}
示例#12
0
void DbSettingDialog::OnItemSelected(wxListEvent& event)
{
    long selecteditem = -1;
    selecteditem = m_listCtrlRecentFiles->GetNextItem(selecteditem, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);

    m_filePickerSqlite->SetPath(GetColumnText(m_listCtrlRecentFiles, (int)selecteditem, 0));
}
示例#13
0
void CompilerMainPage::SaveFileTypes()
{
    CHECK_PTR_RET(m_compiler);

    std::map<wxString, Compiler::CmpFileTypeInfo> fileTypes;
    int count = m_listCtrlFileTypes->GetItemCount();
    for(int i = 0; i < count; i++) {
        Compiler::CmpFileTypeInfo ft;
        ft.extension = GetColumnText(m_listCtrlFileTypes, i, 0);
        ft.kind = GetColumnText(m_listCtrlFileTypes, i, 1) == _("Resource") ? Compiler::CmpFileKindResource :
                                                                              Compiler::CmpFileKindSource;
        ft.compilation_line = GetColumnText(m_listCtrlFileTypes, i, 2);

        fileTypes[ft.extension] = ft;
    }
    m_compiler->SetFileTypes(fileTypes);
}
示例#14
0
void CompilerMainPage::OnFileTypeActivated(wxListEvent& event)
{
    if(m_selectedFileType != wxNOT_FOUND) {
        EditCmpFileInfo dlg(wxGetTopLevelParent(this));
        dlg.SetCompilationLine(GetColumnText(m_listCtrlFileTypes, m_selectedFileType, 2));
        dlg.SetExtension(GetColumnText(m_listCtrlFileTypes, m_selectedFileType, 0));
        dlg.SetKind(GetColumnText(m_listCtrlFileTypes, m_selectedFileType, 1));

        if(dlg.ShowModal() == wxID_OK) {
            SetColumnText(m_listCtrlFileTypes, m_selectedFileType, 2, dlg.GetCompilationLine());
            SetColumnText(m_listCtrlFileTypes, m_selectedFileType, 0, dlg.GetExtension().Lower());
            SetColumnText(m_listCtrlFileTypes, m_selectedFileType, 1, dlg.GetKind());
        }
        m_isDirty = true;
    }
    event.Skip();
}
示例#15
0
void NewClassDlg::OnListItemActivated(wxListEvent& event)
{
    m_selectedItem = event.m_itemIndex;
    // open the inheritance dialog
    wxString parentName = GetColumnText(m_listCtrl1, m_selectedItem, 0);
    wxString access = GetColumnText(m_listCtrl1, m_selectedItem, 1);
    NewIneritanceDlg* dlg = new NewIneritanceDlg(NULL, m_mgr, parentName, access);
    if(dlg->ShowModal() == wxID_OK) {
        // now set the text to this column
        SetColumnText(m_listCtrl1, m_selectedItem, 0, dlg->GetParentName());
        SetColumnText(m_listCtrl1, m_selectedItem, 1, dlg->GetAccess());

        SetColumnText(m_listCtrl1, m_selectedItem, 2, dlg->GetFileName());

        m_listCtrl1->Refresh();
    }
    dlg->Destroy();
}
示例#16
0
void WatchesTable::OnMenuDerefExpr(wxCommandEvent &event)
{
	wxUnusedVar(event);
	if (m_selectedId != wxNOT_FOUND) {
		wxString curvalue = GetColumnText(m_selectedId, 0);
		curvalue.Prepend(wxT("*"));
		SetColumnText(m_selectedId, 0, curvalue);
		RefreshValues();
	}
}
示例#17
0
void WatchesTable::DoShowMoreDetails(long item)
{
	if( item != wxNOT_FOUND ) {
		wxString value = GetColumnText(item, 0);
		IDebugger *dbgr = DebuggerMgr::Get().GetActiveDebugger();
		if ( dbgr && dbgr->IsRunning() && ManagerST::Get()->DbgCanInteract() ) {
			dbgr->CreateVariableObject( value, DBG_USERR_WATCHTABLE );
		}
	}
}
示例#18
0
void ThreadListPanel::OnItemActivated( wxListEvent& event )
{
    long threadId(wxNOT_FOUND);
    int index = event.m_itemIndex;
    if(index != wxNOT_FOUND) {
        wxString str_id = GetColumnText(m_list, index, 0);
        str_id.ToLong(&threadId);
        Manager *mgr = ManagerST::Get();
        mgr->DbgSetThread(threadId);
    }
}
示例#19
0
void DbSettingDialog::OnItemActivated(wxListEvent& event)
{
    wxCommandEvent dummy;

    long selecteditem = -1;
    selecteditem = m_listCtrlRecentFiles->GetNextItem(selecteditem, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);

    m_filePickerSqlite->SetPath(GetColumnText(m_listCtrlRecentFiles, (int)selecteditem, 0));
    OnSqliteOkClick(dummy);
    Close();
}
示例#20
0
void WatchesTable::OnMenuEditExpr(wxCommandEvent &event)
{
	wxUnusedVar(event);
	if (m_selectedId != wxNOT_FOUND) {
		wxString curvalue = GetColumnText(m_selectedId, 0);
		wxString newValue = wxGetTextFromUser(wxT("Edit expression:"), wxT("Edit"), curvalue);
		if (newValue.IsEmpty() == false) {
			SetColumnText(m_selectedId, 0, newValue);
			RefreshValues();
		}
	}
}
示例#21
0
void CompilerMainPage::SaveComilerOptions()
{
    CHECK_PTR_RET(m_compiler);
    Compiler::CmpCmdLineOptions cmpOptions;
    for(int idx = 0; idx < m_listCompilerOptions->GetItemCount(); ++idx) {
        Compiler::CmpCmdLineOption cmpOption;
        cmpOption.name = m_listCompilerOptions->GetItemText(idx);
        cmpOption.help = GetColumnText(m_listCompilerOptions, idx, 1);

        cmpOptions[cmpOption.name] = cmpOption;
    }
    m_compiler->SetCompilerOptions(cmpOptions);
}
示例#22
0
void CompilerMainPage::SaveLinkerOptions()
{
    CHECK_PTR_RET(m_compiler);
    Compiler::CmpCmdLineOptions lnkOptions;
    for(int idx = 0; idx < m_listLinkerOptions->GetItemCount(); ++idx) {
        Compiler::CmpCmdLineOption lnkOption;
        lnkOption.name = m_listLinkerOptions->GetItemText(idx);
        lnkOption.help = GetColumnText(m_listLinkerOptions, idx, 1);

        lnkOptions[lnkOption.name] = lnkOption;
    }
    m_compiler->SetLinkerOptions(lnkOptions);
}
void CompilerLinkerOptionsPage::Save(CompilerPtr cmp)
{
	Compiler::CmpCmdLineOptions lnkOptions;
	for (int idx = 0; idx < m_listLinkerOptions->GetItemCount(); ++idx)
	{
		Compiler::CmpCmdLineOption lnkOption;
		lnkOption.name = m_listLinkerOptions->GetItemText(idx);
		lnkOption.help = GetColumnText(m_listLinkerOptions, idx, 1);
		
		lnkOptions[lnkOption.name] = lnkOption;
	}
	cmp->SetLinkerOptions(lnkOptions);
}
void PreDefinedTypesPage::DoEditItem()
{
	//Edit the selection
	if (m_selectedItem == wxNOT_FOUND) {
		return;
	}

	//popup edit dialog
	DbgCommandDlg dlg(this);

	wxString name  = GetColumnText(m_listCtrl1, m_selectedItem, 0);
	wxString expr  = GetColumnText(m_listCtrl1, m_selectedItem, 1);
	wxString dbgCmd= GetColumnText(m_listCtrl1, m_selectedItem, 2);

	dlg.SetName(name);
	dlg.SetExpression(expr);
	dlg.SetDbgCommand(dbgCmd);

	if (dlg.ShowModal() == wxID_OK) {
		SetColumnText(m_listCtrl1, m_selectedItem, 0, dlg.GetName());
		SetColumnText(m_listCtrl1, m_selectedItem, 1, dlg.GetExpression());
		SetColumnText(m_listCtrl1, m_selectedItem, 2, dlg.GetDbgCommand());
	}
}
示例#25
0
void CompilerMainPage::OnLinkerOptionActivated(wxListEvent& event)
{
    if(m_selectedLnkOption == wxNOT_FOUND) {
        return;
    }

    wxString name = m_listLinkerOptions->GetItemText(m_selectedLnkOption);
    wxString help = GetColumnText(m_listLinkerOptions, m_selectedLnkOption, 1);
    CompilerLinkerOptionDialog dlg(wxGetTopLevelParent(this), name, help);
    if(dlg.ShowModal() == wxID_OK) {
        m_isDirty = true;
        SetColumnText(m_listLinkerOptions, m_selectedLnkOption, 0, dlg.GetName());
        SetColumnText(m_listLinkerOptions, m_selectedLnkOption, 1, dlg.GetHelp());
        m_listLinkerOptions->SetColumnWidth(1, wxLIST_AUTOSIZE);
    }
}
void CompilerLinkerOptionsPage::OnLinkerOptionActivated( wxListEvent& event )
{
	if (m_selectedLnkOption == wxNOT_FOUND) {
		return;
	}
	
	wxString name = m_listLinkerOptions->GetItemText(m_selectedLnkOption);
	wxString help = GetColumnText(m_listLinkerOptions, m_selectedLnkOption, 1);
	CompilerLinkerOptionDialog dlg(this, name, help);
	if (dlg.ShowModal() == wxID_OK)
	{
		SetColumnText(m_listLinkerOptions, m_selectedLnkOption, 0, dlg.m_sName);
		SetColumnText(m_listLinkerOptions, m_selectedLnkOption, 1, dlg.m_sHelp);
		m_listLinkerOptions->SetColumnWidth(1, wxLIST_AUTOSIZE);
	}
}
示例#27
0
void GenericListControl::HandleNotify(LPARAM lParam)
{
	LPNMHDR mhdr = (LPNMHDR) lParam;

	if (mhdr->code == NM_DBLCLK)
	{
		LPNMITEMACTIVATE item = (LPNMITEMACTIVATE) lParam;
		if ((item->iItem != -1 && item->iItem < GetRowCount()) || sendInvalidRows)
			OnDoubleClick(item->iItem,item->iSubItem);
		return;
	}

	if (mhdr->code == NM_RCLICK)
	{
		const LPNMITEMACTIVATE item = (LPNMITEMACTIVATE)lParam;
		if ((item->iItem != -1 && item->iItem < GetRowCount()) || sendInvalidRows)
			OnRightClick(item->iItem,item->iSubItem,item->ptAction);
		return;
	}

	if (mhdr->code == LVN_GETDISPINFO)
	{
		NMLVDISPINFO* dispInfo = (NMLVDISPINFO*)lParam;

		stringBuffer[0] = 0;
		GetColumnText(stringBuffer,dispInfo->item.iItem,dispInfo->item.iSubItem);
		
		if (stringBuffer[0] == 0)
			wcscat(stringBuffer,L"Invalid");

		dispInfo->item.pszText = stringBuffer;
		return;
	}
	 
	// handle checkboxes
	if (mhdr->code == LVN_ITEMCHANGED && updating == false)
	{
		NMLISTVIEW* item = (NMLISTVIEW*) lParam;
		if (item->iItem != -1 && (item->uChanged & LVIF_STATE) != 0)
		{
			// image is 1 if unchcked, 2 if checked
			int oldImage = (item->uOldState & LVIS_STATEIMAGEMASK) >> 12;
			int newImage = (item->uNewState & LVIS_STATEIMAGEMASK) >> 12;
			if (oldImage != newImage)
				OnToggle(item->iItem,newImage == 2);
		}
示例#28
0
wxArrayString WatchesTable::GetExpressions()
{
	long item = wxNOT_FOUND;
	wxArrayString expressions;
	while ( true ) {
		item = m_listTable->GetNextItem(item,
		                                wxLIST_NEXT_ALL,
		                                wxLIST_STATE_DONTCARE);

		if ( item == -1 )
			break;

		wxString text(GetColumnText(item, 0));
		expressions.Add(text);
	}
	return expressions;
}
示例#29
0
long WatchesTable::FindExpressionItem(const wxString &expression)
{
	long item = -1;
	while ( true ) {
		item = m_listTable->GetNextItem(item,
		                                wxLIST_NEXT_ALL,
		                                wxLIST_STATE_DONTCARE);

		if ( item == -1 )
			break;

		wxString text(GetColumnText(item, 0));
		if (text == expression)
			return item;
	}
	return wxNOT_FOUND;
}
示例#30
0
void MacrosDlg::OnCopy(wxCommandEvent& e)
{
    if (m_item != wxNOT_FOUND) {
        wxString value = GetColumnText(m_listCtrlMacros, m_item,  0);
#if wxUSE_CLIPBOARD
        if (wxTheClipboard->Open()) {
            wxTheClipboard->UsePrimarySelection(false);
            if (!wxTheClipboard->SetData(new wxTextDataObject(value))) {
                //wxPrintf(wxT("Failed to insert data %s to clipboard"), textToCopy.GetData());
            }
            wxTheClipboard->Close();
        } else {
            wxPrintf(wxT("Failed to open the clipboard"));
        }
#endif
    }
    m_item = wxNOT_FOUND;
}