Package: GWindows.Edit_Boxes

Dependencies

with GWindows.Base;

Description

GWINDOWS - Ada 95 Framework for Win32 Development

G W I N D O W S . E D I T _ B O X E S

S p e c

$Revision: 1.2 $

Copyright (C) 1999 - 2004 David Botton

This is free software; you can redistribute it and/or modify it under terms of the GNU General Public License as published by the Free Soft- ware Foundation; either version 2, or (at your option) any later ver- sion. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License distributed with this; see file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

As a special exception, if other files instantiate generics from this unit, or you link this unit with other files to produce an executable, this unit does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

More information about GWindows and the latest current release can be located on the web at http://www.gnavi.org/gwindows

Edit_Box_Type

Header

package GWindows.Edit_Boxes is
 

Type Summary

Edit_Box_Access
Edit_Box_Type derived from Base_Window_Type
Overridden Operations:  On_Command
New Operations:  Can_Undo, Clear, Clear_Undo, Copy, Create, Cut, Digits_Only, Digits_Only, Fire_On_Change, Fire_On_Focus, Fire_On_Horizontal_Scroll, Fire_On_Lost_Focus, Fire_On_Max_Text, Fire_On_Out_Of_Memory, Fire_On_Update, Fire_On_Vertical_Scroll, First_Visible, Get_Selection, Lower_Case_Only, Lower_Case_Only, Modified, Modified, On_Change, On_Change_Handler, On_Focus, On_Focus_Handler, On_Horizontal_Scroll, On_Horizontal_Scroll_Handler, On_Lost_Focus, On_Lost_Focus_Handler, On_Max_Text, On_Max_Text_Handler, On_Out_Of_Memory, On_Out_Of_Memory_Handler, On_Update, On_Update_Handler, On_Vertical_Scroll, On_Vertical_Scroll_Handler, Password, Password, Paste, Read_Only, Read_Only, Replace_Selection, Set_Selection, Text_Limit, Text_Limit, Undo, Upper_Case_Only, Upper_Case_Only
Inherited Operations:  Accelerator_Handle, Accelerator_Handle, Accelerator_Table, Attach, Attach_Control, Attach_Dialog, Attach_Dialog_Item, Border, Border, Capture_Mouse, Center, Center, Child, Client_Area_Height, Client_Area_Height, Client_Area_Size, Client_Area_Width, Client_Area_Width, Close, Control, Controlling_Parent, Create_Control, Disable, Dock, Dock, Enable, Enabled, Enabled, End_Dialog, Enumerate_Children, Finalize, Fire_On_Context_Menu, Fire_On_Create, Fire_On_Destroy, Fire_On_Horizontal_Scroll, Fire_On_Pre_Create, Fire_On_Vertical_Scroll, First_Window, Focus, Focus, Freeze, Get_Canvas, Get_Font, Get_Full_Window_Canvas, Group, Group, Handle, Height, Height, Hide, Horizontal_Scroll_Bar, Horizontal_Scroll_Bar, ID, Initialize, Is_Dialog, Is_Dialog, Is_Modal, Is_Modal, Keyboard_Support, Keyboard_Support, Last_Window, Left, Left, MDI_Client_Window, MDI_Client_Window, Modal_Result, Modal_Result, Move, Next_Tab_Stop, Next_Window, On_Context_Menu, On_Context_Menu_Handler, On_Create, On_Create_Handler, On_Destroy, On_Destroy_Handler, On_Draw_Item, On_Filter_Message, On_Horizontal_Scroll, On_Horizontal_Scroll_Handler, On_Message, On_Notify, On_Pre_Create, On_Pre_Create_Handler, On_Vertical_Scroll, On_Vertical_Scroll_Handler, Order, Order, Parent, Parent, Point_To_Client, Point_To_Desktop, Previous_Tab_Stop, Previous_Window, Redraw, Set_Font, Show, Size, Tab_Stop, Tab_Stop, Text, Text, Text_Length, Thaw, Top, Top, Valid, Vertical_Scroll_Bar, Vertical_Scroll_Bar, Visible, Visible, Width, Width
Multi_Line_Edit_Box_Access
Multi_Line_Edit_Box_Type derived from Edit_Box_Type
Overridden Operations:  Create
New Operations:  Create_Multi_Line, Line_Count, Line_From_Position, Line_Length, Line_Text, Position_From_Line, Scroll, Scroll_Position, Scroll_To_Caret
Inherited Operations:  Accelerator_Handle, Accelerator_Handle, Accelerator_Table, Attach, Attach_Control, Attach_Dialog, Attach_Dialog_Item, Border, Border, Can_Undo, Capture_Mouse, Center, Center, Child, Clear, Clear_Undo, Client_Area_Height, Client_Area_Height, Client_Area_Size, Client_Area_Width, Client_Area_Width, Close, Control, Controlling_Parent, Copy, Create_Control, Cut, Digits_Only, Digits_Only, Disable, Dock, Dock, Enable, Enabled, Enabled, End_Dialog, Enumerate_Children, Finalize, Fire_On_Change, Fire_On_Context_Menu, Fire_On_Create, Fire_On_Destroy, Fire_On_Focus, Fire_On_Horizontal_Scroll, Fire_On_Horizontal_Scroll, Fire_On_Lost_Focus, Fire_On_Max_Text, Fire_On_Out_Of_Memory, Fire_On_Pre_Create, Fire_On_Update, Fire_On_Vertical_Scroll, Fire_On_Vertical_Scroll, First_Visible, First_Window, Focus, Focus, Freeze, Get_Canvas, Get_Font, Get_Full_Window_Canvas, Get_Selection, Group, Group, Handle, Height, Height, Hide, Horizontal_Scroll_Bar, Horizontal_Scroll_Bar, ID, Initialize, Is_Dialog, Is_Dialog, Is_Modal, Is_Modal, Keyboard_Support, Keyboard_Support, Last_Window, Left, Left, Lower_Case_Only, Lower_Case_Only, MDI_Client_Window, MDI_Client_Window, Modal_Result, Modal_Result, Modified, Modified, Move, Next_Tab_Stop, Next_Window, On_Change, On_Change_Handler, On_Command, On_Context_Menu, On_Context_Menu_Handler, On_Create, On_Create_Handler, On_Destroy, On_Destroy_Handler, On_Draw_Item, On_Filter_Message, On_Focus, On_Focus_Handler, On_Horizontal_Scroll, On_Horizontal_Scroll, On_Horizontal_Scroll_Handler, On_Horizontal_Scroll_Handler, On_Lost_Focus, On_Lost_Focus_Handler, On_Max_Text, On_Max_Text_Handler, On_Message, On_Notify, On_Out_Of_Memory, On_Out_Of_Memory_Handler, On_Pre_Create, On_Pre_Create_Handler, On_Update, On_Update_Handler, On_Vertical_Scroll, On_Vertical_Scroll, On_Vertical_Scroll_Handler, On_Vertical_Scroll_Handler, Order, Order, Parent, Parent, Password, Password, Paste, Point_To_Client, Point_To_Desktop, Previous_Tab_Stop, Previous_Window, Read_Only, Read_Only, Redraw, Replace_Selection, Set_Font, Set_Selection, Show, Size, Tab_Stop, Tab_Stop, Text, Text, Text_Length, Text_Limit, Text_Limit, Thaw, Top, Top, Undo, Upper_Case_Only, Upper_Case_Only, Valid, Vertical_Scroll_Bar, Vertical_Scroll_Bar, Visible, Visible, Width, Width
Pointer_To_Edit_Box_Class
Scroll_Command_Type

