MutChild.h
gehe zur Dokumentation dieser Datei
00001 
00105 #ifndef MUTCHILD_H
00106 #define MUTCHILD_H
00107 
00108 #include "wx/toolbar.h"
00109 #include "wx/dynarray.h"
00110 #include "wx/arrimpl.cpp" // this is a magic incantation which must be done!
00111 #include "mhDefs.h"
00112 #include "wx/aui/aui.h"
00113 #include "MutTextBox.h"
00114 
00115 
00116 /*
00117 typedef int WinKind;
00118 #define WK_KEY 0
00119 #define WK_TS  1
00120 #define WK_ACT 2
00121 #define WK_LOGIC 3
00122 #define WK_ROUTE 4
00123 #define WK_EDIT 5
00124 #define WK_NULL 6
00125 */
00126 
00127 //extern WinKind ActiveWinKind;
00128 
00129 //#define PARENT_KIND (PARENT->winKind)
00130 //#define PARENT_BOX (PARENT->winAttr->Box)
00131 //#define PARENT ((MutChild*)GetParent())
00132 
00133 
00134 //class WinAttr;
00135 //WX_DECLARE_OBJARRAY(WinAttr, ArrayOfWinAttr);
00136 
00137 //WX_DEFINE_OBJARRAY(ArrayOfWinAttr);
00138 
00139 extern ArrayOfWinAttr WinAttrs[WK_NULL];
00140 
00141 class MutFrame;
00142 
00143 //#ifdef MDI_FORCE_EXTERN
00144 //class MutChild: public wxAuiPaneInfo, private wxObject
00145 //#else
00146 //class MutChild: public wxMDIChildFrame
00147 //#endif
00148 
00149 class MutChild: public MutTextBox
00150 {
00151 
00152 public:
00153         MutChild (WinKind winkind,
00154                   WinAttr *winAttr,
00155                   wxWindow * parent= NULL,
00156                   wxWindowID id = -1,
00157 
00158                   const wxPoint& pos = wxDefaultPosition,
00159                   const wxSize & size = wxDefaultSize);
00160 
00161         ~MutChild();
00162 
00163         void OnActivate(wxActivateEvent& event);
00164 
00165 //    void OnRefresh(wxCommandEvent& event);
00166 //    void OnUpdateRefresh(wxUpdateUIEvent& event);
00167 //    void OnQuit(wxCommandEvent& event);
00168 //    void OnSize(wxSizeEvent& event);
00169 //    void OnMove(wxMoveEvent& event);
00170 
00171         void deleteFromWinAttrs();
00172 
00173         void OnClose(wxCloseEvent& event)
00174         {
00175                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00176 #ifdef DEBUG
00177                 std::cerr << "MutChild::OnClose" << std::endl;
00178 #endif
00179                 MutTextBox::OnClose(event);
00180         }
00181 
00182 
00183         void OnAuiClose(wxAuiManagerEvent& event)
00184 
00185         {
00186                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00187 #ifdef DEBUG
00188                 std::cerr << "MutChild::OnAuiClose" << std::endl;
00189 #endif
00190                 deleteFromWinAttrs();
00191         }
00192 
00193         // Override sizing for drawing the color
00194 
00195         void GetClientSize(int * width, int * height)
00196         {
00197                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00198                 MutTextBox::GetClientSize(width,height);
00199 
00200                 if ((width += 2) < 0) width = 0;
00201 
00202                 if ((height +=2) < 0) height =0;
00203         }
00204 
00205         void SetClientSize(int width, int height)
00206         {
00207                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00208                 MutTextBox::SetClientSize(width-2, height-3);
00209         }
00210 
00211         void SetClientSize(const wxSize& size)
00212         {
00213                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00214                 wxSize s = size;
00215                 s.IncBy(-2);
00216                 MutTextBox::SetClientSize(s);
00217         }
00218 
00219         void ClientToScreen(int * x, int * y )
00220 
00221         {
00222                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00223                 MutTextBox::ClientToScreen(x,y);
00224                 x+=1;
00225                 y+=1;
00226         }
00227 
00228         wxPoint ClientToScreen(const wxPoint& pt) const
00229         {
00230                 wxASSERT(WK_KEY <= winKind && winKind < WK_NULL);
00231                 return MutTextBox::ClientToScreen(pt)+wxPoint(1,1);
00232         }
00233 
00234 
00235 //      void MenuPassOn(wxCommandEvent& event);
00236 //      void MenuPassToParent(wxCommandEvent& event);
00237 
00238         DECLARE_EVENT_TABLE()
00239 };
00240 
00241 extern int gs_nFrames;
00242 
00243 WinAttr* GetWinAttr(WinKind kind, int box = 0);
00244 
00245 WinAttr* Get(WinKind kind, int box = 0);
00246 
00247 bool IsOpen(WinKind kind, int box = 0);
00248 
00249 bool IsWanted(WinKind kind, int box = 0);
00250 
00251 void DontWant(WinKind kind, int box = 0);
00252 
00253 int NumberOfOpen(WinKind kind);
00254 
00255 #endif
00256 

Erzeugt am Sun Aug 21 2011 10:51:54 für Mutabor von doxygen 1.7.4