Archicad 28 C++ API
Loading...
Searching...
No Matches
Tracking::Tracker Class Reference

Class for managing one specific tracker and its fields. More...

#include <Tracker.hpp>

Inheritance diagram for Tracking::Tracker:

Classes

class  HintGuard
 Helper guard class to specify a hint what to do when the editing of a field needs to be ended and possibly the reason for ending it. More...
 
class  InEditKeyboardHandler
 Class to derive from, when creating custom keyboard handlers for the tracker's edit mode. More...
 
class  RunningModeKeyboardHandler
 Class to derive from, when creating custom keyboard handlers for the tracker's running mode. More...
 

Public Types

enum class  ValueHandlingOnDeactivate { ValueHandlingOnDeactivate::Accept , ValueHandlingOnDeactivate::Reject }
 Determines what to do with the edited field's latest value when the editing of the field needs to end. More...
 
enum class  PositionHandingOnDeactivate { PositionHandingOnDeactivate::KeepAsItIs , PositionHandingOnDeactivate::RemoveFromIdealPosition }
 Determines how to relocate the tracker when the editing of the field needs to be ended. More...
 
typedef GS::ConstForwardIterator< ITrackerItem * > ConstItemIterator
 A constant iterator to read the items of the tracker.
 
typedef GS::ForwardIterator< ITrackerItem * > ItemIterator
 An iterator for accessing the items of the tracker.
 

Public Member Functions

 Tracker ()
 Tracker constructor.
 
void AddItem (ITrackerItem *trackerItem)
 Add an item to the tracker.
 
void SwapItems (ITrackerItem *trackerItem1, ITrackerItem *trackerItem2)
 Swaps the specified items.
 
ConstItemIterator EnumerateAllItems () const
 Provides a constant iterator to read each item of the tracker regardless whether they are visible or not.
 
ItemIterator EnumerateAllItems ()
 Provides an iterator to access each item of the tracker regardless whether they are visible or not.
 
ConstItemIterator EnumerateVisibleItems () const
 Provides a constant iterator to read the visible items of the tracker.
 
ItemIterator EnumerateVisibleItems ()
 Provides an iterator to access the visible items of the tracker.
 
const ITrackerItem * GetSelectedItem () const
 Provides the item for the tracker field that is currently the default one, shown with bold fonts, or is being edited.
 
ITrackerItem * GetSelectedItem ()
 Provides access to change the item that is currently the default field, shown with bold fonts, or is being edited.
 
virtual void Synchronize ()
 Draws the tracker after ensuring that each field's value is consistent based on the input.
 
virtual void RefreshFade ()
 Function for updating the fade animation.
 
DG::NativeRect GetRect (void) const
 Provides the size and position of the tracker.
 
void SetPosition (const DG::NativePoint &point, bool animated=false, short milliSec=-1)
 Repositions the tracker with the possibility of being animated.
 
void MoveToVisiblePosition ()
 Moves the tracker to near to its current location but where it doesn't obstruct anything.
 
void StayInVisiblePosition ()
 Makes tracker stay at the position set by MoveToVisiblePosition.
 
DG::Item * ActivateEditMode ()
 Starts the editing of the currently default tracker field (see GetSelectedItem)
 
void DeactivateEditMode (ValueHandlingOnDeactivate valueHandling, const GS::Optional< const ITrackerItem * > &acceptedItemPtr, PositionHandingOnDeactivate positionHandling)
 Stops the editing of the currently default tracker field (see GetSelectedItem)
 
bool IsInEditMode () const
 Checks if any tracker field value is being edited.
 
bool IsTrackerEditWindowActive () const
 Checks whether the tracker's window is focused.
 
void SetNextActivableItem ()
 Activates the editing of the field following (i.e. the row below) the default or edited one.
 
void SetPrevActivableItem ()
 Activates the editing of the field preceding (i.e. the row above) the default or edited one.
 
bool IsFirstActivableItemActive ()
 Checks whether the first editable field is currently being edited or not.
 
bool IsLastActivableItemActive ()
 Checks whether the last editable field is currently being edited or not.
 