Constants and Named Numbers

Off : constant Character := Character'Val (0);

Other Items:

type Edit_Box_Type is new GWindows.Base.Base_Window_Type with private;

type Edit_Box_Access is access all Edit_Box_Type;

type Pointer_To_Edit_Box_Class is access all Edit_Box_Type'Class;
Edit_Box_Type - Creation Methods

procedure Create
  (Edit              : in out Edit_Box_Type;
   Parent            : in out GWindows.Base.Base_Window_Type'Class;
   Text              : in     GString;
   Left              : in     Integer;
   Top               : in     Integer;
   Width             : in     Integer;
   Height            : in     Integer;
   Horizontal_Scroll : in     Boolean                            := True;
   ID                : in     Integer                            := 0;
   Show              : in     Boolean                            := True;
   Is_Dynamic        : in     Boolean                            := False);
Create Edit Box

procedure Lower_Case_Only (Window : in out Edit_Box_Type;
                           State  : Boolean := True);

function Lower_Case_Only (Window : in Edit_Box_Type) return Boolean;
When on converts all characters to lower case

procedure Upper_Case_Only (Window : in out Edit_Box_Type;
                           State  : Boolean := True);

function Upper_Case_Only (Window : in Edit_Box_Type) return Boolean;
When on converts all characters to upper case

