home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l040 / 11.ddi / WDOCDEMO.ZIP / STATTEST.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-10-27  |  4.0 KB  |  105 lines

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