Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SpecPalette.cpp

Go to the documentation of this file.
00001 /* provides stand-alone interface to the spectral palette designer */
00002 #include "wxUIElements/vuSpecPalette.h"
00003 #include <wx/frame.h>
00004 #include <iostream>
00005 using namespace std;
00006 
00012 //----------------------------------------------------------------------------
00013 //------------------------- The wxApp application class ----------------------
00014 //----------------------------------------------------------------------------
00015 
00016 // Define a new application type
00017 class SPaled : public wxApp
00018 {
00019 public:
00021 
00022        bool OnInit();
00023 
00024 private:
00026     wxFrame *m_Main;
00027 };
00028 
00029 //----------------------------------------------------------------------------
00030 //------------------------- public: bool OnInit() ----------------------------
00031 //----------------------------------------------------------------------------
00032 
00033 bool SPaled::OnInit()
00034 {
00035     SPalette spal;
00036     vuSpecPalette spalDlg(m_Main, spal);
00037     SetTopWindow(&spalDlg);
00038     if(argc > 1) {
00039         cout << "loading palette "<<argv[1]<<" ... ";
00040         if(!spal.load(argv[1])) {
00041             cout << "error loading file." << endl;
00042             return false;
00043         } else {
00044             cout << "done."<<endl;
00045             spalDlg.FitAllDesignColours();
00046         }
00047     }
00048     if(spalDlg.ShowModal() == wxID_OK) {
00049       return false;     // false to make the terminate the application
00050     } else return false;
00051 };
00052 //----------------------------------------------------------------------------
00053 //------------------------- Main program implementation ----------------------
00054 //----------------------------------------------------------------------------
00055 
00056     //This wxWindows macro implements the main function of the program.
00057     //See the wxWindows documentation for more information.
00058 
00059 IMPLEMENT_APP(SPaled)

Generated on Wed Dec 15 21:20:31 2004 for vuVolume by  doxygen 1.3.9.1