MutLogicWnd.cpp
gehe zur Dokumentation dieser Datei
00001 
00032 // ---------------------------------------------------------------------------
00033 // headers
00034 // ---------------------------------------------------------------------------
00035 
00036 #include "Defs.h"
00037 // For compilers that support precompilation, includes "wx/wx.h".
00038 #include "wx/wxprec.h"
00039 
00040 #ifdef __BORLANDC__
00041 #pragma hdrstop
00042 #endif
00043 
00044 #ifndef WX_PRECOMP
00045 #include "wx/wx.h"
00046 //    #include "wx/mdi.h"
00047 #endif
00048 
00049 #include "Global.h"
00050 //#include <stdio.h>
00051 #include "Runtime.h"
00052 #include "MidiKern.h"
00053 //#include "Help.rh"
00054 //#include "Mutabor.rh"
00055 #include "MutLogicWnd.h"
00056 #include "MutChild.h"
00057 #include "MutFrame.h"
00058 #include "MutRouteWnd.h"
00059 
00060 
00061 //#if !defined(__WXMSW__)
00062 #include "Icon/Logic.xpm"
00063 #include "Icon/LogicOpen.xpm"
00064 #include "Icon/Tonesyst.xpm"
00065 #include "Icon/TonesystOpen.xpm"
00066 //#endif
00067 
00068 int pubTaste; // Taste aus anderen Fenstern f¸r MutWin
00069 
00070 extern bool UseColorBars;
00071 
00072 //void RightButtonMenu(TWindow *win, TPoint &point);
00073 
00074 // TMutTag -----------------------------------------------------------
00075 // repr‰sentiert Logik im Mut-Dialog
00076 
00077 #define MUTTAGX 90
00078 #define MUTTAGY 70
00079 
00080 
00081 wxSize MutTagSize(MUTTAGX, MUTTAGY);
00082 
00083 /*#define SETUPWINDOW_FONT(CLASS, BASECLASS, FONT)         \
00084   void CLASS::SetupWindow()                                                                             \
00085   {                                                                                                                             \
00086            BASECLASS::SetupWindow();                                                                    \
00087            SetWindowFont(HFONT(FONT), false);                                           \
00088   }
00089 
00090 */
00091 
00092 class MutTag : public wxWindow
00093 {
00094 
00095 public:
00096 
00097         MutTag(wxWindow *parent, const wxPoint& pos,
00098                int isLogic, int isOpen, int key, const wxString& text);
00099 
00100 private:
00101         bool IsLogic;
00102         int Key;
00103         wxIcon Icon;
00104         wxString Text;
00105         int TPos;
00106 
00107 public:
00108         int GetKey()
00109         {
00110                 return Key;
00111         }
00112 
00113         bool GetIsLogic()
00114 
00115         {
00116                 return IsLogic;
00117         }
00118 
00119         void InitText(wxDC& dc);
00120         /*    void ODADrawEntire(DRAWITEMSTRUCT far& drawInfo);
00121         void ODAFocus(DRAWITEMSTRUCT far& drawInfo);
00122         void ODASelect(DRAWITEMSTRUCT far& drawInfo);*/
00123         void OnPaint(wxPaintEvent& WXUNUSED(event));
00124         void OnChar(wxKeyEvent& event);
00125         void OnLeftDown(wxMouseEvent& event);
00126         void OnFocus(wxFocusEvent& event);
00127 
00128 private:
00129         void PaintCenteredText(wxDC &dc, wxString s, int y)
00130         {
00131                 wxCoord w, h;
00132                 dc.GetTextExtent(s, &w, &h);
00133                 dc.DrawText(s, (MUTTAGX-w)/2, y);
00134         }
00135 
00136 public:
00137         DECLARE_EVENT_TABLE()
00138 };
00139 
00140 BEGIN_EVENT_TABLE(MutTag, wxWindow)
00141         EVT_PAINT(MutTag::OnPaint)
00142         EVT_CHAR(MutTag::OnChar)
00143         EVT_LEFT_DOWN(MutTag::OnLeftDown)
00144         EVT_SET_FOCUS(MutTag::OnFocus)
00145         EVT_KILL_FOCUS(MutTag::OnFocus)
00146 END_EVENT_TABLE()
00147 
00148 /*TFont MutFont(8, 0, 0, 0, FW_NORMAL,
00149   false, false, false, 1, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
00150   DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "MS Sans Serif");
00151 
00152 SETUPWINDOW_FONT(TMutTag, TButton, MutFont)*/
00153 
00154 MutTag::MutTag(wxWindow *parent, const wxPoint& pos,
00155                int isLogic, int isOpen, int key, const wxString& text)
00156                 : wxWindow(parent, CM_MUTTAG, pos, MutTagSize)
00157 {
00158         /*  int Types[4] = { IDI_TONSYST, IDI_LOGIC, IDI_TONSYSTOPEN, IDI_LOGICOPEN};
00159           Attr.Style |= BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
00160                                  | WS_GROUP | WS_TABSTOP;
00161           Icon = new TIcon(GetModule()->GetInstance(), (TResId)Types[isLogic + 2*isOpen]);*/
00162         //      SetBackgroundColour(*wxWHITE);
00163 
00164         const char  ** TagIcon[4] = {
00165                                             tonesyst_xpm, logic_xpm, tonesystopen_xpm, logicopen_xpm
00166                                     };
00167 
00168         Icon = wxIcon(TagIcon[isLogic + 2*isOpen]);
00169         Text = text;
00170         TPos = -1;
00171         IsLogic = isLogic;
00172         Key = key;
00173 
00174 //TODO  Attr.AccelTable = IDA_MUTWIN;
00175 }
00176 
00177 void MutTag::InitText(wxDC& dc)
00178 
00179 {
00180         int i = Text.Length();
00181         wxCoord w, h;
00182         dc.GetTextExtent(Text, &w, &h);
00183 
00184         if ( w <= MUTTAGX-4 ) TPos = 0;
00185 
00186         while ( i >= 0 ) {
00187                 if ( Text[i] == '_' ) {
00188                         Text[i] = '-';
00189                         if ( TPos == -1 ) {
00190                                 dc.GetTextExtent(Text.Left(i+1), &w, &h);
00191                                 if ( w <= MUTTAGX-4 ) TPos = i+1;
00192                         }
00193                 }
00194 
00195                 i--;
00196         }
00197 
00198         if ( TPos == -1 ) TPos = 0;
00199 
00200         dc.GetTextExtent(Text.Mid(TPos), &w, &h);
00201 
00202         if ( w > MUTTAGX-4 )
00203                 Text.Last() = '.';
00204 
00205         dc.GetTextExtent(Text.Mid(TPos), &w, &h);
00206 
00207         int l = Text.Length();
00208 
00209         while ( w > MUTTAGX-4 ) {
00210                 l--;
00211                 Text.Truncate(l);
00212                 Text.Last() = '.';
00213                 dc.GetTextExtent(Text.Mid(TPos), &w, &h);
00214         }
00215 }
00216 
00217 void MutTag::OnPaint(wxPaintEvent& WXUNUSED(event))
00218 {
00219         wxPaintDC dc(this);
00220 
00221         dc.SetMapMode(wxMM_TEXT);
00222         // evtl. erst noch Abteilung des Textes berechnen
00223 
00224         if ( TPos == -1 ) InitText(dc);
00225 
00226         // Selected-Rahmen
00227         wxPen SelPen(*wxBLACK, 1, wxDOT);
00228 
00229         if ( wxWindow::FindFocus() == this )
00230                 dc.SetPen(SelPen);
00231         else
00232                 dc.SetPen(*wxWHITE_PEN);
00233 
00234         if ( TPos )
00235                 dc.DrawRectangle(1, 3, MUTTAGX-6, MUTTAGY-3);
00236         else
00237                 dc.DrawRectangle(1, 3, MUTTAGX-6, MUTTAGY-6);
00238 
00239         dc.SetPen(wxNullPen);
00240 
00241         // Icon zeichnen
00242         dc.DrawIcon(Icon, MUTTAGX/2-16, 10);
00243 
00244         // Taste auf Icon
00245         dc.SetBackgroundMode(wxTRANSPARENT);
00246 
00247         PaintCenteredText(dc, wxString::Format(_T("%c"), Key), 20);
00248 
00249         dc.SetBackgroundMode(wxSOLID);
00250 
00251         // Beschriftung
00252         if ( TPos ) {
00253                 PaintCenteredText(dc, Text.Mid(0, TPos), 44);
00254                 PaintCenteredText(dc, Text.Mid(TPos), 56);
00255         } else
00256                 PaintCenteredText(dc, Text, 50);
00257 
00258         /*  // Focus
00259           if (drawInfo.itemState & ODS_FOCUS)
00260                  dc.DrawFocusRect(TRect(MUTTAGX/2-19, 7, MUTTAGX/2+19, 7+38));*/
00261 }
00262 
00263 /*void TMutTag::ODADrawEntire(DRAWITEMSTRUCT far& drawInfo)
00264 {
00265   TDC dc(drawInfo.hDC);
00266   // evtl. erst noch Abteilung des Textes berechnen
00267   if ( TPos == -1 ) InitText(dc);
00268   // Selected-Rahmen
00269   if (drawInfo.itemState & ODS_SELECTED)
00270            SelectObject(drawInfo.hDC, GetStockObject(BLACK_PEN));
00271   else
00272            SelectObject(drawInfo.hDC, GetStockObject(WHITE_PEN));
00273   if ( TPos )
00274            dc.Rectangle(TRect(1, 3, MUTTAGX-3, MUTTAGY));
00275   else
00276            dc.Rectangle(TRect(1, 3, MUTTAGX-3, MUTTAGY-3));
00277   dc.RestorePen();
00278   // Icon zeichnen
00279   dc.DrawIcon(MUTTAGX/2-16, 10, *Icon);
00280   // Taste auf Icon
00281   dc.SetBkMode(TRANSPARENT);
00282   char s[20];
00283   sprintf(s, "%c", Key);
00284   dc.DrawText(s, -1, TRect(MUTTAGX/2-10, 20, MUTTAGX/2+10, 20+14), DT_CENTER | DT_VCENTER);
00285   dc.SetBkMode(OPAQUE);
00286   // Beschriftung
00287   if ( TPos )
00288   {
00289          dc.DrawText(Text, TPos, TRect(2, 44, MUTTAGX-2, 44+14), DT_CENTER | DT_VCENTER);
00290            dc.DrawText(&(Text[TPos]), -1, TRect(2, 56, MUTTAGX-2, 56+14), DT_CENTER | DT_VCENTER);
00291   }
00292   else
00293            dc.DrawText(Text, -1, TRect(2, 50, MUTTAGX-2, 50+14), DT_CENTER | DT_VCENTER);
00294   // Focus
00295   if (drawInfo.itemState & ODS_FOCUS)
00296          dc.DrawFocusRect(TRect(MUTTAGX/2-19, 7, MUTTAGX/2+19, 7+38));
00297 }
00298 
00299 void TMutTag::ODAFocus(DRAWITEMSTRUCT far& drawInfo)
00300 {
00301   TDC dc(drawInfo.hDC);
00302   dc.DrawFocusRect(TRect(MUTTAGX/2-19, 7, MUTTAGX/2+19, 7+38));
00303 }
00304 
00305 void TMutTag::ODASelect(DRAWITEMSTRUCT far& drawInfo)
00306 {
00307   ODADrawEntire(drawInfo);
00308 }*/
00309 
00310 void MutTag::OnChar(wxKeyEvent& event)
00311 {
00312 //  TButton::EvChar(key, repeatCount, flags);
00313 
00314         if ( ('A' < event.GetKeyCode() && event.GetKeyCode() <= 'z') || event.GetKeyCode() == WXK_TAB || event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_SPACE )
00315                 wxPostEvent(GetParent(),event);
00316 }
00317 
00318 void MutTag::OnLeftDown(wxMouseEvent& event)
00319 {
00320         wxCommandEvent event1(wxEVT_COMMAND_MENU_SELECTED, CM_MUTTAG);
00321         event1.SetEventObject(this);
00322         //((MutLogicWnd*)GetParent())->UpDate(GetKey(), GetIsLogic());
00323         wxPostEvent(GetParent(),event1);
00324         event.Skip();
00325 }
00326 
00327 void MutTag::OnFocus(wxFocusEvent& event)
00328 {
00329         Refresh();
00330         ((MutLogicWnd*)GetParent())->CorrectScroller();
00331         event.Skip();
00332 }
00333 
00334 /*LRESULT TMutTag::EvCommand(UINT id, HWND hWndCtl, UINT notifyCode)
00335 {
00336   if (hWndCtl == 0 && notifyCode == 1)
00337          // from an accelerator
00338          if ( id == VK_LEFT || id == VK_RIGHT || id == VK_UP || id == VK_DOWN || id == VK_F12 )
00339                 Parent->HandleMessage(WM_CHAR, id, 1);
00340   return TButton::EvCommand(id, hWndCtl, notifyCode);
00341 }*/
00342 
00343 // Funktion f¸r FirstThat
00344 
00345 /*bool HasPosition(TWindow *win, void *param)
00346 {
00347   return win->Attr.X == ((int*)param)[0] && win->Attr.Y == ((int*)param)[1];
00348 }*/
00349 
00350 // MutLogicWnd ----------------------------------------------------------
00351 // Fenster, das die Logiken enth‰lt
00352 
00353 /*DEFINE_RESPONSE_TABLE1(MutLogicWnd, TWindow)
00354   EV_WM_CHAR,
00355   EV_WM_SIZE,
00356   EV_COMMAND(CM_MUTTAG, CmMutTag),
00357   EV_COMMAND(CM_TASTE, CmTaste),
00358   EV_COMMAND(CM_BOX, CmBox),
00359   EV_WM_RBUTTONDOWN,
00360 END_RESPONSE_TABLE;*/
00361 
00362 BEGIN_EVENT_TABLE(MutLogicWnd, wxScrolledWindow)
00363         EVT_CHAR(MutLogicWnd::OnChar)
00364         EVT_SIZE(MutLogicWnd::OnSize)
00365         EVT_MENU(CM_MUTTAG, MutLogicWnd::CmMutTag)
00366         EVT_CLOSE(MutLogicWnd::OnClose)
00367 END_EVENT_TABLE()
00368 
00369 MutLogicWnd::MutLogicWnd(wxWindow *parent,
00370                          int box,
00371 
00372                          const wxPoint& pos,
00373                          const wxSize& size)
00374                 : wxScrolledWindow(parent, -1, pos, size, wxHSCROLL | wxVSCROLL | wxTAB_TRAVERSAL)
00375 {
00376 #ifdef DEBUG
00377         std::cout << "MutLogicWnd::MutLogicWnd: Box " <<  box << std::endl;
00378 #endif
00379         /*  TWindow::Attr.Style |= WS_GROUP | WS_CLIPCHILDREN|
00380                                         WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL | WS_BORDER;
00381           Scroller = new TScroller(this, 8, 7, 8, 7);*/
00382         boxnumber = box;
00383         ColorBar1 = 0;
00384         ColorBar2 = 0;
00385         /*  Attr.AccelTable = IDA_MUTWIN;*/
00386         SetScrollRate( 10, 10 );
00387         SetBackgroundColour(*wxWHITE);
00388         Ok = false;
00389         CmBox();
00390 
00391         winAttr = GetWinAttr(WK_LOGIC,box);
00392         wxASSERT(!winAttr->Win);
00393         winAttr->Win = this;
00394 }
00395 
00396 /*void MutLogicWnd::SetupWindow()
00397 {
00398   TWindow::SetupWindow();
00399   SetWindowFont(HFONT(MutFont), false);
00400   CmBox();
00401 }
00402 */
00403 
00404 void MutLogicWnd::doClose(wxEvent& event)
00405 {
00406         DEBUGLOG (other, _T(""));
00407         wxWindow * parent;
00408         bool stop;
00409         wxCommandEvent event1(wxEVT_COMMAND_MENU_SELECTED, CM_STOP);
00410 
00411         if ( (stop = (NumberOfOpen(WK_LOGIC) <= 1) ) ) {
00412                 parent = GetParent();
00413 
00414                 while (!(dynamic_cast<MutFrame *>(parent))) {
00415                         DEBUGLOG (other, _T("Searching for MutFrame: %p..."),parent);
00416                         parent = parent->GetParent();
00417                 }
00418 
00419                 //GetApplication()->GetMainWindow()->PostMessage(WM_COMMAND, CM_STOP);
00420         }
00421 
00422         //    delete winAttr;
00423         event.Skip(false);
00424 
00425         Destroy();
00426 
00427         DEBUGLOGBASE(other,"MutLogicWnd",_T("Destroyed Window"));
00428 
00429         if (stop) wxPostEvent(parent,event1);
00430 
00431         DEBUGLOGBASE(other,"MutLogicWnd",_T("Destroyed Window"));
00432 }
00433 
00434 
00435 // Reaktion auf Computertastatur
00436 
00437 void MutLogicWnd::OnChar(wxKeyEvent& event)
00438 {
00439         pubTaste = event.GetKeyCode();
00440         CmTaste();
00441         event.Skip();
00442 }
00443 
00444 void MutLogicWnd::CmTaste()
00445 
00446 {
00447         int key = pubTaste;
00448         /*      if ( key == WXK_TAB )
00449                 {
00450                    HWND Handle = GetWindowPtr(GetFocus())->GetNextWindow(GW_HWNDNEXT);
00451                    if ( Handle )
00452                             GetWindowPtr(Handle)->SetFocus();
00453                    else
00454                             GetFirstChild()->SetFocus();
00455               SetFocusPos();
00456                    CorrectScroller();
00457           }
00458           else if ( key == VK_UP )
00459                    MoveFocus(0, -1);
00460           else if ( key == VK_DOWN )
00461                    MoveFocus(0, +1);
00462           else if ( key == VK_LEFT )
00463                    MoveFocus(-1, 0);
00464           else if ( key == VK_RIGHT )
00465                    MoveFocus(+1, 0);
00466           else if ( key == VK_F12 )
00467             MessageBox("This code was nearly completely written by R.K.", "Besides...", MB_OK | MB_ICONASTERISK);
00468           else*/
00469 
00470         if ( key == WXK_SPACE ) {
00471                 /*              TWindow *Win = FirstThat(HasPosition, FocusPos);
00472                 if ( Win ) Win->SetFocus();
00473                 CorrectScroller();
00474                 SetFocusPos();*/
00475                 wxWindow *w = wxWindow::FindFocus();
00476 
00477                 if ( w && w->GetId() == CM_MUTTAG )
00478                         UpDate(((MutTag*)w)->GetKey(), ((MutTag*)w)->GetIsLogic());
00479         } else {
00480                 // Buchstabentaste
00481                 // Umwandeln in Groflbuchstaben
00482 
00483                 if ( 'a' <= key && key <= 'z' ) key += 'A' - 'a';
00484 
00485                 // ermiteln, ob Logik
00486                 char isLogic = IsLogicKey((char)key);
00487 
00488                 if ( isLogic == 2 ) return;
00489 
00490                 // Update aufrufen
00491                 UpDate(key, isLogic);
00492         }
00493 }
00494 
00495 void MutLogicWnd::OnSize(wxSizeEvent& event)
00496 {
00497         //  wxScrolledWindow::EvSize(sizeType, size);
00498         event.Skip();
00499         DoLayout();
00500 }
00501 
00502 #define max(a, b) ((a) < (b) ? (b) : (a))
00503 
00504 void MutLogicWnd::DoLayout()
00505 {
00506         wxSize R = GetClientSize();
00507         int nx = (R.GetWidth()-4) / MUTTAGX, ny = (R.GetHeight()-4)/ MUTTAGY;
00508         bool quer = R.GetWidth() > R.GetHeight();
00509 
00510         if ( nx * ny < nTags ) // Scroller notwendig
00511         {
00512 
00513                 if  ( ny < 1) ny = 1;
00514 
00515                 if ( quer ) nx = (nTags + ny -1) / ny;
00516         }
00517         std::cout << nTags << nx << std::endl;
00518 
00519         if  ( nx < 1 ) nx = 1;
00520 
00521         ny = (nTags + nx -1) / nx;
00522 
00523         int x = 4, y = 4, xi = 0;
00524 
00525         std::cout << nx << MUTTAGX << ny << MUTTAGY << std::endl;
00526 
00527         SetVirtualSize(nx*MUTTAGX+8, ny*MUTTAGY+8);
00528 
00529         int xv, yv;
00530 
00531         GetViewStart(&xv, &yv);
00532 
00533         for (wxWindowList::iterator i = GetChildren().begin(); i!=GetChildren().end(); i++) {
00534                 wxWindow * Win= *i;
00535                 if ( Win->GetId() == CM_MUTTAG ) {
00536                         //                      Win->Move(x - Scroller->XPos*Scroller->XUnit, y - Scroller->YPos*Scroller->YUnit, MUTTAGX, MUTTAGY, true);
00537                         Win->Move(x-xv*10, y-yv*10);
00538                         x += MUTTAGX;
00539                         xi++;
00540 
00541                         if ( xi == nx ) {
00542                                 x = 4;
00543                                 xi = 0;
00544                                 y += MUTTAGY;
00545                         }
00546                 }
00547         }
00548 
00549         if ( xi )
00550                 y += MUTTAGY;
00551 
00552         // Farbbalken
00553         if ( ColorBar1 )
00554                 ColorBar1->SetSize(-xv*10, -yv*10, max(nx*MUTTAGX+8, R.GetWidth()), 2);
00555 
00556         if ( ColorBar2 )
00557                 ColorBar2->SetSize(-xv*10, -yv*10, 2, max(ny*MUTTAGY+8, R.GetHeight()));
00558 
00559         CorrectScroller();
00560 };
00561 
00562 // Reaktion auf geklickte TMutTag-s
00563 
00564 void MutLogicWnd::CmMutTag(wxCommandEvent& event)
00565 {
00566         MutTag *Tag = (MutTag*)event.GetEventObject();
00567         UpDate(Tag->GetKey(), Tag->GetIsLogic());
00568 }
00569 
00570 void MutLogicWnd::CorrectScroller()
00571 {
00572         wxWindow *Win = wxWindow::FindFocus();
00573 
00574         if ( !Win || Win->GetId() != CM_MUTTAG )
00575                 return;
00576 
00577         int xView, yView;
00578 
00579         GetViewStart(&xView, &yView);
00580 
00581         xView *=10;
00582 
00583         yView *=10;
00584 
00585         int xw, yw;
00586 
00587         Win->GetPosition(&xw, &yw);
00588 
00589         xw += xView;
00590 
00591         yw += yView;
00592 
00593         int w, h;
00594 
00595         GetClientSize(&w, &h);
00596 
00597         int dx = xView, dy = yView;
00598 
00599         // rechte untere Ecke im Bild ???
00600         if ( xw + MUTTAGX > xView+w ) dx = xw + MUTTAGX - w;
00601 
00602         if ( yw + MUTTAGY > yView+h ) dy = yw + MUTTAGY - h;
00603 
00604         // linke obere Ecke im Bild ??? (dominierend)
00605         if ( xw < xView ) dx = xw;
00606 
00607         if ( yw < yView ) dy = yw;
00608 
00609         Scroll(dx / 10, dy / 10);
00610 }
00611 
00612 // keyboardanalyse, Fenster aufr‰umen, Logiken lesen und anzeigen
00613 void MutLogicWnd::UpDate(int thekey, bool isLogicKey)
00614 {
00615         // Analyse zuerst
00616         KeyboardAnalyse(boxnumber, thekey, isLogicKey);
00617         curTaste[boxnumber][isLogicKey] = thekey;
00618         wxWindow *ToFocus = NULL;
00619 
00620         if ( isLogicKey )
00621                 curTaste[boxnumber][0] = 0;
00622 
00623         // alte TMutTag-s lˆschen
00624         DestroyChildren();
00625 
00626         // neue erstellen
00627         char isLogic, s[200], s1[200], key, isOpen;
00628 
00629         wxString sText, sEinst;
00630 
00631         wxWindow *aWin;
00632 
00633         nTags = 0;
00634 
00635         if ( GetMutTag(isLogic, s, s1, key, boxnumber) )
00636                 do {
00637                         nTags++;
00638                         sText = muT(s);
00639                         sEinst = muT(s1);
00640 
00641                         if ( (isOpen = (key == curTaste[boxnumber][(size_t)isLogic])) != 0 ) {
00642                                 if ( isLogic ) {
00643                                         curLogic[boxnumber] = sText;
00644 
00645                                         if ( !sEinst.IsEmpty() )
00646                                                 curTS[boxnumber] = sEinst;
00647                                         else if ( !curTS[boxnumber] )
00648                                                 curTS[boxnumber] = _("(INITIAL)");
00649                                         else if ( curTS[boxnumber][0] != '[' )
00650                                                 curTS[boxnumber] = wxString::Format(_T("[%s]"), curTS[boxnumber].c_str());
00651                                 } else
00652                                         curTS[boxnumber] = sText;
00653                         }
00654 
00655                         aWin = new MutTag(this, wxDefaultPosition, isLogic, isOpen, key, sText);
00656 
00657                         if ( isOpen ) ToFocus = aWin;
00658                 } while ( GetMutTag(isLogic, s, s1, key) );
00659 
00660         // Color Bars
00661         if ( UseColorBars ) {
00662                 wxColour BarColor = BoxColor(boxnumber);
00663                 ColorBar1 = new wxWindow(this, -1, wxPoint(0, 0), wxSize(2,2));
00664                 ColorBar1->SetBackgroundColour(BarColor);
00665                 ColorBar1->Disable();
00666                 ColorBar2 = new wxWindow(this, -1, wxPoint(0, 0), wxSize(2,2));
00667                 ColorBar2->SetBackgroundColour(BarColor);
00668                 ColorBar2->Disable();
00669         } else {
00670                 ColorBar1 = 0;
00671                 ColorBar2 = 0;
00672         }
00673 
00674         // neue TMutTag-s aktivieren
00675         //CreateChildren();
00676         // Fokus setzen
00677 #if 0
00678         if ( !ToFocus )
00679                 ToFocus = GetChildren().GetFirst()->GetData();
00680 #endif
00681 
00682         if ( ToFocus && FindFocus() != ToFocus)
00683                 ToFocus->SetFocus();
00684 
00685         // Tags anordnen
00686         DoLayout();
00687 
00688         wxCommandEvent event1(wxEVT_COMMAND_MENU_SELECTED,
00689                               CM_UPDATEUI);
00690         GetParent()->GetEventHandler()->ProcessEvent(event1);
00691         Ok = true;
00692 }
00693 
00694 // Reaktion auf neues aktuelles Instrument
00695 void MutLogicWnd::CmBox()
00696 {
00697         DEBUGLOG (other, _T("%s at box %d"),CompiledFile.c_str(),boxnumber );
00698         // Titel setzen
00699         GetParent()->SetName(wxString::Format(_("Logic: %s - Box %d"),
00700                                               CompiledFile.c_str(), boxnumber));
00701         // Tags updaten
00702         UpDate(0, true);
00703 }
00704 
00705 /*
00706 void MutLogicWnd::EvRButtonDown(uint, TPoint& point)
00707 {
00708   RightButtonMenu(this, point);
00709 }*/
00710 
00711 

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