Пример #1
0
 public void AddWidget(Widget widg)
 {
     widg.SetPosition(x+widg.localx, y+widg.localy+28);
     Widgets.Add(widg);
     ActiveWidget = Widgets[0];
 }
Пример #2
0
 public override void MouseClick(MouseButtonEventArgs e)
 {
     if(CloseButton.GetGlobalBounds().Contains(e.X, e.Y))
     {
         this.Close();
     }
     else if(TopBar.GetGlobalBounds().Contains(e.X, e.Y))
     {
         WM.Grab(this);
     }
     else if(BottomRight.GetGlobalBounds().Contains(e.X, e.Y) &&    bordType == BorderType.Resizable)
     {
         WM.Resize(this);
     }
     for(int i = 0; i < Widgets.Count; i++)
     {
         if(Widgets[i].BoundingBox.Contains(e.X, e.Y))
         {
                 //WM.parent.RWindow.SetTitle(Widgets[i].ToString());
             if(!Widgets[i].Active)
             {
                 if(ActiveWidget != null)
                     ActiveWidget.SetActive(false);
                 ActiveWidget = Widgets[i];
                 ActiveWidget.SetActive(true);
             }
             ActiveWidget.MouseClick(e);
             return;
         }
     }
     if(ActiveWidget != null)
         ActiveWidget.SetActive(false);
     ActiveWidget = null;
 }