void SetFirstActivableItem ()
 Activates the first editable field (i.e. the topmost editable row)
 
void SetLastActivableItem ()
 Activates the last editable field (i.e. the bottommost editable row)
 
void Hide () override
 Hides the tracker.
 
void Show () override
 Shows the tracker.
 
bool IsVisible () const override
 Checks whether the tracker is visible or not.
 
void SetGlobalOpacity (float opacity)
 Changes the opacity of the entire tracker, with its texts and background as a single unit.
 
void SetShowParameterNames (bool showParameterNames)
 Changes the appearance of the tracker whether to display the name of the fields or not.
 
void SetAllwaysShowParameterNames (bool allwaysShowParameterNames)
 Provides the option to override the value specified by SetShowParameterNames.
 
void SetEditTrackerSizePreference (bool isEditTrackerMinimizedParam)
 Changes the behavior of the tracker whether to automatically expand and show every field each time a field is started to be edited.
 
Gfx::Color GetForegroundColor ()
 Retrieves the color of texts and icons.
 
Gfx::Color GetBackgroundColor ()
 Retrieves the background color (i.e. the fill behind texts and icons)
 
Gfx::Color GetFrameColor ()
 Retrieves the tracker's frame color.
 
bool GetDrawFrame ()
 Retrieves whether the tracker's frame is shown.
 
void SetCustomBackgroundColor (const Gfx::Color &color)
 Changes the background color (i.e. the fill behind texts and icons)
 
void SetCustomForeGroundColor (const Gfx::Color &color)
 Changes the color of texts and icons.
 
void SetCustomFrameColor (const Gfx::Color &color)
 Changes the frame color.
 
void SetCustomDrawFrame (bool drawFrameToSet)
 Changes whether to show the tracker's frame.
 
bool IsDecimalSeparator (const DG::Key::Code &code) const
 Checks whether a keyboard code is for the decimal separator.
 
void SetInEditKeyboardHandler (GS::Owner< InEditKeyboardHandler > handler)
 Sets a keyboard handler to use in edit mode.
 
void SetRunningModeKeyboardHandler (GS::Owner< RunningModeKeyboardHandler > handler)
 Sets a keyboard handler to use in running mode.
 

Static Public Member Functions

static void SetForegroundColor (const Gfx::Color &foregroundColorToSet)
 Changes the color of texts and icons globally for all trackers.
 
static void SetBackgroundColor (const Gfx::Color &backgroundColorToSet)
 Changes the background color (i.e. the fill behind texts and icons) globally for all trackers.
 
static void SetFrameColor (const Gfx::Color &frameColorToSet)
 Changes the frame color globally for all trackers.
 
static Gfx::Color GetDefaultForegroundColor ()
 Retrieves the color of texts and icons used globally by all trackers.
 
static Gfx::Color GetDefaultBackgroundColor ()
 Retrieves the background color (i.e. the fill behind texts and icons) used globally by all trackers.
 
static Gfx::Color GetDefaultFrameColor ()
 Retrieves the frame color used globally by all trackers.
 
static void SetOpacity (float opacityToSet)
 Changes the opacity of the background (i.e. the fill behind texts and icons) for all trackers, globally.
 
static void SetDrawFrame (bool drawFrameToSet)
 Changes whether to show the tracker's frame globally for all trackers.
 
static void SetSmallFont (bool smallFontToSet)
 Changes whether the tracker rows should be display more compactly, globally for all trackers.
 
static float GetOpacity ()
 Retrieves the tracker's opacity.
 
static bool GetSmallFont ()
 Retrieves whether tracker rows are displayed more compactly.
 
static short ReadTrackerTimesPref (const GS::UniString &name, Int32 defaultValue)
 Utility function for retrieving tracker animation durations stored in the system preferences (i.e the registry on Windows)
 

Protected Member Functions

void ShowReturnToRunningModeButton (bool show)
 Provides the option to force hiding the Mark Position button for each field of the tracker.
 
void RefreshSize ()
 Updates the size of the entire tracker based on its content such as fields, icons, etc.
 

Friends

class TrackerItemBase
 
class ITrackerItem
 

Detailed Description

Class for managing one specific tracker and its fields.