本文整理汇总了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;
}
}
示例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,"+");
}
}
示例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);
}
示例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
}
示例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;
}
示例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);
}
示例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();
}
}
示例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");
}
}
示例9: UpdateAllButtons
void UpdateAllButtons()
{
int i;
for(i = 0; i < MAXBUTTONS;i++)
{
if(ButtonList[i].inuse)UpdateButton(&ButtonList[i]);
}
}
示例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]);
}
}
示例11: SS_BT_MMClick
void SS_BT_MMClick() {
//
Countervalue=0;
UpdateButton(&SM_BT_CT,"Start");
DrawScreen(&ManualMode);
CurrentMode = 0;
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例15: ClearStates
void cJoystickSDL::Update() {
if ( NULL != mJoystick ) {
ClearStates();
for ( Int32 i = 0; i < mButtons; i++ ) {
UpdateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) );
}
}
}