Package: GWindows.Combo_Boxes

Dependencies

with GWindows.Base;

Description

GWINDOWS - Ada 95 Framework for Win32 Development

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

S p e c

$Revision: 1.3 $

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

Combo_Box_Type

Header

package GWindows.Combo_Boxes is
 

Type Summary

Combo_Box_Access
Combo_Box_Type derived from Base_Window_Type
Overridden Operations:  On_Command
New Operations:  Add, Add, Alternate_User_Interface, Alternate_User_Interface, Clear, Copy, Count, Create, Current, Current, Cut, Delete, Dropped, Dropped, Find, Find_Exact, Fire_On_Close_Up, Fire_On_Double_Click, Fire_On_Drop_Down, Fire_On_Edit_Change, Fire_On_Edit_Update, Fire_On_Focus, Fire_On_Lost_Focus, Fire_On_Out_Of_Memory, Fire_On_Select_End_Cancel, Fire_On_Select_End_OK, Fire_On_Selection_Change, Get_Edit_Selection, On_Close_Up, On_Close_Up_Handler, On_Double_Click, On_Double_Click_Handler, On_Drop_Down, On_Drop_Down_Handler, On_Edit_Change, On_Edit_Change_Handler, On_Edit_Update, On_Edit_Update_Handler, On_Focus, On_Focus_Handler, On_Lost_Focus, On_Lost_Focus_Handler, On_Out_Of_Memory, On_Out_Of_Memory_Handler, On_Select_End_Cancel, On_Select_End_Cancel_Handler, On_Select_End_OK, On_Select_End_OK_Handler, On_Selection_Change, On_Selection_Change_Handler, Paste, Set_Edit_Selection, Text_Limit, Top_Item, Top_Item, Undo, Value, Value_Length
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
Drop_Down_Combo_Box_Access
Drop_Down_Combo_Box_Type derived from Combo_Box_Type
Overridden Operations:  Create
Inherited Operations:  Accelerator_Handle, Accelerator_Handle, Accelerator_Table, Add, Add, Alternate_User_Interface, Alternate_User_Interface, Attach, Attach_Control, Attach_Dialog, Attach_Dialog_Item, Border, Border, Capture_Mouse, Center, Center, Child, Clear, Client_Area_Height, Client_Area_Height, Client_Area_Size, Client_Area_Width, Client_Area_Width, Close, Control, Controlling_Parent, Copy, Count, Create_Control, Current, Current, Cut, Delete, Disable, Dock, Dock, Dropped, Dropped, Enable, Enabled, Enabled, End_Dialog, Enumerate_Children, Finalize, Find, Find_Exact, Fire_On_Close_Up, Fire_On_Context_Menu, Fire_On_Create, Fire_On_Destroy, Fire_On_Double_Click, Fire_On_Drop_Down, Fire_On_Edit_Change, Fire_On_Edit_Update, Fire_On_Focus, Fire_On_Horizontal_Scroll, Fire_On_Lost_Focus, Fire_On_Out_Of_Memory, Fire_On_Pre_Create, Fire_On_Select_End_Cancel, Fire_On_Select_End_OK, Fire_On_Selection_Change, Fire_On_Vertical_Scroll, First_Window, Focus, Focus, Freeze, Get_Canvas, Get_Edit_Selection, 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_Close_Up, On_Close_Up_Handler, On_Command, On_Context_Menu, On_Context_Menu_Handler, On_Create, On_Create_Handler, On_Destroy, On_Destroy_Handler, On_Double_Click, On_Double_Click_Handler, On_Draw_Item, On_Drop_Down, On_Drop_Down_Handler, On_Edit_Change, On_Edit_Change_Handler, On_Edit_Update, On_Edit_Update_Handler, On_Filter_Message, On_Focus, On_Focus_Handler, On_Horizontal_Scroll, On_Horizontal_Scroll_Handler, On_Lost_Focus, On_Lost_Focus_Handler, On_Message, On_Notify, On_Out_Of_Memory, On_Out_Of_Memory_Handler, On_Pre_Create, On_Pre_Create_Handler, On_Select_End_Cancel, On_Select_End_Cancel_Handler, On_Select_End_OK, On_Select_End_OK_Handler, On_Selection_Change, On_Selection_Change_Handler, On_Vertical_Scroll, On_Vertical_Scroll_Handler, Order, Order, Parent, Parent, Paste, Point_To_Client, Point_To_Desktop, Previous_Tab_Stop, Previous_Window, Redraw, Set_Edit_Selection, Set_Font, Show, Size, Tab_Stop, Tab_Stop, Text, Text, Text_Length, Text_Limit, Thaw, Top, Top, Top_Item, Top_Item, Undo, Valid, Value, Value_Length, Vertical_Scroll_Bar, Vertical_Scroll_Bar, Visible, Visible, Width, Width
Drop_Down_List_Box_Access
Drop_Down_List_Box_Type derived from Combo_Box_Type
Overridden Operations:  Text, Text
New Operations:  Create
Inherited Operations:  Accelerator_Handle, Accelerator_Handle, Accelerator_Table, Add, Add, Alternate_User_Interface, Alternate_User_Interface, Attach, Attach_Control, Attach_Dialog, Attach_Dialog_Item, Border, Border, Capture_Mouse, Center, Center, Child, Clear, Client_Area_Height, Client_Area_Height, Client_Area_Size, Client_Area_Width, Client_Area_Width, Close, Control, Controlling_Parent, Copy, Count, Create, Create_Control, Current, Current, Cut, Delete, Disable, Dock, Dock, Dropped, Dropped, Enable, Enabled, Enabled, End_Dialog, Enumerate_Children, Finalize, Find, Find_Exact, Fire_On_Close_Up, Fire_On_Context_Menu, Fire_On_Create, Fire_On_Destroy, Fire_On_Double_Click, Fire_On_Drop_Down, Fire_On_Edit_Change, Fire_On_Edit_Update, Fire_On_Focus, Fire_On_Horizontal_Scroll, Fire_On_Lost_Focus, Fire_On_Out_Of_Memory, Fire_On_Pre_Create, Fire_On_Select_End_Cancel, Fire_On_Select_End_OK, Fire_On_Selection_Change, Fire_On_Vertical_Scroll, First_Window, Focus, Focus, Freeze, Get_Canvas, Get_Edit_Selection, 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_Close_Up, On_Close_Up_Handler, On_Command, On_Context_Menu, On_Context_Menu_Handler, On_Create, On_Create_Handler, On_Destroy, On_Destroy_Handler, On_Double_Click, On_Double_Click_Handler, On_Draw_Item, On_Drop_Down, On_Drop_Down_Handler, On_Edit_Change, On_Edit_Change_Handler, On_Edit_Update, On_Edit_Update_Handler, On_Filter_Message, On_Focus, On_Focus_Handler, On_Horizontal_Scroll, On_Horizontal_Scroll_Handler, On_Lost_Focus, On_Lost_Focus_Handler, On_Message, On_Notify, On_Out_Of_Memory, On_Out_Of_Memory_Handler, On_Pre_Create, On_Pre_Create_Handler, On_Select_End_Cancel, On_Select_End_Cancel_Handler, On_Select_End_OK, On_Select_End_OK_Handler, On_Selection_Change, On_Selection_Change_Handler, On_Vertical_Scroll, On_Vertical_Scroll_Handler, Order, Order, Parent, Parent, Paste, Point_To_Client, Point_To_Desktop, Previous_Tab_Stop, Previous_Window, Redraw, Set_Edit_Selection, Set_Font, Show, Size, Tab_Stop, Tab_Stop, Text_Length, Text_Limit, Thaw, Top, Top, Top_Item, Top_Item, Undo, Valid, Value, Value_Length, Vertical_Scroll_Bar, Vertical_Scroll_Bar, Visible, Visible, Width, Width
Pointer_To_Combo_Box_Class

