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


C++ UpdateButton函数代码示例

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


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

示例1: switch

void kGUIMovieControlObj::PressPlayPause(kGUIEvent *event)
{
	switch(event->GetEvent())
	{
	case EVENT_PRESSED:
		if(m_movie->GetPlaying()==false)
		{
			if(m_movie->GetDone()==true)
				m_movie->ReStart();
			m_movie->SetPlayAudio(true);
			m_movie->SetPlaying(true);
		}
		else
			m_movie->SetPlaying(false);
		UpdateButton();
	break;
	case EVENT_RIGHTCLICK:	/* show 1 frame */
		if(m_movie->GetPlaying()==false)
		{
			if(m_movie->LoadNextFrame()==false)
				m_movie->ReStart();
		}
		UpdateButton();
	break;
	}
}
开发者ID:CarlHuff,项目名称:kgui,代码行数:26,代码来源:kguimcontrol.cpp

示例2: SP_BT_PolClick

void SP_BT_PolClick() {
//Polarity Swiching

if (Hvpolartiyflag == Positive) // Pos -> Neg
   {

    // Set PWM Voltage to 0
    PWM1_10bit(0);
    PWM2_10bit(0);
    // Wait 1 sec for voltage drop to 0
    delay_ms(1000);
    
    // Turn Neg on,
    HVMRelay = 0; // Power Supply 2 Neg
    delay_ms(100);
    
    HVPSRelay = 1;
    delay_ms(100);
    
    //set to Voltset
    PWM1_10bit(Voltset*5+23);
    

    // Update HVFlag
    Hvpolartiyflag = Negtive;
     // Update Display
    UpdateButton(&SP_BT_Pol,"-");
    

    }
else       //Neg to Pos
    {
    
    // Set PWM Voltage to 0
    PWM1_10bit(0);
    PWM2_10bit(0);
    delay_ms(1000);
    
    HVMRelay = 1; // Pos Supply Off
    
    // Wait 1 sec for voltage drop to 0
    delay_ms(100);
    // Turn Neg on, set to Voltset
    
    HVPSRelay = 0;
    delay_ms(100);
    
    PWM1_10bit(Voltset*5+23);
    PWM2_10bit(Voltset*5+23);

    // Update HVFlag
    Hvpolartiyflag = Positive;
    
     // Update Display
    UpdateButton(&SP_BT_Pol,"+");
    }

}
开发者ID:whuang86cn,项目名称:uC_Dev,代码行数:58,代码来源:ES613_GUI2_SP_events_code.c

示例3: UpdateButton

void CFormatTabDlg::OnSelchange()
{
	UpdateButton(m_buttonClearAll, m_nCount > 0);
	// force these since if the edit control is empty and
	// an item in the box is clicked on, the edit control will
	// not be filled in first
	UpdateButton(m_buttonSet, TRUE);
	UpdateButton(m_buttonClear, TRUE);
	WORD wID = LOWORD(GetDefID());
	if (wID != IDC_BUTTON_SET)
		SetDefID(IDC_BUTTON_SET);
}
开发者ID:jetlive,项目名称:skiaming,代码行数:12,代码来源:formatta.cpp

示例4: _GetButtonPtr

