home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / reslib / stattxt / stattxt.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.0 KB  |  38 lines

  1. //************************************************************
  2. // Using Resources - Switching Resources Dynamically
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //************************************************************
  8. #include <iframe.hpp>
  9. #include <iapp.hpp>
  10. #include <istattxt.hpp>
  11. #include "mytext.h"
  12.  
  13. void main()
  14. {
  15.    // Store the location of our resources from MYENG.DLL
  16.    // in the application framework.
  17.    IApplication::current()
  18.      .setUserResourceLibrary("myeng");
  19.  
  20.    // Create a frame and a text field for the client.
  21.    IFrameWindow frame("Text from a Resource File");
  22.    IStaticText text(100, &frame, &frame);
  23.  
  24.    // Align and add the text from a resource.
  25.    text
  26.      .setAlignment(IStaticText::centerCenter)
  27.      .setText(MY_TEXT);
  28.  
  29.    // Put the text in the client and show the window.
  30.    frame
  31.      .setClient(&text)
  32.      .setFocus()
  33.      .show();
  34.  
  35.    // Run the application.
  36.    IApplication::current().run();
  37. }
  38.