• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ getSelection函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: wxFileSelector

void HtmlExportWindow::onOk(wxCommandEvent&) {
	ExportTemplateP exp = list->getSelection<ExportTemplate>();
	// get filename
	String name = wxFileSelector(_TITLE_("save html"),settings.default_export_dir,_(""),_(""),exp->file_type, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
	if (name.empty()) return;
	settings.default_export_dir = wxPathOnly(name);
	// export
	export_set(set, getSelection(), exp, name);
	// Done
	EndModal(wxID_OK);
}
开发者ID:BestRCH,项目名称:magicseteditor,代码行数:11,代码来源:html_export_window.cpp


示例2: getSelectedParent

SimSet* SimTreeView::getSelectedParent()
{
   HTREEITEM hItem;
   SimObject *obj;
   if ( (hItem = getSelection()) != NULL )
      if ( (hItem = getParent( hItem )) != NULL )
         if ( (obj = getObject( hItem )) != NULL )
            return( dynamic_cast<SimSet*>(obj) );

   return NULL;
}   
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:11,代码来源:simTreeView.cpp


示例3: getSelection

void CmdRaytracingResetCamera::activated(int iMsg)
{
    std::vector<App::DocumentObject*> sel = getSelection().getObjectsOfType(Raytracing::RayProject::getClassTypeId());
    if (sel.size() != 1) {
        sel = getSelection().getObjectsOfType(Raytracing::LuxProject::getClassTypeId());
        if (sel.size() != 1) {
            QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
                QObject::tr("Select one Raytracing project object."));
            return;
        }
    }

    if (sel.front()->getTypeId().isDerivedFrom(Raytracing::RayProject::getClassTypeId())) {
        //povray
        try {
            openCommand("Reset Raytracing Camera");
            doCommand(Doc,"import RaytracingGui");
            doCommand(Doc,"App.activeDocument().%s.Camera = RaytracingGui.povViewCamera()",sel.front()->getNameInDocument());
            commitCommand();
            updateActive();
        }
        catch (...) {
            abortCommand();
            throw;
        }
    }
    else if (sel.front()->getTypeId().isDerivedFrom(Raytracing::LuxProject::getClassTypeId())) {
        //luxrender
        try {
            openCommand("Reset Raytracing Camera");
            doCommand(Doc,"import RaytracingGui");
            doCommand(Doc,"App.activeDocument().%s.Camera = RaytracingGui.luxViewCamera()",sel.front()->getNameInDocument());
            commitCommand();
            updateActive();
        }
        catch (...) {
            abortCommand();
            throw;
        }
    }
}
开发者ID:DanielDTR,项目名称:FreeCAD_sf_master,代码行数:41,代码来源:Command.cpp


示例4: main

int main()
{
	int userInput;
	struct Node* head;
	struct Node* tail;
	head = NULL;
	tail = NULL;
	
	printWelcomeMsg();
	
	userInput = 0;
	while (userInput != -1) {
		userInput = getSelection("Enter your selection: ");		
		if(userInput == 1) {
			userInput = getSelection("Enter the value to append to head: ");
			insertAtHead(&head, &tail, userInput);
		} else if (userInput == 2) {
			userInput = getSelection("Enter the value to append to tail: ");
			insertAtTail(&tail, &head, userInput);
		} else if (userInput == -1) {
			printExitMessage();
			scanf("%d", &userInput);
			printf("\n");
			if (userInput == 1) {
				printForward(tail);
			} else if (userInput == 2) {
				printReverse(head);
			} else {
				printf("\nExiting without displaying output.");
			}
			return 0;
		}
		else {
			printf("You've made an error. Please try again.\n\n");
		}
	}

	printForward(tail);
	
	return 0;
}
开发者ID:tnesbit450,项目名称:learning,代码行数:41,代码来源:dll.c


示例5: moveUpStation

void SettingsDialog::moveUpStation()
{
    if ( getSelection() )
    {
        if ( selectedStation > 0 )
        {
            stationList.swap( selectedStation, selectedStation - 1 );
            selectedStation -= 1;
            updateStationsTable();
        }
    }
}
开发者ID:ivanov-pavel,项目名称:QRadioTray,代码行数:12,代码来源:settingsdialog.cpp


示例6: getSelection

void CSVRender::WorldspaceWidget::centerOrbitCameraOnSelection()
{
    std::vector<osg::ref_ptr<TagBase> > selection = getSelection(~0);

    for (std::vector<osg::ref_ptr<TagBase> >::iterator it = selection.begin(); it!=selection.end(); ++it)
    {
        if (CSVRender::ObjectTag *objectTag = dynamic_cast<CSVRender::ObjectTag*> (it->get()))
        {
            mOrbitCamControl->setCenter(objectTag->mObject->getPosition().asVec3());
        }
    }
}
开发者ID:DavidDanielsson,项目名称:openmw,代码行数:12,代码来源:worldspacewidget.cpp


