GuiEditCtrl

Engine/source/gui/editor/guiEditCtrl.h

Native side of the GUI editor.

More...

Callbacks

DECLARE_CALLBACK(void , onHierarchyChanged , () )
DECLARE_CALLBACK(void , onDelete , () )
DECLARE_CALLBACK(void , onPreEdit , (SimSet *selection) )
DECLARE_CALLBACK(void , onPostEdit , (SimSet *selection) )
DECLARE_CALLBACK(void , onClearSelected , () )
DECLARE_CALLBACK(void , onAddSelected , (GuiControl *control) )
DECLARE_CALLBACK(void , onRemoveSelected , (GuiControl *control) )
DECLARE_CALLBACK(void , onPreSelectionNudged , (SimSet *selection) )
DECLARE_CALLBACK(void , onPostSelectionNudged , (SimSet *selection) )
DECLARE_CALLBACK(void , onSelectionMoved , (GuiControl *control) )
DECLARE_CALLBACK(void , onSelectionCloned , (SimSet *selection) )
DECLARE_CALLBACK(void , onTrashSelection , (SimSet *selection) )
DECLARE_CALLBACK(void , onAddNewCtrl , (GuiControl *control) )
DECLARE_CALLBACK(void , onAddNewCtrlSet , (SimSet *set) )
DECLARE_CALLBACK(void , onSelectionResized , (GuiControl *control) )
DECLARE_CALLBACK(void , onFitIntoParent , (bool width, bool height) )
DECLARE_CALLBACK(void , onMouseModeChange , () )
DECLARE_CALLBACK(void , onControlInspectPreApply , (GuiControl *control) )
DECLARE_CALLBACK(void , onControlInspectPostApply , (GuiControl *control) )

Public Types

enum
guideAxis {
  GuideVertical 
  GuideHorizontal 
}
enum
Justification {
  JUSTIFY_LEFT 
  JUSTIFY_CENTER_VERTICAL 
  JUSTIFY_RIGHT 
  JUSTIFY_TOP 
  JUSTIFY_BOTTOM 
  SPACING_VERTICAL 
  SPACING_HORIZONTAL 
  JUSTIFY_CENTER_HORIZONTAL 
}
enum
mouseModes {
  Selecting 
  MovingSelection 
  SizingSelection 
  DragSelecting 
  DragGuide 
  DragClone 
}
enum
sizingModes {
  sizingNone = 0
  sizingLeft = 1
  sizingRight = 2
  sizingTop = 4
  sizingBottom = 8
}
enum
snappingAxis {
  SnapVertical 
  SnapHorizontal 
}
enum
snappingEdges {
  SnapEdgeMin 
  SnapEdgeMid 
  SnapEdgeMax 
}
Parent 

Protected Types

enum
_Anonymous_ {
  NUT_SIZE = 4
  MIN_GRID_SIZE = 3
}
GuiControlPtr 
GuiControlVector 

Public Friends

Protected Attributes

GFXVertexBufferHandle< GFXVertexPCT >
bool

Indices of the guide's being dragged in DragGuide mouse mode.

mGuides [2]

The guides defined on the current content control.

Identification of edge being snapped for each axis.

Hit testing lists for each axis.

Reference point on snap line for each axis.

bool

Snap flag for each axis. If true, we are currently snapped in a drag.

Snap distance in pixels.

Controls providing the snap reference lines on each axis.

bool

If true, edge and center snapping will work against canvas (= content control).

bool

If true, selection centers will snap to other control centers.

bool

If true, edge and center snapping will work against controls.

bool

If true, selection edges will snap to other control edges.

bool

If true, edge and center snapping will work against guides.

Protected Static Attributes

Protected Functions

