コード例 #1
0
// MakeRegisterPanel():
//  Creates the Register Panel
bool SimplifyDongle::MakeRegisterPanel() {
  if( simp_int == NULL )
    return false;

  // Create the Panel
  register_panel = simp_int->panel_funcs->Create( "Simplify Registration" );

  try {
    if( !( dongle_id = STRRO_CTL( simp_int->panel_funcs->orig_struct, register_panel,
                                  "Dongle ID", 43 ) ) )
      throw false;

    if( !( reg_code = STR_CTL( simp_int->panel_funcs->orig_struct, register_panel,
                               "Reg Code", 43 ) ) )
      throw false;

    if( !( register_now = WBUTTON_CTL( simp_int->panel_funcs->orig_struct, register_panel,
                                       "Register Now", 150 ) ) )
      throw false;

    // Position some things
    MOVE_CON( dongle_id, 25, 212 );
    PanelTools::AlignLabels( dongle_id, reg_code );

    PAN_SETW( simp_int->panel_funcs->orig_struct, register_panel, 400 );
    PAN_SETH( simp_int->panel_funcs->orig_struct, register_panel, 350 );

    PanelTools::PutUnder( reg_code, register_now );

    int pw = PAN_GETW( simp_int->panel_funcs->orig_struct, register_panel );
    int w  = CON_W( register_now );
    int y  = CON_Y( register_now );
    MOVE_CON( register_now, (pw/2 - w/2), y );

    // Default Values
    char buffer[10];
    sprintf( buffer, "%ld", GetDongleID() );
    SET_STR( dongle_id, buffer, strlen( buffer ) );

    // Listener Functions
    CON_SETEVENT( register_now, OnRegisterNow, this );
    CON_SETEVENT( reg_code,     OnRegisterNow, this );

    // Set the Draw Functions
    simp_int->panel_funcs->Set( register_panel, PAN_USERDRAW, DrawRegisterPanel );

    return true;
  } catch( bool a ) {
    if( !a ) {
      simp_int->message->Error("Error creating interface controls; aborting" );
      return false;
    }
  }

  return true;
}
コード例 #2
0
ファイル: ui_util.cpp プロジェクト: Emulyator/gamecatapult
/*
 *  UI_UtilString1        QUERY ONE STRING
 */
