示例#1
0
文件: dna.c 项目: DimondTheCat/xray
static void ctl_enable( void )
{
   int i;

   switch ( atom_type ) {
      case ATYPE_POINT:
         for ( i = 2; i < 10; i++ )
            GHOST_CON( ctl[ i ] );
         break;
      case ATYPE_SPHERE:
         for ( i = 2; i < 10; i++ )
            RENDER_CON( ctl[ i ] );
         break;
      case ATYPE_DODEC:
         for ( i = 2; i < 4; i++ )
            GHOST_CON( ctl[ i ] );
         for ( i = 4; i < 10; i++ )
            RENDER_CON( ctl[ i ] );
         break;
   }

   switch ( bond_type ) {
      case BTYPE_LINE:
         for ( i = 11; i < 14; i++ )
            GHOST_CON( ctl[ i ] );
         break;
      case BTYPE_CYLINDER:
         for ( i = 11; i < 14; i++ )
            RENDER_CON( ctl[ i ] );
         break;
   }
}
示例#2
0
// HandleMatchToggle():
void HandleMatchToggle( LWControl *con, void *data ) {
  int state;
  GET_INT( rint->match_toggle, state );

  if( state == 0 ) {
    GHOST_CON( rint->match_string );
  } else {
    UNGHOST_CON( rint->match_string );
  }
}
示例#3
0
// HandleList():
void HandleList( LWControl *con, void *data ) {
  int index, column, other;
  GET_IVEC( rint->list, index, column, other );

  if( index >= (int)rint->swaps.NumElements() ) {
    index = ((int)rint->swaps.NumElements()) - 1;
    SET_IVEC( rint->list, index, 1, 0 );
  } else {
    if( index != -1 ) {
      int x = CON_MOUSEX( con );
      int y = CON_MOUSEY( con );

      if( x < list_column_widths[0] + 8 )
        rint->swaps[ index ]->SetUse( !rint->swaps[ index ]->GetUse() );
    }
  }

  if( index == -1 ) {
    SET_STR( rint->path, "", 0 );
    SET_FLOAT( rint->weight, 1.0 );
    SET_INT( rint->enable, 1 );

    GHOST_CON( rint->path   );
    GHOST_CON( rint->weight );
    GHOST_CON( rint->enable );
  } else {
    char * string = (char *)rint->swaps[ index ]->GetFullPath();
    if( string == NULL ) {
      SET_STR( rint->path, "", 0 );
    } else {
      SET_STR( rint->path, string, strlen( string ) );
    }

    SET_FLOAT( rint->weight, rint->swaps[ index ]->GetWeight() );
    SET_INT( rint->enable,   rint->swaps[ index ]->GetUse() );

    UNGHOST_CON( rint->path   );
    UNGHOST_CON( rint->weight );
    UNGHOST_CON( rint->enable );
  }
}
示例#4
0
// ShowItemSelectionTab():
bool FreeKeyInterface::ShowItemSelectionTab() {
  UNGHOST_CON( select_item_name       );
  UNGHOST_CON( select_name_mode       );
  UNGHOST_CON( apply_select_item_name );
  UNGHOST_CON( select_toggle          );
  UNGHOST_CON( select_item_mode       );
  UNGHOST_CON( select_info_area );
  UNGHOST_CON( fk_int->select_children_toggle );

  REDRAW_CON( select_item_name );

  // Decide if the And Children toggle should be ghosted
  int sel_opt, sel_mode;
  GET_INT( fk_int->select_item_mode, sel_mode );
  GET_INT( fk_int->select_toggle, sel_opt );

  if( (sel_opt == 2) && (sel_mode > 0) )
    GHOST_CON( fk_int->select_children_toggle );

  return true;
}