Other Items:

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

type Combo_Box_Access is access all Combo_Box_Type;

type Pointer_To_Combo_Box_Class is access all Combo_Box_Type'Class;
Combo_Box_Type - Creation Methods

procedure Create
  (Combo      : in out Combo_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;
   Sort       : in     Boolean                              := True;
   ID         : in     Integer                              := 0;
   Show       : in     Boolean                              := True;
   Is_Dynamic : in     Boolean                              := False);
Create Combo Box

procedure Alternate_User_Interface (Combo : in out Combo_Box_Type;
                                    State : in     Boolean := True);

function Alternate_User_Interface (Combo : in Combo_Box_Type)
                                  return Boolean;
Use of alternative user interface for combo boxes (ie. use down arrow instead of F4 to drop lists)

procedure Text_Limit (Combo : in out Combo_Box_Type;
                      Size  : in Natural);
Limit amount of text that can be entered

procedure Dropped (Combo : in out Combo_Box_Type;
                   State : in     Boolean := True);

function Dropped (Combo : in Combo_Box_Type)
                 return Boolean;
Drop state of list box

procedure Get_Edit_Selection
  (Combo          : in out Combo_Box_Type;
   Start_Position :    out Natural;
   End_Position   :    out Natural);

procedure Set_Edit_Selection
  (Combo          : in out Combo_Box_Type;
   Start_Position : in     Integer;
   End_Position   : in     Integer);
