GuiEditCtrl
Engine/source/gui/editor/guiEditCtrl.h
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 { GuideVertical GuideHorizontal }
Justification { JUSTIFY_LEFT JUSTIFY_CENTER_VERTICAL JUSTIFY_RIGHT JUSTIFY_TOP JUSTIFY_BOTTOM SPACING_VERTICAL SPACING_HORIZONTAL JUSTIFY_CENTER_HORIZONTAL }
mouseModes { Selecting MovingSelection SizingSelection DragSelecting DragGuide DragClone }
sizingModes { sizingNone = 0 sizingLeft = 1 sizingRight = 2 sizingTop = 4 sizingBottom = 8 }
snappingAxis { SnapVertical SnapHorizontal }
snappingEdges { SnapEdgeMin SnapEdgeMid SnapEdgeMax }
Parent
Protected Types
_Anonymous_ { NUT_SIZE = 4 MIN_GRID_SIZE = 3 }
GuiControlPtr
Vector< GuiControl * >
GuiControlVector
Public Friends
class
Protected Attributes
GFXVertexBufferHandle< GFXVertexPCT >
bool
bool
mDragGuide [2]
mDragGuideIndex [2]
Indices of the guide's being dragged in DragGuide mouse mode.
bool
bool
bool
bool
mSnapEdge [2]
Identification of edge being snapped for each axis.
mSnapHits [2]
Hit testing lists for each axis.
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.
Snap distance in pixels.
mSnapTargets [2]
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
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)
Protected Static Functions
Public Functions
addNewControl(GuiControl * ctrl)
addSelectControlAt(const Point2I & pos)
addSelectControlsInRegion(const RectI & rect, U32 hitTestFlags)
addSelection(GuiControl * ctrl)
addSelection(S32 id)
canHitSelectedControls(bool state)
clearGuides(guideAxis axis)
controlInspectPostApply(GuiControl * object)
controlInspectPreApply(GuiControl * object)
DECLARE_CATEGORY("Gui Editor" )
DECLARE_DESCRIPTION("Implements the framework <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the GUI editor." )
fitIntoParents(bool width, bool height)
getDragRect(RectI & b)
const Vector< GuiControl * > &
SimSet *
loadSelection(const char * filename)
moveAndSnapSelection(const Point2I & delta, bool callback)
moveSelection(const Point2I & delta, bool callback)
moveSelectionToCtrl(GuiControl * ctrl, bool callback)
bool
onAdd()
Called when this object is added to the scene.
onMouseDown(const GuiEvent & event)
onMouseDragged(const GuiEvent & event)
Do special pre-render processing.
onRightMouseDown(const GuiEvent & event)
bool
onWake()
Called when this object is asked to wake up returns true if it's actually awake at the end.
readGuides(guideAxis axis, GuiControl * ctrl)
removeSelection(GuiControl * ctrl)
removeSelection(S32 id)
resizeControlsInSelectionBy(const Point2I & delta, U32 mode)
saveSelection(const char * filename)
select(GuiControl * ctrl)
selectChildren(bool addToSelection)
bool
selectionContains(GuiControl * ctrl)
bool
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)
writeGuides(guideAxis axis, GuiControl * ctrl)
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)