File: alert.adb

package info (click to toggle)
libtexttools 2.0.3-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,188 kB
  • ctags: 635
  • sloc: ada: 13,120; cpp: 1,679; ansic: 777; makefile: 156; sh: 2
file content (55 lines) | stat: -rw-r--r-- 1,367 bytes parent folder | download | duplicates (3)
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
with Ada.Text_IO;
use  Ada.Text_IO;

with Common, OS, Strings, UserIO, Controls, Windows;
use  Common, OS, Strings, UserIO, Controls, Windows;

procedure alert is
  line1 : aliased AStaticLine;
  line2 : aliased AStaticLine;
  ok    : aliased ASimpleButton;
  DT    : aDialogTaskRecord;

  b     : boolean;
  id    : AControlNumber;
begin
  StartupCommon( "TIA", "tia" );
  StartupOS;
  StartupUserIO;
  StartupControls;
  StartupWindows;

  OpenWindow( To255( "Alert Demo" ), 0, 0, 40, 20, normal, false );
  DrawWindow;

  Init( line1, 2, 2, 38, 2 );
  SetText( line1, "This a demonstration of alerts." );
  AddControl( line1'unchecked_access );

  Init( line2, 2, 3, 38, 3 );
  SetText( line2,  "There are 7 types of alert windows." );
  AddControl( line2'unchecked_access );

  Init( ok, 2, 18, 30, 18, 'o' );
  SetText( ok, "OK" );
  AddControl( ok'unchecked_access );

  DoDialog( DT );
  CloseWindow;

  NoteAlert( "This is a note alert" );
  CautionAlert( "This is a caution alert" );
  StopAlert( "This is a stop alert" );
  b := YesAlert( "This is a yes alert", warning );
  b := YesAlert( "This is a no alert", warning );
  b := CancelAlert( "This is a cancel alert", "Do it", warning );
  id := YesCancelAlert( "This is a yes/cancel alert", warning );

  ShutdownWindows;
  ShutdownControls;
  ShutdownUserIO;
  ShutdownOS;
  ShutdownCommon;

end alert;