当前位置: 首页>>代码示例>>C++>>正文


C++ Cursor函数代码示例

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


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

示例1: assert

Cursor Transaction::prepare(const AnyString& stmt)
{
    assert(!(!pChannel));

    // the adapter
    ::yn_dbi_adapter& adapter = pChannel->adapter;

    if (YUNI_UNLIKELY(nullHandle == pTxHandle))
    {
        if (errNone != pChannel->begin(pTxHandle))
            return Cursor(adapter, nullptr);
    }

    // query handle
    void* handle = nullptr;

    if (YUNI_LIKELY(not stmt.empty() and adapter.dbh))
    {
        assert(adapter.query_new != NULL  and "invalid adapter query_new");
        assert(adapter.query_ref_acquire != NULL and "invalid adapter query_ref_acquire");
        assert(adapter.query_ref_release != NULL and "invalid adapter query_ref_release");

        adapter.query_new(&handle, adapter.dbh, stmt.c_str(), stmt.size());
    }

    return Cursor(adapter, handle);
}
开发者ID:ollie314,项目名称:libyuni,代码行数:27,代码来源:transaction.cpp

示例2: DisplaySensorValues

inline void DisplaySensorValues()
{
    if(lcdRefreshCount == 0)  // Mitigates screen flicker and time consuming operations
    {
        #ifdef DEBUG_MODE
        // Sensors on top line        
        Cursor(BOTTOM, 0);

        #ifdef USE_SMART_INTERSECTIONS
        Print("Signal: ", intersectionTurnFlag);
        #else
        Print("Intersection: ", intersectionIndex + 1);
        #endif
        
        #else
        Cursor(TOP, 0); Print("                "); Cursor(TOP, 0);
        Print("Time: "); lcd.print(float(lapTime)/10.0); Print("s");
        #endif
    }
    #ifndef DEBUG_MODE
    if(batteryCount == 0)
    {
        Cursor(BOTTOM, 0);
        batteryVoltage = float(analogRead(BATTERY_SENSOR)) / 1024.0 * 5.0;
        Print("Battery: "); lcd.print(batteryVoltage); Print("V");
    }
    #endif
}
开发者ID:johndharvey,项目名称:Robert-roving-robot,代码行数:28,代码来源:Wire+following+PID+control.cpp

示例3: TripCodeDataProc

void TripCodeDataProc()			// EEPROM TRIP ERROR DATA LOAD
{
	BUTTON KeyIn;
	int loopCtrl=1;
	signed int point = 0;
	int change=1;
	LCD_Clear();
	strcpy(st, "TRIP [0]");
	PrintLCD(0,0,st);

	strcpy(st, "          ");
	PrintLCD(0,10,st);

	DisplayChar(1, 0, '1');
	strcpy(st, " TRIP DESCIPTION ");
	PrintLCD(1,2,st);

	DisplayChar(2, 0, '2');
	strcpy(st, " RECORD DATE  ");
	PrintLCD(2,2,st);

	strcpy(st, "VDC=      ");
	PrintLCD(3,0,st);

	strcpy(st, "DATA=     ");
	PrintLCD(3,10,st);

	printTripHystory(0);

	Cursor(0,6,CURSOR_BLINK);				

	while( loopCtrl){

		KeyIn = GetKey();

		if( KeyIn == BTN_SET )	printTripHystory( point );
		else if( KeyIn  == BTN_STOP){
			machine_state = STATE_SET_MODE;
			loopCtrl = 0;
			return ;
		}
		else if( KeyIn == BTN_DOWN)	point --;
		else if( KeyIn == BTN_UP)	point++;
		else 						change = 0;

		if		(point > 9) point = 0;
		else if	(point < 0 ) point = 9;

		if(change){
			DisplayChar(0,6,point+'0');
			Cursor(0,6,CURSOR_BLINK);				
		}
		else change = 1;
	}
}
开发者ID:eunwho,项目名称:lcdConverter,代码行数:55,代码来源:KeyProc.C

示例4: ShowMenu

