コード例 #1
0
 // This runs through all widgets.. It would be more efficient
 // to maintain a list of widgets that are interested in updates
 public static void OnUpdate(float elapsed)
 {
     onUpdateMeter.Enter();
     FloatEventArgs args = new FloatEventArgs();
     args.data = elapsed;
     foreach (Region entry in FrameMap.Values) {
         try {
             if (!(entry is Frame))
                 continue;
             Frame frame = entry as Frame;
             frame.OnUpdate(args);
         } catch (Exception ex) {
             LogUtil.ExceptionLog.WarnFormat("Exception in frame event handler: {0}", ex);
         }
     }
     onUpdateMeter.Exit();
 }
コード例 #2
0
 public static bool InjectMouseWheel(float wheelStep)
 {
     bool handled = false;
     FloatEventArgs e = new FloatEventArgs();
     e.data = wheelStep;
     PointF pt = GuiSystem.Instance.MousePosition;
     List<Frame> hitFrames = GetFrames(pt);
     foreach (Frame frame in hitFrames) {
         try {
             if (frame.HasMouseWheelEvent) {
                 if (!frame.IsVisible())
                     log.InfoFormat("Invisible window: {0}", frame.Name);
                 frame.OnMouseWheel(e);
                 handled = true;
             }
         } catch (Exception ex) {
             LogUtil.ExceptionLog.WarnFormat("Exception in frame event handler: {0}", ex);
         }
     }
     return handled;
 }