ConstraintsPanel.h

00001 // -*- C++ -*- generated by wxGlade 0.4 on Sat Dec 10 22:01:21 2005
00002 
00003 #include "../Constraint.h"
00004 #include "../CountedPtr.h"
00005 #include "../History.h"
00006 #include "../Parser.h"
00007 #include "../VariableNames.h"
00008 
00009 #include "FunctionValidator.h"
00010 
00011 #ifndef CONSTRAINTSPANEL_H
00012 #define CONSTRAINTSPANEL_H
00013 
00014 // begin wxGlade: ::dependencies
00015 // end wxGlade
00016 
00017 
00018 class ConstraintsPanel: public wxPanel {
00019 public:
00020     friend class ConstraintsValidator;
00021 
00022     enum {
00023         // TODO: usunąć zbędne
00024 //        ID_BUTTON_ADD = 1,
00025         ID_BUTTON_EDIT = 1,
00026 //        ID_BUTTON_REMOVE,
00027         ID_COMBO_FUNCTION,
00028         ID_LISTBOX
00029     };
00030 
00031     // begin wxGlade: ConstraintsPanel::ids
00032     // end wxGlade
00033 
00034     ConstraintsPanel(wxWindow*                      parent,
00035                      int                            id,
00036                      CountedPtr<const Parser>       cpParser,
00037                      ProblemBase*                   pProblem,
00038                      FunctionValidator::Type        functionValidatorType,
00039                      History&                       rFunctionHistory,
00040                      History&                       rConstraintHistory,
00041                      const wxPoint&                 pos=wxDefaultPosition,
00042                      const wxSize&                  size=wxDefaultSize,
00043                      long                           style=0);
00044 
00045 
00046     void        OnAdd(wxCommandEvent& event);
00047     void        OnEdit(wxCommandEvent& event);
00048     void        OnRemove(wxCommandEvent& event);
00049     void        OnTextUpdate(wxCommandEvent& event);
00050     void        OnComboSelect(wxCommandEvent& event);
00051     void        OnTextEnter(wxCommandEvent& event);
00052     void        OnListSelect(wxCommandEvent& event);
00053     void        OnConstraintsChange(wxCommandEvent& event);
00054 
00057     void        InitFunctionDirty();
00058 private:
00059     // begin wxGlade: ConstraintsPanel::methods
00060     void set_properties();
00061     void do_layout();
00062     // end wxGlade
00063 
00067     void        UpdateFunction();
00069     bool        ParseFunction();
00071     void        RefreshList();
00072 
00077     wxArrayInt  MarkInvalidConstraints() const;
00078 
00084     void        RemoveInvalidConstraints(const wxArrayInt& indexes);
00085 
00086 
00087     CountedPtr<const Parser>        mcpParser;      
00088     CountedPtr<const FunctionBase>  mcpFunction;    
00089     CountedPtr<const VariableNames> mcpVariables;   
00090     vector<Constraint>              mConstraints;   
00091 
00092     ProblemBase*    mpProblem;  
00093 
00094     bool        mFunctionDirty; 
00095 
00096     History&    mrConstraintHistory;    
00097 
00098 protected:
00099     // begin wxGlade: ConstraintsPanel::attributes
00100     wxStaticBox* sizer_5_staticbox;
00101     wxStaticBox* sizer_10_staticbox;
00102     wxComboBox* mpFunctionCombo;
00103     wxListBox* mpConstraintList;
00104     wxButton* mpAddButton;
00105     wxButton* mpEditButton;
00106     wxButton* mpRemoveButton;
00107     // end wxGlade
00108 
00109     DECLARE_EVENT_TABLE()
00110 }; // wxGlade: end class
00111 
00112 
00113 #endif // CONSTRAINTSPANEL_H

Wygenerowano Fri Sep 29 21:04:48 2006 dla EduOptim2 programem  doxygen 1.4.6