Class TUndoChangeSelection

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TUndoChangeSelection = class(TCustomUndo)

Description

TUndoChangeSelection is used to change or restore which TScreenObjects or vertices in an individual TScreenObject are selected.

To use, Create a TUndoChangeSelection, change the TScreenObjects that are selected, and call SetPostSelection. Then Undo and Redo can be used to restore or redo the changes in what is selected.

      UndoChangeSelection := TUndoChangeSelection.Create;
      try
        // Change the selected TScreenObjects here.
        UndoChangeSelection.SetPostSelection;
        if UndoChangeSelection.SelectionChanged then
        begin
          frmGoPhast.UndoStack.Submit(UndoChangeSelection);
        end
        else
        begin
          UndoChangeSelection.Free;
        end;
      except
        UndoChangeSelection.Free;
        raise;
      end;
   

Hierarchy

Overview

Fields

Private FNewSelectedVertices: T2DBoolArray;
Private FNewSelectedScreenObjects: TList;
Private FOldSelectedVertices: T2DBoolArray;
Private FOldSelectedScreenObjects: TList;

Methods

Private procedure ResetSelection(const ScreenObjects: TList; const SelectedVertices: T2DBoolArray);
Private procedure SetPriorSelection;
Private procedure SetSelection(const ScreenObjects: TList; var SelectedVertices: T2DBoolArray);
Protected function Description: string; override;
Public constructor Create;
Public destructor Destroy; override;
Public procedure DoCommand; override;
Public procedure Redo; override;
Public function SelectionChanged: boolean;
Public procedure SetPostSelection;
Public procedure Undo; override;

Description

Fields

Private FNewSelectedVertices: T2DBoolArray;

FNewSelectedVertices: T2DBoolArray; FNewSelectedVertices records the selected vertices of a single TScreenObject when SetPostSelection was called.

Private FNewSelectedScreenObjects: TList;

FNewSelectedScreenObjects: TList; FNewSelectedScreenObjects records the selected TScreenObjects when SetPostSelection was called.

Private FOldSelectedVertices: T2DBoolArray;

FOldSelectedVertices: T2DBoolArray; FOldSelectedVertices records the selected vertices of a single TScreenObject when the TUndoChangeSelection was created.

Private FOldSelectedScreenObjects: TList;

FOldSelectedScreenObjects: TList; FOldSelectedScreenObjects records the selected TScreenObjects when the TUndoChangeSelection was created.

Methods

Private procedure ResetSelection(const ScreenObjects: TList; const SelectedVertices: T2DBoolArray);

ResetSelection sets the selected TScreenObjects and the selected vertices of a single TScreenObject to the values specified by ScreenObjects and SelectedVertices.

Private procedure SetPriorSelection;

SetPriorSelection stores the selected TScreenObjects and the selected vertices if any) of a TScreenObject in FOldSelectedScreenObjects and FOldSelectedVertices.

Private procedure SetSelection(const ScreenObjects: TList; var SelectedVertices: T2DBoolArray);

SetSelection stores the selected TScreenObjects in ScreenObjects and the selected vertices of a single TScreenObject in SelectedVertices.

Protected function Description: string; override;

Description tells what TUndoChangeSelection does.

Public constructor Create;

Create creates an instance of TUndoChangeSelection and stores the selected TScreenObjects.

Public destructor Destroy; override;

Destroy gets rid of the instance of TUndoChangeSelection.

Public procedure DoCommand; override;

DoCommand causes the paint boxes showing the selected TScreenObjects to be invalidated.

Public procedure Redo; override;

Redo sets the selection to what it was when SetPostSelection was called.

Public function SelectionChanged: boolean;

SelectionChanged indicates whether or not the selection changed.

Public procedure SetPostSelection;

SetPostSelection stores the selected TScreenObjects and the selected vertices if any) of a TScreenObject in FNewSelectedScreenObjects and FNewSelectedVertices.

Public procedure Undo; override;

Undo sets the selection to what it was when the TUndoChangeSelection was created.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:46