示例7: moveDownStation

void SettingsDialog::moveDownStation()
{
    if ( getSelection() )
    {
        if ( selectedStation < stationList.count() - 1 )
        {
            stationList.swap( selectedStation, selectedStation + 1 );
            selectedStation += 1;
            updateStationsTable();
        }
    }
}
开发者ID:ivanov-pavel,项目名称:QRadioTray,代码行数:12,代码来源:settingsdialog.cpp


示例8: getSelection

void CPetRoomsGlyph::selectGlyph(const Point &topLeft, const Point &pt) {
	if (isAssigned()) {
		bool isShiftPressed = g_vm->_window->getSpecialButtons() & MK_SHIFT;

		if (isShiftPressed) {
			int selection = getSelection(topLeft, pt);
			if (selection >= 0)
				_roomFlags |= 1 << selection;
		}

		updateTooltip();
	}
}
开发者ID:Tkachov,项目名称:scummvm,代码行数:13,代码来源:pet_rooms_glyphs.cpp


示例9: XOJ_CHECK_TYPE

void XournalView::clearSelection()
{
	XOJ_CHECK_TYPE(XournalView);

	EditSelection* sel = GTK_XOURNAL(widget)->selection;
	GTK_XOURNAL(widget)->selection = NULL;
	delete sel;

	control->setClipboardHandlerSelection(getSelection());

	getCursor()->setMouseSelectionType(CURSOR_SELECTION_NONE);
	control->getToolHandler()->setSelectionEditTools(false, false, false);
}
开发者ID:xournalpp,项目名称:xournalpp,代码行数:13,代码来源:XournalView.cpp


示例10: Menu

ChannelMenu::ChannelMenu(WindowManager *manager, XEvent *e)
    : Menu(manager, e), m_channels(manager->channels()),
      m_channel(manager->channel())
{
    XButtonEvent *ev = (XButtonEvent *)e;

    Client *c = m_windowManager->windowToClient(ev->window);
    ev->x = ev->x_root; ev->y = ev->y_root;
	
    int channel = getSelection() + 1;

    m_windowManager->gotoChannel(channel, c);
}
开发者ID:bbidulock,项目名称:wmx,代码行数:13,代码来源:Menu.C


示例11: gtk_list_store_clear

// Update the attributes table
void ShaderSelector::updateInfoTable() {

	gtk_list_store_clear(_infoStore);

	// Get the selected texture name. If nothing is selected, we just leave the
	// infotable empty.
	std::string selName = getSelection();

	// Notify the client of the change to give it a chance to update the infostore
	if (_client != NULL && !selName.empty()) {
		_client->shaderSelectionChanged(selName, _infoStore);
	}
}
开发者ID:ibrahimmusba,项目名称:ufoai,代码行数:14,代码来源:ShaderSelector.cpp


示例12: display

void Game::run()
{
	int selection;
	string filename, tester;
	ifstream testStream;
	
	display("\nWelcome to the adventure game!\n");
	
	do {
		display("\nWhat will you do? (enter the number corresponding to your selection)\n 1. New game\n 2. Load game\n 0. Quit game\n");
		selection = getSelection();
		switch (selection) {
			case 1:
				cout << '\n';
				if (loadDefaultData() == OK)
					playGame();
				break;
			case 0:
				break;
			case 2:
				display("\nWhat is the name of your save file? (press enter to cancel)\n");
				getline(cin, filename);
				
				testStream.open(filename.c_str());
				getline(testStream, tester);
				if (filename != "") {
					if (tester != "start_save_file") {
						stringstream output;
						output << "\nSorry, " << filename << " is not the name of a valid save file.  Try again.\n";
						display(output.str());
						selection = -1;
						break;
					}
					testStream.close();
				
					if (loadGame(filename) == ERROR)
						cout << "Error: something went wrong with loadGame().\n";
					else {
						cout << '\n';
						playGame(filename);
					}
				}
				break;
			default:
				display("Invalid selection. Try again.\n");
				break;
		}
	} while (selection != 0);
	
	display("\nGood bye! Thanks for playing!\n\n");
}
开发者ID:OwenWelsh,项目名称:TextBasedAdventure,代码行数:51,代码来源:Game.cpp


示例13: getSelection

void Editor::updateSelectionOrigin()
{
    int lineFrom, indexFrom, lineTo, indexTo;
    getSelection(&lineFrom, &indexFrom, &lineTo, &indexTo);
    if (lineFrom == -1)
    {
        selectionOrigin.line = -1;
        selectionOrigin.index = -1;
    } else if (selectionOrigin.line == -1)
    {
        selectionOrigin.line = lineFrom;
        selectionOrigin.index = indexFrom;
    }
}
开发者ID:Williangalvani,项目名称:arduide,代码行数:14,代码来源:Editor.cpp


