home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / tpw / docdemos / stattest.pas < prev    next >
Pascal/Delphi Source File  |  1991-05-20  |  4KB  |  106 lines

  1. {************************************************}
  2. {                                                }
  3. {   Turbo Pascal for Windows                     }
  4. {   Demo program                                 }
  5. {   Copyright (c) 1991 by Borland International  }
  6. {                                                }
  7. {************************************************}
  8.  
  9. program StatTest;
  10.  
  11. uses WObjects, WinTypes, WinProcs;
  12.  
  13. const
  14.   id_ST1 = 101;
  15.   id_ST2 = 102;
  16.   id_ST3 = 103;
  17.   id_ST4 = 104;
  18.   id_ST5 = 105;
  19.   id_ST6 = 106;
  20.   id_ST7 = 107;
  21.   id_ST8 = 108;
  22.   id_ST9 = 109;
  23.   id_ST10 = 110;
  24.   id_ST11 = 111;
  25.   id_ST12 = 112;
  26.   id_ST13 = 113;
  27.   id_ST14 = 114;
  28.   id_ST15 = 115;
  29.   id_ST16 = 116;
  30.   id_ST17 = 117;
  31.   id_ST18 = 118;
  32.   id_ST19 = 119;
  33.   id_ST20 = 120;
  34.  
  35. type
  36.  
  37.   TestApplication = object(TApplication)
  38.     procedure InitMainWindow; virtual;
  39.   end;
  40.  
  41.   PTestWindow = ^TestWindow;
  42.   TestWindow = object(TWindow)
  43.     constructor Init(AParent: PWindowsObject; ATitle: PChar);
  44.   end;
  45.  
  46. {--------------------------------------------------}
  47. { TestWindow's method implementations:             }
  48. {--------------------------------------------------} 
  49.  
  50. constructor TestWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  51. var
  52.   AStat : PStatic;
  53. begin
  54.   TWindow.Init(AParent, ATitle);
  55.   AStat := New(PStatic, Init(@Self, id_ST1, 'Default Static', 20, 20, 150, 24, 0));
  56.   AStat := New(PStatic, Init(@Self, id_ST2, 'SS_SIMPLE', 20, 50, 150, 24, 0));
  57.   AStat := New(PStatic, Init(@Self, id_ST3, 'SS_LEFT', 20, 80, 150, 24, 0));
  58.   AStat := New(PStatic, Init(@Self, id_ST4, 'SS_CENTER', 20, 110, 150, 24, 0));
  59.   AStat := New(PStatic, Init(@Self, id_ST5, 'SS_RIGHT', 20, 140, 150, 24, 0));
  60.   AStat := New(PStatic, Init(@Self, id_ST6, 'SS_BLACKFRAME', 20, 170, 150, 24, 0));
  61.   AStat := New(PStatic, Init(@Self, id_ST7, 'SS_BLACKRECT', 20, 200, 150, 24, 0));
  62.   AStat := New(PStatic, Init(@Self, id_ST8, 'SS_GRAYFRAME', 20, 230, 150, 24, 0));
  63.   AStat := New(PStatic, Init(@Self, id_ST9, 'SS_GRAYRECT', 20, 260, 150, 24, 0));
  64.   AStat := New(PStatic, Init(@Self, id_ST10, 'SS_NOPREFIX', 20, 290, 150, 24, 0));
  65.   AStat := New(PStatic, Init(@Self, id_ST11, 'Sample &Text', 170, 20, 200, 24, 0));
  66.   AStat := New(PStatic, Init(@Self, id_ST12, 'Sample &Text', 170, 50, 200, 24, 0));
  67.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_SIMPLE;
  68.   AStat := New(PStatic, Init(@Self, id_ST13, 'Sample &Text', 170, 80, 200, 24, 0));
  69.   AStat := New(PStatic, Init(@Self, id_ST14, 'Sample &Text', 170, 110, 200, 24, 0));
  70.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_CENTER;
  71.   AStat := New(PStatic, Init(@Self, id_ST15, 'Sample &Text', 170, 140, 200, 24, 0));
  72.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_RIGHT;
  73.   AStat := New(PStatic, Init(@Self, id_ST16, 'Sample &Text', 170, 170, 200, 24, 0));
  74.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_BLACKFRAME;
  75.   AStat := New(PStatic, Init(@Self, id_ST17, 'Sample &Text', 170, 200, 200, 24, 0));
  76.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_BLACKRECT;
  77.   AStat := New(PStatic, Init(@Self, id_ST18, 'Sample &Text', 170, 230, 200, 24, 0));
  78.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_GRAYFRAME;
  79.   AStat := New(PStatic, Init(@Self, id_ST19, 'Sample &Text', 170, 260, 200, 24, 0));
  80.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_GRAYRECT;
  81.   AStat := New(PStatic, Init(@Self, id_ST20, 'Sample &Text', 170, 290, 200, 24, 0));
  82.   AStat^.Attr.Style := AStat^.Attr.Style and not SS_LEFT or SS_NOPREFIX or SS_RIGHT;
  83. end;
  84.  
  85. {--------------------------------------------------}
  86. { TestApplication's method implementations:        }
  87. {--------------------------------------------------} 
  88.  
  89. procedure TestApplication.InitMainWindow;
  90. begin
  91.   MainWindow := New(PTestWindow, Init(nil, 'Static Control Tester'));
  92. end;
  93.  
  94. {--------------------------------------------------}
  95. { Main program:                                    }
  96. {--------------------------------------------------} 
  97.  
  98. var
  99.   TestApp : TestApplication;
  100. begin
  101.   TestApp.Init('StatTest');
  102.   TestApp.Run;
  103.   TestApp.Done;
  104. end.
  105.  
  106.