class PFloatEditBox: public PNumberEditBox

A text editing box that only allows numbers to be entered

Inheritance:


Public Fields

[more]double minimum
Minimum value possible for edit box.

Public Methods

[more] PFloatEditBox ( PInteractor * parent, double min = -FLT_MAX, double max = FLT_MAX, double val = 0, double ndg = 1, unsigned decs = 0 )
Create a number edit box for decimal values with the parameters specified, validation to assure the user does not enter values outside the range specified.
[more] PFloatEditBox ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, double * valuePtr )
Create control from interactor layout with the specified control ID.
[more]virtual ~PFloatEditBox ()
Destroy the number edit box.
[more]void SetValue ( double val )
Set the value of the number edit box control.
[more]double GetValue () const
Get the current contents of the number edit box control as entered by the user, or set via the SetValue() function.
[more]double* GetValuePointer () const
Get the current value pointer associated with the control.
[more]void SetValuePointer ( double * ptr )
Set the current value pointer associated with the control.
[more]void SetMaximum ( double val )
Set the maximum value that may be entered in the number edit box.
[more]double GetMaximum ()
Get the maximum value that may be entered in the number edit box.
[more]void SetMinimum ( double val )
Set the minimum value that may be entered in the number edit box.
[more]double GetMinimum ()
Get the minimum value that may be entered in the number edit box.
[more]void SetNudge ( double val )
Set the nudge value that will be used by the nudge buttons in the number edit box.
[more]double GetNudge ()
Get the nudge value that will be used by the nudge buttons in the number edit box.
[more]void SetDecimals ( unsigned decs )
Set the number decimals that will be displayed in the number edit box.
[more]unsigned GetDecimals ()
Get the number decimals that will be displayed in the number edit box.
[more]virtual BOOL OnEndInput ()
The system calls this whenever the system wishes to change focus to another interactor in the same layout or titled window.
[more]virtual void TransferValue ( int option )
This function transfers the value of the control to or from the variable pointed to by the value pointer member variable.
[more]virtual void AddNudge ()
Add the nudge value to the edit box value.

Public

[more] New functions for class

Protected Fields

[more]double maximum
Minimum value possible for edit box.
[more]double nudge
Amount to change the value with the nudge buttons.
[more]unsigned decimals
Number of decimals for display.

Protected Methods

[more]virtual void OnKeyInput ( const PString & str )
The system calls this whenever a keyboard key was pressed and this interactor had the focus.
[more]virtual void SubtractNudge ()
Subtract the nudge value to the edit box value.

Protected

[more] Overrides from class PInteractor
[more] Overrides from class PControl
[more] Overrides from class PNumberClass
[more] Member variables


Inherited from PNumberEditBox:


Inherited from PEditBox:

Public Methods

ovirtual void SetText( const PString & str )
oPString GetText() const
ovoid SetMaxText( PINDEX max )
oPINDEX GetLength() const
oBOOL IsModified() const
ovoid SetSelection( PINDEX start = 0, PINDEX finish = P_MAX_INDEX )
oBOOL GetSelection( PINDEX * start = NULL, PINDEX * finish = NULL ) const
ovoid ReplaceSelection( const PString & text, BOOL canUndo = TRUE )
oBOOL CanUndo() const
ovoid Undo()
ovoid Cut()
ovoid Copy() const
ovoid Paste()
ovoid Clear()

Public

PNotifier codes

o Notification codes sent to the callback function.


Inherited from PControl:

Public Fields

oPRESOURCE_ID controlID

Public Methods

ovirtual PBalloon* OnBalloonHelp()
ovirtual BOOL IsTabStop() const
oPRESOURCE_ID GetControlID() const
ovoid SetControlID( PRESOURCE_ID theID )
oconst PNotifier& GetNotifier() const
oBOOL WillNotifyOnStateUpdate() const
ovoid SetNotifier( const PNotifier & func, BOOL notifyForStateUpdate = FALSE )
oconst PString& GetBalloonHelp() const
ovoid SetBalloonHelp( const PString & text )
ovirtual void DefaultDimensions()
ovirtual void UpdateMyCommandSources()

Public

o Codes passed to the notification function on changes of state.

Protected Fields

oPNotifier callback
ovoid* valuePointer
oBOOL notifyForStateUpdate
oPString balloonHelpText


Inherited from PInteractor:

Public Classes

oenum PositionOrigin
oenum CoordinateSystem
oenum AutoAdjustType

Public Fields

