Class TUndoChangeSelection

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TUndoChangeSelection = class(TCustomUpdateScreenObjectDisplayUndo)

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

Strict Private FOldChildModelScreenObjects: TList;
Private FOldSegment: TSegment2D;
Protected FNewSelectedVertices: T2DBoolArray;
Protected FNewSelectedScreenObjects: TList;
Protected FOldSelectedVertices: T2DBoolArray;
Protected FOldSelectedScreenObjects: TList;
Protected FOldVisibleScreenObjects: TList;
Protected FNewVisibleScreenObjects: TList;
Protected FUpdateVisible: boolean;

Methods

Private procedure ResetVisible(const ScreenObjects: TList);
Protected procedure ResetSelection(const ScreenObjects: TList; const SelectedVertices: T2DBoolArray);
Protected procedure SetPriorSelection;
Protected procedure SetSelection(const ScreenObjects: TList; var SelectedVertices: T2DBoolArray);
Protected procedure StoreVisible(const ScreenObjects: TList);
Protected function Description: string; override;
Protected procedure InvalidateImages;
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

Strict Private FOldChildModelScreenObjects: TList;
 
Private FOldSegment: TSegment2D;
 
Protected FNewSelectedVertices: T2DBoolArray;

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

Protected FNewSelectedScreenObjects: TList;

FNewSelectedScreenObjects records the selected TScreenObjects when SetPostSelection was called.

Protected FOldSelectedVertices: T2DBoolArray;

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

Protected FOldSelectedScreenObjects: TList;

FOldSelectedScreenObjects records the selected TScreenObjects when the TUndoChangeSelection was created.

Protected FOldVisibleScreenObjects: TList;
 
Protected FNewVisibleScreenObjects: TList;
 
Protected FUpdateVisible: boolean;
 

Methods

Private procedure ResetVisible(const ScreenObjects: TList);
 
Protected 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.

Protected procedure SetPriorSelection;

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

Protected 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 procedure StoreVisible(const ScreenObjects: TList);
 
Protected function Description: string; override;

Description tells what TUndoChangeSelection does.

Protected procedure InvalidateImages;

InvalidateImages causes all the zoomboxes to redraw.

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.12.1 on 2013-05-13 15:42:06