int UI_UtilString1( LWPanelFuncs *panfunc, char *title, char *caption, char *strin, char *strout )
{
	LWPanelID			panelID;
	LWControl           *control;
	int                 btn;

	panelID = (*panfunc->create)( title, NULL );
	control = STR_CTL( panfunc, panelID, caption, 40 );
	SET_STR( control, strin, 255 );
	btn     = (*panfunc->open)( panelID, PANF_BLOCKING|PANF_CANCEL );
	if (btn) {
		GET_STR( control, strout, 255 );
	}
	PAN_KILL( panfunc, panelID );

	return btn;
}
コード例 #3
0
// MakeGroupControls():
bool FreeKeyInterface::MakeGroupControls() {
  try {
    int x, y;

    // Group Controls
    if( !( group_name = STR_CTL( panel_funcs->orig_struct, main_panel,
                                 "Group Name", 75 ) ) )
      throw false;

    if( !( group_delete = WBUTTON_CTL( panel_funcs->orig_struct, main_panel,
                                       "Del", 50 ) ) )
      throw false;

    if( !( group_edit_mode = WPOPUP_CTL( panel_funcs->orig_struct, main_panel,
                                         "Modify", group_edit_text, 250 ) ) )
      throw false;

    if( !( group_edit_apply = WBUTTON_CTL( panel_funcs->orig_struct, main_panel,
                                           "Apply", 100 ) ) )
      throw false;

    PanelTools::PutUnder( tool_options_tabs, group_name );
    x = CON_X( group_name );
    y = CON_Y( group_name );
    MOVE_CON( group_name, x, y+4 );

    PanelTools::PutOnLineWith( group_name, group_delete    );
    PanelTools::AlignLabels( group_name, group_edit_mode );
    PanelTools::PutOnLineWith( group_edit_mode, group_edit_apply );

    // Event Handler Functions
    CON_SETEVENT( group_name,              OnGroupName,          this );
    CON_SETEVENT( group_delete,            OnGroupDel,           this );
    CON_SETEVENT( group_edit_apply,        OnGroupEditApply,     this );

    return true;
  } catch( bool ) {
    return false;
  }

  return true;
}
コード例 #4
0
ファイル: window.c プロジェクト: DimondTheCat/xray
static void create_controls( void )
{
   static char *labtype[] = { "Byte", "Word", "Long", "Float", "Double", NULL };
   static char *labbyte[] = { "Intel", "Motorola", NULL };
   static char *labjump[] = { "Absolute", "Forward", "Backward", NULL };
   static char *labsrch[] = { "Text", "Text + Hex", "Current", NULL };
   int x, y, ph;


   /* create a control */

   ctl[ 1 ] = STR_CTL( panf, panel, "", 58 );

   /* find out how much vertical space the panel wants for drawing its
      own decorations */

   ph = PAN_GETH( panf, panel ) - CON_H( ctl[ 1 ] );

   /* create the rest of the controls */

   ctl[  0 ] = CANVAS_CTL( panf, panel, "", 78 * TXWIDTH + DX * 2,
      NROWS * TXHEIGHT + DY * 2 );

   ctl[  2 ] = STRRO_CTL( panf, panel, "", 21 );
   ctl[  3 ] = WPOPUP_CTL( panf, panel, "", labtype, 76 );
   ctl[  4 ] = BOOL_CTL( panf, panel, "Unsigned" );
   ctl[  5 ] = WPOPUP_CTL( panf, panel, "", labbyte, 76 );
   ctl[  6 ] = MINISLIDER_CTL( panf, panel, "", 4, 1, 16 );
   ctl[  7 ] = STR_CTL( panf, panel, "Jump", 12 );
   ctl[  8 ] = WBUTTON_CTL( panf, panel, "Search", 56 );
   ctl[  9 ] = STRRO_CTL( panf, panel, "Mod", 4 );
   ctl[ 10 ] = VSLIDER_CTL( panf, panel, "", NROWS * TXHEIGHT + DY * 2, 0, 1000 );
   ctl[ 11 ] = STRRO_CTL( panf, panel, "", 12 );
   ctl[ 12 ] = WPOPUP_CTL( panf, panel, "", labjump, 80 );
   ctl[ 13 ] = STR_CTL( panf, panel, "", 24 );
   ctl[ 14 ] = WPOPUP_CTL( panf, panel, "", labsrch, 80 );
   ctl[ 15 ] = CANVAS_CTL( panf, panel, "", 32, 32 );
   ctl[ 16 ] = WBUTTON_CTL( panf, panel, "New", 40 );

   /* position all of the controls */

   x = CON_X( ctl[ 0 ] );
   y = CON_Y( ctl[ 0 ] );
   y += CON_H( ctl[ 2 ] );
   MOVE_CON( ctl[ 0 ], x, y + 2 );

   y = CON_Y( ctl[ 0 ] );
   MOVE_CON( ctl[ 10 ], 79 * TXWIDTH + 10, y + 1 );

   y = CON_Y( ctl[ 1 ] ) + 2;
   x = CON_X( ctl[ 0 ] );
   MOVE_CON( ctl[ 16 ], x + DX, y );

   x += CON_W( ctl[ 16 ] );
   MOVE_CON( ctl[ 1 ], x, y );

   x = CON_X( ctl[ 1 ] );
   x += CON_W( ctl[ 1 ] );
   MOVE_CON( ctl[ 2 ], x, y );

   x = CON_X( ctl[ 10 ] );
   x += CON_W( ctl[ 10 ] );
   MOVE_CON( ctl[ 15 ], x - 32, y );

   y += CON_H( ctl[ 1 ] ) - 2;
   x = CON_X( ctl[ 0 ] );
   MOVE_CON( ctl[ 11 ], x - 3, y );

   x += CON_W( ctl[ 11 ] );
   MOVE_CON( ctl[ 9 ], x, y );

   x = CON_X( ctl[ 9 ] );
   x += CON_W( ctl[ 9 ] );
   MOVE_CON( ctl[ 6 ], x, y );

   x = CON_X( ctl[ 6 ] );
   x += CON_W( ctl[ 6 ] );
   MOVE_CON( ctl[ 5 ], x, y );

   x = CON_X( ctl[ 5 ] );
   x += CON_W( ctl[ 5 ] );
   MOVE_CON( ctl[ 3 ], x - 6, y );

   x = CON_X( ctl[ 3 ] );
   x += CON_W( ctl[ 3 ] );
   MOVE_CON( ctl[ 4 ], x, y );

   y = CON_Y( ctl[ 0 ] );
   y += CON_H( ctl[ 0 ] );
   x = CON_X( ctl[ 0 ] );
   MOVE_CON( ctl[ 7 ], x + DX, y );

   x = CON_X( ctl[ 7 ] );
   x += CON_W( ctl[ 7 ] );
   MOVE_CON( ctl[ 12 ], x - 4, y );

   x = CON_X( ctl[ 12 ] );
   x += CON_W( ctl[ 12 ] );
   MOVE_CON( ctl[ 8 ], x + 18, y );

   x = CON_X( ctl[ 8 ] );
   x += CON_W( ctl[ 8 ] );
   MOVE_CON( ctl[ 13 ], x - 4, y );

   x = CON_X( ctl[ 13 ] );
   x += CON_W( ctl[ 13 ] );
   MOVE_CON( ctl[ 14 ], x - 4, y );

   /* now that we know how much room the controls will take up, set the
      height of the panel */

   y = CON_Y( ctl[ 8 ] );
   y += CON_H( ctl[ 8 ] );
   PAN_SETH( panf, panel, y + ph - 6 );

   /* initialize the controls */

   SET_INT( ctl[ 3 ], datatype );
   SET_INT( ctl[ 4 ], unsign );
   SET_INT( ctl[ 5 ], byteorder );
   SET_INT( ctl[ 6 ], linesize );
   SET_STR( ctl[ 7 ], "0", 2 );
   SET_STR( ctl[ 9 ], "0", 2 );
   SET_INT( ctl[ 10 ], 0 );
   SET_STR( ctl[ 11 ], "0", 2 );
   SET_INT( ctl[ 12 ], 0 );
   SET_INT( ctl[ 14 ], 0 );

   /* set the control event callbacks */

   CON_SETEVENT( ctl[  1 ], handle_file, NULL );
   CON_SETEVENT( ctl[  3 ], handle_datatype, NULL );
   CON_SETEVENT( ctl[  4 ], handle_unsigned, NULL );
   CON_SETEVENT( ctl[  5 ], handle_byteorder, NULL );
   CON_SETEVENT( ctl[  6 ], handle_rowsize, NULL );
   CON_SETEVENT( ctl[  7 ], handle_jump, NULL );
   CON_SETEVENT( ctl[  8 ], handle_search, NULL );
   CON_SETEVENT( ctl[ 10 ], handle_scroll, NULL );
   CON_SETEVENT( ctl[ 13 ], handle_search, NULL );
   CON_SETEVENT( ctl[ 16 ], handle_new, NULL );

   /* set the control drawing callbacks */

   ival.ptr.ptr = drawcb_text;
   ctl[ 0 ]->set( ctl[ 0 ], CTL_USERDRAW, &ival );
   ival.ptr.ptr = drawcb_icon;
   ctl[ 15 ]->set( ctl[ 15 ], CTL_USERDRAW, &ival );
}
コード例 #5
0
ファイル: window.c プロジェクト: DimondTheCat/xray
static int print_ui( char *outname, int *range, int *mode, int *cols,
   char *comment )
{
   char *rlist[] = { "Current Page", "Entire File", NULL };
   char *mlist[] = { "Write", "Append", NULL };
   char *tlist[] = { " ", NULL };
   LWPanelID panel;
   LWControl *ctl[ 8 ];
   int i, x, y, dy, ok;

   if( !( panel = PAN_CREATE( panf, "Print to File" )))
      return 0;

   ctl[ 0 ] = FILE_CTL( panf, panel, "File", 40 );
   ctl[ 1 ] = HCHOICE_CTL( panf, panel, "Range", rlist );
   ctl[ 2 ] = HCHOICE_CTL( panf, panel, "Mode", mlist );
   ctl[ 3 ] = TEXT_CTL( panf, panel, "Columns", tlist );
   ctl[ 4 ] = BOOLBUTTON_CTL( panf, panel, "Position" );
   ctl[ 5 ] = BOOLBUTTON_CTL( panf, panel, "Buffer" );
   ctl[ 6 ] = BOOLBUTTON_CTL( panf, panel, "Printable" );
   ctl[ 7 ] = STR_CTL( panf, panel, "Comment", 40 );

   for ( i = 0; i < 4; i++ ) {
      ival.intv.value = 100 - CON_LW( ctl[ i ] );
      ctl[ i ]->set( ctl[ i ], CTL_X, &ival );
   }

   x = CON_HOTX( ctl[ 2 ] );
   y = CON_Y( ctl[ 2 ] );
   dy = y - CON_Y( ctl[ 1 ] );
   y += dy;

   MOVE_CON( ctl[ 4 ], x, y );
   x += CON_W( ctl[ 4 ] );
   MOVE_CON( ctl[ 5 ], x, y );
   x += CON_W( ctl[ 5 ] );
   MOVE_CON( ctl[ 6 ], x, y );
   x = 100 - CON_LW( ctl[ 7 ] );
   y += dy;
   MOVE_CON( ctl[ 7 ], x, y );

   PAN_SETH( panf, panel, y + dy );

   SET_STR( ctl[ 0 ], outname, 256 );
   SET_INT( ctl[ 1 ], *range );
   SET_INT( ctl[ 2 ], *mode );
   SET_INT( ctl[ 4 ], ( *cols & 1 ));
   SET_INT( ctl[ 5 ], ( *cols & 2 ));
   SET_INT( ctl[ 6 ], ( *cols & 4 ));
   SET_STR( ctl[ 7 ], comment, 256 );

   ok = panf->open( panel, PANF_BLOCKING | PANF_CANCEL );

   if ( ok ) {
      GET_STR( ctl[ 0 ], outname, 256 );
      GET_INT( ctl[ 1 ], *range );
      GET_INT( ctl[ 2 ], *mode );
      GET_INT( ctl[ 4 ], i );  if ( i ) *cols |= 1; else *cols &= ~1;
      GET_INT( ctl[ 5 ], i );  if ( i ) *cols |= 2; else *cols &= ~2;
      GET_INT( ctl[ 6 ], i );  if ( i ) *cols |= 4; else *cols &= ~4;
      GET_STR( ctl[ 7 ], comment, 256 );
   }

   PAN_KILL( panf, panel );

   return ok;
}
コード例 #6
0
ファイル: dna.c プロジェクト: DimondTheCat/xray
static void ctl_create( void )
{
   static char *labatype[] = { "Point", "Sphere", "Dodec", NULL };
   static char *labbtype[] = { "Line", "Cylinder", NULL };
   static char *labradii[] = { "Radii", NULL };
   int x, y, w, h, ph, i;


   /* create a control */

   ctl[ 0 ] = STR_CTL( panf, panel, "Sequence", 40 );

   /* find out how much vertical space the panel wants for drawing its
      own decorations, and get some other panel metrics */

   ph = PAN_GETH( panf, panel ) - CON_H( ctl[ 0 ] );
   dmet = panf->drawFuncs->dispMetrics();

   /* create the rest of the controls */

   ctl[  1 ] = WPOPUP_CTL( panf, panel, "Atoms", labatype, 100 );
   ctl[  2 ] = INT_CTL( panf, panel, "Sides" );
   ctl[  3 ] = INT_CTL( panf, panel, "Segments" );
   ctl[  4 ] = TEXT_CTL( panf, panel, "", labradii );
   ctl[  5 ] = FLOAT_CTL( panf, panel, "Carbon" );
   ctl[  6 ] = FLOAT_CTL( panf, panel, "Hydrogen" );
   ctl[  7 ] = FLOAT_CTL( panf, panel, "Nitrogen" );
   ctl[  8 ] = FLOAT_CTL( panf, panel, "Oxygen" );
   ctl[  9 ] = FLOAT_CTL( panf, panel, "Phosphorus" );
   ctl[ 10 ] = WPOPUP_CTL( panf, panel, "Bonds", labbtype, 100 );
   ctl[ 11 ] = INT_CTL( panf, panel, "Sides" );
   ctl[ 12 ] = INT_CTL( panf, panel, "Segments" );
   ctl[ 13 ] = FLOAT_CTL( panf, panel, "Radius" );
   ctl[ 14 ] = BOOL_CTL( panf, panel, "Base Plates" );

   w = 2 * panf->drawFuncs->textWidth( panel, "Polygons:" ) + 16;
   ctl[ 15 ] = CANVAS_CTL( panf, panel, "", w, 3 * dmet->textHeight );

   /* position all of the controls */

   x = CON_X( ctl[ 0 ] );
   x += CON_W( ctl[ 1 ] );
   h = CON_HOTH( ctl[ 1 ] ) + 4;

   w = CON_W( ctl[ 1 ] );
   y = CON_Y( ctl[ 0 ] ) + 3 * h / 2;
   MOVE_CON( ctl[ 1 ], x - w, y );

   w = CON_W( ctl[ 2 ] );
   MOVE_CON( ctl[ 2 ], x - w, y + 3 * h / 2 );

   w = CON_W( ctl[ 3 ] );
   y = CON_Y( ctl[ 2 ] );
   MOVE_CON( ctl[ 3 ], x - w, y + h );

   w = CON_W( ctl[ 4 ] );
   y = CON_Y( ctl[ 3 ] );
   MOVE_CON( ctl[ 4 ], ( x - w ) / 2, y + 3 * h / 2 );

   for ( i = 5; i < 10; i++ ) {
      w = CON_W( ctl[ i ] );
      y = CON_Y( ctl[ i - 1 ] );
      MOVE_CON( ctl[ i ], x - w, y + h );
   }

   x = x * 2 + 10;
   w = CON_W( ctl[ 10 ] );
   y = CON_Y( ctl[ 1 ] );
   MOVE_CON( ctl[ 10 ], x - w, y );

   w = CON_W( ctl[ 11 ] );
   y = CON_Y( ctl[ 10 ] );
   MOVE_CON( ctl[ 11 ], x - w, y + 3 * h / 2 );

   w = CON_W( ctl[ 12 ] );
   y = CON_Y( ctl[ 11 ] );
   MOVE_CON( ctl[ 12 ], x - w, y + h );

   w = CON_W( ctl[ 13 ] );
   y = CON_Y( ctl[ 12 ] );
   MOVE_CON( ctl[ 13 ], x - w, y + 3 * h / 2 );

   w = CON_W( ctl[ 14 ] );
   y = CON_Y( ctl[ 13 ] );
   MOVE_CON( ctl[ 14 ], x - w, y + 3 * h / 2 );

   w = CON_W( ctl[ 15 ] );
   y = CON_Y( ctl[ 14 ] );
   MOVE_CON( ctl[ 15 ], x - w, y + 2 * h );

   /* now that we know how much room the controls will take up, set the
      height of the panel */

   h = CON_Y( ctl[ 9 ] );
   h += CON_HOTH( ctl[ 9 ] );
   PAN_SETH( panf, panel, h + ph - 6 );

   /* initialize the controls */

   ctl_set();

   /* set the event handlers and user data */

   for ( i = 0; i < 15; i++ )
      CON_SETEVENT( ctl[ i ], ctl_event, NULL );

   ival.ptr.ptr = ctl_draw;
   ctl[ 15 ]->set( ctl[ 15 ], CTL_USERDRAW, &ival );
}
コード例 #7
0
// MakeItemSelectionControls():
bool FreeKeyInterface::MakeItemSelectionControls() {
  try {
    int x, y;
    // ItemSelection Controls
    if( !( select_item_name = STR_CTL( panel_funcs->orig_struct, main_panel,
                                       "Match String", 65 ) ) )
      throw false;

    if( !( select_name_mode = WPOPUP_CTL( panel_funcs->orig_struct, main_panel,
                                          "Compare", selection_name_text, 100 ) ) )
      throw false;

    if( !( select_toggle = WPOPUP_CTL( panel_funcs->orig_struct, main_panel,
                                       "Mode", select_toggle_text, 83 ) ) )
      throw false;

    if( !( select_item_mode = WPOPUP_CTL( panel_funcs->orig_struct, main_panel,
                                          "", selection_mode_text, 257 ) ) )
      throw false;

    if( !( select_children_toggle = BOOL_CTL( panel_funcs->orig_struct, main_panel,
                                             "And Children" ) ) )
      throw false;

    if( !( apply_select_item_name = WBUTTON_CTL( panel_funcs->orig_struct, main_panel,
                                                 "Apply", 100 ) ) )
      throw false;

    SET_INT( select_item_mode, 1 );
    SET_INT( select_name_mode, 1 );
    SET_INT( select_children_toggle, 1 );
    SET_INT( select_toggle, 0 );

    PanelTools::PutUnder( tool_options_tabs, select_item_name );
    x = CON_X( select_item_name );
    y = CON_Y( select_item_name );
    MOVE_CON( select_item_name, x, y+4 );

    PanelTools::PutOnLineWith( select_item_name, select_name_mode, -2 );
    PanelTools::AlignLabels( select_item_name, select_toggle );
    PanelTools::PutOnLineWith( select_toggle, select_item_mode );
    PanelTools::PutOnLineWith( select_item_mode, select_children_toggle );
    PanelTools::PutOnLineWith( select_children_toggle, apply_select_item_name );

        x  = CON_X( apply_select_item_name );
    int w  = CON_W( apply_select_item_name );
    int x2 = CON_X( item_scroll );
    int w2 = CON_W( item_scroll );

    int y2 = CON_HOTY( select_name_mode );
        y  = CON_HOTY( apply_select_item_name );
    int h  = CON_HOTH( apply_select_item_name );

    // Item Selection Info
    if( !( select_info_area = AREA_CTL( panel_funcs->orig_struct, main_panel,
                                        "", (x2+w2) - (x+w) - 20, (y+h) - y2 ) ) )
      throw false;

    PanelTools::PutOnLineWith( select_name_mode, select_info_area );

    // Event Handler Functions
    CON_SETEVENT( apply_select_item_name,  OnApplySelection,     this );
    CON_SETEVENT( select_item_mode,        OnSelectionMode,      this );
    CON_SETEVENT( select_toggle,           OnSelectionMode,      this );

    // Set the Draw Functions
    ival.intv.value = (int)&DrawSelectInfo;
    (*select_info_area->set)( select_info_area, CTL_USERDRAW, &ival );

    return true;
  } catch( bool ) {
    return false;
  }

  return true;
}
コード例 #8
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool ReplaceObjects_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*panel_funcs->destroy)( panel );
    panel = NULL;
  }

  char title_string[256];
  sprintf( title_string, "ReplaceObjects -- %c2001 Joe Angell, TM Productions", 169 );
  panel = (*panel_funcs->create)( title_string, panel_funcs );
  if( !panel ) {                    // Make sure the panel was created
    (*message->error)("Error creating main panel, aborting", NULL );
    return false;
  }

  // Limit To Pop-Up
  limit_to_popup = WPOPUP_CTL( panel_funcs, panel, "Limit To",
                               limit_to_popup_strings, 110 );

  // Sort By Pop-Up
  sort_by_popup = WPOPUP_CTL( panel_funcs, panel, "Sort By",
                              sort_by_popup_strings, 110 );
  PanelTools::PutOnLineWith( limit_to_popup, sort_by_popup, 10 );

  // Match
  match_toggle = BOOL_CTL( panel_funcs, panel, "Match Name" );
  match_string = STR_CTL(  panel_funcs, panel, "Name Contains", 41 );
  PanelTools::PutOnLineWith( match_toggle, match_string, 10 );

  // List
  list = MULTILIST_CTL( panel_funcs, panel, "Swap Objects",
                        300, 20, ListNames, ListCount, ListColumnWidths );
  PanelTools::PutUnder( match_toggle, list, 20 );

  // Add
  add = WBUTTON_CTL( panel_funcs, panel, "Add", 60 );
  PanelTools::PutOnLineWith( list, add, 3);

  // Clone
  clone = WBUTTON_CTL( panel_funcs, panel, "Clone", 60 );
  PanelTools::AlignLabels( add, clone );

  // Remove
  remove = WBUTTON_CTL( panel_funcs, panel, "Remove", 60 );
  PanelTools::AlignLabels( clone, remove );

  // Clear All
  clear_all  = WBUTTON_CTL( panel_funcs, panel, "Clear All", 60 );
  PanelTools::AlignLabels( remove, clear_all );
  PanelTools::PutUnder( clear_all, clear_all );

  // About
  about = WBUTTON_CTL( panel_funcs, panel, "About", 60 );
  PanelTools::PutOnLineWith( sort_by_popup, about );

  // Load
  load = LOADBUTTON_CTL( panel_funcs, panel, "Load", 60 );
  PanelTools::PutOnLineWith( sort_by_popup, about );

  // Save
  save = SAVEBUTTON_CTL( panel_funcs, panel, "Save", 60 );
  PanelTools::PutOnLineWith( sort_by_popup, about );

  // Path
  path = FILE_CTL( panel_funcs, panel, "Object Path", 59 );
  PanelTools::PutUnder( list, path, 18 );

  // Weight
  weight = FLOAT_CTL( panel_funcs, panel, "Weight" );
  PanelTools::AlignLabels( path, weight );

  // Enable
  enable = BOOL_CTL( panel_funcs, panel, "Enable" );
  PanelTools::PutOnLineWith( weight, enable );

  // Store Original Names
  store_original_name = BOOL_CTL( panel_funcs, panel, "Store Original Object Name As Tag" );
  SET_INT( store_original_name, store_original_name_value );
  PanelTools::AlignLabels( weight, store_original_name, 18 );

  int x  = CON_X( add );
  int y  = CON_Y( list );
  int h  = CON_H( list );
  int h2 = CON_H( about );
  MOVE_CON( about, x, (y + h) - h2 );
  MOVE_CON( save,  x, (y + h) - (h2 * 3) + 10 );
  MOVE_CON( load,  x, (y + h) - (h2 * 4) + 15 );

  // Default Values
  SET_INT( list, -1 );
  HandleList( list, NULL );

  // Event Handlers
  CON_SETEVENT( list,          HandleList,        NULL );
  CON_SETEVENT( about,         HandleAbout,       NULL );

  CON_SETEVENT( sort_by_popup, HandleSortBy,      NULL );
  CON_SETEVENT( match_toggle,  HandleMatchToggle, NULL );

  CON_SETEVENT( add,           HandleAdd,         NULL );
  CON_SETEVENT( clone,         HandleClone,       NULL );
  CON_SETEVENT( remove,        HandleRemove,      NULL );
  CON_SETEVENT( clear_all,     HandleClearAll,    NULL );

  CON_SETEVENT( load,          HandleLoad,        NULL );
  CON_SETEVENT( save,          HandleSave,        NULL );

  CON_SETEVENT( path,          HandlePath,        NULL );
  CON_SETEVENT( weight,        HandleWeight,      NULL );
  CON_SETEVENT( enable,        HandleEnable,      NULL );

  // Panel-Level Callbacks
  (*panel_funcs->set)( panel, PAN_USERDRAW, DrawPanel );

  // Get a copy of the swaps
  swaps.Flush();
  ReplaceObjects_SwapObject *new_swap;
  for( unsigned long i=0; i < old_swaps.NumElements(); i++ ) {
    new_swap = new ReplaceObjects_SwapObject;
    *new_swap = *old_swaps[i];
    swaps.Add( new_swap );
  }

  HandleMatchToggle( match_toggle, NULL );

  // Open the Panel
  int retval = (*panel_funcs->open)( panel, PANF_BLOCKING | PANF_CANCEL | PANF_PASSALLKEYS );
  if( retval > 0 ) {
    do_process = true;
    GET_INT( store_original_name, store_original_name_value );

    old_swaps.Flush();
    ReplaceObjects_SwapObject *new_swap;
    for( unsigned long i=0; i < swaps.NumElements(); i++ ) {
      new_swap = new ReplaceObjects_SwapObject;
      *new_swap = *swaps[i];
      old_swaps.Add( new_swap );
    }
  }

  return do_process;
}