本文整理汇总了C++中getSelection函数的典型用法代码示例。如果您正苦于以下问题:C++ getSelection函数的具体用法?C++ getSelection怎么用?C++ getSelection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSelection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例5: moveUpStation
void SettingsDialog::moveUpStation()
{
if ( getSelection() )
{
if ( selectedStation > 0 )
{
stationList.swap( selectedStation, selectedStation - 1 );
selectedStation -= 1;
updateStationsTable();
}
}
}
示例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());
}
}
}
示例7: moveDownStation
void SettingsDialog::moveDownStation()
{
if ( getSelection() )
{
if ( selectedStation < stationList.count() - 1 )
{
stationList.swap( selectedStation, selectedStation + 1 );
selectedStation += 1;
updateStationsTable();
}
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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");
}
示例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;
}
}
示例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();
}
示例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();
}