TABLE OF CONTENTS
- 1. Widgets/TEntry
- 1.1. TEntry/SpinBox
- 1.1.1. SpinBox/SpinBox.Tk_SpinBox
- 1.1.2. SpinBox/SpinBox.Create_(function)
- 1.1.3. SpinBox/SpinBox.Create_(procedure)
- 1.1.4. SpinBox/SpinBox.Get_Widget
- 1.1.5. SpinBox/SpinBox.Identify
- 1.1.6. SpinBox/SpinBox.Invoke
- 1.1.7. SpinBox/SpinBox.Selection_Element_(function)
- 1.1.8. SpinBox/SpinBox.Selection_Element_(procedure)
- 1.1.9. SpinBox/SpinBox.Set_(function)
- 1.1.10. SpinBox/SpinBox.Set_(procedure)
- 1.2. TEntry/TEntry.Tk_Entry
- 1.3. TEntry/TEntry.BBox
- 1.4. TEntry/TEntry.Create_(function)
- 1.5. TEntry/TEntry.Create_(procedure)
- 1.6. TEntry/TEntry.Delete
- 1.7. TEntry/TEntry.Entry_Index
- 1.8. TEntry/TEntry.Get
- 1.9. TEntry/TEntry.Get_Widget
- 1.10. TEntry/TEntry.ICursor
- 1.11. TEntry/TEntry.Insert
- 1.12. TEntry/TEntry.Scan_DragTo
- 1.13. TEntry/TEntry.Scan_Mark
- 1.14. TEntry/TEntry.Selection_Adjust
- 1.15. TEntry/TEntry.Selection_Clear
- 1.16. TEntry/TEntry.Selection_From
- 1.17. TEntry/TEntry.Selection_Present
- 1.18. TEntry/TEntry.Selection_Range
- 1.19. TEntry/TEntry.Selection_To
- 1.20. TEntry/TEntry.Validate
- 1.21. TEntry/TEntry.XView_(function)
- 1.22. TEntry/TEntry.XView_(procedure)
- 1.23. TEntry/TEntry.Xview_Move_To
- 1.24. TEntry/TEntry.Xview_Scroll
Widgets/TEntry [ Packages ]
[ Top ] [ Widgets ] [ Packages ]
FUNCTION
Provides code for manipulate Tk widget Entry
SOURCE
package Tcl.Tk.Ada.Widgets.TEntry with SPARK_Mode is pragma Elaborate_Body;
TEntry/TEntry.Tk_Entry [ Types ]
FUNCTION
This is a non-abstract type derived directly from Tk_Widget. Each of the derived widgets redefines the Create subprogram in order to create the correct type of widget.
SOURCE
type Tk_Entry is new Tk_Widget with private;
TEntry/TEntry.BBox [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Get size of bounding box of the selected character in the selected Tk_Entry
SOURCE
function BBox (TextEntry: in Tk_Entry'Class; Index: in String) return String with Pre => Index /= "";
PARAMETERS
EntryWidget - Tk_Entry which will be queried Index - Index of the character which bounding box will be taken
RESULT
Four values: x1, y1 - coordinates of starting point of bounding box from top left, x2, y2 - coordinates of ending point from bottom right of bounding box.
EXAMPLE
-- Get the bounding box of the whole My_Entry entry Coords: constant String := BBox(My_Entry, "all");
COMMANDS
TextEntry bbox index
HISTORY
8.6.5 - Added
TEntry/TEntry.Create_(function) [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
SOURCE
overriding function Create (pathName: in String; options: in String := ""; Interp: in Tcl_Interp := Null_Interp) return Tk_Entry with Global => null;
PARAMETERS
pathName - Tk path (starts with dot) for the widget options - Options which will be passed to the widget. Default value is empty Interp - Tcl interpreter to which the widget will be created. If null, the widget will be created in the "contextual" interpreter. Default value is null.
RESULT
Newly created Tk_Entry
EXAMPLE
-- Create a new tentry with pathname .myentry and width of 10 characters My_Entry: constant Tk_Entry := Create(".myentry", "-width 10");
SEE ALSO
TEntry.Create_(procedure)
COMMANDS
entry pathName ?options?
HISTORY
8.6.1 - Moved from Tcl.Tk.Ada.Widgets
TEntry/TEntry.Create_(procedure) [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
SOURCE
overriding procedure Create (Widgt: out Tk_Entry; pathName: in String; options: in String := ""; Interp: in Tcl_Interp := Null_Interp) with Global => null;
PARAMETERS
Widgt - Tk_Entry which will be created pathName - Tk path (starts with dot) for the widget options - Options which will be passed to the widget. Default value is empty Interp - Tcl interpreter to which the widget will be created. If null, the widget will be created in the "contextual" interpreter. Default value is null.
OUTPUT
Newly created Tk_Entry as parameter Widgt
EXAMPLE
-- Create tentry My_Entry with pathname .myentry and state readonly on the current Tcl interpreter declare My_Entry: Tk_Entry; begin Create(My_Entry, ".myentry", "-state readonly"); end;
SEE ALSO
TEntry.Create_(function)
COMMANDS
entry pathName ?options?
HISTORY
8.6.1 - Moved from Tcl.Tk.Ada.Widgets
TEntry/TEntry.Delete [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Delete part of text from the selected entry
SOURCE
procedure Delete (TextEntry: in Tk_Entry'Class; FirstIndex: in String; LastIndex: in String := "") with Pre => FirstIndex /= "";
PARAMETERS
TextEntry - Tk_Entry in which text will be deleted FirstIndex - Index of text from which delete will start. Index starts from 0 LastIndex - End index to which text will be deleted. If empty, delete only one character. Default is empty.
EXAMPLE
-- Delete second character from My_Entry entry Delete(My_Entry, "1");
COMMANDS
TextEntry delete first ?last?
HISTORY
8.6.2 - Added
TEntry/TEntry.Entry_Index [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Get numerical index of character from the selected Index
SOURCE
function Entry_Index (TextEntry: in Tk_Entry'Class; Index: in String) return String with Pre => Index /= "";
PARAMETERS
TextEntry - Tk_Entry which will be queried for index Index - Index of character which numeric index will be taken
RESULT
Numerical index of the selected character
EXAMPLE
-- Get the numerical index of the last character in My_Entry entry Index: constant String := Entry_Index(My_Entry, "end");
COMMANDS
TextEntry index index
HISTORY
8.6.5 - Added
TEntry/TEntry.Get [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Get entry's text.
SOURCE
function Get(Widgt: in Tk_Entry'Class) return String;
PARAMETERS
Widgt - Tk_Entry from which text will be taken
RESULT
Returns the entry's string.
EXAMPLE
-- Get the text of My_Entry entry Text: constant String := Get(My_Entry);
COMMANDS
Widgt get
HISTORY
8.6.1 - Moved from Tcl.Tk.Ada.Widgets
TEntry/TEntry.Get_Widget [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Get the existing Tk_Entry widget
SOURCE
overriding function Get_Widget (pathName: in String; Interp: in Tcl_Interp := Get_Context) return Tk_Entry with Global => null;
PARAMETERS
pathName - Tk path (starts with dot) for the widget Interp - Tcl interpreter on which the widget exists. Can be empty. Default value is current Tcl interpreter
RESULT
Existing Tk_Entry widget
EXAMPLE
-- Get entry widget with name .myentry on the current Tcl interpreter My_Entry: constant Tk_Entry := Get_Widget(".myentry");
HISTORY
8.6.9 - Added
TEntry/TEntry.ICursor [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Place insertion cursor in the selected Tk_Entry just before the selected character
SOURCE
procedure ICursor(TextEntry: in Tk_Entry'Class; Index: in String) with Pre => Index /= "";
PARAMETERS
TextEntry - Tk_Entry in which insertion cursor will be placed Index - Index of the character before which insertion cursor will be placed
EXAMPLE
-- Place the insertion cursor in My_Entry entry at start ICursor(My_Entry, "0");
COMMANDS
TextEntry icursor index
HISTORY
8.6.5 - Added
TEntry/TEntry.Insert [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Insert text at selected index to the selected Tk_Entry
SOURCE
procedure Insert (TextEntry: in Tk_Entry'Class; Index: in String; Text: in String) with Pre => Index /= "" and Text /= "";
PARAMETERS
TextEntry - Tk_Entry to which text will be inserted Index - Index in which position text will be inserted Text - Text to insert
EXAMPLE
-- Insert hello world text at the end of the My_Entry entry current text Insert(My_Entry, "end", "{hello world}");
COMMANDS
TextEntry insert index text
HISTORY
8.6.2 - Added
TEntry/TEntry.Scan_DragTo [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Computes the difference between its X argument and the X argument to the last Scan_Mark procedure for the Tk_Entry. It then adjusts the view by 10 times the difference in coordinates.
SOURCE
procedure Scan_DragTo(TextEntry: in Tk_Entry'Class; X: in String) with Pre => X /= "";
PARAMETERS
TextEntry - Tk_Entry in which difference will be computed X - X coordinate which difference will be computed
EXAMPLE
-- Drag view of My_Entry entry to X coordinate 24 Scan_DragTo(My_Entry, "24");
COMMANDS
TextEntry scan dragto x
HISTORY
8.6.5 - Added
TEntry/TEntry.Scan_Mark [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Sets starting position for scan in the selected Tk_Entry
SOURCE
procedure Scan_Mark(TextEntry: in Tk_Entry'Class; X: in String) with Pre => X /= "";
PARAMETERS
TextEntry - Tk_Entry in which mark will be set X - X coordinate of the mark to set
EXAMPLE
-- Set the starting position for scan in My_Entry entry to X coordinate 18 Scan_Mark(My_Entry, "18");
COMMANDS
TextEntry scan mark x
HISTORY
8.6.5 - Added
TEntry/TEntry.Selection_Adjust [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Add characters to the Tk_Entry selection. If nothing is selected, create a new selection from the beginning to the selected by Index character
SOURCE
procedure Selection_Adjust (TextEntry: in Tk_Entry'Class; Index: in String) with Pre => Index /= "";
PARAMETERS
TextEntry - Tk_Entry in which selection will be adjusted Index - Index of character to set as the last in the selection
EXAMPLE
-- Add second character in My_Entry entry to the selection Selection_Adjust(My_Entry, "1");
COMMANDS
TextEntry selection adjust index
HISTORY
8.6.5 - Added
TEntry/TEntry.Selection_Clear [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Remove the selection from the selected Tk_Entry
SOURCE
procedure Selection_Clear(TextEntry: in Tk_Entry'Class);
PARAMETERS
TextEntry - Tk_Entry in which the selection will be cleared
EXAMPLE
-- Remove the selection from My_Entry entry Selection_Clear(My_Entry);
COMMANDS
TextEntry selection clear
HISTORY
8.6.5 - Added
TEntry/TEntry.Selection_From [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Set the selection anchor at the selected character in the selected Tk_Entry. Does not change the selection
SOURCE
procedure Selection_From (TextEntry: in Tk_Entry'Class; Index: in String) with Pre => Index /= "";
PARAMETERS
TextEntry - Tk_Entry in which the selection anchor will be set Index - Index of the character before which the selection anchor will be set
EXAMPLE
-- Set the selection anchor to the 10th character in My_Entry entry Selection_From(My_Entry, "9");
COMMANDS
TextEntry selection from index
HISTORY
8.6.5 - Added
TEntry/TEntry.Selection_Present [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Check if any character is selected in the selected Tk_Entry
SOURCE
function Selection_Present(TextEntry: in Tk_Entry'Class) return String;
PARAMETERS
TextEntry - Tk_Entry which will be queried for the selection
RESULT
"1" if any character in TextEntry is selected, otherwise "0"
EXAMPLE
-- Check if any character is selected in My_Entry entry Is_Selected: constant String := Selection_Present(My_Entry);
COMMANDS
TextEntry selection present
HISTORY
8.6.5 - Added
TEntry/TEntry.Selection_Range [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Set the characters selection in the selected Tk_Entry
SOURCE
procedure Selection_Range (TextEntry: in Tk_Entry'Class; StartIndex, EndIndex: in String) with Pre => StartIndex /= "" and EndIndex /= "";
PARAMETERS
TextEntry - Tk_Entry in which the selection will be set StartIndex - Start index of character of the selection EndIndex - End index of character of the selection
EXAMPLE
-- Set the selection in My_Entry entry from first character to 5th Selection_Range(My_Entry, "0", "4");
COMMANDS
TextEntry selection range startindex endindex
HISTORY
8.6.5 - Added
TEntry/TEntry.Selection_To [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Set selection in the selected Tk_Entry
SOURCE
procedure Selection_To(TextEntry: in Tk_Entry'Class; Index: in String) with Pre => Index /= "";
PARAMETERS
TextEntry - Tk_Entry in which the selection will be set Index - Index of character from which the selection will be set. If is before the selection anchor point, the selection will be to the anchor point. If after, the selection will be from the anchor point to the Index
EXAMPLE
-- Set the selection from anchor point to the last character in My_Entry Selection_To(My_Entry, "end");
COMMANDS
TextEntry selection to index
HISTORY
8.6.5 - Added
TEntry/TEntry.Validate [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Force the Tk_Entry to revalidate its value
SOURCE
function Validate(TextEntry: in Tk_Entry'Class) return String;
PARAMETERS
TextEntry - Tk_Entry which value will be validated
RESULT
"1" if value of TextEntry is valid, otherwise "0"
EXAMPLE
-- Revalidate value of My_Entry entry Valid: constant String := Validate(My_Entry);
COMMANDS
TextEntry validate
HISTORY
8.6.5 - Added
TEntry/TEntry.XView_(function) [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Get which horizontal fraction of the Tk_Entry is visible
SOURCE
function XView(TextEntry: in Tk_Entry'Class) return String;
PARAMETERS
TextEntry - Tk_Entry which will be queried for visibility
RESULT
Pair of elements: first element is the start of horizontal fraction of the TextEntry which is visible, second is the end of horizontal fraction of the TextEntry which is visible.
EXAMPLE
-- Get the horizontal fraction of the My_Entry entry Horizontal_Fraction: constant String := XView(My_Entry);
SEE ALSO
TEntry.XView_(procedure)
COMMANDS
TextEntry xview
HISTORY
8.6.5 - Added
TEntry/TEntry.XView_(procedure) [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Adjusts the view in the window so that the character position given by index is displayed at the left edge of the window
SOURCE
procedure XView(TextEntry: in Tk_Entry'Class; Index: in String) with Pre => Index /= "";
PARAMETERS
TextEntry - Tk_Entry which will be adjusted Index - Character index to which TextEntry will be adjusted. Character position starts from 0
EXAMPLE
-- Set view of My_Entry entry to second character XView(My_Entry, "1");
SEE ALSO
TEntry.XView_(function)
COMMANDS
TextEntry xview index
HISTORY
8.6.5 - Added
TEntry/TEntry.Xview_Move_To [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Adjusts the view in the window so that fraction of the total width of the Tk_Entry is off-screen to the left.
SOURCE
procedure Xview_Move_To (TextEntry: in Tk_Entry'Class; Fraction: in String) with Pre => Fraction /= "";
PARAMETERS
TextEntry - Tk_Entry which view will be adjusted Fraction - Fraction of the TextEntry to move. Must be between 0 and 1
EXAMPLE
-- Show the first half of the entry My_Entry Xview_Move_To(My_Entry, "0.5");
COMMANDS
TextEntry xview moveto fraction
HISTORY
8.6.5 - Added
TEntry/TEntry.Xview_Scroll [ Subprograms ]
[ Top ] [ TEntry ] [ Subprograms ]
FUNCTION
Shift the view in the window on left or right according to Number and What.
SOURCE
procedure Xview_Scroll (TextEntry: in Tk_Entry'Class; Number, What: in String) with Pre => Number /= "" and (What = "units" or What = "pages");
PARAMETERS
TextEntry - Tk_Entry which view will be shifted Number - The amount of What to shift the TextEntry What - Type of amount to move. Can be "units" or "pages"
EXAMPLE
-- Move the view in the My_Entry entry by 10 units to right Xview_Scroll(My_Entry, "10", "units");
COMMANDS
TextEntry xview scroll number what
HISTORY
8.6.5 - Added