Selection in edit box

procedure Current (Combo : in Combo_Box_Type;
                   Item  : in Natural);

function Current (Combo : in Combo_Box_Type) return Natural;
Currently selected

function Count (Combo : in Combo_Box_Type) return Natural;
Returns number of items in combo box

function Value_Length (Combo : in Combo_Box_Type;
                       Item  : in Positive)
                      return Natural;
Returns the length of string value at Item

function Value (Combo : in Combo_Box_Type;
                Item  : in Positive)
               return GString;
Returns the string value at Item

procedure Top_Item (Combo : in out Combo_Box_Type;
                    Item  : in     Positive);

function Top_Item (Combo  : in Combo_Box_Type) return Natural;
Top item displayed in combo box

procedure Add (Combo : in out Combo_Box_Type;
               Value : in     GString);

procedure Add (Combo : in out Combo_Box_Type;
               After : in     Positive;
               Value : in     GString);
Add a value to the combo box

procedure Delete (Combo : in out Combo_Box_Type;
                  Item  : in     Positive);
Delete value at item

procedure Cut (Combo : in out Combo_Box_Type);
Send a cut command

procedure Copy (Combo : in out Combo_Box_Type);
Send a copy command

procedure Paste (Combo : in out Combo_Box_Type);
Send a paste command

procedure Undo (Combo : in out Combo_Box_Type);
Send an undo command

procedure Clear (Combo : in out Combo_Box_Type);
Clear combo box

function Find (Combo      : in Combo_Box_Type;
               Value      : in GString;
               Start_Item : in Natural        := 0)
              return Natural;
Find a string in the combo box. The search starts with the item after Start_Item. If Start_Item = 0 all items are searched. Return 0 if not found

function Find_Exact (Combo      : in Combo_Box_Type;
                     Value      : in GString;
                     Start_Item : in Natural        := 0)
                    return Natural;
Find the exact string in the combo box. The search starts with the item after Start_Item. If Start_Item = 0 all items are searched. Return 0 if not found

