pxt-core
Version:
Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors
58 lines (57 loc) • 2.04 kB
TypeScript
/// <reference path="../../pxtlib.d.ts" />
/// <reference path="../../pxtsim.d.ts" />
import * as Blockly from "blockly";
import { FieldMatrix } from "./field_matrix";
import { FieldCustom } from "./field_utils";
export declare class FieldLedMatrix extends FieldMatrix implements FieldCustom {
private static CELL_WIDTH;
private static CELL_HORIZONTAL_MARGIN;
private static CELL_VERTICAL_MARGIN;
private static CELL_CORNER_RADIUS;
private static BOTTOM_MARGIN;
private static Y_AXIS_WIDTH;
private static X_AXIS_HEIGHT;
private static TAB;
isFieldCustom_: boolean;
SERIALIZABLE: boolean;
private params;
private onColor;
private offColor;
private static DEFAULT_OFF_COLOR;
private scale;
protected numMatrixCols: number;
protected numMatrixRows: number;
private yAxisLabel;
private xAxisLabel;
private cellState;
private currentDragState_;
protected clearSelectionOnBlur: boolean;
protected forceFocusVisible: boolean;
constructor(text: string, params: any, validator?: Blockly.FieldValidator);
protected getCellToggled(x: number, y: number): boolean;
protected useTwoToneFocusIndicator(x: number, y: number): boolean;
/**
* Show the inline free-text editor on top of the text.
* @private
*/
showEditor_(): void;
private initMatrix;
private getLabel;
private dontHandleMouseEvent_;
private clearLedDragHandler;
updateEditable(): void;
protected attachPointerEventHandlersToCell(x: number, y: number, cellRect: SVGElement): void;
protected toggleCell: (x: number, y: number, value?: boolean) => void;
private handleRootMouseMoveListener;
private getColor;
private getOpacity;
private updateCell;
setValue(newValue: string | number, restoreState?: boolean): void;
render_(): void;
getValue(): string;
getFieldDescription(): string;
private restoreStateFromString;
private updateValue;
private getYAxisWidth;
private getXAxisHeight;
}