void drawChar(char c, int x, int y){ if(c == '\x7f'){ int x0,y0; delChar(x,y); } else DrawChar(c,x,y); }
/** * Function name ImportDirective::ImportDirective * Description constructor for class ImportDirective * @param const string& filename * @param StringPosRange range * @param const string& type * @return - * @exception - * @see - */ ImportDirective::ImportDirective(const string& fileName, StringPosRange range, const string& type) : m_range(range), m_type(type) { string csid = "#import"; string strHelp; strHelp.append(fileName); TCHAR * pch = const_cast<char*>(strHelp.c_str()); _tcslwr(pch); string strFN1; if(strHelp.find(csid) != -1) { m_fileName = fileName.substr(csid.length(), fileName.length() - csid.length()); } else { m_fileName = fileName; } delChar(' '); delChar('\"'); strFN1 = m_fileName; string strEndMark = "\""; int iPos = strFN1.find(strEndMark); if (iPos > 0) { m_fileName = strFN1.substr(0, iPos); } else { m_fileName = strFN1; } delChar(' '); delChar('\"'); }
void CharTableView::keyPressEvent(QKeyEvent *k) { switch (k->key()) { case Qt::Key_Backspace: case Qt::Key_Delete: emit delChar(); break; case Qt::Key_Insert: // safely emit selectChar(model()->characters()[currentCharactersIndex()]); viewDoubleClicked(QModelIndex()); break; } QTableView::keyPressEvent(k); }
int main(int argc, char* argv[]) { char str[] = "abcdefgh"; // 注意,此处不能写成char *str = "abcdefgh"; printf("%s\n", str); delChar(str, 'c'); printf("%s\n", str); }