doControlSnap(const GuiEvent & event, const RectI & selectionBounds, const RectI & selectionBoundsGlobal, Point2I & delta)
doGridSnap(const GuiEvent & event, const RectI & selectionBounds, const RectI & selectionBoundsGlobal, Point2I & delta)
doGuideSnap(const GuiEvent & event, const RectI & selectionBounds, const RectI & selectionBoundsGlobal, Point2I & delta)
doSnapping(const GuiEvent & event, const RectI & selectionBounds, Point2I & delta)
findGuide(guideAxis axis, const Point2I & point, U32 tolerance)
findSnaps(snappingAxis axis, const Point2I & mousePoint, const RectI & minRegion, const RectI & midRegion, const RectI & maxRegion)
registerSnap(snappingAxis axis, const Point2I & mousePoint, const Point2I & point, snappingEdges edge, GuiControl * ctrl)
startMouseGuideDrag(guideAxis axis, U32 index, bool lockMouse)

Protected Static Functions

drawCrossSection(U32 axis, S32 offset, const RectI & bounds, ColorI color, GFXDrawUtil * drawer)
bool
inNut(const Point2I & pt, S32 x, S32 y)
snapDelta(snappingAxis axis, snappingEdges edge, S32 offset, const RectI & bounds, Point2I & delta)

Public Functions

addGuide(guideAxis axis, U32 offset)
DECLARE_CATEGORY("Gui Editor" )
DECLARE_DESCRIPTION("Implements the framework <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the GUI editor." )
drawNut(const Point2I & nut, ColorI & outlineColor, ColorI & nutColor)
drawNuts(RectI & box, ColorI & outlineColor, ColorI & nutColor)
fitIntoParents(bool width, bool height)
getCursor(GuiCursor *& cursor, bool & showCursor, const GuiEvent & lastGuiEvent)

Get information about the cursor.

loadSelection(const char * filename)
moveAndSnapSelection(const Point2I & delta, bool callback)
moveSelection(const Point2I & delta, bool callback)
moveSelectionToCtrl(GuiControl * ctrl, bool callback)
bool

Called when this object is added to the scene.

bool

Happens when a key is depressed.

Do special pre-render processing.

Called when this object is removed.

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

Called when this object is asked to sleep.

bool

Called when this object is asked to wake up returns true if it's actually awake at the end.

saveSelection(const char * filename)
selectChildren(bool addToSelection)
selectParents(bool addToSelection)
setCurrentAddSet(GuiControl * ctrl, bool clearSelection)
setEditMode(bool value)
setSelection(GuiControl * ctrl, bool inclusive)

Public Static Functions

Detailed Description

Native side of the GUI editor.

Callbacks

DECLARE_CALLBACK(void , onHierarchyChanged , () )

DECLARE_CALLBACK(void , onDelete , () )

DECLARE_CALLBACK(void , onPreEdit , (SimSet *selection) )

DECLARE_CALLBACK(void , onPostEdit , (SimSet *selection) )

DECLARE_CALLBACK(void , onClearSelected , () )

DECLARE_CALLBACK(void , onSelect , (GuiControl *control) )

DECLARE_CALLBACK(void , onAddSelected , (GuiControl *control) )

DECLARE_CALLBACK(void , onRemoveSelected , (GuiControl *control) )

DECLARE_CALLBACK(void , onPreSelectionNudged , (SimSet *selection) )

DECLARE_CALLBACK(void , onPostSelectionNudged , (SimSet *selection) )

DECLARE_CALLBACK(void , onSelectionMoved , (GuiControl *control) )

DECLARE_CALLBACK(void , onSelectionCloned , (SimSet *selection) )

DECLARE_CALLBACK(void , onTrashSelection , (SimSet *selection) )

DECLARE_CALLBACK(void , onAddNewCtrl , (GuiControl *control) )

DECLARE_CALLBACK(void , onAddNewCtrlSet , (SimSet *set) )

DECLARE_CALLBACK(void , onSelectionResized , (GuiControl *control) )

DECLARE_CALLBACK(void , onFitIntoParent , (bool width, bool height) )

DECLARE_CALLBACK(void , onMouseModeChange , () )

DECLARE_CALLBACK(void , onControlInspectPreApply , (GuiControl *control) )

