Sign in Join
FPDoc Onlineexperiment

TCalculatorDialog class

In unit ExtDlgs

Implements a pop-up calculator dialog used to perform simple calculations and return the value.

Declaration

pascal
TCalculatorDialog = class(TExtCommonDialog)

Inheritance

  1. TCalculatorDialog
  2. TExtCommonDialog
  3. TCommonDialog
  4. TLCLComponent
  5. TComponent
  6. TPersistent
  7. TObject

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

CalcDisplaypublicCalcDisplay - the current numeric value in the main calculator display.
MemorypublicMemory - the value stored in the calculator's memory.
BeepOnErrorpublishedBeepOnError - if True, beeps when there is an entry error or other calculator error.
CalculatorLayoutpublishedCalculatorLayout - whether simple or normal.
PrecisionpublishedPrecision - the level of precision to be used in calculations; default is set by DefCalcPrecision.
TitlepublishedThe Title or Caption displayed for the dialog.
ValuepublishedValue - the numeric value (result) returned by the calculator.
DialogScalepublishedScaling percentage applied to the calculator dialog form.
ColorBtnDigitspublishedColor for the digit buttons displayed in the calculator dialog.
ColorBtnMemorypublishedColor for the Memory button displayed in the calculator dialog.
ColorBtnOkpublishedColor for the OK button displayed in the calculator dialog.
ColorBtnCancelpublishedColor for the Cancel button displayed in the calculator dialog.
ColorBtnClearpublishedColor for the Clear button displayed in the calculator dialog.
ColorBtnOtherspublishedColor for other buttons displayed in the calculator dialog.
ColorDisplayTextpublishedColor for text displayed in the calculator dialog.
ColorDisplayBackpublishedColor for background in the display area for the calculator dialog.

Methods

WSRegisterClassprotectedRegisters this component class with the current WidgetSet.
OnDialogCloseprotectedImplements the event handler signalled when the dialog is closed.
OnDialogShowprotected
OnDialogCloseQueryprotected
ChangeprotectedChange - software emulator for the OnChange event ???
CalcKeyprotectedImplements the event handler signalled to process keys in the dialog.
DefaultTitleprotectedGets the default value used in the Title property for the calculator dialog.
DisplayChangeprotectedImplements the event handler signalled when the calculator display has been changed on the dialog form.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
ExecutepublicCreates, configures, and displays the form for the calculator dialog.

Events

OnCalcKeypublishedOnCalcKey - event handler for a key press in the calculator.
OnChangepublishedOnChange - event handler for any change in the calculator.
OnDisplayChangepublishedOnDisplayChange - 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.