// Display the menu on screen
void ShowMenu()
{
    // Show menu item on top row
    Clear();
    Cursor(TOP, 0);
    Print(parameters[menuIndex]->Name);
    Print(" ", parameters[menuIndex]->Value);

    // Show sensor info on bottom row. Useful for threshold calibration
    Cursor(BOTTOM, 0);
    Print(" ", analogRead(LEFT_SENSOR));
    Print(" ", analogRead(RIGHT_SENSOR));
    Print(" ", analogRead(CENTER_SENSOR));
    Print(" ");
    lcd.print(float(lapTime)/10.0); Print("s");

    switch(ReadButton())
    {
        case UP:    // Increase item value
        holdCounter = (previousButton == UP) ? (holdCounter + 1) : 0;
        previousButton = UP;
        parameters[menuIndex]->Value += 1 + (holdCounter / 20);
        break;
        case DOWN:  // Lower item value
        holdCounter = (previousButton == DOWN) ? (holdCounter + 1) : 0;
        previousButton = DOWN;
        parameters[menuIndex]->Value -= (1 + (holdCounter / 20));
        break;
        case LEFT:  // Next menu item
        menuIndex = (menuIndex > 0) ? (menuIndex - 1) : (PARAMETER_COUNT - 1);
        break;
        case RIGHT: // Previous menu item
        menuIndex = (menuIndex < PARAMETER_COUNT - 1) ? (menuIndex + 1) : 0;
        break;
        case SELECT:// Exit menu
        delay(500);
        if (ReadButton() == SELECT)
        {
            Clear();
            Cursor(TOP, 0);
            Print("Exiting menu");
            SaveToEEPROM(); // Save values to EEPROM before exiting
            delay(750);
            currentState = moveStraight;
            intersectionTurnFlag = 0;
            lapTime = 0;
            batteryCount = 1;
            Clear();
            return;
        }
        break;
    }
    delay(150); 
}
开发者ID:johndharvey,项目名称:Robert-roving-robot,代码行数:55,代码来源:Wire+following+PID+control.cpp

示例5: cx_cursor

Cursor Cursor::get_definition() const
{
	CXCursor cx_cursor(clang_getCursorDefinition(m_cx_cursor));
	if ( is_null(cx_cursor) ) {
		if ( is_null(m_cx_cursor) ) {
			CLANGXX_THROW_LogicError("Error retrieving a cursor that points to the definition of that entity.");
		}
		return Cursor();
	}

	return Cursor(std::move(cx_cursor), m_translation_unit);
}
开发者ID:pegacorn,项目名称:libclang-cpp,代码行数:12,代码来源:Cursor.cpp

示例6: Cursor

bool Myazo::InitWindowClass(void)
{
	Handle Cursor(LoadCursor(Instance,MAKEINTRESOURCE(IDC_CURSOR1)),[](void* Obj){if(Obj) DestroyCursor((HCURSOR)Obj);}),
		Icon(LoadImage(Instance,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,32,32,0),[](void* Obj){if(Obj) DeleteObject(Obj);}),
		IconSmall(LoadImage(Instance,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,16,16,0),[](void* Obj){if(Obj) DeleteObject(Obj);});
	WNDCLASSEX WndClass;
	ZeroMemory(&WndClass,sizeof(WndClass));
	WndClass.cbSize=sizeof(WndClass);
	WndClass.lpfnWndProc=WndProc;
	WndClass.hInstance=GetModuleHandle(nullptr);
	WndClass.hIcon=(HICON)Icon.get();
	WndClass.hIconSm=(HICON)IconSmall.get();
	WndClass.hCursor=(HCURSOR)Cursor.get();
	WndClass.lpszClassName=L"MyazoMainWindow";	
	MainWindow=DialogWindow(WndClass);
	if(!MainWindow.Register()) return false;
	WndClass.style=CS_VREDRAW|CS_HREDRAW;
	WndClass.hbrBackground=CreateSolidBrush(RGB(100,100,100));
	WndClass.lpfnWndProc=LayerWndProc;
	WndClass.lpszClassName=L"MyazoLayerWindow";
	LayerWindow=DialogWindow(WndClass);
	if(!LayerWindow.Register()) return false;
	WndClass.hbrBackground=(HBRUSH)COLOR_WINDOW;
	WndClass.lpfnWndProc=AuthWndProc;
	WndClass.hCursor=LoadCursor(nullptr,IDC_ARROW);
	WndClass.lpszClassName=L"MyazoAuthWindow";
	AuthWindow=DialogWindow(WndClass);
	if(!AuthWindow.Register()) return false;
	return true;
}
开发者ID:Mamesoft,项目名称:Myazo_Win,代码行数:30,代码来源:MyazoInit.cpp

