TCalculatorDialog class
Implements a pop-up calculator dialog used to perform simple calculations and return the value.
Declaration
TCalculatorDialog = class(TExtCommonDialog)Inheritance
Description
TCalculatorDialog is a
TExtCommonDialog descendant
which implements a pop-up calculator dialog used to perform calculations and
return the result in the Value property. Value uses the Double type, and can
be represented using the number of digits in the Precision property.
TCalculatorDialog uses a TCalculatorForm instance in the DlgForm property which includes separate panels to display the input value, numeric keys, labels, and other buttons on the dialog form. A CalculatorLayout property allows use of a detailed or a simplified view on the form. Properties are provided to set the colors used for components on DlgForm, including:
- ColorBtnDigits
- ColorBtnMemory
- ColorBtnOk
- ColorBtnCancel
- ColorBtnClear
- ColorBtnOthers
- ColorDisplayText
- ColorDisplayBack
Use the Memory property to store or retrieve a value for the calculator dialog.
See also
Properties
CalcDisplay | public | CalcDisplay - the current numeric value in the main calculator display. |
Memory | public | Memory - the value stored in the calculator's memory. |
BeepOnError | published | BeepOnError - if True, beeps when there is an entry error or other calculator error. |
CalculatorLayout | published | CalculatorLayout - whether simple or normal. |
Precision | published | Precision - the level of precision to be used in calculations; default is set by DefCalcPrecision. |
Title | published | The Title or Caption displayed for the dialog. |
Value | published | Value - the numeric value (result) returned by the calculator. |
DialogScale | published | Scaling percentage applied to the calculator dialog form. |
ColorBtnDigits | published | Color for the digit buttons displayed in the calculator dialog. |
ColorBtnMemory | published | Color for the Memory button displayed in the calculator dialog. |
ColorBtnOk | published | Color for the OK button displayed in the calculator dialog. |
ColorBtnCancel | published | Color for the Cancel button displayed in the calculator dialog. |
ColorBtnClear | published | Color for the Clear button displayed in the calculator dialog. |
ColorBtnOthers | published | Color for other buttons displayed in the calculator dialog. |
ColorDisplayText | published | Color for text displayed in the calculator dialog. |
ColorDisplayBack | published | Color for background in the display area for the calculator dialog. |
Methods
WSRegisterClass | protected | Registers this component class with the current WidgetSet. |
OnDialogClose | protected | Implements the event handler signalled when the dialog is closed. |
OnDialogShow | protected | |
OnDialogCloseQuery | protected | |
Change | protected | Change - software emulator for the OnChange event ??? |
CalcKey | protected | Implements the event handler signalled to process keys in the dialog. |
DefaultTitle | protected | Gets the default value used in the Title property for the calculator dialog. |
DisplayChange | protected | Implements the event handler signalled when the calculator display has been changed on the dialog form. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
Execute | public | Creates, configures, and displays the form for the calculator dialog. |
Events
OnCalcKey | published | OnCalcKey - event handler for a key press in the calculator. |
OnChange | published | OnChange - event handler for any change in the calculator. |
OnDisplayChange | published | OnDisplayChange - event handler for any change in the calculator display. |
Inherited
From TExtCommonDialog (10)
DialogPosition DlgForm GetHeight GetLeft GetTop GetWidth Left SetLeft SetTop Top
From TCommonDialog (19)
AttachTo Close DoCanClose DoClose DoExecute DoShow Handle HandleAllocated Height HelpContext OnCanClose OnClose OnDialogResult OnShow ResetShowCloseFlags SetHeight SetWidth UserChoice Width
From TLCLComponent (7)
DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance RemoveAllHandlersOfObject WidgetSetClass
From TComponent (74)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (36)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