DECLARE_CALLBACK(void , onControlInspectPostApply , (GuiControl *control) )

Public Types

guideAxis

Enumerator

GuideVertical
GuideHorizontal
Justification

Enumerator

JUSTIFY_LEFT
JUSTIFY_CENTER_VERTICAL
JUSTIFY_RIGHT
JUSTIFY_TOP
JUSTIFY_BOTTOM
SPACING_VERTICAL
SPACING_HORIZONTAL
JUSTIFY_CENTER_HORIZONTAL
mouseModes

Enumerator

Selecting
MovingSelection
SizingSelection
DragSelecting
DragGuide
DragClone
sizingModes

Enumerator

sizingNone = 0
sizingLeft = 1
sizingRight = 2
sizingTop = 4
sizingBottom = 8
snappingAxis

Enumerator

SnapVertical
SnapHorizontal
snappingEdges

Enumerator

SnapEdgeMin
SnapEdgeMid
SnapEdgeMax
typedef GuiControl Parent 

Protected Types

@103

Enumerator

NUT_SIZE = 4
MIN_GRID_SIZE = 3
typedef SimObjectPtr< GuiControl > GuiControlPtr 
typedef Vector< GuiControl * > GuiControlVector 

Public Friends

Protected Attributes

GuiControlPtr mContentControl 
GuiControlPtr mCurrentAddSet 
GFXVertexBufferHandle< GFXVertexPCT > mDots 
GFXStateBlockRef mDotSB 
bool mDragAddSelection 
Point2I mDragBeginPoint 
Vector< Point2I > mDragBeginPoints 
bool mDragGuide [2]
U32 mDragGuideIndex [2]

Indices of the guide's being dragged in DragGuide mouse mode.

bool mDragMoveUndo 
bool mDrawBorderLines 
bool mDrawGuides 
bool mFullBoxSelection 
Point2I mGridSnap 
Vector< U32 > mGuides [2]

The guides defined on the current content control.

Point2I mLastDragPos 
Point2I mLastMousePos 
mouseModes mMouseDownMode 
GuiControlVector mSelectedControls 
SimSet * mSelectedSet 
Point2I mSelectionAnchor 
sizingModes mSizingMode 
snappingEdges mSnapEdge [2]

Identification of edge being snapped for each axis.

GuiControlVector mSnapHits [2]

Hit testing lists for each axis.

S32 mSnapOffset [2]

Reference point on snap line for each axis.

bool mSnapped [2]

Snap flag for each axis. If true, we are currently snapped in a drag.

S32 mSnapSensitivity 

Snap distance in pixels.

GuiControlPtr mSnapTargets [2]

Controls providing the snap reference lines on each axis.

bool mSnapToCanvas 

If true, edge and center snapping will work against canvas (= content control).

bool mSnapToCenters 

If true, selection centers will snap to other control centers.

bool mSnapToControls 

If true, edge and center snapping will work against controls.

bool mSnapToEdges 

If true, selection edges will snap to other control edges.

bool mSnapToGuides 

If true, edge and center snapping will work against guides.

SimGroup * mTrash 

Protected Static Attributes

StringTableEntry smGuidesPropertyName [2]

Protected Functions

doControlSnap(const GuiEvent & event, const RectI & selectionBounds, const RectI & selectionBoundsGlobal, Point2I & delta)

doGridSnap(const GuiEvent & event, const RectI & selectionBounds, const RectI & selectionBoundsGlobal, Point2I & delta)

doGuideSnap(const GuiEvent & event, const RectI & selectionBounds, const RectI & selectionBoundsGlobal, Point2I & delta)

doSnapping(const GuiEvent & event, const RectI & selectionBounds, Point2I & delta)

findGuide(guideAxis axis, const Point2I & point, U32 tolerance)

findSnaps(snappingAxis axis, const Point2I & mousePoint, const RectI & minRegion, const RectI & midRegion, const RectI & maxRegion)

getSnapRegion(snappingAxis axis, const Point2I & center)