示例7: MouseMoved

void PSplitter::MouseMoved(BPoint where, uint32 code, const BMessage *a_message)
{
	if (a_message == NULL && Bounds().Contains(where))
		be_app->SetCursor(Cursor());
	else
		be_app->SetCursor(B_HAND_CURSOR);
} /* PSplitter::MouseMoved */
开发者ID:HaikuArchives,项目名称:Pe,代码行数:7,代码来源:PSplitter.cpp

示例8: bson

Cursor CollectionView::get(Flags::Query flags) const
{
   bson_t q;
   bson_t f;

   BSON::BSONC bson("$query", _query);

   if (_sort) {
      bson.append("$orderby", _sort);
   }

   Utils::to_bson_t(bson, &q);

   if (_fields) {
      Utils::to_bson_t(_fields, &f);
   }

   mongoc_cursor_t *cursor = mongoc_collection_find(
      _collection->collection.get(),
      (mongoc_query_flags_t) flags,
      _skip,
      _limit,
      0,
      &q,
      (_fields ? &f : nullptr),
      nullptr
   );

   return Cursor(std::unique_ptr<CursorImpl>(new CursorImpl(_collection->client, cursor)));
}
开发者ID:hanumantmk,项目名称:libbsoncpp,代码行数:30,代码来源:collection_view.cpp

示例9:

	Input::Input()
	{
		if (GetEnginePlatform() == Platform::Windows)
		{
			mCursors.Add(Cursor());
			mCursors.Last().isPressed = false;
		}
	}
开发者ID:zenkovich,项目名称:o2,代码行数:8,代码来源:Input.cpp

示例10: message

