Course list http://www.c-jump.com/bcc/

Lab 3: FLUID Window Class


  1. Description
  2. Copying Visual Studio Project
  3. Using FLUID to create a C++ class
  4. Getting Started with FLUID Project
  5. Adding CFluidWindow class
  6. Adding the class constructor
  7. Adding the window
  8. Testing what we have so far
  9. Adding FLUID-generated .CXX to Visual Studio Project
  10. How to submit

1. Description



2. Copying Visual Studio Project


  1. The prototype for this exercise is Lab 1, c255labs\labs\c255_lab01_intro.

  2. Follow Lab 2 instructions to make a copy of Lab 1 directory. Remember to cleanup Lab 1 project before making a copy.

  3. Rename new copy as c255labs\labs\c255_lab03_win_class.

  4. Open c255labs\labs\c255_lab03_win_class\c255_lab01_intro.sln in Visual Studio. (You can double-click the .SLN file name in Windows Explorer to open it automatically.)

  5. In Solution Explorer, rename solution name as c255_lab03_win_class.

  6. Rename project name as c255_lab03_win_class.

  7. Rename c255_lab01_main.cpp as c255_lab03_main.cpp.

  8. Save everything by CTRL+SHIFT+S.

  9. Build and run the program. Everything should compile and run without a problem.

  10. To save your work:

     


3. Using FLUID to create a C++ class



4. Getting Started with FLUID Project



5. Adding CFluidWindow class



6. Adding the class constructor



7. Adding the window



8. Testing what we have so far



9. Adding FLUID-generated .CXX to Visual Studio Project


  1. Open Visual Studio project and add file fluid_project/CFluidWindow.cxx to the list of source files.

  2. Create CDemoWindow.h under project source directory

    
        c255labs\labs\c255_lab03_win_class\src
    
    
  3. Copy and paste the following code into the file:

    
    // CDemoWindow.h
    
    #ifndef _CDEMOWINDOW_H_INCLUDED_
    #define _CDEMOWINDOW_H_INCLUDED_
    
    #include "../fluid_project/CFluidWindow.h"
    
    class CDemoWindow : public CFluidWindow {
    public:
        void show()
        {
            // Make the window visible:
            win_app->show();
        }
    };//class CDemoWindow
    
    #endif // _CDEMOWINDOW_H_INCLUDED_
    
    
  4. Modify c255_lab03_main.cpp as follows:

    
    // main.cpp
    
    #include "CDemoWindow.h"
    
    int main()
    {
        CDemoWindow window;
        window.show();
        return Fl::run();
    }
    
    
  5. Compile and test the program.

     


10. How to submit