oPCursor cursor

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
oPInteractor* GetParent() const
oBOOL IsChild( PInteractor * parent ) const
oPINDEX GetNumChildren()
oPInteractor& operator[]( PINDEX index )
ovirtual void UpdateCommandSources()
ovirtual void SetFont( const PFont & newFont, BOOL toChildren = TRUE )
oconst PRealFont& GetFont()
oPDIMENSION ToPixelsDX( PDIMENSION x ) const
oPDIMENSION ToPixelsDY( PDIMENSION y ) const
oPORDINATE ToPixelsX( PORDINATE x ) const
oPORDINATE ToPixelsY( PORDINATE y ) const
oPDim ToPixels( const PDim & dim ) const
oPPoint ToPixels( const PPoint & pt ) const
oPRect ToPixels( const PRect & r ) const
oPDIMENSION FromPixelsDX( PDIMENSION x ) const
oPDIMENSION FromPixelsDY( PDIMENSION y ) const
oPORDINATE FromPixelsX( PORDINATE x ) const
oPORDINATE FromPixelsY( PORDINATE y ) const
oPDim FromPixels( const PDim & dim ) const
oPPoint FromPixels( const PPoint & pt ) const
oPRect FromPixels( const PRect & r ) const
ovoid SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin = TopLeftParent, PositionOrigin yOrigin = TopLeftParent )
oPPoint GetPosition( CoordinateSystem coords ) const
oPPoint ToScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
oPPoint FromScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
ovoid SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
oPDim GetDimensions( CoordinateSystem coords ) const
oPRect GetStructureBounds( CoordinateSystem coords ) const
ovirtual PRect GetDrawingBounds( CoordinateSystem coords ) const
ovoid AutoAdjustBounds( PRect & bounds, AutoAdjustType type = AdjustBounds )
oBOOL ContainsPoint( const PPoint & pt, CoordinateSystem coords ) const
oPInteractor* FindInteractor( const PPoint & pt, CoordinateSystem coords ) const
ovirtual void Enable( BOOL enabled = TRUE )
ovoid Disable()
oBOOL IsEnabled() const
ovirtual void ShowAll()
ovirtual void Show( BOOL visible = TRUE )
ovoid Hide()
oBOOL IsVisible() const
ovirtual void BringToTop()
ovirtual BOOL IsOnTop() const
ovoid Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Update()
ovoid GrabMouse()
ovoid ReleaseMouse()
oBOOL HasMouse() const
ovoid GrabFocus()
oBOOL HasFocus() const
ovirtual void SetCursor( const PCursor & newCursor )
oPCursor GetCursor() const
ovoid SetCursorToParent( BOOL useParent = TRUE )
ovoid SetAllCursors( const PCursor & newCursor )
ovoid RestoreAllCursors()
ovoid SetWaitCursor()
ovoid SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCursorPos( CoordinateSystem coords ) const
ovirtual void ShowCursor( BOOL show = TRUE )
ovoid HideCursor()
ovoid SetCaret( const PCaret & newCaret )
oPCaret GetCaret() const
ovoid SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCaretPos( CoordinateSystem coords ) const
ovirtual void ShowCaret(BOOL show = TRUE)
ovoid HideCaret()
ovirtual void SetForegroundColour( const PColour & newColour )
oconst PColour& GetForegroundColour() const
ovirtual void SetBackgroundColour( const PColour & newColour )
oconst PColour& GetBackgroundColour() const
oPDim GetBorderSize() const
oconst PColour& GetBorderColour() const
oPCanvas* StartMouseTrack( BOOL wantsCanvas = FALSE )
ovirtual void OnMouseMove( PKeyCode button, const PPoint & where )
ovirtual void OnMouseDown( PKeyCode button, const PPoint & where, BOOL doubleClick )
ovirtual void OnMouseUp( PKeyCode button, const PPoint & where )
ovirtual BOOL OnKeyDown( PKeyCode key, unsigned repeat )
ovirtual void OnKeyUp( PKeyCode key )
ovirtual void OnGainFocus()
ovirtual void OnLostFocus()
ovirtual void OnStartInput()
ovirtual void OnRedraw( PCanvas & canvas )
ovirtual void OnControlNotify( PControl & control, int option )
ovirtual void OnSelectHelp()
ovirtual void OnMouseTrack( PCanvas * canvas, const PPoint & where, BOOL lastTrack )
ovirtual void _SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin, PositionOrigin yOrigin )

Public

Overrides from class PObject

System callback functions.

Protected Fields

oPApplication* owner
oPInteractor* parent
oPInteractorList children
oPRealFont font
oPCursor savedCursor
oPCaret caret
oPPoint caretPosition
oint caretVisible
oPColour foregroundColour
oPColour backgroundColour
oPInteractor* mouseTrackInteractor
oPInteractorCanvas* mouseTrackCanvas