void
RemoteHWInterface::SetCursor(ServerCursor* cursor)
{
	HWInterface::SetCursor(cursor);
	RemoteMessage message(NULL, fSendBuffer);
	message.Start(RP_SET_CURSOR);
	message.AddCursor(Cursor().Get());
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:8,代码来源:RemoteHWInterface.cpp

示例11: cursor

void FastCGITransport::onHeader(std::unique_ptr<folly::IOBuf> key_chain,
                                std::unique_ptr<folly::IOBuf> value_chain) {
  Cursor cursor(key_chain.get());
  std::string key = cursor.readFixedString(key_chain->computeChainDataLength());
  cursor = Cursor(value_chain.get());
  std::string value = cursor.readFixedString(
                               value_chain->computeChainDataLength());
  handleHeader(key, value);
}
开发者ID:Jumbal,项目名称:hhvm,代码行数:9,代码来源:fastcgi-transport.cpp

示例12: newRange

void KeywordItem::execute(Document* document, const Range& word)
{
    if ( m_flags & ForceLineBeginning ) {
        Range newRange(Cursor(word.start().line(), 0), word.end());
        document->replaceText(newRange, m_keyword);
    }
    else {
        document->replaceText(word, m_keyword);
    }
}
开发者ID:kensington,项目名称:kdevelop-python,代码行数:10,代码来源:keyword.cpp

示例13: switch

 // ESC K is sent on a ESC Z
 const char* VT52::putChar(char c) {
  c & 0x7F;
  switch(_state) {
  case State::Normal:
      if(c != ESC) return BasicTerminal::putChar(c);
       _state = State::InEscape;// escape code
       break;
  case State::InEscape:
      switch(c) {
         case 'A': if(_cursor.y() > 0) _cursor.moveUp(); break; // Cursor up
         case 'B': if(_cursor.y() <= (_height-1)) _cursor.moveDown(); break; // Cursor up
         case 'C': if(_cursor.x() <= (_width-1)) _cursor.moveRight(); break; // Cursor up
         case 'D': if(_cursor.x() > 0 ) _cursor.moveLeft(); break; // Cursor up
         case 'F': _graphicsMode = true; break; // enter graphics mode, not supported yet
         case 'G': _graphicsMode = false; break;// exit graphics mode
         case 'H': _cursor = Cursor(); break; // set home
         case 'L':  reverseLineFeed(); break; // reverse line feed, not sure if this is right?
         case 'J': clearScreen(_cursor.y(),_cursor.x()); break;
         case 'K': clearLine(_cursor.y(),_cursor.x());  break;
         case 'Y':
             _state = State::NeedY;
          return nullptr;
         case 'Z': // Ident
             _state = State::Normal; // have to change the state here since we return here
             return "\033K"; // return for VT52 without copier or printer
      case 0133: _holdScreen = true; break;// hold screen mode on, not supported right yet
      case 0134: _holdScreen = false; break;// hold screen mode off, not supported right yet
      case 075: _altKeypad = true; break; // alternate keypad mode on '='
      case 076: _altKeypad = false; break;// alternate keypad mode off '>'
      }
      _state = State::Normal;
      break;
  case State::NeedY:
      _posBuffer = c;
      _state = State::NeedX;
      break;
  case State::NeedX:
      setCursor(Cursor(c - 040,_posBuffer-040));
      _state = State::Normal;
      break;
  }
  return nullptr;
 }
开发者ID:WarlockD,项目名称:QtPDP8,代码行数:44,代码来源:termina_vt52.cpp

示例14: OnCursorPressedMsgApply

	void Input::OnCursorPressedMsgApply(const Vec2F& pos, CursorId id /*= 0*/)
	{
		if (id == 0 && o2Config.GetPlatform() == Platform::Windows)
		{
			mCursors[0].position = pos;
			mCursors[0].isPressed = true;
			mCursors[0].pressedTime = 0.0f;
		}
		else mCursors.Add(Cursor(pos, id));
	}
开发者ID:zenkovich,项目名称:o2,代码行数:10,代码来源:Input.cpp

示例15: SelectMenuPage1

void SelectMenuPage1()			// System 설정 메뉴
{
	BUTTON KeyIn;

	int loopCtrl =1;
	int selection = 1;

	LCD_Clear();
	strcpy(st, " - MAIN MENU -   1/2");
	PrintLCD(0,0,st);

	DisplayChar(1, 0, '1');
	strcpy(st, " EDIT CTRL DATA   ");
	PrintLCD(1,2,st);

	DisplayChar(2, 0, '2');
	strcpy(st, " TRIP RECORD VIEW  ");
	PrintLCD(2,2,st);

	DisplayChar(3, 0, '3');
	strcpy(st, " SYSTEM RESET     ");
	PrintLCD(3,2,st);


	while( loopCtrl )
	{
		KeyIn = GetKey();
	
		Cursor(selection,0,CURSOR_BLINK);
		if( KeyIn == BTN_DOWN ){
			if(selection >= 3 ){
				machine_state = STATE_SET_MODE2;
				return;
			}
			else selection ++;
		}
		else if( KeyIn == BTN_UP ){
			if(selection > 1 ) selection --;
		}
		else if (( KeyIn == BTN_RIGHT)|| (KeyIn == BTN_ESC)){ 
			machine_state = STATE_SET_MODE2;
			return;
		} 
		else if ( KeyIn == BTN_STOP){
			machine_state = STATE_MONITOR_MODE;
			return;
		}
		else if( KeyIn == BTN_SET){
			if(		 selection == 1) 	Machine_state = STATE_EDIT_MODE;
			else if( selection == 2)	machine_state = STATE_TRIP_MODE;
			else						machine_state = STATE_RESET_MODE;
			return;
		}	
	}
}
开发者ID:eunwho,项目名称:lcdConverter,代码行数:55,代码来源:KeyProc.C


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