private static void RaiseScroll(IntPtr cPtr, IntPtr sender, IntPtr e) { try { if (!_Scroll.ContainsKey(cPtr)) { throw new InvalidOperationException("Delegate not registered for Scroll event"); } if (sender == IntPtr.Zero && e == IntPtr.Zero) { _Scroll.Remove(cPtr); return; } if (Noesis.Extend.Initialized) { ScrollHandler handler = _Scroll[cPtr]; if (handler != null) { handler(Noesis.Extend.GetProxy(sender, false), new ScrollEventArgs(e, false)); } } } catch (Exception exception) { Noesis.Error.SetNativePendingError(exception); } }
public NESContext( ICPU cpu, RicohRP2C02 ppu, PixelMuxer pixelMuxer, InputHandler inputHandler, ScrollHandler scrollHandler, PaletteHandler paletteHandler, BackgroundHandler backgroundHandler) { this.CPU = cpu; this.PPU = ppu; this.PixelMuxer = pixelMuxer; this.InputHandler = inputHandler; this.ScrollHandler = scrollHandler; this.PaletteHandler = paletteHandler; this.BackgroundHandler = backgroundHandler; if (File.Exists(Constants.DebugFile)) { File.Delete(Constants.DebugFile); } Log.Logger = new LoggerConfiguration() .MinimumLevel.Verbose() .WriteTo.File ( Constants.DebugFile, outputTemplate: "{Message}{NewLine}", restrictedToMinimumLevel: LogEventLevel.Verbose, flushToDiskInterval: TimeSpan.FromSeconds(10.0) ) .Destructure.ByTransforming <Registers>(Registers.DestructureForLog) .CreateLogger(); }
/** * Creates a new {@code DragAndDropHandler} for the listview implementation * in given {@link com.nhaarman.listviewanimations.itemmanipulation.dragdrop.DragAndDropListViewWrapper} * * @param dragAndDropListViewWrapper the {@code DragAndDropListViewWrapper} which wraps the listview implementation to use. */ public DragAndDropHandler(DragAndDropListViewWrapper dragAndDropListViewWrapper) { mWrapper = dragAndDropListViewWrapper; if (mWrapper.getAdapter() != null) { setAdapterInternal(mWrapper.getAdapter()); } mScrollHandler = new ScrollHandler(this); mWrapper.setOnScrollListener(mScrollHandler); mDraggableManager = new DefaultDraggableManager(); if (Build.VERSION.SdkInt <= BuildVersionCodes.Kitkat) { mSwitchViewAnimator = new KitKatSwitchViewAnimator(this); } else { mSwitchViewAnimator = new LSwitchViewAnimator(this); } mMobileItemId = INVALID_ID; ViewConfiguration vc = ViewConfiguration.Get(dragAndDropListViewWrapper.getListView().Context); mSlop = vc.ScaledTouchSlop; }
void Update() { ScrollHandler.HandleScroll(); if (mapGen != null) { DisplayMap(displayView); } }
public bool HandleUserInput() { ScrollHandler.HandleScroll(); bool updateClick = HandleClick(); bool updateKeys = HandleKeys(); return(updateClick || updateKeys); }
public JSliderBar() { InitializeComponent(); Scroll += new ScrollHandler(OnScroll); ScrollEnd += new ScrollHandler(OnScrollEnd); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); }
private static byte GetColorIndex(Tile tile, ScrollHandler scrollHandler) { // To get a color index, we slice down the data even further to grab specific pixel details // and pull the color details from the ROMs pattern table(s). byte lowBits = tile.LowTileByte; byte highBits = tile.HighTileByte; byte lowBit = (byte)((lowBits >> (7 - scrollHandler.FineXScroll)) & 1); byte highBit = (byte)((highBits >> (7 - scrollHandler.FineXScroll)) & 1); return((byte)(lowBit + highBit * 2)); }
private void Initialize() { // Create Views mColumnHeaderRecyclerView = CreateColumnHeaderRecyclerView(); mRowHeaderRecyclerView = CreateRowHeaderRecyclerView(); mCellRecyclerView = CreateCellRecyclerView(); // Add Views AddView(mColumnHeaderRecyclerView); AddView(mRowHeaderRecyclerView); AddView(mCellRecyclerView); // Create Handlers mSelectionHandler = new SelectionHandler(this); mVisibilityHandler = new VisibilityHandler(this); mScrollHandler = new ScrollHandler(this); mPreferencesHandler = new PreferencesHandler(this); mColumnWidthHandler = new ColumnWidthHandler(this); InitializeListeners(); }
public RicohRP2C02( IPPUMemoryMap memoryMap, PPURegisters registers, PPUInternalRegisters internalRegisters, ScrollHandler scrollHandler, PaletteHandler paletteHandler, BackgroundHandler backgroundHandler, PixelMuxer pixelMuxer, SpriteHandler spriteHandler) { this.InternalRegisters = internalRegisters; this.Registers = registers; this.MemoryMap = (PPURawMemoryMap)memoryMap; this.ScrollHandler = scrollHandler; this.PaletteHandler = paletteHandler; this.BackgroundHandler = backgroundHandler; this.SpriteHandler = spriteHandler; this.PixelMuxer = pixelMuxer; }
public static Tile GetTileFromPixel(int x, int y, ScrollHandler scrollHandler, Tile workingTile, int bgOffset, PPUInternalRegisters registers) { var scrolledX = scrollHandler.vCoarseXScroll - 1; var scrolledY = scrollHandler.vCoarseYScroll; var tile = workingTile; tile.PPUAddress = (ushort)(0x2000 + x + (y * Constants.NumberOfColumns)); tile.Location = (x, y); var colorIndex = GetColorIndex(tile, scrollHandler); byte paletteId = 0; if (colorIndex != 0) { paletteId = (byte)((tile.AttributeData >> 0) & 3); } tile.PaletteAddress = (ushort)(0x3f00 + 4 * paletteId + colorIndex); return(tile); }
public virtual void OnViewAttachedToWindow(AbstractViewHolder holder) { base.OnViewAttachedToWindow(holder); CellRecyclerViewAdapter.CellRowViewHolder viewHolder = (CellRecyclerViewAdapter.CellRowViewHolder)holder; ScrollHandler scrollHandler = mTableView.GetScrollHandler(); // The below code helps to display a new attached recyclerView on exact scrolled position. ((ColumnLayoutManager)viewHolder.recyclerView.GetLayoutManager()).ScrollToPositionWithOffset( scrollHandler.GetColumnPosition(), scrollHandler.GetColumnPositionOffset()); SelectionHandler selectionHandler = mTableView.GetSelectionHandler(); if (selectionHandler.IsAnyColumnSelected()) { AbstractViewHolder cellViewHolder = (AbstractViewHolder)viewHolder.recyclerView.FindViewHolderForAdapterPosition( selectionHandler.GetSelectedColumnPosition()); if (cellViewHolder != null) { // Control to ignore selection color if (!mTableView.IsIgnoreSelectionColors()) { cellViewHolder.SetBackgroundColor(mTableView.GetSelectedColor()); } cellViewHolder.SetSelected(AbstractViewHolder.SelectionState.Selected); } } else { if (selectionHandler.IsRowSelected(holder.AdapterPosition)) { selectionHandler.ChangeSelectionOfRecyclerView(viewHolder.recyclerView, AbstractViewHolder.SelectionState.Selected, mTableView.GetSelectedColor()); } } }
internal void AddScrollHandler(Keys key, ScrollHandler handler) { scrollHandlers[key] = handler; }
void Awake() { instance = this; }