procedure Digits_Only (Window : in out Edit_Box_Type;
                           State  : Boolean := True);

function Digits_Only (Window : in Edit_Box_Type) return Boolean;
Only allow digits

procedure Read_Only (Window : in out Edit_Box_Type;
                           State  : Boolean := True);

function Read_Only (Window : in Edit_Box_Type) return Boolean;
Read only

procedure Password (Window        : in out Edit_Box_Type;
                    Password_Char : in     Character     := '*');

function Password (Window : in Edit_Box_Type) return Boolean;
Displays a Password_Char for each typed letter Usee Password (Window, Off) to turn off password Does not work for Multi_Line_Edit_Boxes

function Can_Undo (Edit : in Edit_Box_Type) return Boolean;
Returns true if an undo operation is possible

function First_Visible (Edit : in Edit_Box_Type) return Natural;
Returns first visible character (if multi line first visible line) Always returns 0 for single line rich edit controls

procedure Text_Limit (Edit : in out Edit_Box_Type;
                      Size : in     Natural);

function Text_Limit (Edit : in Edit_Box_Type) return Natural;
Maximum number of characters that can be entered

procedure Modified (Edit  : in out Edit_Box_Type;
                    State : in     Boolean       := True);

function Modified (Edit : in Edit_Box_Type) return Boolean;
Modification flag

procedure Get_Selection
  (Edit           : in out Edit_Box_Type;
   Start_Position :    out Natural;
   End_Position   :    out Natural);

procedure Set_Selection
  (Edit           : in out Edit_Box_Type;
   Start_Position : in     Integer;
   End_Position   : in     Integer);
Selection in edit box

procedure Replace_Selection
  (Edit     : in out Edit_Box_Type;
   Text     : in     GString;
   Can_Undo : in     Boolean       := True);
Selection in edit box

procedure Cut (Edit : in out Edit_Box_Type);
Send a cut command

procedure Copy (Edit : in out Edit_Box_Type);
Send a copy command

procedure Paste (Edit : in out Edit_Box_Type);
Send a paste command

procedure Clear (Edit : in out Edit_Box_Type);
Send a clear command

procedure Undo (Edit : in out Edit_Box_Type);
Send an undo command

procedure Clear_Undo (Edit : in out Edit_Box_Type);
Clears the undo buffer

