/* InitActiveEdit() * ===================================================================== * Initializes the Active Device display to preset initial values. * the device to display is in xdevice. */ void InitActiveEdit( void ) { /* Set a global index number for the device editor so that we * know which one is currently being displayed. Note that this is * for the active drivers. */ CurHotDriver = DNAME( xdevice ); NoExit( EDELETE ); Disable( EDELETE ); /* Display the device number in text form. */ sprintf( DeviceText, "%d", DDEV( xdevice ) ); TedText( CURNUM ) = &DeviceText[0]; /* Display the driver name in text form ( includes the .SYS ) */ strcpy( DriverText, drivers[ DNAME( xdevice )] ); TedText( CURNAME ) = &DriverText[0]; /* Set the ROM/RES flags */ Deselect( CURROM ); Deselect( CURRES ); if( DTYPE( xdevice ) == 'P' ) /* ROM driver - SCREEN.SYS */ Select( CURROM ); if( DTYPE( xdevice ) == 'R' ) /* Resident Driver */ Select( CURRES ); }
/* * Set MA speed buttons */ void set_accelbox( OBJECT *tree, int linear ) { Deselect(OFF); Deselect(SLOW); Deselect(FAST); if( linear < 0 ) Select(OFF); else if( linear > 0 ) Select(SLOW); else Select(FAST); }
//----------------------------------------------------------------------------- // Purpose: // Input : exp - //----------------------------------------------------------------------------- void mxExpressionTray::Select( int exp, bool deselect /*=true*/ ) { int oldcell = m_nCurCell; if ( deselect ) { Deselect(); } m_nPrevCell = oldcell; m_nCurCell = exp; if ( m_nCurCell >= 0 ) { CExpClass *active = expressions->GetActiveClass(); if ( active ) { CExpression *exp = active->GetExpression( m_nCurCell ); if ( exp ) { exp->SetSelected( true ); } } } redraw(); }
void set_parkbox( void ) { OBJECT *tree = rs_object; extern int parktime; if( parktime < 0 ) { HideObj(PARKSECT); } else if( parktime > 0 ) { Select(PARK); ObState(PARKUP) = ObState(PARKBOX) = ObState(PARKSLID) = ObState(PARKDOWN) = NORMAL; HideObj(PARKCOVR); } else { Deselect(PARK); ObState(PARKUP) = ObState(PARKDOWN) = ObState(PARKBOX) = ObState(PARKSLID) = ObState(PARKDOWN) = DISABLED; ShowObj(PARKCOVR); } }
BListItem* BListView::RemoveItem(int32 index) { BListItem* item = ItemAt(index); if (item == NULL) return NULL; if (item->IsSelected()) Deselect(index); if (!fList.RemoveItem(item)) return NULL; if (fFirstSelected != -1 && index < fFirstSelected) fFirstSelected--; if (fLastSelected != -1 && index < fLastSelected) fLastSelected--; if (fAnchorIndex != -1 && index < fAnchorIndex) fAnchorIndex--; _RecalcItemTops(index); _InvalidateFrom(index); _FixupScrollBar(); return item; }
void set_accelbox( int linear ) { OBJECT *tree = rs_object; Deselect(ACCOFF); Deselect(ACCSLOW); Deselect(ACCFAST); if( linear < 0 ) Select(ACCOFF); else if( linear > 0 ) Select(ACCSLOW); else Select(ACCFAST); }
void set_screenbox( int enabled ) { OBJECT *tree = rs_object; if( !ma_info->stacy ) HideObj(STACOPTS); else ShowObj(STACOPTS); if( enabled ) { Select(SCREEN); ObFlags(SWITCH) = ObFlags(LITE) = TOUCHEXIT; ObState(SWITCH) = ObState(LITE) = ObState(SAVEUP) = ObState(SAVEBOX) = ObState(SAVESLID) = ObState(SAVEDOWN) = ObState(MODEM) = NORMAL; HideObj(SAVECOVR); } else { Deselect(SCREEN); ObFlags(SWITCH) = ObFlags(LITE) = NONE; ObState(SWITCH) = ObState(LITE) = ObState(SAVEUP) = ObState(SAVEBOX) = ObState(SAVESLID) = ObState(SAVEDOWN) = ObState(MODEM) = DISABLED; ShowObj(SAVECOVR); } }
void UITextEditor::SetFocusable(bool Focusable) { if (Focusable) { if (!m_focusable) m_parent->IncreaseFocusableChildCount(); } else { if (m_focusable) m_parent->DecreaseFocusableChildCount(); if (m_parent && m_parent->GetLastChildWithFocus() == this) m_parent->SetLastChildWithFocus(NULL); if (GetFocusWidget() == this) { Deselect(); // TODO get index from parent AutoSelectFocusWidget(0); } } m_focusable = Focusable; }
MythUITextEdit::MythUITextEdit(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_Message = ""; m_Filter = FilterNone; m_isPassword = false; m_blinkInterval = 0; m_cursorBlinkRate = 40; m_Position = -1; m_maxLength = 255; m_backgroundState = NULL; m_cursorImage = NULL; m_Text = NULL; m_keyboardPosition = VK_POSBELOWEDIT; connect(this, SIGNAL(TakingFocus()), SLOT(Select())); connect(this, SIGNAL(LosingFocus()), SLOT(Deselect())); m_CanHaveFocus = true; m_initialized = false; m_lastKeyPress.start(); }
/* * Set up buttons and covers in screensave box. */ void set_screenbox( OBJECT *tree, int enabled ) { if( !ma_info->stacy ) HideObj(STACBOX); else ShowObj(STACBOX); if( enabled ) { Select(SCRN); ObFlags(STACSCRN) = ObFlags(STACLITE) = TOUCHEXIT; ObState(STACSCRN) = ObState(STACLITE) = ObState(SCRNUP) = ObState(SCRNBACK) = ObState(SCRNTHUM) = ObState(SCRNDN) = ObState(PHONE) = NORMAL; HideObj(SCRNCOVR); } else { Deselect(SCRN); ObFlags(STACSCRN) = ObFlags(STACLITE) = NONE; ObState(STACSCRN) = ObState(STACLITE) = ObState(SCRNUP) = ObState(SCRNBACK) = ObState(SCRNTHUM) = ObState(SCRNDN) = ObState(PHONE) = DISABLED; ShowObj(SCRNCOVR); } }
/* Assign_Slit() *========================================================================== * Assigns the 6 slits visible an FNODE, where possible. * IN: FNODE *ptr: Start assigning with this node * FNODE *array[]: A 5 slit pointer array. */ void Assign_Slit( HDEVICE_PTR ptr, HDEVICE_PTR array[] ) { int i; HDEVICE_PTR curptr; curptr = ptr; for( i = 0; i < MAX_SLITS; i++ ) { array[ i ] = NULL; Deselect( First_Obj + i ); TedText( First_Obj + i ) = fblank; if( curptr ) { if( HNAME( curptr ) != -1 ) { array[i] = curptr; TedText( First_Obj + i ) = cdrivers[ HNAME( curptr )]; if( HFLAG( curptr ) ) Select( First_Obj + i ); curptr = HNEXT( curptr ); } } } }
void LowGrav::StopShooting() { if (active) { Deselect(); } else { Weapon::StopShooting(); } }
void PlaybackTab<PlaybackTraits>::OnSelect( wxListEvent& event ) { wxLogDebugFunc( _T( "" ) ); if ( event.GetIndex() == -1 ) { Deselect(); } else { try { m_watch_btn->Enable( true ); m_delete_btn->Enable( true ); int index = event.GetIndex(); m_replay_listctrl->SetSelectedIndex( index ); //this might seem a bit backwards, but it's currently the only way that doesn't involve casting away constness int m_sel_replay_id = m_replay_listctrl->GetDataFromIndex( index )->id; PlaybackType& rep = playbacklist<ListType>().GetPlaybackById( m_sel_replay_id ); wxLogMessage( _T( "Selected replay %d " ), m_sel_replay_id ); m_players_text->SetLabel( _T( "" ) ); m_map_text->SetLabel( rep.battle.GetHostMapName() ); m_mod_text->SetLabel( rep.battle.GetHostModName() ); m_minimap->SetBattle( &( rep.battle ) ); m_minimap->UpdateMinimap(); m_players->Clear(); m_players->SetBattle( ( IBattle* )&rep.battle ); for ( size_t i = 0; i < rep.battle.GetNumUsers(); ++i ) { try { User& usr = rep.battle.GetUser( i ); m_players->AddUser( usr ); } catch ( ... ) {} } } catch ( ... ) { Deselect(); } event.Skip(); } }
void SingleLineWXMEdit::OnWXMEditKillFocus() { if (!IsSelected()) return; Deselect(); SetRepaintAll(true); Refresh(); }
// NB: CloneNode() assumes that this always succeeds NS_IMETHODIMP nsXFormsRepeatElement::SetParent(nsIXFormsRepeatElement *aParent) { mParent = aParent; // We're an inner repeat owned by a parent, let it control whether we are // selected or not. Deselect(); return NS_OK; }
void SDC::SetObjects(HDC gc, HBITMAP bmp) { Deselect(); m_gc = gc; m_mswbmp = bmp; SelectObject(m_gc, GetStockObject(NULL_BRUSH)); Select(); }
void PlaybackTab<PlaybackTraits>::RemovePlayback( const int index ) { if ( index == -1 ) return; if ( index == m_replay_listctrl->GetSelectedIndex() ) Deselect(); m_replay_listctrl->RemovePlayback( index ); }
void PlaybackTab::OnChar(wxKeyEvent& event) { const int keyCode = event.GetKeyCode(); if (keyCode == WXK_DELETE) { m_replay_dataview->DeletePlayback(); Deselect(); } else { event.Skip(); } }
void USelection::Select(UObject* InObject, bool bSelect) { if( bSelect ) { Select( InObject ); } else { Deselect( InObject ); } }
void wxListBox::Command (wxCommandEvent & event) { if (event.GetExtraLong()) SetSelection (event.GetInt()); else { Deselect (event.GetInt()); return; } ProcessCommand (event); }
void pawsTree::SetRoot(pawsTreeNode* _root) { if(root != NULL) { if(selected == root) Deselect(); pawsWidget::DeleteChild(root); } root = _root; AddChild(root); }
void STrackNode::ToggleSelect() { if(IsSelected()) { Select(); } else { Deselect(); } }
void PlaybackTab<PlaybackTraits>::RemovePlayback( const PlaybackType& replay ) { int index = m_replay_listctrl->GetIndexFromData( &replay ); if ( index == -1 ) return; if ( index == m_replay_listctrl->GetSelectedIndex() ) Deselect(); m_replay_listctrl->RemovePlayback( replay ); }
void Bejeweled::Refill() { int oldscore = score; for(int x = 0;x < xsize;x++) { for(int y = 0;y < ysize;y++) { delete grid[x][y]; grid[x][y] = new Jewel(GetRandomJewel(),x,y+ysize); grid[x][y]->SetPosition(x,y,true); } } Deselect(); Update(); SetScore(oldscore); // do NOT give points for random combos }
/* Dclick_Select() *========================================================================== * Selects one of the 5 mouse double click objects possible */ void Dclick_Select( int obj ) { OBJECT *tree = ( OBJECT *)rs_trindex[ GENERAL ]; Deselect( cur_value.dclick + M0 ); Objc_draw( tree, cur_value.dclick + M0, 0, NULL ); Select( obj ); cur_value.dclick = obj - M0; Objc_draw( tree, obj, 0, NULL ); Set_Dclick(); wait_button( UP ); }
void PlaybackTab::ReloadList() { if (!LSL::usync().IsLoaded()) { wxLogWarning(_("Unitsync library required")); return; } Deselect(); m_replay_dataview->Clear(); if (m_replay_loader == nullptr) { m_replay_loader = new PlaybackLoader(this, true); } m_replay_loader->Run(); }
void wxListBox::ExtendSelection(int itemTo) { // if we don't have the explicit values for selection start/end, make them // up if ( m_selAnchor == -1 ) m_selAnchor = m_current; if ( itemTo == -1 ) itemTo = m_current; // swap the start/end of selection range if necessary int itemFrom = m_selAnchor; if ( itemFrom > itemTo ) { int itemTmp = itemFrom; itemFrom = itemTo; itemTo = itemTmp; } // the selection should now include all items in the range between the // anchor and the specified item and only them int n; for ( n = 0; n < itemFrom; n++ ) { Deselect(n); } for ( ; n <= itemTo; n++ ) { SetSelection(n); } int count = GetCount(); for ( ; n < count; n++ ) { Deselect(n); } }
MythUIButton::MythUIButton(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_clickTimer = new QTimer(); m_clickTimer->setSingleShot(true); m_Pushed = false; m_Lockable = false; m_Text = NULL; m_BackgroundState = NULL; connect(m_clickTimer, SIGNAL(timeout()), SLOT(UnPush())); connect(this, SIGNAL(TakingFocus()), SLOT(Select())); connect(parent, SIGNAL(LosingFocus()), SLOT(Deselect())); connect(this, SIGNAL(LosingFocus()), SLOT(Deselect())); connect(this, SIGNAL(Enabling()), SLOT(Enable())); connect(this, SIGNAL(Disabling()), SLOT(Disable())); SetCanTakeFocus(true); }
void BComboBox::Select(int32 index, bool changeTextSelection) { int32 oldIndex = fSelected; if (index < fChoiceList->CountChoices() && index >= 0) { BWindow *win = Window(); bool gotLock = (win && win->Lock()); if (!win || gotLock) { fSelected = index; if (fPopupWindow && fPopupWindow->Lock()) { ChoiceListView *lv = fPopupWindow->ListView(); lv->InvalidateItem(oldIndex); lv->InvalidateItem(fSelected); lv->ScrollToSelection(); fPopupWindow->Unlock(); } if (changeTextSelection) { // Find last coma const char *ptr = fText->Text(); const char *end; int32 tlength = fText->TextLength(); for (end = ptr+tlength-1; end>ptr; end--) { if (*end == ',') { // Find end of whitespace for (end++; isspace(*end); end++) {} break; } } int32 soffset = end-ptr; int32 eoffset = tlength; if (end != 0) fText->Delete(soffset, eoffset); tlength = strlen(fChoiceList->ChoiceAt(fSelected)); fText->Insert(soffset, fChoiceList->ChoiceAt(fSelected), tlength); eoffset = fText->TextLength(); fText->Select(soffset, eoffset); // fText->SetText(fChoiceList->ChoiceAt(fSelected)); // fText->SelectAll(); } if (gotLock) win->Unlock(); } } else { Deselect(); return; } }
/* * Double clicked on an RGB slider */ void do_rgb( int slider, int base, int index ) { int CurValue; GRECT orect; MRETS mk; ActiveTree( ad_tree ); orect = ObRect( slider ); objc_offset( ad_tree, slider, &orect.g_x, &orect.g_y ); ActiveTree( ad_slide2 ); ObX( CSLIDERS ) = ObX( EXIT2 ) = orect.g_x -= 2; ObY( CSLIDERS ) = ObY( EXIT2 ) = orect.g_y -= 2; ObW( CSLIDERS ) = orect.g_w += 3; ObH( CSLIDERS ) = orect.g_h += 4; myitoa( curscrn[ index ], &PenNum[0] ); TedText( CSLIDERS ) = PenNum; ObjcDraw( ad_slide2, CSLIDERS, 0, NULL ); form_do( ad_slide2, CSLIDERS ); if( strlen( TedText( CSLIDERS ) ) ) { CurValue = atoi( TedText( CSLIDERS ) ); CurValue = min( CurValue, 1000 ); CurValue = max( CurValue, 0 ); curscrn[ index ] = CurValue; } Deselect( CSLIDERS ); Deselect( EXIT2 ); ActiveTree( ad_tree ); adjcol(); update_slid( base, slider, curscrn[index], 0, 1000, 1 ); EvntButton( 1, 1, 0, &mk ); }