本文整理汇总了C++中GetCurrentLine函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCurrentLine函数的具体用法?C++ GetCurrentLine怎么用?C++ GetCurrentLine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetCurrentLine函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SetStatus
void DisassemblyTextCtrl::OnDclick(wxMouseEvent& event)
{
if(GetStatus())
{
SetStatus(0);
PluginsArray plugins = Manager::Get()->GetPluginManager()->GetDebuggerOffers();
if (plugins.GetCount())
{
cbDebuggerPlugin* dbg = (cbDebuggerPlugin*)plugins[0];
if (dbg)
{
// is the debugger running?
if (dbg->IsRunning())
{
dbg->StepByStep();
}
}
}
}
int LineNum = GetCurrentLine();
int L2 = GetCurrentLine();
wxString LineText,SourceFile;
unsigned long SourceLine=0;
while(LineNum > 0)
{
LineText = GetLine(LineNum--);
if(reRelativePath.Matches(LineText))
break;
}
if(LineText.IsEmpty())
return ;
LineText.AfterLast(_T(':')).ToULong(&SourceLine,10);
SourceFile = Manager::Get()->GetProjectManager()->GetActiveProject()->GetBasePath();
SourceFile << LineText.Before(_T(':'));
SyncEditor(LineText.Before(_T(':')),SourceLine,true);
SetReadOnly(false);
MarkerDeleteAll(DEBUG_MARKER);
MarkerAdd(SourceLine,DEBUG_MARKER);
SetReadOnly(true);
//wxMessageBox(wxString::Format(_T("%s:%d"),SourceFile.c_str(),SourceLine));
event.Skip();
}
开发者ID:yjdwbj,项目名称:cb10-05-ide,代码行数:53,代码来源:disassemblytextctrl.cpp
示例2: 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,代码来源:MaterialScriptEditor.cpp
示例3: GetCurrentLine
void Navigator::Navigate()
{
if(navigating)
return;
navigating = true;
int ii = list.GetCursor();
if(theide && ii >= 0 && ii < litem.GetCount()) {
int ln = GetCurrentLine() + 1;
const NavItem& m = *litem[ii];
if(m.kind == KIND_LINE || IsNull(search)) {
theide->GotoPos(Null, m.line);
if(m.kind == KIND_LINE) { // Go to line - restore file view
search.Clear();
Search();
navigating = false;
}
SyncCursor();
}
else {
Vector<NavLine> l = GetNavLines(m);
int q = l.GetCount() - 1;
for(int i = 0; i < l.GetCount(); i++)
if(GetSourceFilePath(l[i].file) == NormalizeSourcePath(theide->editfile) && l[i].line == ln) {
q = (i + l.GetCount() + 1) % l.GetCount();
break;
}
if(q >= 0 && q < l.GetCount()) {
String path = GetSourceFilePath(l[q].file);
if(!theide->GotoDesignerFile(path, m.nest, m.name, l[q].line))
theide->GotoPos(path, l[q].line);
}
}
}
navigating = false;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:35,代码来源:Navigator.cpp
示例4: IMDelete
/*
* IMDelete - handle DEL key pressed in insert mode
*/
vi_rc IMDelete( void )
{
int wlen;
if( CurrentFile == NULL ) {
return( ERR_NO_FILE );
}
startNewLineUndo();
wlen = WorkLine->len + 1;
if( wlen == 0 ) {
wlen = CurrentLine->len + 1;
}
if( EditFlags.Modeless && CurrentPos.column == wlen && CurrentLine->next ) {
/* go to beginning of next line */
GoToLineRelCurs( CurrentPos.line + 1 );
GoToColumnOK( 1 );
GetCurrentLine();
} else {
GoToColumn( CurrentPos.column + 1, wlen );
if( CurrentPos.column != wlen - 1 || abbrevCnt == 0 ) {
abbrevCnt++; /* gets subtracted by IMBackSpace */
}
}
return( IMBackSpace() );
} /* IMDelete */
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:30,代码来源:editins.c
示例5: DeleteBlockFromCurrentLine
/*
* DeleteBlockFromCurrentLine - remove chars from line, leave result in work line
*/
vi_rc DeleteBlockFromCurrentLine( int scol, int ecol, int saveb_flag )
{
int i;
/*
* check if we can do this on the current line
*/
if( scol > ecol ) {
i = scol;
scol = ecol;
ecol = i;
}
if( scol < 0 || ecol >= CurrentLine->len ) {
return( ERR_CANNOT_DELETE_CHAR );
}
if( saveb_flag ) {
AddLineToSavebuf( CurrentLine->data, scol, ecol );
}
/*
* remove chars
*/
GetCurrentLine();
for( i = ecol + 1; i <= CurrentLine->len; i++ ) {
WorkLine->data[scol + (i - (ecol + 1))] = WorkLine->data[i];
}
WorkLine->len -= ecol - scol + 1;
return( ERR_NO_ERR );
} /* DeleteBlockFromCurrentLine */
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:34,代码来源:editdc.c
示例6: OldStyleComment
static void OldStyleComment (void)
/* Remove an old style C comment from line. */
{
/* Remember the current line number, so we can output better error
* messages if the comment is not terminated in the current file.
*/
unsigned StartingLine = GetCurrentLine();
/* Skip the start of comment chars */
NextChar ();
NextChar ();
/* Skip the comment */
while (CurC != '*' || NextC != '/') {
if (CurC == '\0') {
if (NextLine () == 0) {
PPError ("End-of-file reached in comment starting at line %u",
StartingLine);
return;
}
} else {
if (CurC == '/' && NextC == '*') {
PPWarning ("`/*' found inside a comment");
}
NextChar ();
}
}
/* Skip the end of comment chars */
NextChar ();
NextChar ();
}
开发者ID:PanchoManera,项目名称:cc65,代码行数:32,代码来源:preproc.c
示例7: clrtoeol
void
clrtoeol(void)
{
register screenline_t *slp = GetCurrentLine();
register int ln;
standing = NA;
if (cur_col <= slp->sso)
slp->mode &= ~STANDOUT;
/*
if (cur_col == 0) // TODO and contains ANSI
{
// workaround poor ANSI issue
size_t sz = (slp->len > slp->oldlen) ? slp->len : slp->oldlen;
sz = (sz < ANSILINELEN) ? sz : ANSILINELEN;
memset(slp->data, ' ', sz);
slp->len = 0;
return;
}
*/
if (cur_col > slp->oldlen) {
for (ln = slp->len; ln <= cur_col; ln++)
slp->data[ln] = ' ';
}
if (cur_col < slp->oldlen) {
for (ln = slp->len; ln >= cur_col; ln--)
slp->data[ln] = ' ';
}
slp->len = cur_col;
}
开发者ID:OmniBus,项目名称:hkday-pttbbs,代码行数:33,代码来源:screen.c
示例8: OnCharAdded
/// Indent if newline was added.
void OnCharAdded(wxScintillaEvent &event) {
// Change this if support for mac files with \r is needed
if (event.GetKey() == '\n' || event.GetKey() == '\r') {
int currentLine = GetCurrentLine();
if (currentLine <= 0) {
return;
}
// width of one indent character
int indentWidth = (GetUseTabs() ? GetTabWidth() : 1);
if (indentWidth == 0) {
return;
}
// indent as prev line level
int indentSize = GetLineIndentation(currentLine - 1);
SetLineIndentation(currentLine, indentSize);
// position = (line start pos) + (tabs count) + (space count)
GotoPos(PositionFromLine(currentLine)
+ (indentSize / indentWidth)
+ (indentSize % indentWidth));
// notify that the text was changed
ChangeModified(true);
}
}
开发者ID:amyvmiwei,项目名称:lldebug,代码行数:28,代码来源:sourceview.cpp
示例9: Internal
void Internal (const char* Format, ...)
/* Print a message about an internal compiler error and die. */
{
va_list ap;
const char* FileName;
unsigned LineNum;
if (CurTok.LI) {
FileName = GetInputName (CurTok.LI);
LineNum = GetInputLine (CurTok.LI);
} else {
FileName = GetCurrentFile ();
LineNum = GetCurrentLine ();
}
fprintf (stderr, "%s(%u): Internal compiler error:\n",
FileName, LineNum);
va_start (ap, Format);
vfprintf (stderr, Format, ap);
va_end (ap);
fprintf (stderr, "\n");
if (Line) {
fprintf (stderr, "\nInput: %.*s\n", (int) SB_GetLen (Line), SB_GetConstBuf (Line));
}
/* Use abort to create a core dump */
abort ();
}
开发者ID:Aliandrana,项目名称:snesdev,代码行数:30,代码来源:error.c
示例10: Fatal
void Fatal (const char* Format, ...)
/* Print a message about a fatal error and die */
{
va_list ap;
const char* FileName;
unsigned LineNum;
if (CurTok.LI) {
FileName = GetInputName (CurTok.LI);
LineNum = GetInputLine (CurTok.LI);
} else {
FileName = GetCurrentFile ();
LineNum = GetCurrentLine ();
}
fprintf (stderr, "%s(%u): Fatal: ", FileName, LineNum);
va_start (ap, Format);
vfprintf (stderr, Format, ap);
va_end (ap);
fprintf (stderr, "\n");
if (Line) {
Print (stderr, 1, "Input: %.*s\n", (int) SB_GetLen (Line), SB_GetConstBuf (Line));
}
exit (EXIT_FAILURE);
}
开发者ID:Aliandrana,项目名称:snesdev,代码行数:27,代码来源:error.c
示例11: 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,代码来源:TextEditor.cpp
示例12: PPError
void PPError (const char* Format, ...)
/* Print an error message. For use within the preprocessor. */
{
va_list ap;
va_start (ap, Format);
IntError (GetCurrentFile(), GetCurrentLine(), Format, ap);
va_end (ap);
}
开发者ID:Aliandrana,项目名称:snesdev,代码行数:8,代码来源:error.c
示例13: PPWarning
void PPWarning (const char* Format, ...)
/* Print warning message. For use within the preprocessor. */
{
va_list ap;
va_start (ap, Format);
IntWarning (GetCurrentFile(), GetCurrentLine(), Format, ap);
va_end (ap);
}
开发者ID:Aliandrana,项目名称:snesdev,代码行数:8,代码来源:error.c
示例14: GetPromptLine
bool wxSTEditorShell::CaretOnPromptLine(STE_CaretPos_Type option)
{
int prompt_line = GetPromptLine();
bool on_last = GetCurrentLine() >= prompt_line;
//wxPrintf(wxT("Caret on last line total %d current %d onlast %d\n"), total_lines, GetCurrentLine(), (int)on_last);
if (!on_last && (option != STE_CARET_MOVE_NONE))
{
if ((option & STE_CARET_MOVE_LASTLINE) != 0)
GotoLine(prompt_line);
else if ((option & STE_CARET_MOVE_ENDTEXT) != 0)
GotoPos(GetLength());
}
return GetCurrentLine() >= prompt_line;
}
开发者ID:Aetherdyne,项目名称:glintercept,代码行数:17,代码来源:steshell.cpp
示例15: IMBackSpace
/*
* IMBackSpace - process the backspace key in insert mode
*/
vi_rc IMBackSpace( void )
{
char killedChar, overChar;
bool mv_right;
bool stay_at_end;
int i;
if( CurrentFile == NULL ) {
return( ERR_NO_FILE );
}
startNewLineUndo();
if( abbrevCnt > 0 ) {
abbrevCnt--;
}
if( CurrentPos.column == 1 ) {
if( !EditFlags.WrapBackSpace ) {
return( ERR_NO_ERR );
}
if( CurrentPos.line ==1 ) {
return( ERR_NO_ERR );
}
stay_at_end = FALSE;
if( WorkLine->len == 0 ) {
stay_at_end = TRUE;
}
doneWithCurrentLine();
abbrevCnt = 0;
GoToLineRelCurs( CurrentPos.line - 1 );
GoToColumnOnCurrentLine( CurrentLine->len );
mv_right = TRUE;
if( CurrentLine->len == 0 ) {
mv_right = FALSE;
}
GenericJoinCurrentLineToNext( FALSE );
if( mv_right && !stay_at_end ) {
GoToColumnOnCurrentLine( CurrentPos.column + 1 );
}
if( stay_at_end ) {
GoToColumnOK( CurrentLine->len + 1 );
}
CurrentLineReplaceUndoStart();
currLineRepUndo = TRUE;
GetCurrentLine();
return( ERR_NO_ERR );
}
killedChar = WorkLine->data[CurrentPos.column - 2];
overChar = WorkLine->data[CurrentPos.column - 1];
for( i = CurrentPos.column - 1; i <= WorkLine->len + 1; i++ ) {
WorkLine->data[i - 1] = WorkLine->data[i];
}
WorkLine->len--;
GoToColumn( CurrentPos.column - 1, WorkLine->len + 1 );
DisplayWorkLine( SSKillsFlags( killedChar ) || SSKillsFlags( overChar ) );
return( ERR_NO_ERR );
} /* IMBackSpace */
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:61,代码来源:editins.c
示例16: EnterHexKey
/*
* EnterHexKey - enter a hexidecimal key stroke and insert it into the text
*/
vi_rc EnterHexKey( void )
{
int i;
char st[MAX_STR], val;
vi_rc rc;
const char *ptr;
rc = ModificationTest();
if( rc != ERR_NO_ERR ) {
return( rc );
}
if( CurrentLine->len >= EditVars.MaxLine - 1 ) {
return( ERR_LINE_FULL );
}
rc = PromptForString( "Enter the number of char to insert:", st, sizeof( st ) - 1, NULL );
if( rc != ERR_NO_ERR ) {
if( rc == NO_VALUE_ENTERED ) {
return( ERR_NO_ERR );
}
return( rc );
}
/*
* get value
*/
ptr = SkipLeadingSpaces( st );
val = (char)strtol( ptr, NULL, 0 );
if( val == '\0' ) {
return( ERR_INVALID_VALUE );
}
/*
* build undo record
*/
StartUndoGroup( UndoStack );
CurrentLineReplaceUndoStart();
CurrentLineReplaceUndoEnd( true );
EndUndoGroup( UndoStack );
/*
* add the char
*/
GetCurrentLine();
for( i = WorkLine->len; i >= CurrentPos.column - 1; i-- ) {
WorkLine->data[i + 1] = WorkLine->data[i];
}
WorkLine->data[CurrentPos.column - 1] = val;
WorkLine->len++;
DisplayWorkLine( true );
if( CurrentPos.column < WorkLine->len ) {
GoToColumn( CurrentPos.column + 1, WorkLine->len + 1 );
}
ReplaceCurrentLine();
EditFlags.Dotable = true;
return( ERR_NO_ERR );
} /* EnterHexKey */
开发者ID:bhanug,项目名称:open-watcom-v2,代码行数:61,代码来源:misc.c
示例17: CHECK_IS_LLDB_SESSION
void LLDBPlugin::OnJumpToCursor(wxCommandEvent& event)
{
CHECK_IS_LLDB_SESSION();
const auto editor = m_mgr->GetActiveEditor();
if(!editor) { return; }
m_connector.JumpTo(editor->GetFileName(), editor->GetCurrentLine() + 1);
}
开发者ID:eranif,项目名称:codelite,代码行数:9,代码来源:LLDBPlugin.cpp
示例18: startNewLineUndo
/*
* startNewLineUndo - start current line undo stuff
*/
static void startNewLineUndo( void )
{
if( needNewUndoForLine ) {
CurrentLineReplaceUndoStart();
currLineRepUndo = TRUE;
GetCurrentLine();
needNewUndoForLine = FALSE;
}
} /* startNewLineUndo */
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:13,代码来源:editins.c
示例19: 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,代码来源:CodeEditor.cpp
示例20: instr
// readback
int
instr(char *str)
{
register screenline_t *slp = GetCurrentLine();
*str = 0;
if (!slp)
return 0;
slp->data[slp->len] = 0;
strip_ansi(str, (char*)slp->data, STRIP_ALL);
return strlen(str);
}
开发者ID:OmniBus,项目名称:hkday-pttbbs,代码行数:12,代码来源:screen.c
注:本文中的GetCurrentLine函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论