registerSnap(snappingAxis axis, const Point2I & mousePoint, const Point2I & point, snappingEdges edge, GuiControl * ctrl)

setMouseMode(mouseModes mode)

snapToGrid(Point2I & point)

startDragClone(const Point2I & startPoint)

startDragMove(const Point2I & startPoint)

startDragRectangle(const Point2I & startPoint)

startMouseGuideDrag(guideAxis axis, U32 index, bool lockMouse)

updateSelectedSet()

Protected Static Functions

drawCrossSection(U32 axis, S32 offset, const RectI & bounds, ColorI color, GFXDrawUtil * drawer)

inNut(const Point2I & pt, S32 x, S32 y)

snapDelta(snappingAxis axis, snappingEdges edge, S32 offset, const RectI & bounds, Point2I & delta)

Public Functions

GuiEditCtrl()

addGuide(guideAxis axis, U32 offset)

addNewControl(GuiControl * ctrl)

addSelectControlAt(const Point2I & pos)

addSelectControlsInRegion(const RectI & rect, U32 hitTestFlags)

addSelection(GuiControl * ctrl)

addSelection(S32 id)

bringToFront()

canHitSelectedControls(bool state)

clearGuides(guideAxis axis)

clearSelection()

cloneSelection()

controlInspectPostApply(GuiControl * object)

controlInspectPreApply(GuiControl * object)

DECLARE_CATEGORY("Gui Editor" )

DECLARE_CONOBJECT(GuiEditCtrl )

DECLARE_DESCRIPTION("Implements the framework <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the GUI editor." )

deleteSelection()

drawNut(const Point2I & nut, ColorI & outlineColor, ColorI & nutColor)

drawNuts(RectI & box, ColorI & outlineColor, ColorI & nutColor)

fitIntoParents(bool width, bool height)

getAddSet()

getContentControl()

getCurrentAddSet()

getCursor(GuiCursor *& cursor, bool & showCursor, const GuiEvent & lastGuiEvent)

Reimplemented from: GuiControl

getDragRect(RectI & b)

getMouseMode()

getNumSelected()

getSelected()

getSelectedSet()

getSelectionBounds()

getSelectionGlobalBounds()

getSelectionSize()

getSizingHitKnobs(const Point2I & pt, const RectI & box)

getTrash()

justifySelection(Justification j)

loadSelection(const char * filename)

moveAndSnapSelection(const Point2I & delta, bool callback)

moveSelection(const Point2I & delta, bool callback)

moveSelectionToCtrl(GuiControl * ctrl, bool callback)

onAdd()

Reimplemented from: GuiControl

onKeyDown(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseDown(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseDragged(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseUp(const GuiEvent & event)

Reimplemented from: GuiControl

onPreRender()

Reimplemented from: GuiControl

onRemove()

Reimplemented from: GuiControl

onRender(Point2I offset, const RectI & updateRect)

Reimplemented from: GuiControl

onRightMouseDown(const GuiEvent & event)

Reimplemented from: GuiControl

onSleep()

Reimplemented from: GuiControl

onWake()

Reimplemented from: GuiControl

pushToBack()

readGuides(guideAxis axis, GuiControl * ctrl)

redo()

removeSelection(GuiControl * ctrl)

removeSelection(S32 id)

resizeControlsInSelectionBy(const Point2I & delta, U32 mode)

saveSelection(const char * filename)

select(GuiControl * ctrl)

selectAll()

selectChildren(bool addToSelection)

selectionContains(GuiControl * ctrl)

selectionContainsParentOf(GuiControl * ctrl)

selectParents(bool addToSelection)

setContentControl(GuiControl * ctrl)

setCurrentAddSet(GuiControl * ctrl, bool clearSelection)

setEditMode(bool value)

setSelection(GuiControl * ctrl, bool inclusive)

setSnapToGrid(U32 gridsize)

undo()

writeGuides(guideAxis axis, GuiControl * ctrl)

Public Static Functions

initPersistFields()