Protected Methods

ovirtual void _SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void _SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void SetFocusInteractor( PInteractor * interactor )
ovirtual PInteractor* GetFocusInteractor() const

Protected

o Flag to indicate that the parent interactor layouts cursor should be used with this interactor.


Documentation

A text editing box that only allows numbers to be entered
o PFloatEditBox( PInteractor * parent, double min = -FLT_MAX, double max = FLT_MAX, double val = 0, double ndg = 1, unsigned decs = 0 )
Create a number edit box for decimal values with the parameters specified, validation to assure the user does not enter values outside the range specified.
Parameters:
parent - Interactor into which the control is placed.
min - Minimum value allowed for entry.
max - Maximum value allowed for entry.
val - Initial value for editing.
ndg - Amount to change via the nudge buttons.
decs - Number of decimals to display number in.

o PFloatEditBox( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, double * valuePtr )
Create control from interactor layout with the specified control ID.
Parameters:
parent - Interactor into which the box is placed.
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the editor value.

ovirtual ~PFloatEditBox()
Destroy the number edit box.

o New functions for class

ovoid SetValue( double val )
Set the value of the number edit box control. This will be updated on the screen immediately (within OS constraints).
Parameters:
val - New value for edit box.

odouble GetValue() const
Get the current contents of the number edit box control as entered by the user, or set via the SetValue() function.

Returns:
floating point for the current contents of the edit box.

odouble* GetValuePointer() const
Get the current value pointer associated with the control. The variable pointed to by this is autamatically updated with the current value of the edit box.

Returns:
value pointer associated with the control.

ovoid SetValuePointer( double * ptr )
Set the current value pointer associated with the control. The variable pointed to by this is autamatically updated with the current value of the edit box.
Parameters:
ptr - New value pointer to associate with the control.

ovoid SetMaximum( double val )
Set the maximum value that may be entered in the number edit box.
Parameters:
val - New maximum value for edit box.

odouble GetMaximum()
Get the maximum value that may be entered in the number edit box.

Returns:
floating point maximum value.

ovoid SetMinimum( double val )
Set the minimum value that may be entered in the number edit box.
Parameters:
val - New minimum value for the edit box.

odouble GetMinimum()
Get the minimum value that may be entered in the number edit box.

Returns:
floating point minimum value.

ovoid SetNudge( double val )
Set the nudge value that will be used by the nudge buttons in the number edit box.
Parameters:
val - New nudge amount for the edit box nudge buttons.

odouble GetNudge()
Get the nudge value that will be used by the nudge buttons in the number edit box.

Returns:
floating point minimum value.

ovoid SetDecimals( unsigned decs )
Set the number decimals that will be displayed in the number edit box.

The user may enter in more decimals than specified and they will be converted, but when a new value is displayed via SetValue() call or via using the nudge buttons, only this number of decimals will be displayed.

Parameters:
decs - New number of decimals for number display in edit box.

ounsigned GetDecimals()
Get the number decimals that will be displayed in the number edit box.

The user may enter in more decimals than specified and they will be converted, but when a new value is displayed via SetValue() call or via using the nudge buttons, only this number of decimals will be displayed.

Returns:
number of decimals

o Overrides from class PInteractor

ovirtual BOOL OnEndInput()
The system calls this whenever the system wishes to change focus to another interactor in the same layout or titled window.

Returns:
TRUE to allow the change and FALSE to cause the change not to occur and the focus restored to the control.

ovirtual void OnKeyInput( const PString & str )
The system calls this whenever a keyboard key was pressed and this interactor had the focus. The string is the translated ANSI/UNICODE representation of the key combination.
Parameters:
str - String representation of the key pressed.

o Overrides from class PControl

ovirtual void TransferValue( int option )
This function transfers the value of the control to or from the variable pointed to by the value pointer member variable.
Parameters:
option - Transfer value option. When this is -1 when the function transfers the value from the value pointer into the control. This is called in PDialog::OnInit() function. When option is zero then the function transfers the value from the control to the value pointer variable. This is called just before the callback function every time the edit box value changes.

o Overrides from class PNumberClass

ovirtual void AddNudge()
Add the nudge value to the edit box value.

ovirtual void SubtractNudge()
Subtract the nudge value to the edit box value.

o Member variables

odouble minimum
Minimum value possible for edit box.

odouble maximum
Minimum value possible for edit box.

odouble nudge
Amount to change the value with the nudge buttons.

ounsigned decimals
Number of decimals for display.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.