Marco's Web Center

Menu for Development

Site Menu
Object Pascal Handbook
Delphi Handbooks Collection
Mastering Borland Delphi 2005
(Old) White Papers
(Old)Tools
(Old) Conferences

My Other Sites
Italian Site (www.marcocantu.it)
the delphi search

Spirit of delphi

Advertising
Home My Blog Books Object Pascal Marco

Home: Code Repository: Mastering Delphi 6

Chapter 11 - Project ListTest

Project Structure

ListTest.dpr
program ListTest;

uses
  Forms,
  ListForm in 'ListForm.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
ListForm.pas
unit ListForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ActnList, ComCtrls, ToolWin, StdCtrls, MdListAct, ExtActns;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    ListBox2: TListBox;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ActionList1: TActionList;
    ListCopyAction1: TMdListCopyAction;
    ListCutAction1: TMdListCutAction;
    ListPasteAction1: TMdListPasteAction;
    Edit1: TEdit;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

end.
ListForm.dfm
object Form1: TForm1
  Left = 192
  Top = 107
  Width = 370
  Height = 291
  Caption = 'ListTest (Custom Actions)'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object ListBox1: TListBox
    Left = 184
    Top = 40
    Width = 169
    Height = 217
    Color = clWindow
    ItemHeight = 13
    Items.Strings = (
      'four'
      'five'
      'six')
    TabOrder = 0
  end
  object ListBox2: TListBox
    Left = 8
    Top = 40
    Width = 169
    Height = 217
    Color = clWindow
    ItemHeight = 13
    Items.Strings = (
      'one'
      'two'
      'three')
    TabOrder = 1
  end
  object ToolBar1: TToolBar
    Left = 0
    Top = 0
    Width = 362
    Height = 29
    BorderWidth = 1
    ButtonHeight = 19
    ButtonWidth = 39
    Caption = 'ToolBar1'
    Customizable = False
    EdgeBorders = [ebTop, ebBottom]
    Flat = True
    List = True
    ParentShowHint = False
    ShowCaptions = True
    ShowHint = True
    TabOrder = 2
    Wrapable = False
    object ToolButton1: TToolButton
      Left = 0
      Top = 0
      Action = ListCutAction1
    end
    object ToolButton2: TToolButton
      Left = 39
      Top = 0
      Action = ListCopyAction1
    end
    object ToolButton3: TToolButton
      Left = 78
      Top = 0
      Action = ListPasteAction1
    end
    object Edit1: TEdit
      Left = 117
      Top = 0
      Width = 121
      Height = 19
      Color = clWindow
      TabOrder = 0
    end
  end
  object ActionList1: TActionList
    Left = 48
    Top = 72
    object ListCopyAction1: TMdListCopyAction
      Category = 'ListBox'
      Caption = 'Copy'
    end
    object ListCutAction1: TMdListCutAction
      Category = 'ListBox'
      Caption = 'Cut'
    end
    object ListPasteAction1: TMdListPasteAction
      Category = 'ListBox'
      Caption = 'Paste'
    end
  end
end