Marco Cantù 1998, Mastering Delphi 4

Project: STATUSB.DPR


Project Structure


STATUSB.DPR

program Statusb;

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

{$R *.RES}

begin
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

STATUSF.PAS

unit StatusF;

interface

uses
  SysUtils, Windows, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, Menus, ExtCtrls, Buttons, ComCtrls;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    New1: TMenuItem;
    Open1: TMenuItem;
    Save1: TMenuItem;
    Saveas1: TMenuItem;
    N1: TMenuItem;
    Exit1: TMenuItem;
    Help1: TMenuItem;
    About1: TMenuItem;
    Edit1: TMenuItem;
    Undo1: TMenuItem;
    N2: TMenuItem;
    Cut1: TMenuItem;
    Copy1: TMenuItem;
    Paste1: TMenuItem;
    Panel2: TPanel;
    SpeedButtonNote: TSpeedButton;
    SpeedButtonBold: TSpeedButton;
    SpeedButtonItalic: TSpeedButton;
    SpeedButtonUnderline: TSpeedButton;
    SpeedButtonLeft: TSpeedButton;
    SpeedButtonCenter: TSpeedButton;
    SpeedButtonRight: TSpeedButton;
    StatusBar1: TStatusBar;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure ShowHint(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnHint := ShowHint;
end;

procedure TForm1.ShowHint(Sender: TObject);
begin
  StatusBar1.SimpleText := Application.Hint;
end;

end.

STATUSF.DFM

object Form1: TForm1
  Left = 233
  Top = 162
  Width = 435
  Height = 300
  Caption = 'Status Bar'
  Font.Color = clBlack
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  Menu = MainMenu1
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Panel2: TPanel
    Left = 0
    Top = 0
    Width = 427
    Height = 30
    Align = alTop
    ParentShowHint = False
    ShowHint = True
    TabOrder = 0
    object SpeedButtonNote: TSpeedButton
      Left = 8
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Play Note|Play a note using the PC speaker'
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        3333330000003330033333333333330000003300003330033333330000003300
        0003000033333300000033300003000003333300000033333303300003333300
        0000333333033333033333000000333333033333033333000000333333033333
        0333330000003333330333330333330000003333330333330333330000003333
        3300033303333300000033333303300003333300000033333300033303333300
        0000333333333000033333000000333333333333333333000000333333333333
        333333000000}
    end
    object SpeedButtonBold: TSpeedButton
      Left = 120
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Bold|Show the text in bold'
      AllowAllUp = True
      GroupIndex = 2
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        3333330000003333333333333333330000003333333333333333330000003333
        0000000033333300000033330000000003333300000033333003333003333300
        0000333330033330033333000000333330033300033333000000333330000000
        3333330000003333300000000333330000003333300333300333330000003333
        3003333003333300000033330000000003333300000033330000000033333300
        0000333333333333333333000000333333333333333333000000333333333333
        333333000000}
    end
    object SpeedButtonItalic: TSpeedButton
      Left = 144
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Italic|Show the text in italics'
      AllowAllUp = True
      GroupIndex = 2
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        3333330000003333333333333333330000003333333333333333330000003333
        3000000333333300000033333330033333333300000033333330033333333300
        0000333333300333333333000000333333330033333333000000333333330033
        3333330000003333333300333333330000003333333330033333330000003333
        3333300333333300000033333330000003333300000033333333333333333300
        0000333333333333333333000000333333333333333333000000333333333333
        333333000000}
    end
    object SpeedButtonUnderline: TSpeedButton
      Left = 168
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Underlined|Show the text underlined'
      AllowAllUp = True
      GroupIndex = 2
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        3333330000003333333333333333330000003333333333333333330000003333
        3000000003333300000033333000000003333300000033333333333333333300
        0000333333300030033333000000333333000000033333000000333333003000
        3333330000003333330033003333330000003333330033003333330000003333
        3300330033333300000033333000300033333300000033333333333333333300
        0000333333333333333333000000333333333333333333000000333333333333
        333333000000}
    end
    object SpeedButtonLeft: TSpeedButton
      Left = 40
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Left|Left justify the text'
      GroupIndex = 1
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        333333000000330000000000000033000000330FFFFFFFFFFFF033000000330F
        0000000FFFF033000000330FFFFFFFFFFFF033000000330F000FFFFFFFF03300
        0000330FFFFFFFFFFFF033000000330F00000FFFFFF033000000330FFFFFFFFF
        FFF033000000330F000FFFFFFFF033000000330FFFFFFFFFFFF033000000330F
        00000000FFF033000000330FFFFFFFFFFFF033000000330F000000FFFFF03300
        0000330FFFFFFFFFFFF033000000330000000000000033000000333333333333
        333333000000}
    end
    object SpeedButtonCenter: TSpeedButton
      Left = 64
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Center|Center the text'
      GroupIndex = 1
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        333333000000330000000000000033000000330FFFFFFFFFFFF033000000330F
        FF000000FFF033000000330FFFFFFFFFFFF033000000330FFFF0000FFFF03300
        0000330FFFFFFFFFFFF033000000330FFF000000FFF033000000330FFFFFFFFF
        FFF033000000330FFFFF00FFFFF033000000330FFFFFFFFFFFF033000000330F
        F00000000FF033000000330FFFFFFFFFFFF033000000330FFF000000FFF03300
        0000330FFFFFFFFFFFF033000000330000000000000033000000333333333333
        333333000000}
    end
    object SpeedButtonRight: TSpeedButton
      Left = 88
      Top = 2
      Width = 25
      Height = 25
      Hint = 'Right|Right justify the text'
      GroupIndex = 1
      Glyph.Data = {
        42010000424D4201000000000000760000002800000012000000110000000100
        040000000000CC00000000000000000000001000000000000000000000000000
        80000080000000808000800000008000800080800000C0C0C000808080000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
        333333000000330000000000000033000000330FFFFFFFFFFFF033000000330F
        FFF0000000F033000000330FFFFFFFFFFFF033000000330FFFFFFFF000F03300
        0000330FFFFFFFFFFFF033000000330FFFFFF00000F033000000330FFFFFFFFF
        FFF033000000330FFFFFFFF000F033000000330FFFFFFFFFFFF033000000330F
        FF00000000F033000000330FFFFFFFFFFFF033000000330FFFFF000000F03300
        0000330FFFFFFFFFFFF033000000330000000000000033000000333333333333
        333333000000}
    end
  end
  object StatusBar1: TStatusBar
    Left = 0
    Top = 235
    Width = 427
    Height = 19
    Panels = <>
    SimplePanel = True
  end
  object MainMenu1: TMainMenu
    Left = 24
    Top = 48
    object File1: TMenuItem
      Caption = '&File'
      Hint = 'Operations on files'
      object New1: TMenuItem
        Caption = '&New...'
        Hint = 'Create a new file'
      end
      object Open1: TMenuItem
        Caption = '&Open...'
        Hint = 'Open an existing file'
      end
      object Save1: TMenuItem
        Caption = '&Save'
        Hint = 'Save the current file'
      end
      object Saveas1: TMenuItem
        Caption = 'Save &as...'
        Hint = 'Save the file with a new name'
      end
      object N1: TMenuItem
        Caption = '-'
      end
      object Exit1: TMenuItem
        Caption = 'E&xit'
        Hint = 'Terminate the application'
      end
    end
    object Edit1: TMenuItem
      Caption = '&Edit'
      Hint = 'Operations on the text'
      object Undo1: TMenuItem
        Caption = '&Undo'
        Hint = 'Reverse the last action'
      end
      object N2: TMenuItem
        Caption = '-'
      end
      object Cut1: TMenuItem
        Caption = 'Cu&t'
        Hint = 'Delete the selection, moving it to the clipboard'
      end
      object Copy1: TMenuItem
        Caption = '&Copy'
        Hint = 'Make a copy of the current selection in the clipboard'
      end
      object Paste1: TMenuItem
        Caption = '&Paste'
        Hint = 'Paste the current clipboard data'
      end
    end
    object Help1: TMenuItem
      Caption = '&Help'
      Hint = 'Access to information about the program'
      object About1: TMenuItem
        Caption = 'About...'
        Hint = 'Display the About Box'
      end
    end
  end
end


Copyright Marco Cantù 1998