File: unit1.pas

package info (click to toggle)
lazarus 2.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 214,460 kB
  • sloc: pascal: 1,862,622; xml: 265,709; cpp: 56,595; sh: 3,008; java: 609; makefile: 535; perl: 297; sql: 222; ansic: 137
file content (196 lines) | stat: -rw-r--r-- 4,354 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
unit unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Dialogs, Forms, Controls, Graphics,
  StdCtrls, Buttons, Menus,
  ExtCtrls, PopupNotifier, ActnList, ComCtrls, Grids,
  ColorBox, CheckLst, DBGrids;

type

  { TForm1 }

  TForm1 = class(TForm)
    ApplicationProperties1: TApplicationProperties;
    BitBtn1: TBitBtn;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Button9: TButton;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckListBox1: TCheckListBox;
    ColorBox1: TColorBox;
    ColorListBox1: TColorListBox;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    DBGrid1: TDBGrid;
    Edit1: TEdit;
    GroupBox1: TGroupBox;
    ImageList1: TImageList;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    FlipLabel: TLabel;
    Label8: TLabel;
    ListBox1: TListBox;
    ListBox2: TListBox;
    MainMenu1: TMainMenu;
    Memo1: TMemo;
    MenuItem1: TMenuItem;
    MenuItem10: TMenuItem;
    FileMnu: TMenuItem;
    MenuItem26: TMenuItem;
    MenuItem27: TMenuItem;
    MenuItem28: TMenuItem;
    MenuItem29: TMenuItem;
    NewMnu: TMenuItem;
    MenuItem19: TMenuItem;
    MenuItem2: TMenuItem;
    MenuItem20: TMenuItem;
    MenuItem21: TMenuItem;
    MenuItem22: TMenuItem;
    MenuItem23: TMenuItem;
    MenuItem24: TMenuItem;
    MenuItem25: TMenuItem;
    MenuItem3: TMenuItem;
    MenuItem4: TMenuItem;
    MenuItem5: TMenuItem;
    MenuItem6: TMenuItem;
    MenuItem7: TMenuItem;
    MenuItem8: TMenuItem;
    MenuItem9: TMenuItem;
    PageControl1: TPageControl;
    Panel1: TPanel;
    PopupMenu1: TPopupMenu;
    PopupNotifier1: TPopupNotifier;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioGroup1: TRadioGroup;
    ScrollBar1: TScrollBar;
    Shape2: TShape;
    SpeedButton1: TSpeedButton;
    StaticText1: TStaticText;
    StringGrid1: TStringGrid;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    TabSheet3: TTabSheet;
    TabSheet4: TTabSheet;
    TrayIcon1: TTrayIcon;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure MenuItem20Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    procedure DefaultWidths;
  public
  end;

var
  Form1: TForm1; 

implementation

{$r *.lfm}

{ TForm1 }

procedure TForm1.Button3Click(Sender: TObject);
begin
  if BiDiMode <> bdLeftToRight then
    BiDiMode := bdLeftToRight
  else
    BiDiMode := bdRightToLeft;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  DefaultWidths;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  ParentBidiMode := True;
  if Application.BidiMode = bdRightToLeft then
    Application.BidiMode := bdLeftToRight
  else
    Application.BidiMode := bdRightToLeft;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
  if StringGrid1.TitleStyle >= tsNative then
    StringGrid1.TitleStyle := tsLazarus
  else
    StringGrid1.TitleStyle := succ(StringGrid1.TitleStyle);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  TrayIcon1.BalloonHint := 'Balloon Hint?';
  TrayIcon1.Hint := 'Ok!';
  TrayIcon1.ShowBalloonHint;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  FlipChildren(True);
  if IsFlipped then
  begin
    FlipLabel.Caption := 'Flipped';
    FlipLabel.Color := clRed;
  end
  else
  begin
    FlipLabel.Caption := 'Native';
    FlipLabel.Color := clNone;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  DefaultWidths;
end;

procedure TForm1.MenuItem20Click(Sender: TObject);
begin
  Close;
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
  PopupNotifier1.Text := 'Notify me?';
  PopupNotifier1.Show;
end;

procedure TForm1.DefaultWidths;
var
  i: Integer;
begin
  for i := 0 to StringGrid1.ColCount -1 do
    StringGrid1.ColWidths[i]:=50;
end;

end.