procedure On_Double_Click_Handler (Combo  : in out Combo_Box_Type;
                                   Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Double_Click (Combo : in out Combo_Box_Type);

procedure On_Selection_Change_Handler (Combo  : in out Combo_Box_Type;
                            Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Selection_Change (Combo : in out Combo_Box_Type);

procedure On_Focus_Handler (Combo  : in out Combo_Box_Type;
                            Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Focus (Combo : in out Combo_Box_Type);

procedure On_Lost_Focus_Handler (Combo  : in out Combo_Box_Type;
                                 Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Lost_Focus (Combo : in out Combo_Box_Type);

procedure On_Out_Of_Memory_Handler
  (Combo  : in out Combo_Box_Type;
   Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Out_Of_Memory (Combo : in out Combo_Box_Type);

procedure On_Edit_Change_Handler (Combo  : in out Combo_Box_Type;
                                  Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Edit_Change (Combo : in out Combo_Box_Type);

procedure On_Edit_Update_Handler (Combo  : in out Combo_Box_Type;
                                  Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Edit_Update (Combo : in out Combo_Box_Type);

procedure On_Drop_Down_Handler (Combo  : in out Combo_Box_Type;
                                Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Drop_Down (Combo : in out Combo_Box_Type);

procedure On_Close_Up_Handler (Combo  : in out Combo_Box_Type;
                               Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Close_Up (Combo : in out Combo_Box_Type);

procedure On_Select_End_OK_Handler
  (Combo  : in out Combo_Box_Type;
   Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Select_End_OK (Combo : in out Combo_Box_Type);

procedure On_Select_End_Cancel_Handler
  (Combo  : in out Combo_Box_Type;
   Handler : in GWindows.Base.Action_Event);

procedure Fire_On_Select_End_Cancel (Combo : in out Combo_Box_Type);
Combo_Box_Type - Event Methods

procedure On_Double_Click (Combo : in out Combo_Box_Type);
Double Clicked

procedure On_Selection_Change (Combo : in out Combo_Box_Type);
Selection Changed

procedure On_Focus (Combo : in out Combo_Box_Type);
Received focus

procedure On_Lost_Focus (Combo : in out Combo_Box_Type);
Lost focus

procedure On_Out_Of_Memory (Combo : in out Combo_Box_Type);
Control can not allocate more memory

procedure On_Edit_Change (Combo : in out Combo_Box_Type);
Contents of edit box changed

procedure On_Edit_Update (Combo : in out Combo_Box_Type);
Contents of edit box will be updated

procedure On_Drop_Down (Combo : in out Combo_Box_Type);
Combo box list dropped

procedure On_Close_Up (Combo : in out Combo_Box_Type);
Combo box list closed

procedure On_Select_End_OK (Combo : in out Combo_Box_Type);
Selection made

procedure On_Select_End_Cancel (Combo : in out Combo_Box_Type);
Selection canceled

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

type Drop_Down_Combo_Box_Type is new Combo_Box_Type with private;
Drop_Down_Combo_Box_Type

type Drop_Down_Combo_Box_Access is access all Drop_Down_Combo_Box_Type;
Drop_Down_Combo_Box_Type - Creation Methods

procedure Create
  (Combo      : in out Drop_Down_Combo_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;
   Sort       : in     Boolean                              := True;
   ID         : in     Integer                              := 0;
   Show       : in     Boolean                              := True;
   Is_Dynamic : in     Boolean                              := False);
Create a drop down combo box

type Drop_Down_List_Box_Type is new Combo_Box_Type with private;
Drop_Down_List_Box_Type

type Drop_Down_List_Box_Access is
  access all Drop_Down_List_Box_Type;
Drop_Down_List_Box_Type - Creation Methods

procedure Create
  (Combo      : in out Drop_Down_List_Box_Type;
   Parent     : in out GWindows.Base.Base_Window_Type'Class;
   Left       : in     Integer;
   Top        : in     Integer;
   Width      : in     Integer;
   Height     : in     Integer;
   Sort       : in     Boolean                              := True;
   ID         : in     Integer                              := 0;
   Show       : in     Boolean                              := True;
   Is_Dynamic : in     Boolean                              := False);
Create a drop down list box

procedure Text (Window : in out Drop_Down_List_Box_Type;
                Text   : in     GString);

function Text  (Window : in Drop_Down_List_Box_Type)
               return GString;
Get or set current selection / focus item

private

   --  Implementation-defined ...
end GWindows.Combo_Boxes;