Package: GWindows.List_Boxes

Dependencies

with GWindows.Base;

Description

GWINDOWS - Ada 95 Framework for Win32 Development

G W I N D O W S . L I S 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

List_Box_Type

Header

package GWindows.List_Boxes is
 

Type Summary

List_Box_Access
List_Box_Type derived from Base_Window_Type
Overridden Operations:  On_Command, Text, Text
New Operations:  Add, Add, Clear, Count, Create, Current, Current, Delete, Find, Find_Exact, Fire_On_Double_Click, Fire_On_Focus, Fire_On_Lost_Focus, Fire_On_Out_Of_Memory, Fire_On_Selection_Cancel, Fire_On_Selection_Change, On_Double_Click, On_Double_Click_Handler, On_Focus, On_Focus_Handler, On_Lost_Focus, On_Lost_Focus_Handler, On_Out_Of_Memory, On_Out_Of_Memory_Handler, On_Selection_Cancel, On_Selection_Cancel_Handler, On_Selection_Change, On_Selection_Change_Handler, Selected, Selected, Top_Item, Top_Item, 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_Length, Thaw, Top, Top, Valid, Vertical_Scroll_Bar, Vertical_Scroll_Bar, Visible, Visible, Width, Width
Multiple_Selection_List_Box_Access
Multiple_Selection_List_Box_Type derived from List_Box_Type
Overridden Operations:  Create, Selected
New Operations:  Select_Count, Select_Range, Selected_Items
Inherited Operations:  Accelerator_Handle, Accelerator_Handle, Accelerator_Table, Add, Add, 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, Count, Create_Control, Current, Current, Delete, Disable, Dock, Dock, Enable, Enabled, Enabled, End_Dialog, Enumerate_Children, Finalize, Find, Find_Exact, Fire_On_Context_Menu, Fire_On_Create, Fire_On_Destroy, Fire_On_Double_Click, Fire_On_Focus, Fire_On_Horizontal_Scroll, Fire_On_Lost_Focus, Fire_On_Out_Of_Memory, Fire_On_Pre_Create, Fire_On_Selection_Cancel, Fire_On_Selection_Change, 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_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_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_Selection_Cancel, On_Selection_Cancel_Handler, On_Selection_Change, On_Selection_Change_Handler, On_Vertical_Scroll, On_Vertical_Scroll_Handler, Order, Order, Parent, Parent, Point_To_Client, Point_To_Desktop, Previous_Tab_Stop, Previous_Window, Redraw, Selected, Set_Font, Show, Size, Tab_Stop, Tab_Stop, Text, Text, Text_Length, Thaw, Top, Top, Top_Item, Top_Item, Valid, Value, Value_Length, Vertical_Scroll_Bar, Vertical_Scroll_Bar, Visible, Visible, Width, Width
Pointer_To_List_Box_Class
Selection_Array_Type

Other Items:

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

type List_Box_Access is access all List_Box_Type;

type Pointer_To_List_Box_Class is access all List_Box_Type'Class;
List_Box_Type - Creation Methods

procedure Create
  (List       : in out 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 List Box

procedure Current (List : in List_Box_Type;
                   Item : in Natural);

function Current (List : in List_Box_Type) return Natural;
Returns currently selected / focused item

function Count (List : in List_Box_Type) return Natural;
Returns number of items in list box

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

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

procedure Selected (List  : in out List_Box_Type;
                    Item  : in     Positive;
                    State : in     Boolean       := True);

function Selected (List  : in List_Box_Type;
                   Item  : in Positive)
                  return Boolean;
Item select state

procedure Top_Item (List  : in out List_Box_Type;
                    Item  : in     Positive);

function Top_Item (List  : in List_Box_Type) return Natural;
Top item displayed in list box

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

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

procedure Add (List  : in out List_Box_Type;
               Value : in     GString);

procedure Add (List  : in out List_Box_Type;
               After : in     Positive;
               Value : in     GString);
Add a value to the list box

procedure Delete (List : in out List_Box_Type;
                  Item : in     Positive);
Delete value at item

procedure Clear (List : in out List_Box_Type);
Clear list box

function Find (List       : in List_Box_Type;
               Value      : in GString;
               Start_Item : in Natural       := 0)
              return Natural;
Find a string in the list box Return 0 if not found

function Find_Exact (List       : in List_Box_Type;
                     Value      : in GString;
                     Start_Item : in Natural       := 0)
                    return Natural;
Find a string in the list box Return 0 if not found

procedure On_Double_Click_Handler
  (List    : in out List_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Double_Click (List : in out List_Box_Type);

procedure On_Selection_Cancel_Handler
  (List    : in out List_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Selection_Cancel (List : in out List_Box_Type);

procedure On_Selection_Change_Handler
  (List    : in out List_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Selection_Change (List : in out List_Box_Type);

procedure On_Focus_Handler (List    : in out List_Box_Type;
                            Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Focus (List : in out List_Box_Type);

procedure On_Lost_Focus_Handler
  (List    : in out List_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Lost_Focus (List : in out List_Box_Type);

procedure On_Out_Of_Memory_Handler
  (List : in out List_Box_Type;
   Handler : in     GWindows.Base.Action_Event);

procedure Fire_On_Out_Of_Memory (List : in out List_Box_Type);
List_Box_Type - Event Methods

procedure On_Double_Click (List : in out List_Box_Type);
Double Clicked

procedure On_Selection_Cancel (List : in out List_Box_Type);
Selection Cancled

procedure On_Selection_Change (List : in out List_Box_Type);
Selection Changed

procedure On_Focus (List : in out List_Box_Type);
Received focus

procedure On_Lost_Focus (List : in out List_Box_Type);
Lost focus

procedure On_Out_Of_Memory (List : in out List_Box_Type);
Control can not allocate more memory

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

type Multiple_Selection_List_Box_Type is new List_Box_Type with private;
Multiple_Selection_List_Box_Type

type Multiple_Selection_List_Box_Access is
  access all Multiple_Selection_List_Box_Type;
Multiple_Selection_List_Box_Type - Creation Methods

procedure Create
  (List       : in out Multiple_Selection_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 List Box

procedure Selected
  (List  : in out Multiple_Selection_List_Box_Type;
   Item  : in     Positive;
   State : in     Boolean       := True);

procedure Select_Range
  (List       : in out Multiple_Selection_List_Box_Type;
   Start_Item : in     Positive;
   End_Item   : in     Positive;
   State      : in     Boolean                          := True);
Select a range of items

function Select_Count
  (List : in Multiple_Selection_List_Box_Type)
  return Natural;
Number of selected items

type Selection_Array_Type is array (Natural range <>) of aliased Integer;

function Selected_Items
  (List : in Multiple_Selection_List_Box_Type)
  return Selection_Array_Type;

private

   --  Implementation-defined ...
end GWindows.List_Boxes;