示例#1
0
/* 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 );
}
示例#2
0
/*
 * 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();
}
示例#4
0
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);
    }
}
示例#5
0
文件: ListView.cpp 项目: RAZVOR/haiku
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;
}
示例#6
0
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);
}
示例#7
0
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);
    }

}
示例#8
0
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;
}
示例#9
0
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();
}
示例#10
0
/*
 * 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);
    }

}
示例#11
0
/* 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 );	
            }  
        }  
    }
}
示例#12
0
void LowGrav::StopShooting()
{
  if (active) {
    Deselect();
  } else {
    Weapon::StopShooting();
  }
}
示例#13
0
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();
	}
}
示例#14
0
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;
}
示例#16
0
void SDC::SetObjects(HDC gc, HBITMAP bmp) {
	Deselect();

	m_gc = gc;
	m_mswbmp = bmp;

	SelectObject(m_gc, GetStockObject(NULL_BRUSH));

	Select();
}
示例#17
0
void PlaybackTab<PlaybackTraits>::RemovePlayback( const int index )
{
	if ( index == -1 )
		return;

	if ( index == m_replay_listctrl->GetSelectedIndex() )
		Deselect();

	m_replay_listctrl->RemovePlayback( index );
}
示例#18
0
void PlaybackTab::OnChar(wxKeyEvent& event)
{
	const int keyCode = event.GetKeyCode();
	if (keyCode == WXK_DELETE) {
		m_replay_dataview->DeletePlayback();
		Deselect();
	} else {
		event.Skip();
	}
}
示例#19
0
void USelection::Select(UObject* InObject, bool bSelect)
{
	if( bSelect )
	{
		Select( InObject );
	}
	else
	{
		Deselect( InObject );
	}
}
示例#20
0
文件: listbox.cpp 项目: hgwells/tive
void wxListBox::Command (wxCommandEvent & event)
{
    if (event.GetExtraLong())
        SetSelection (event.GetInt());
    else
    {
        Deselect (event.GetInt());
        return;
    }
    ProcessCommand (event);
}
示例#21
0
void pawsTree::SetRoot(pawsTreeNode* _root)
{
    if(root != NULL)
    {
        if(selected == root)
            Deselect();
        pawsWidget::DeleteChild(root);
    }
    root = _root;
    AddChild(root);
}
示例#22
0
void STrackNode::ToggleSelect()
{
	if(IsSelected()) 
	{
		Select();
	}
	else 
	{
		Deselect();
	}
}
示例#23
0
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 );
}
示例#24
0
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
}
示例#25
0
/* 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 );
}
示例#26
0
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();
}
示例#27
0
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);
    }
}
示例#28
0
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);
}
示例#29
0
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;
	}
}
示例#30
0
/*
 * 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 );
}