home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / STATIC.PAK / STATICX.CPP < prev   
C/C++ Source or Header  |  1995-08-29  |  3KB  |  69 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //----------------------------------------------------------------------------
  4. #include <owl\owlpch.h>
  5. #include <owl\applicat.h>
  6. #include <owl\framewin.h>
  7. #include <owl\static.h>
  8.  
  9. class TTestWindow : public TWindow {
  10.   public:
  11.     TTestWindow();
  12. };
  13.  
  14. TTestWindow::TTestWindow()
  15.   : TWindow(0, 0, 0)
  16. {
  17.   TStatic* statik;
  18.  
  19.   Attr.W = 390;
  20.   Attr.H = 334;
  21.   
  22.   new TStatic(this, -1, "Default Static", 20, 20, 150, 24, 0);
  23.   new TStatic(this, -1, "SS_SIMPLE", 20, 50, 150, 24, 0);
  24.   new TStatic(this, -1, "SS_LEFT", 20, 80, 150, 24, 0);
  25.   new TStatic(this, -1, "SS_CENTER", 20, 110, 150, 24, 0);
  26.   new TStatic(this, -1, "SS_RIGHT", 20, 140, 150, 24, 0);
  27.   new TStatic(this, -1, "SS_BLACKFRAME", 20, 170, 150, 24, 0);
  28.   new TStatic(this, -1, "SS_BLACKRECT", 20, 200, 150, 24, 0);
  29.   new TStatic(this, -1, "SS_GRAYFRAME", 20, 230, 150, 24, 0);
  30.   new TStatic(this, -1, "SS_GRAYRECT", 20, 260, 150, 24, 0);
  31.   new TStatic(this, -1, "SS_NOPREFIX", 20, 290, 150, 24, 0);
  32.   new TStatic(this, -1, "Sample &Text", 170, 20, 200, 24, 0);
  33.  
  34.   statik = new TStatic(this, -1, "Sample &Text", 170, 50, 200, 24, 14);
  35.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_SIMPLE;
  36.   new TStatic(this, -1, "Sample &Text", 170, 80, 200, 24, 0);
  37.   statik = new TStatic(this, -1, "Sample &Text", 170, 110, 200, 24, 14);
  38.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_CENTER;
  39.   statik = new TStatic(this, -1, "Sample &Text", 170, 140, 200, 24, 14);
  40.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_RIGHT;
  41.   statik = new TStatic(this, -1, "Sample &Text", 170, 170, 200, 24, 0);
  42.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_BLACKFRAME;
  43.   statik = new TStatic(this, -1, "Sample &Text", 170, 200, 200, 24, 0);
  44.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_BLACKRECT;
  45.   statik = new TStatic(this, -1, "Sample &Text", 170, 230, 200, 24, 0);
  46.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_GRAYFRAME;
  47.   statik = new TStatic(this, -1, "Sample &Text", 170, 260, 200, 24, 0);
  48.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_GRAYRECT;
  49.   statik = new TStatic(this, -1, "Sample &Text", 170, 290, 200, 24, 0);
  50.   statik->Attr.Style = (statik->Attr.Style & ~SS_LEFT) | SS_RIGHT|SS_NOPREFIX;
  51. }
  52.  
  53. //----------------------------------------------------------------------------
  54.  
  55. class TTestApp : public TApplication {
  56.   public:
  57.     TTestApp() : TApplication() {}
  58.     void InitMainWindow() {
  59.       MainWindow = new TFrameWindow(0, "Static Control Tester", new TTestWindow, TRUE);
  60.     }
  61. };
  62.  
  63. int
  64. OwlMain(int /*argc*/, char* /*argv*/ [])
  65. {
  66.   TTestApp app;
  67.   return app.Run();
  68. }
  69.