procedure On_Focus_Handler (Edit    : in out Edit_Box_Type;
                            Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Focus (Edit : in out Edit_Box_Type);

procedure On_Lost_Focus_Handler
  (Edit    : in out Edit_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Lost_Focus (Edit : in out Edit_Box_Type);

procedure On_Change_Handler (Edit    : in out Edit_Box_Type;
                             Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Change (Edit : in out Edit_Box_Type);

procedure On_Max_Text_Handler (Edit    : in out Edit_Box_Type;
                               Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Max_Text (Edit : in out Edit_Box_Type);

procedure On_Horizontal_Scroll_Handler
  (Edit         : in out Edit_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Horizontal_Scroll (Edit : in out Edit_Box_Type);

procedure On_Vertical_Scroll_Handler
  (Edit    : in out Edit_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Vertical_Scroll (Edit : in out Edit_Box_Type);

procedure On_Update_Handler (Edit    : in out Edit_Box_Type;
                             Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Update (Edit : in out Edit_Box_Type);

procedure On_Out_Of_Memory_Handler
  (Edit : in out Edit_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Out_Of_Memory (Edit : in out Edit_Box_Type);
Edit_Box_Type - Event Methods

procedure On_Focus (Edit : in out Edit_Box_Type);
Received focus

procedure On_Lost_Focus (Edit : in out Edit_Box_Type);
Lost focus

procedure On_Change (Edit : in out Edit_Box_Type);
Change made to edit box text

procedure On_Max_Text (Edit : in out Edit_Box_Type);
Reached max text for this control

procedure On_Horizontal_Scroll (Edit : in out Edit_Box_Type);
Horizontal Scroll

procedure On_Vertical_Scroll (Edit : in out Edit_Box_Type);
Vertical Scroll

procedure On_Update (Edit : in out Edit_Box_Type);
Sent before redrawing text in control

procedure On_Out_Of_Memory (Edit : in out Edit_Box_Type);
Control can not allocate more memory

procedure On_Command (Window  : in out Edit_Box_Type;
                      Code    : in     Integer;
                      ID      : in     Integer;
                      Control : in
                        GWindows.Base.Pointer_To_Base_Window_Class);
Receives command messags from parent window

type Multi_Line_Edit_Box_Type is new Edit_Box_Type with private;
Mutli_Line_Edit_Box_Type

type Multi_Line_Edit_Box_Access is access all Multi_Line_Edit_Box_Type;
Mutli_Line_Edit_Box_Type - Creation Methods

procedure Create
  (Edit              : in out Multi_Line_Edit_Box_Type;
   Parent            : in out GWindows.Base.Base_Window_Type'Class;
   Text              : in     GString;
   Left              : in     Integer;
   Top               : in     Integer;
   Width             : in     Integer;
   Height            : in     Integer;
   Horizontal_Scroll : in     Boolean                            := False;
   ID                : in     Integer                            := 0;
   Show              : in     Boolean                            := True;
   Is_Dynamic        : in     Boolean                            := False);
Create Multi Line Edit Box with vertical scroll bar and return capture

procedure Create_Multi_Line
  (Edit              : in out Multi_Line_Edit_Box_Type;
   Parent            : in out GWindows.Base.Base_Window_Type'Class;
   Text              : in     GString;
   Left              : in     Integer;
   Top               : in     Integer;
   Width             : in     Integer;
   Height            : in     Integer;
   Horizontal_Scroll : in     Boolean                            := False;
   Vertical_Scroll   : in     Boolean                            := True;
   Capture_Return    : in     Boolean                            := True;
   ID                : in     Integer                            := 0;
   Show              : in     Boolean                            := True;
   Is_Dynamic        : in     Boolean                            := False);
Create Multi Line Edit Box

function Line_Text (Edit : Multi_Line_Edit_Box_Type;
                    Line : Positive)
                   return GString;
Text at line

function Line_Length (Edit : Multi_Line_Edit_Box_Type;
                      Line : Positive)
                     return Natural;
Length of text at line

function Line_Count (Edit : Multi_Line_Edit_Box_Type) return Natural;
Number of lines

function Scroll_Position (Edit : in Multi_Line_Edit_Box_Type)
                         return Integer;
Scroll position

function Line_From_Position (Edit     : Multi_Line_Edit_Box_Type;
                             Position : Natural)
                            return Positive;
Returns the line containing the character at position If Position = 0 then return line of selection or current line

function Position_From_Line (Edit : Multi_Line_Edit_Box_Type;
                             Line : Natural)
                            return Positive;
Returns the position of the first character on line If Line = 0 then return line of selection or current line

type Scroll_Command_Type is (Line_Up, Line_Down, Page_Up, Page_Down);

procedure Scroll (Edit    : in out Multi_Line_Edit_Box_Type;
                  Command : in     Scroll_Command_Type);
Scroll box

procedure Scroll_To_Caret (Edit : in out Multi_Line_Edit_Box_Type);
Scroll box so that input caret is in view

private

   --  Implementation-defined ...
end GWindows.Edit_Boxes;