示例14: getSelection

void CCommands::FreezeSelection() {
CComBSTR file;
CComBSTR token;
long line;
long column;
long offset;

    getSelection(file,token,offset,line,column);
	m_SelectedFile = file.m_str;
	m_SelectedFile.Replace("\\","/");
	m_SelectedLine = line;
	m_SelectedColumn = column;
	m_SelectedLength = token.Length();
}
开发者ID:kit-transue,项目名称:software-emancipation-discover,代码行数:14,代码来源:Commands.cpp


示例15: beginUndoAction

void SonicPiScintilla::moveLineOrSelection(int numLines) {
  beginUndoAction();

  int linenum, cursor, origLinenum, origCursor;
  getCursorPosition(&linenum, &cursor);
  origLinenum = linenum;
  origCursor = cursor;

  bool hadSelectedText = hasSelectedText();


  if(!hadSelectedText) {
    setSelection(linenum, 0, linenum + 1, 0);
  }

  int lineFrom, indexFrom, lineTo, indexTo, lineOffset;
  getSelection(&lineFrom, &indexFrom, &lineTo, &indexTo);
  lineOffset = lineTo - origLinenum;
  linenum = lineFrom;

  QString selection = selectedText();

  if(selection[selection.length()-1] != '\n') {
    selection = selection + "\n";
    lineTo += 1;
    lineOffset += 1;
    indexTo = 0;
    replaceSelectedText("");
    setCursorPosition(linenum, 0);
    SendScintilla(SCI_DELETEBACK);
  } else {
    replaceSelectedText("");
  }
  setCursorPosition(linenum, 0);

  moveLines(numLines);

  getCursorPosition(&linenum, &cursor);
  setCursorPosition(linenum, 0);
  insert(selection);

  setCursorPosition(linenum + lineOffset, origCursor);

  int diffLine = lineTo - lineFrom;
  int diffIndex = indexTo - indexFrom;

  setSelection(linenum + diffLine, diffIndex, linenum, 0);

  endUndoAction();
}
开发者ID:Russell-Jones,项目名称:sonic-pi,代码行数:50,代码来源:sonicpiscintilla.cpp


示例16: getSelection

void CmdRaytracingExportProject::activated(int)
{
    QString filterLabel;
    unsigned int n = getSelection().countObjectsOfType(Raytracing::RayProject::getClassTypeId());
    if (n != 1) {
        n = getSelection().countObjectsOfType(Raytracing::LuxProject::getClassTypeId());
        if (n != 1) {
            QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
                QObject::tr("Select one Raytracing project object."));
            return;
        }
        else {
            filterLabel =  QString::fromLatin1("%1 (*.lxs)").arg(QObject::tr("Luxrender"));
        }
    }
    else {
        filterLabel = QString::fromLatin1("%1 (*.pov)").arg(QObject::tr("POV-Ray"));
    }

    QStringList filter;
    filter << filterLabel;
    filter << QString::fromLatin1("%1 (*.*)").arg(QObject::tr("All Files"));

    QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), QObject::tr("Export page"), QString(), filter.join(QLatin1String(";;")));
    if (!fn.isEmpty()) {
        std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
        openCommand("Raytracing export project");

        doCommand(Doc,"PageFile = open(App.activeDocument().%s.PageResult,'r')",Sel[0].FeatName);
        std::string fname = (const char*)fn.toUtf8();
        doCommand(Doc,"OutFile = open(unicode('%s','utf-8'),'w')",fname.c_str());
        doCommand(Doc,"OutFile.write(PageFile.read())");
        doCommand(Doc,"del OutFile,PageFile");

        commitCommand();
    }
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:37,代码来源:Command.cpp


示例17: CreateSolidCaret

