Marco Web Center

[an error occurred while processing this directive]

Home: Code Repository: Delphi 2009 Handbook

Project: EditFamilyDemo.dproj

Project Structure

EditFamilyDemo.dpr
program EditFamilyDemo;

uses
  Forms,
  EditFamily_MainForm in 'EditFamily_MainForm.pas' {FormEditFamily};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TFormEditFamily, FormEditFamily);
  Application.Run;
end.
EditFamily_MainForm.pas
unit EditFamily_MainForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DBCtrls;

type
  TFormEditFamily = class(TForm)
    edRightAlign: TEdit;
    edNumber: TEdit;
    memoLowercase: TMemo;
    cbTextHint: TComboBox;
    btnUpcase: TButton;
    btnAlign: TButton;
    edTextHint: TEdit;
    edPassword: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure btnUpcaseClick(Sender: TObject);
    procedure btnAlignClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormEditFamily: TFormEditFamily;

implementation

{$R *.dfm}

procedure TFormEditFamily.btnAlignClick(Sender: TObject);
begin
  edRightAlign.Alignment := TAlignment (
    (Ord (edRightAlign.Alignment) + 1) mod (Ord(High(TAlignment)) + 1));
end;

procedure TFormEditFamily.btnUpcaseClick(Sender: TObject);
begin
  memoLowercase.Lines.Text := 'Mixed Case Text Added';
  ShowMessage (memoLowercase.Lines.Text);

  memoLowercase.CharCase := ecUpperCase;
  memoLowercase.Lines.Text := 'Cantù';
end;

end.
EditFamily_MainForm.pas.dfm
object FormEditFamily: TFormEditFamily
  Left = 0
  Top = 0
  Caption = 'EditFamilyDemo'
  ClientHeight = 292
  ClientWidth = 383
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 27
    Top = 216
    Width = 76
    Height = 13
    Caption = 'Password Char:'
  end
  object Label2: TLabel
    Left = 24
    Top = 160
    Width = 71
    Height = 13
    Caption = 'Numbers Only:'
  end
  object Label3: TLabel
    Left = 24
    Top = 101
    Width = 48
    Height = 13
    Caption = 'Text Hint:'
  end
  object Label4: TLabel
    Left = 24
    Top = 16
    Width = 79
    Height = 13
    Caption = 'Right Alignment:'
  end
  object edRightAlign: TEdit
    Left = 24
    Top = 32
    Width = 121
    Height = 21
    Alignment = taRightJustify
    TabOrder = 0
    Text = 'Text on the right'
  end
  object edNumber: TEdit
    Left = 24
    Top = 176
    Width = 121
    Height = 21
    NumbersOnly = True
    TabOrder = 1
    Text = '3'
  end
  object memoLowercase: TMemo
    Left = 184
    Top = 120
    Width = 169
    Height = 133
    CharCase = ecLowerCase
    Lines.Strings = (
      'this is some text')
    TabOrder = 2
  end
  object cbTextHint: TComboBox
    Left = 184
    Top = 16
    Width = 169
    Height = 21
    Style = csDropDownList
    ItemHeight = 13
    TabOrder = 3
    TextHint = 'Pick a City'
    Items.Strings = (
      'Rome'
      'Paris'
      'Amsterdam'
      'London'
      'Washington'
      'Maxico City'
      'Brasilia'
      'Buenos Aires'
      'Bejing'
      'Tokio'
      'Camberra'
      'Kuala Lumpur')
  end
  object btnUpcase: TButton
    Left = 232
    Top = 83
    Width = 75
    Height = 25
    Caption = 'btnUpcase'
    TabOrder = 4
    OnClick = btnUpcaseClick
  end
  object btnAlign: TButton
    Left = 48
    Top = 59
    Width = 75
    Height = 25
    Caption = 'btnAlign'
    TabOrder = 5
    OnClick = btnAlignClick
  end
  object edTextHint: TEdit
    Left = 24
    Top = 120
    Width = 121
    Height = 21
    TabOrder = 6
    TextHint = 'Your name'
  end
  object edPassword: TEdit
    Left = 27
    Top = 232
    Width = 121
    Height = 21
    PasswordChar = #9632
    TabOrder = 7
    Text = 'password'
  end
end
HTML file generated by PasToWeb, a tool by Marco Cantù
Copyright 2008 Marco Cantù