void CFlatToolbar::OnLButtonUp(UINT nFlags, CPoint point)
{
	if (m_iButtonCapture < 0)
	{
		CControlBar::OnLButtonUp(nFlags, point);
		return;     // not captured
	}

	AFX_TBBUTTON* pTBB = _GetButtonPtr(m_iButtonCapture);
	ASSERT(!(pTBB->nStyle & TBBS_SEPARATOR));
	UINT nIDCmd = 0;

	UINT nNewStyle = (pTBB->nStyle & ~TBBS_PRESSED);
	if (GetCapture() == this)
	{
		// we did not lose the capture
		ReleaseCapture();
		if (HitTest(point) == m_iButtonCapture)
		{
			// give button a chance to update
			UpdateButton(m_iButtonCapture);

			// then check for disabled state
			if (!(pTBB->nStyle & TBBS_DISABLED))
			{
				// pressed, will send command notification
				nIDCmd = pTBB->nID;

				if (pTBB->nStyle & TBBS_CHECKBOX)
				{
					// auto check: three state => down
					if (nNewStyle & TBBS_INDETERMINATE)
						nNewStyle &= ~TBBS_INDETERMINATE;

					nNewStyle ^= TBBS_CHECKED;
				}
			}
		}
	}

	GetOwner()->SendMessage(WM_SETMESSAGESTRING, AFX_IDS_IDLEMESSAGE);

	int iButtonCapture = m_iButtonCapture;
	m_iButtonCapture = -1;
	if (nIDCmd != 0)
		GetOwner()->SendMessage(WM_COMMAND, nIDCmd);    // send command

	SetButtonStyle(iButtonCapture, nNewStyle);
	UpdateButton(iButtonCapture);

	UpdateWindow(); // immediate feedback
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:52,代码来源:flattoolbar.cpp

示例5: SLOT

//==============
//    PRIVATE SLOTS
//==============
void LTaskManagerPlugin::UpdateButtons(){
  if(updating){ timer->start(); return; } //check again in a moment
  //Make sure this only runs one at a time
  updating=true;
  //Get the current window list
  QList<WId> winlist = LX11::WindowList();
  //qDebug() << "Update Buttons:" << winlist;
  //Now go through all the current buttons first
  for(int i=0; i<BUTTONS.length(); i++){
    //Get the windows managed in this button
    QList<LWinInfo> WI = BUTTONS[i]->windows();
    bool updated=false;
    for(int w=0; w<WI.length(); w++){
      if( winlist.contains( WI[w].windowID() ) ){
        //Still current window - update it later
	winlist.removeAll(WI[w].windowID()); //remove this window from the list since it is done
      }else{
	//Window was closed - remove it
	if(WI.length()==1){
	  //Remove the entire button
	  this->layout()->takeAt(i); //remove from the layout
	  delete BUTTONS.takeAt(i);
	  i--;
	  updated = true; //prevent updating a removed button
	  break; //break out of the button->window loop
	}else{
	  BUTTONS[i]->rmWindow(WI[w]); // one of the multiple windows for the button
	  WI.removeAt(w); //remove this window from the list
	  w--;
	}
	updated=true; //button already changed
      }
    }
    if(!updated){
      QTimer::singleShot(1,BUTTONS[i], SLOT(UpdateButton()) ); //keep moving on
    }
  }
  //Now go through the remaining windows
  for(int i=0; i<winlist.length(); i++){
    //New windows, create buttons for each (add grouping later)
    //Check for a button that this can just be added to
    QString ctxt = LX11::WindowClass(winlist[i]);
    bool found = false;
    for(int b=0; b<BUTTONS.length(); b++){
      if(BUTTONS[b]->text().section("(",0,0).simplified() == ctxt){
        found = true;
	BUTTONS[b]->addWindow(winlist[i]);
	break;
      }
    }
    if(!found){
      //No group, create a new button
      LTaskButton *but = new LTaskButton(this);
        but->addWindow( LWinInfo(winlist[i]) );
      this->layout()->addWidget(but);
      BUTTONS << but;
    }
  }
  updating=false;
}
开发者ID:TetragrammatonHermit,项目名称:external-projects,代码行数:63,代码来源:LTaskManagerPlugin.cpp

示例6: SS_BT_PMClick

void SS_BT_PMClick() {
//
if (Patternflag == Started)
{
   UpdateButton(&SP_BT_ST,"Stop");
  }
else
   {
   UpdateButton(&SP_BT_ST,"Start");
   }
Countervalue=0;
DrawScreen(&PatternMode);
SP_BT_Active();
sprintf(strtmp,"%6u",ZapNum);
UpdateLabel(&SP_LB_Pulse,strtmp);
}
开发者ID:whuang86cn,项目名称:uC_Dev,代码行数:16,代码来源:ES613_GUI2_SP_events_code.c

示例7: assert

//---------------------------------------------------------------------------
void __fastcall TMessageTimeout::DoTimer(TObject * /*Sender*/)
{
  if (FTimeout <= MSecsPerSec)
  {
    assert(FButton != NULL);
    TForm * Dialog = dynamic_cast<TForm *>(FButton->Parent);
    assert(Dialog != NULL);

    Dialog->ModalResult = FButton->ModalResult;
  }
  else
  {
    unsigned int & Timeout = (FSuspended > 0) ? FSuspended : FTimeout;

    if (Timeout > Interval)
    {
      Timeout -= Interval;
    }
    else
    {
      Timeout = 0;
    }
    UpdateButton();
  }
}
开发者ID:mpmartin8080,项目名称:winscp,代码行数:26,代码来源:WinInterface.cpp

示例8: SM_BT_CTClick

void SM_BT_CTClick() {
// Counter Button Start/Stop

//Change Flag
Counterflag = !Counterflag;

//Update Text in Button GUI
if (Counterflag == Started)
{
   UpdateButton(&SM_BT_CT,"Stop");
}
else
{
   UpdateButton(&SM_BT_CT,"Start");
}
}
开发者ID:whuang86cn,项目名称:uC_Dev,代码行数:16,代码来源:ES613_GUI2_SP_events_code.c

示例9: UpdateAllButtons

void UpdateAllButtons()
{
  int i;
  for(i = 0; i < MAXBUTTONS;i++)
  {
    if(ButtonList[i].inuse)UpdateButton(&ButtonList[i]);
  }
}
开发者ID:FratStar,项目名称:AlienRush,代码行数:8,代码来源:window.c

示例10: UpdateButtonsByLayer

void UpdateButtonsByLayer(int layer)
{
  int i;
  for(i = 0; i < MAXBUTTONS;i++)
  {
    if((ButtonList[i].inuse)&&(ButtonList[i].layer == layer))UpdateButton(&ButtonList[i]);
  }
}
开发者ID:FratStar,项目名称:AlienRush,代码行数:8,代码来源:window.c

示例11: SS_BT_MMClick

void SS_BT_MMClick() {
//
 Countervalue=0;
 UpdateButton(&SM_BT_CT,"Start");
DrawScreen(&ManualMode);
CurrentMode = 0;

}
开发者ID:whuang86cn,项目名称:uC_Dev,代码行数:8,代码来源:ES613_GUI2_SP_events_code.c

示例12: UpdateButton

void LTaskButton::rmWindow(LWinInfo win){
  for(int i=0; i<WINLIST.length(); i++){
    if(WINLIST[i].windowID() == win.windowID()){
      WINLIST.removeAt(i);
      break;
    }
  }
  UpdateButton();
}
开发者ID:xiazhen06,项目名称:lumina,代码行数:9,代码来源:LTaskButton.cpp

示例13: qDebug

void LTaskManagerPlugin::UpdateButton(WId win){
  for(int i=0; i<BUTTONS.length(); i++){
    if(BUTTONS[i]->windows().contains(win)){
      qDebug() << "Update Task Manager Button (single window ping)";
      QTimer::singleShot(0,BUTTONS[i], SLOT(UpdateButton()) );
      break;
    }
  }
}
开发者ID:abishai,项目名称:lumina,代码行数:9,代码来源:LTaskManagerPlugin.cpp

示例14: TTimer

//---------------------------------------------------------------------------
__fastcall TMessageTimeout::TMessageTimeout(TComponent * AOwner,
  unsigned int Timeout, TButton * Button) :
  TTimer(AOwner), FOrigTimeout(Timeout), FTimeout(Timeout), FButton(Button)
{
  OnTimer = DoTimer;
  Interval = MSecsPerSec;
  FOrigCaption = FButton->Caption;
  FSuspended = 0;
  UpdateButton();
}
开发者ID:mpmartin8080,项目名称:winscp,代码行数:11,代码来源:WinInterface.cpp

示例15: ClearStates

void cJoystickSDL::Update() {
	if ( NULL != mJoystick ) {
		ClearStates();

		for ( Int32 i = 0; i < mButtons; i++ ) {
			UpdateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) );
		}

	}
}
开发者ID:dogtwelve,项目名称:eepp,代码行数:10,代码来源:cjoysticksdl.cpp


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