void CHexViewView::showCaret() {
  if(!m_caretVisible) {
    CreateSolidCaret(2, CARETHEIGHT);
    ShowCaret();
    m_caretVisible = true;
  }
  m_caret.y = minMax(m_caret.y, 0, m_maxCaret.y);
  m_caret.x = minMax(m_caret.x, 0, m_maxCaret.x);

  bool redraw = false;
  if(m_lineCount && (m_lastLineSize < m_lineSize) && (m_topLine + m_caret.y == m_lineCount-1)) {
    if(m_lineOffset > m_maxLastLineOffset) {
      m_lineOffset = m_maxLastLineOffset;
      isNewSelection();
      redraw = true;
    } else {
      m_caret.x = minMax(m_caret.x, 0, m_lastLineSize - m_lineOffset);
      redraw = isNewSelection();
    }
  } else {
    redraw = isNewSelection();
  }
  m_lastCurrentAddr = getCurrentAddr();
  m_lastSelection   = getSelection();

  if(redraw) {
    repaint();
    return;
  }

  CPoint p(m_caret.x * m_byteSize.cx + m_contentRect.left + m_digitIndex*m_charSize.cx, m_caret.y * m_byteSize.cy + m_contentRect.top);
  SetCaretPos(p);
  m_keepSelection = false;
/*
  const String tmp = format(_T("%s bytes. Addr:%s. Lsize:%d[%d]. Lcount:%I64u, Psize(%d,%d), Scroll(%d,%I64u),max(%d,%I64u)[%d], Caret(%d,%d),max:(%d,%d), Anchor:%I64d, Mark:%s, %s")
                          ,format1000(m_docSize       ).cstr()
                          ,format1000(getCurrentAddr()).cstr()
                          ,m_lineSize, m_lastLineSize
                          ,m_lineCount
                          ,m_pageSize.cx, m_pageSize.cy
                          ,m_lineOffset , m_topLine      , m_maxLineOffset, m_maxTopLine, m_maxLastLineOffset
                          ,m_caret.x    , m_caret.y      , m_maxCaret.x   , m_maxCaret.y
                          ,m_anchor
                          ,getSelection().toString().cstr()
                          ,m_shift ? _T("shift") : EMPTYSTRING);

  theApp.GetMainWnd()->SetWindowText(tmp.cstr());
*/
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:49,代码来源:HexViewView.cpp


示例18: getSelection

void CmdPartSection::activated(int iMsg)
{
    unsigned int n = getSelection().countObjectsOfType(Part::Feature::getClassTypeId());
    if (n != 2) {
        QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
            QObject::tr("Select two shapes please."));
        return;
    }

    std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
    std::string FeatName = getUniqueObjectName("Section");
    std::string BaseName  = Sel[0].FeatName;
    std::string ToolName  = Sel[1].FeatName;

    openCommand("Section");
    doCommand(Doc,"App.activeDocument().addObject(\"Part::Section\",\"%s\")",FeatName.c_str());
    doCommand(Doc,"App.activeDocument().%s.Base = App.activeDocument().%s",FeatName.c_str(),BaseName.c_str());
    doCommand(Doc,"App.activeDocument().%s.Tool = App.activeDocument().%s",FeatName.c_str(),ToolName.c_str());
    doCommand(Gui,"Gui.activeDocument().hide('%s')",BaseName.c_str());
    doCommand(Gui,"Gui.activeDocument().hide('%s')",ToolName.c_str());
    doCommand(Gui,"Gui.activeDocument().%s.LineColor = Gui.activeDocument().%s.ShapeColor", FeatName.c_str(),BaseName.c_str());
    updateActive();
    commitCommand();
}
开发者ID:msocorcim,项目名称:FreeCAD,代码行数:24,代码来源:Command.cpp


示例19: RetrieveBuffer

bool RetrieveBuffer(std::string& text, std::string::size_type& pos)
{
  SDL_SysWMinfo info;

  //printf("Retrieving buffer...\n");
  SDL_VERSION(&info.version);
  if (SDL_GetWMInfo(&info)) {
    Display *dpy  = info.info.x11.display;
    Window  us    = info.info.x11.window;
    char    *data = NULL;

    if (!data) {
      data = getSelection(dpy, us, XA_PRIMARY);
    }
    if (!data) {
      data = getSelection(dpy, us, XA_SECONDARY);
    }
    if (!data) {
      Atom XA_CLIPBOARD = XInternAtom(dpy, "CLIPBOARD", 0);
      data = getSelection(dpy, us, XA_CLIPBOARD);
    }
    if (data) {
      // check cursor position
      if (pos > text.size()) {
        pos = text.size();
      }

      text.insert(pos, data);
      pos += strlen(data);
      XFree(data);

      return true;
    }
  }
  return false;
}
开发者ID:Arnaud474,项目名称:Warmux,代码行数:36,代码来源:copynpaste.cpp


示例20: getSelection

void* IEView::getSelection(IEVIEWEVENT *event) {
    if (selectedText!=NULL) delete selectedText;
    selectedText = getSelection();
    if (selectedText == NULL || wcslen(selectedText)== 0) return NULL;
    if (event->dwFlags & IEEF_NO_UNICODE) {
        int cp = CP_ACP;
        if (event->cbSize == sizeof(IEVIEWEVENT)) {
            cp = event->codepage;
        }
        char *str = Utils::convertToString(selectedText, cp);
        delete selectedText;
        selectedText = (BSTR) str;
    }
    return (void *)selectedText;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:15,代码来源:IEView.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ getSelf函数代码示例发布时间:2022-05-28
下一篇:
C++ getSelectedUnit函数代码示例发布时间:2022-05-28
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap