您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetCurrentPos函数代码示例

51自学网 2021-06-01 21:06:04
  C++
这篇教程C++ GetCurrentPos函数代码示例写得很实用,希望能帮到您。

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

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

示例1: BraceMatch

/* TextEditor::checkBraceMatch * Checks for a brace match at the current cursor position *******************************************************************/void TextEditor::checkBraceMatch(){#ifdef __WXMAC__	bool refresh = false;#else	bool refresh = true;#endif	// Check for brace match at current position	int bracematch = BraceMatch(GetCurrentPos());	if (bracematch != wxSTC_INVALID_POSITION)	{		BraceHighlight(GetCurrentPos(), bracematch);		if (refresh) Refresh();		return;	}	// No match, check for match at previous position	bracematch = BraceMatch(GetCurrentPos() - 1);	if (bracematch != wxSTC_INVALID_POSITION)	{		BraceHighlight(GetCurrentPos() - 1, bracematch);		if (refresh) Refresh();		return;	}	// No match at all, clear any previous brace match	BraceHighlight(-1, -1);	if (refresh) Refresh();}
开发者ID:macressler,项目名称:SLADE,代码行数:33,


示例2: SetFocus

/* TextEditor::showFindReplacePanel * Shows or hides the Find+Replace panel, depending on [show]. If * shown, fills the find text box with the current selection or the * current word at the caret *******************************************************************/void TextEditor::showFindReplacePanel(bool show){	// Do nothing if no F+R panel has been set	if (!panel_fr)		return;	// Hide if needed	if (!show)	{		panel_fr->Hide();		panel_fr->GetParent()->Layout();		SetFocus();		return;	}	// Get currently selected text	string find = GetSelectedText();	// Get the word at the current cursor position if there is no current selection	if (find.IsEmpty())	{		int ws = WordStartPosition(GetCurrentPos(), true);		int we = WordEndPosition(GetCurrentPos(), true);		find = GetTextRange(ws, we);	}	// Show the F+R panel	panel_fr->Show();	panel_fr->GetParent()->Layout();	panel_fr->setFindText(find);}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:36,


示例3: CalculatePos

void ContainerStacker::DriveToPoint() {	SmartDashboard::PutNumber("TargetPosition", m_targetHeight);	int position = CalculatePos();	double error = position - GetCurrentPos();	SmartDashboard::PutNumber("error, can", error);	SmartDashboard::PutNumber("current, can", GetCurrentPos());	SmartDashboard::PutNumber("point, can", position);	CheckSensors();	if(error > 50){		if(error > 1000) {			containerLift->Set(-1);		}		else {			containerLift->Set(-error/1000);		}	}	else if(error < -50) {		if(error < -1000) {			containerLift->Set(1);		}		else {			containerLift->Set(-error/1000);		}	}	else {		containerLift->Set(0);	}}
开发者ID:CRRobotics,项目名称:Robots,代码行数:32,


示例4: GetCurrentPos

void ContainerStacker::DriveToPoint(int point) {	double error = point - GetCurrentPos();	SmartDashboard::PutNumber("error1, can", error);	SmartDashboard::PutNumber("current1, can", GetCurrentPos());	SmartDashboard::PutNumber("point1, can", point);	CheckSensors();	if(error > 50){		if(error > 1000) {			containerLift->Set(-1);		}		else {			containerLift->Set(-error/1000);		}	}	else if(error < -50) {		if(error < -1000) {			containerLift->Set(1);		}		else {			containerLift->Set(-error/1000);		}	}	else {		containerLift->Set(0);	}}
开发者ID:CRRobotics,项目名称:Robots,代码行数:26,


示例5: S_FMT

/* TextEditor::onCharAdded * Called when a character is added to the text *******************************************************************/void TextEditor::onCharAdded(wxStyledTextEvent& e){	// Update line numbers margin width	string numlines = S_FMT("0%d", GetNumberOfLines());	SetMarginWidth(0, TextWidth(wxSTC_STYLE_LINENUMBER, numlines));	// Auto indent	int currentLine = GetCurrentLine();	if (txed_auto_indent && e.GetKey() == '/n')	{		// Get indentation amount		int lineInd = 0;		if (currentLine > 0)			lineInd = GetLineIndentation(currentLine - 1);		// Do auto-indent if needed		if (lineInd != 0)		{			SetLineIndentation(currentLine, lineInd);			// Skip to end of tabs			while (1)			{				int chr = GetCharAt(GetCurrentPos());				if (chr == '/t' || chr == ' ')					GotoPos(GetCurrentPos()+1);				else					break;			}		}	}	// The following require a language to work	if (language)	{		// Call tip		if (e.GetKey() == '(' && txed_calltips_parenthesis)		{			openCalltip(GetCurrentPos());		}		// End call tip		if (e.GetKey() == ')')		{			CallTipCancel();		}		// Comma, possibly update calltip		if (e.GetKey() == ',' && txed_calltips_parenthesis)		{			//openCalltip(GetCurrentPos());			//if (CallTipActive())			updateCalltip();		}	}	// Continue	e.Skip();}
开发者ID:macressler,项目名称:SLADE,代码行数:62,


示例6: switch

void cbStyledTextCtrl::OnKeyDown(wxKeyEvent& event){    switch (event.GetKeyCode())    {        case WXK_TAB:        {            if (m_tabSmartJump && !(event.ControlDown() || event.ShiftDown() || event.AltDown()))            {                if (!AutoCompActive() && m_bracePosition != wxSCI_INVALID_POSITION)                {                    m_lastPosition = GetCurrentPos();                    GotoPos(m_bracePosition);                    // Need judge if it's the final brace                    HighlightRightBrace();                    if (!m_tabSmartJump && CallTipActive())                        CallTipCancel();                    return;                }            }        }        break;        case WXK_BACK:        {            if (m_tabSmartJump)            {                if (!(event.ControlDown() || event.ShiftDown() || event.AltDown()))                {                    const int pos = GetCurrentPos();                    const int index = s_leftBrace.Find((wxChar)GetCharAt(pos - 1));                    if (index != wxNOT_FOUND && (wxChar)GetCharAt(pos) == s_rightBrace.GetChar(index))                    {                        CharRight();                        DeleteBack();                    }                }                else if (m_lastPosition != wxSCI_INVALID_POSITION && event.ControlDown())                {                    GotoPos(m_lastPosition);                    m_lastPosition = wxSCI_INVALID_POSITION;                    return;                }            }        }        break;        case WXK_RETURN:        case WXK_ESCAPE:        {            if (m_tabSmartJump)                m_tabSmartJump = false;        }        break;    }    event.Skip();}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:58,


示例7: checkBraceMatch

/* TextEditor::onUpdateUI * Called when anything is modified in the text editor (cursor * position, styling, text, etc) *******************************************************************/void TextEditor::onUpdateUI(wxStyledTextEvent& e){	// Check for brace match	if (txed_brace_match)		checkBraceMatch();	// If a calltip is open, update it	if (call_tip->IsShown())		updateCalltip();	// Do word matching if appropriate	if (txed_match_cursor_word && language)	{		int word_start = WordStartPosition(GetCurrentPos(), true);		int word_end = WordEndPosition(GetCurrentPos(), true);		string current_word = GetTextRange(word_start, word_end);		if (!current_word.IsEmpty() && HasFocus())		{			if (current_word != prev_word_match)			{				prev_word_match = current_word;				SetIndicatorCurrent(8);				IndicatorClearRange(0, GetTextLength());				SetTargetStart(0);				SetTargetEnd(GetTextLength());				SetSearchFlags(0);				while (SearchInTarget(current_word) != -1)				{					IndicatorFillRange(GetTargetStart(), GetTargetEnd() - GetTargetStart());					SetTargetStart(GetTargetEnd());					SetTargetEnd(GetTextLength());				}			}		}		else		{			SetIndicatorCurrent(8);			IndicatorClearRange(0, GetTextLength());			prev_word_match = "";		}	}	// Hilight current line	MarkerDeleteAll(1);	MarkerDeleteAll(2);	if (txed_hilight_current_line > 0 && HasFocus())	{		int line = LineFromPosition(GetCurrentPos());		MarkerAdd(line, 1);		if (txed_hilight_current_line > 1)			MarkerAdd(line, 2);	}	e.Skip();}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:60,


示例8: GetCurrentLine

void CodeEditor::OnCharAdded(wxScintillaEvent &event){	char ch = event.GetKey();	int currentLine = GetCurrentLine();	int pos = GetCurrentPos();	if (ch == wxT('/n') && currentLine > 0)	{		BeginUndoAction();		wxString indent = GetLineIndentString(currentLine - 1);		wxChar b = GetLastNonWhitespaceChar();		if(b == wxT('{'))		{			if(GetUseTabs())				indent << wxT("/t");			else				indent << wxT("    ");		}		InsertText(pos, indent);		GotoPos((int)(pos + indent.Length()));		ChooseCaretX();		EndUndoAction();	}	else if(ch == wxT('}'))	{		BeginUndoAction();		wxString line = GetLine(currentLine);		line.Trim(false);		line.Trim(true);		if(line.Matches(wxT("}")))		{			pos = GetCurrentPos() - 2;			pos = FindBlockStart(pos, wxT('{'), wxT('}'));			if(pos != -1)			{				wxString indent = GetLineIndentString(LineFromPosition(pos));				indent << wxT('}');				DelLineLeft();				DelLineRight();				pos = GetCurrentPos();				InsertText(pos, indent);				GotoPos((int)(pos + indent.Length()));				ChooseCaretX();			}		}		EndUndoAction();	}}
开发者ID:bill9889,项目名称:OGRE,代码行数:55,


示例9: GetCurrentPos

CString ScintillaEditor::GetWord(){	int savePos = GetCurrentPos();	SendEditor(SCI_WORDLEFT);	DWORD startPos = GetCurrentPos();	SendEditor(SCI_WORDRIGHTEXTEND);	DWORD endPos = GetCurrentPos();	CStringA str;	LPSTR buf = str.GetBufferSetLength(endPos - startPos);	GetSelText(buf);	str.ReleaseBuffer(endPos - startPos);	SendEditor(SCI_SETCURRENTPOS, savePos);	return CString(str);}
开发者ID:WeyrSDev,项目名称:gamecode3,代码行数:15,


示例10: GetCurrentLine

void MaterialScriptEditor::OnCharAdded(wxScintillaEvent &event){    ScintillaEditor::OnCharAdded(event);    char ch = event.GetKey();    if(getCallTipManager().isTrigger(ch))    {        int lineNum = GetCurrentLine();        if(lineNum != -1)        {            wxString line = GetLine(lineNum);            int pos = GetCurrentPos() - 1;            wxString word("");            wxChar ch;            while(pos)            {                ch = GetCharAt(--pos);                if(ch != ' ' && ch != '/n' && ch != '/r' && ch != '/t' && ch != '{' && ch != '}') word.Prepend(ch);                else break;            }            wxString* tips = getCallTipManager().find(word);            if(tips != NULL)            {                CallTipShow(pos, *tips);            }        }    }}
开发者ID:gorkinovich,项目名称:DefendersOfMankind,代码行数:30,


示例11: GetCurrentPos

wxChar CodeEditor::GetLastNonWhitespaceChar(int position /* = -1 */){	if (position == -1)		position = GetCurrentPos();	int count = 0; // Used to count the number of blank lines	bool foundlf = false; // For the rare case of CR's without LF's	while (position)	{		wxChar c = GetCharAt(--position);		int style = GetStyleAt(position);		bool inComment = style == wxSCI_C_COMMENT ||			style == wxSCI_C_COMMENTDOC ||			style == wxSCI_C_COMMENTDOCKEYWORD ||			style == wxSCI_C_COMMENTDOCKEYWORDERROR ||			style == wxSCI_C_COMMENTLINE ||			style == wxSCI_C_COMMENTLINEDOC;		if (c == wxT('/n'))		{			count++;			foundlf = true;		}		else if (c == wxT('/r') && !foundlf)			count++;		else			foundlf = false;		if (count > 1) return 0; // Don't over-indent		if (!inComment && c != wxT(' ') && c != wxT('/t') && c != wxT('/n') && c != wxT('/r'))			return c;	}	return 0;}
开发者ID:bill9889,项目名称:OGRE,代码行数:33,


示例12: s_DefEndPos

void DlgEditMusic::s_DefEndPos() {    if (StopMaj) return;    MusicObject->EndPos=GetCurrentPos();    if (MusicObject->EndPos>=MusicObject->GetRealDuration()) MusicObject->EndPos=MusicObject->GetRealDuration().addMSecs(-1);    ui->CustomRuler->EndPos=QTime(0,0,0,0).msecsTo(MusicObject->EndPos);    RefreshControls();}
开发者ID:JonasCz,项目名称:ffdiaporama-1604-builds,代码行数:7,


示例13: FindDialog

bool SearchableEditor::find(bool newSearch){    if (!fd)        fd = new FindDialog(this, ::wxGetTopLevelParent(this));    if (newSearch || findTextM.empty())    {        if (newSearch)        {            // find selected text            wxString findText(GetSelectedText());            // failing that initialize with the word at the caret            if (findText.empty())            {                int pos = GetCurrentPos();                int start = WordStartPosition(pos, true);                int end = WordEndPosition(pos, true);                if (end > start)                    findText = GetTextRange(start, end);            }            fd->SetFindText(findText);        }        // do not re-center dialog if it is already visible        if (!fd->IsShown())            fd->Show();        fd->SetFocus();        return false;    // <- caller shouldn't care about this    }    int start = GetSelectionEnd();    if (findFlagsM.has(se::FROM_TOP))    {        start = 0;        findFlagsM.remove(se::ALERT);    // remove flag after first find    }    int end = GetTextLength();    int p = FindText(start, end, findTextM, findFlagsM.asStc());    if (p == -1)    {        if (findFlagsM.has(se::WRAP))            p = FindText(0, end, findTextM, findFlagsM.asStc());        if (p == -1)        {            if (findFlagsM.has(se::ALERT))                wxMessageBox(_("No more matches"), _("Search complete"), wxICON_INFORMATION|wxOK);            return false;        }    }    centerCaret(true);    GotoPos(p);    GotoPos(p + findTextM.Length());    SetSelectionStart(p);    SetSelectionEnd(p + findTextM.Length());    centerCaret(false);    return true;}
开发者ID:DragonZX,项目名称:flamerobin,代码行数:57,


示例14: AssignMolType

 /// Override logic for assigning the molecule type /// @note fForceType is ignored if the sequence length is less than the /// value configured in the constructor virtual void AssignMolType(ILineErrorListener * pMessageListener) {     if (GetCurrentPos(eRawPos) < m_SeqLenThreshold) {         _ASSERT( (TestFlag(fAssumeNuc) ^ TestFlag(fAssumeProt) ) );         SetCurrentSeq().SetInst().SetMol(TestFlag(fAssumeNuc)                                           ? CSeq_inst::eMol_na                                           : CSeq_inst::eMol_aa);     } else {         CFastaReader::AssignMolType(pMessageListener);     } }
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:13,


示例15: GetCurrentPos

void Edit::OnBraceMatch (wxCommandEvent &WXUNUSED(event)) {    int min = GetCurrentPos ();    int max = BraceMatch (min);    if (max > (min+1)) {        BraceHighlight (min+1, max);        SetSelection (min+1, max);    }else{        BraceBadLight (min);    }}
开发者ID:jfiguinha,项目名称:Regards,代码行数:10,


示例16: AddLineInfos

void SQFuncState::AddLineInfos(SQInteger line,bool lineop,bool force){	if(_lastline!=line || force){		SQLineInfo li;		li._line=line;li._op=(GetCurrentPos()+1);		if(lineop)AddInstruction(_OP_LINE,0,line);		_lineinfos.push_back(li);		_lastline=line;	}}
开发者ID:IchiroWang,项目名称:OpenTTD,代码行数:10,


示例17: GetCurrentPos

void ctlSQLBox::OnPositionStc(wxStyledTextEvent &event){	int pos = GetCurrentPos();	wxChar ch = GetCharAt(pos - 1);	int st = GetStyleAt(pos - 1);	int match;	// Line numbers	// Ensure we don't recurse through any paint handlers on Mac#ifdef __WXMAC__	Freeze();#endif	UpdateLineNumber();#ifdef __WXMAC__	Thaw();#endif	// Clear all highlighting	BraceBadLight(wxSTC_INVALID_POSITION);	// Check for braces that aren't in comment styles,	// double quoted styles or single quoted styles	if ((ch == '{' || ch == '}' ||	        ch == '[' || ch == ']' ||	        ch == '(' || ch == ')') &&	        st != 2 && st != 6 && st != 7)	{		match = BraceMatch(pos - 1);		if (match != wxSTC_INVALID_POSITION)			BraceHighlight(pos - 1, match);	}	// Roll back through the doc and highlight any unmatched braces	while ((pos--) >= 0)	{		ch = GetCharAt(pos);		st = GetStyleAt(pos);		if ((ch == '{' || ch == '}' ||		        ch == '[' || ch == ']' ||		        ch == '(' || ch == ')') &&		        st != 2 && st != 6 && st != 7)		{			match = BraceMatch(pos);			if (match == wxSTC_INVALID_POSITION)			{				BraceBadLight(pos);				break;			}		}	}	event.Skip();}
开发者ID:Timosha,项目名称:pgadmin3,代码行数:55,


示例18: GetCurrentPos

bool cbStyledTextCtrl::AllowTabSmartJump(){    const int pos = GetCurrentPos();    if (pos == wxSCI_INVALID_POSITION)        return false;    const int style = GetStyleAt(pos);    if (IsString(style) || IsCharacter(style) || IsComment(style) || IsPreprocessor(style))        return !m_tabSmartJump;    return true;}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:11,


示例19: if

void CodeEdit::OnCharAdded(wxStyledTextEvent& event){    // Indent the line to the same indentation as the previous line.    // Adapted from http://STCntilla.sourceforge.net/STCntillaUsage.html    char ch = event.GetKey();    if  (ch == '/r' || ch == '/n')    {        int line        = GetCurrentLine();        int lineLength  = LineLength(line);        if (line > 0 && lineLength <= 2)        {            wxString buffer = GetLine(line - 1);                            for (unsigned int i =  0; i < buffer.Length();  ++i)            {                if (buffer[i] != ' ' && buffer[i] != '/t')                {                    buffer.Truncate(i);                    break;                }            }            ReplaceSelection(buffer);                        // Remember that we just auto-indented so that the backspace            // key will un-autoindent us.            m_autoIndented = true;                    }            }    else if (m_enableAutoComplete && m_autoCompleteManager != NULL)    {        // Handle auto completion.        wxString token;                if (GetTokenFromPosition(GetCurrentPos() - 1, ".:", token))        {            StartAutoCompletion(token);        }    }    event.Skip();}
开发者ID:Halfbrick,项目名称:decoda,代码行数:54,


示例20: PushLocalVariable

SQInteger SQFuncState::PushLocalVariable(const SQObject &name){	SQInteger pos=_vlocals.size();	SQLocalVarInfo lvi;	lvi._name=name;	lvi._start_op=GetCurrentPos()+1;	lvi._pos=_vlocals.size();	_vlocals.push_back(lvi);	if(_vlocals.size()>((SQUnsignedInteger)_stacksize))_stacksize=_vlocals.size();	return pos;}
开发者ID:henryrao,项目名称:kdguigl,代码行数:11,


示例21: OnCopy

void OutputCtrl::OnCopy( wxCommandEvent& event ){   if ( GetCurrentPos() != GetAnchor() )      Copy();   else if ( wxTheClipboard->Open() )    {      wxASSERT( m_Selected != -1 );      wxTheClipboard->SetData( new wxTextDataObject( GetLine( m_Selected ) ) );      wxTheClipboard->Close();   }}
开发者ID:Duion,项目名称:Torsion,代码行数:12,


示例22: while

void SQFuncState::SetStackSize(SQInteger n){	SQInteger size=_vlocals.size();	while(size>n){		size--;		SQLocalVarInfo lvi=_vlocals.back();		if(type(lvi._name)!=OT_NULL){			lvi._end_op=GetCurrentPos();			_localvarinfos.push_back(lvi);		}		_vlocals.pop_back();	}}
开发者ID:IchiroWang,项目名称:OpenTTD,代码行数:13,


示例23: CallTipCancel

void Edit::OnKeyDown (wxKeyEvent &event){    if (CallTipActive())        CallTipCancel();    if (event.GetKeyCode() == WXK_SPACE && event.ControlDown() && event.ShiftDown())    {        int pos = GetCurrentPos();        CallTipSetBackground(*wxYELLOW);        CallTipShow(pos,                    "This is a CallTip with multiple lines./n"                    "It is meant to be a context sensitive popup helper for the user.");        return;    }    event.Skip();}
开发者ID:jfiguinha,项目名称:Regards,代码行数:15,


示例24: SetActualDuration

void wgt_QVideoPlayer::SetActualDuration(int Duration) {    if (ui->CustomRuler!=NULL) {        ui->CustomRuler->setMaximum(Duration-1);        //ui->CustomRuler->repaint();    }    ui->CustomRuler->TotalDuration=Duration;    //ui->CustomRuler->repaint();    int     TimeMSec    =(Duration %1000);    int     TimeSec     =int(Duration/1000);    int     TimeHour    =TimeSec/(60*60);    int     TimeMinute  =(TimeSec%(60*60))/60;    tDuration.setHMS(TimeHour,TimeMinute,TimeSec%60,TimeMSec);    ui->Position->setText(GetCurrentPos().toString(DisplayMSec?"hh:mm:ss.zzz":"hh:mm:ss"));    ui->Duration->setText(tDuration.toString(DisplayMSec?"hh:mm:ss.zzz":"hh:mm:ss"));}
开发者ID:JonasCz,项目名称:ffdiaporama-1604-builds,代码行数:15,


示例25: GotoPos

bool Edit::FindText(int &found_start, int &found_end, bool find_next){  const int flags = m_FindData.GetFlags();  const bool find_down = (flags & wxFR_DOWN) ? true : false;  const wxString find_string = m_FindData.GetFindString();  found_start = found_end = -1;  if (find_next) {    GotoPos(find_down ? GetCurrentPos() : GetCurrentPos() - find_string.size());  }  SearchAnchor();  // search up/down  found_start = find_down ? SearchNext(flags, find_string) : SearchPrev(flags, find_string);  // found  if (found_start > -1) {    found_end = found_start + find_string.size();    GotoPos(found_start);    return true;  }    return false;}
开发者ID:8l,项目名称:objeck-lang,代码行数:24,


示例26: GetSelectionStart

/* TextEditor::findNext * Finds the next occurrence of the [find] after the caret position, * selects it and scrolls to it if needed. Returns false if the * [find] was invalid or no match was found, true otherwise *******************************************************************/bool TextEditor::findNext(string find, int flags){	// Check search string	if (find.IsEmpty())		return false;	// Get current selection	int sel_start = GetSelectionStart();	int sel_end = GetSelectionEnd();	// Search forwards from the end of the current selection	SetSelection(GetCurrentPos(), GetCurrentPos());	SearchAnchor();	int found = SearchNext(flags, find);	if (found < 0)	{		// Not found, loop back to start		SetSelection(0, 0);		SearchAnchor();		found = SearchNext(flags, find);		if (found < 0)		{			// No match found in entire text, reset selection			SetSelection(sel_start, sel_end);			return false;		}	}	// Set caret to the end of the matching text	// (it defaults to the start for some dumb reason)	// and scroll to the selection	SetSelection(found, found + find.length());	EnsureCaretVisible();	return true;}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:41,


示例27: s_SliderMoved

void DlgEditMusic::s_SliderMoved(int Value) {    if (ResetPositionWanted) SetPlayerToPause();    if (InSliderMoveEvent) return;    InSliderMoveEvent=true;    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));    // Update display in controls    ui->CustomRuler->setValue(Value);    ActualPosition=Value;    ui->Position->setText(GetCurrentPos().toString("hh:mm:ss.zzz"));    // Audio    if ((audio_outputStream->state()==QAudio::ActiveState)||(audio_outputStream->state()==QAudio::IdleState)) {        int len=audio_outputStream->bytesFree();        if (len>0) {            Mutex.lock();            while ((AudioBufSize<len)&&(MixedMusic.ListCount()>0)) {                int16_t *Packet=MixedMusic.DetachFirstPacket(true);                if (Packet!=NULL) {                    memcpy(AudioBuf+AudioBufSize,Packet,MixedMusic.SoundPacketSize);                    AudioBufSize+=MixedMusic.SoundPacketSize;                }            }            if ((len)&&(len<=AudioBufSize)) {                int RealLen=audio_outputDevice->write((char *)AudioBuf,len);                if (RealLen<=AudioBufSize) {                    memcpy(AudioBuf,AudioBuf+RealLen,AudioBufSize-RealLen);                    AudioBufSize-=RealLen;                }            }            Mutex.unlock();        }    }    if (PlayerPlayMode && !PlayerPauseMode) {        if (ActualPosition>=QTime(0,0,0,0).msecsTo(MusicObject->GetRealDuration())) {            SetPlayerToPause(); // Stop if it's the end        } else if (FrameList.List.count()>1) {                        // Process            cDiaporamaObjectInfo *Frame=(cDiaporamaObjectInfo *)FrameList.DetachFirstFrame();   // Retrieve frame information            delete Frame;        }    }    QApplication::restoreOverrideCursor();    InSliderMoveEvent=false;}
开发者ID:JonasCz,项目名称:ffdiaporama-1604-builds,代码行数:48,


示例28: while

void SQFuncState::SetStackSize(SQInteger n){	SQInteger size=_vlocals.size();	while(size>n){		size--;		SQLocalVarInfo lvi = _vlocals.back();		if(type(lvi._name)!=OT_NULL){			if(lvi._end_op == UINT_MINUS_ONE) { //this means is an outer				_outers--;			}			lvi._end_op = GetCurrentPos();			_localvarinfos.push_back(lvi);		}		_vlocals.pop_back();	}}
开发者ID:henryrao,项目名称:kdguigl,代码行数:16,


示例29: LineFromPosition

wxString CodeEditor::GetLineIndentString(int line){	int currLine = (line == -1) ? LineFromPosition(GetCurrentPos()) : line;	wxString text = GetLine(currLine);	int length = (int)text.Length();	wxString indent;	for (int i = 0; i < length; ++i)	{		if (text[i] == wxT(' ') || text[i] == wxT('/t'))			indent << text[i];		else			break;	}	return indent;}
开发者ID:bill9889,项目名称:OGRE,代码行数:17,



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


C++ GetCurrentState函数代码示例
C++ GetCurrentPage函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。