home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 7.ddi / OWLDEMOS.ZIP / STATTEST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.9 KB  |  74 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #include <owl.h>
  4. #include <window.h>
  5. #include <static.h>
  6.  
  7. class TTestApp : public TApplication
  8. {
  9. public:
  10.   TTestApp(LPSTR AName, HINSTANCE hInstance, HINSTANCE hPrevInstance,
  11.     LPSTR lpCmdLine, int nCmdShow)
  12.     : TApplication(AName, hInstance, hPrevInstance, lpCmdLine, nCmdShow) {};
  13.   virtual void InitMainWindow();
  14. };
  15.  
  16. class TTestWindow : public TWindow
  17. {
  18. public:
  19.   TTestWindow(PTWindowsObject AParent, LPSTR ATitle);
  20. };
  21.  
  22. TTestWindow::TTestWindow(PTWindowsObject AParent, LPSTR ATitle)
  23.   : TWindow(AParent, ATitle)
  24. {
  25.   TStatic *AStatic;
  26.  
  27.   Attr.X = 100;
  28.   Attr.Y = 100;
  29.   Attr.W = 415;
  30.   Attr.H = 355;
  31.   new TStatic(this, -1, "Default Static", 20, 20, 150, 24, 0);
  32.   new TStatic(this, -1, "SS_SIMPLE", 20, 50, 150, 24, 0);
  33.   new TStatic(this, -1, "SS_LEFT", 20, 80, 150, 24, 0);
  34.   new TStatic(this, -1, "SS_CENTER", 20, 110, 150, 24, 0);
  35.   new TStatic(this, -1, "SS_RIGHT", 20, 140, 150, 24, 0);
  36.   new TStatic(this, -1, "SS_BLACKFRAME", 20, 170, 150, 24, 0);
  37.   new TStatic(this, -1, "SS_BLACKRECT", 20, 200, 150, 24, 0);
  38.   new TStatic(this, -1, "SS_GRAYFRAME", 20, 230, 150, 24, 0);
  39.   new TStatic(this, -1, "SS_GRAYRECT", 20, 260, 150, 24, 0);
  40.   new TStatic(this, -1, "SS_NOPREFIX", 20, 290, 150, 24, 0);
  41.   new TStatic(this, -1, "Sample &Text", 170, 20, 200, 24, 0);
  42.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 50, 200, 24, 14);
  43.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_SIMPLE;
  44.   new TStatic(this, -1, "Sample &Text", 170, 80, 200, 24, 0);
  45.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 110, 200, 24, 14);
  46.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_CENTER;
  47.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 140, 200, 24, 14);
  48.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_RIGHT;
  49.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 170, 200, 24, 0);
  50.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_BLACKFRAME;
  51.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 200, 200, 24, 0);
  52.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_BLACKRECT;
  53.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 230, 200, 24, 0);
  54.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_GRAYFRAME;
  55.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 260, 200, 24, 0);
  56.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_GRAYRECT;
  57.   AStatic = new TStatic(this, -1, "Sample &Text", 170, 290, 200, 24, 0);
  58.   AStatic->Attr.Style = (AStatic->Attr.Style & ~SS_LEFT) | SS_RIGHT | SS_NOPREFIX;
  59. }
  60.  
  61. void TTestApp::InitMainWindow()
  62. {
  63.   MainWindow = new TTestWindow(NULL, Name);
  64. }
  65.  
  66. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  67.   LPSTR lpCmdLine, int nCmdShow)
  68. {
  69.   TTestApp TestApp("Static Control Tester", hInstance, hPrevInstance,
  70.     lpCmdLine, nCmdShow);
  71.   TestApp.Run();
  72.   return TestApp.Status;
  73. }
  74.