public Pos(int XY, ORIGIN dest_origin = default(ORIGIN), ORIGIN src_origin = default(ORIGIN), UI_Element parent = null) { X_abs = Y_abs = X = Y = XY; this.dest_origin = dest_origin; this.src_origin = src_origin; this.parent = parent; ego = null; }
public Pos(int X, int Y, ORIGIN dest_origin = default(ORIGIN), ORIGIN src_origin = default(ORIGIN), UI_Element parent = null) { this.X_abs = this.X = X; this.Y_abs = this.Y = Y; this.dest_origin = dest_origin; this.src_origin = src_origin; this.parent = parent; ego = null; }
public MetaFieldInfo(MetaFieldInfo info) { TagType = info.TagType; NativeFieldCode = info.NativeFieldCode; Value = info.Value; StreamNumber = info.StreamNumber; Language = info.Language; Zone = info.Zone; Origin = info.Origin; }
private void DefineDefaultPosition(GaugeSet.ID set, int windowId, bool enabled, ORIGIN origin, int dx, int dy) { Dictionary <int, bool> enabledMap = defaultEnabledMap[set]; Dictionary <int, int> positionXMap = defaultPositionXMap[set]; Dictionary <int, int> positionYMap = defaultPositionYMap[set]; int LAYOUT_CELL_X = NanoGauges.configuration.verticalGaugeWidth + Gauges.LAYOUT_GAP; int LAYOUT_CELL_Y = NanoGauges.configuration.verticalGaugeHeight + Gauges.LAYOUT_GAP; int LAYOUT_RANGE_X = 3 * LAYOUT_CELL_X / 2; int LAYOUT_RANGE_Y = 3 * LAYOUT_CELL_Y / 2; enabledMap.Add(windowId, enabled); switch (origin) { case ORIGIN.RIGHTEDGE: { int x0 = Screen.width - LAYOUT_CELL_X; int y0 = Screen.height / 2; positionXMap.Add(windowId, x0 + dx); positionYMap.Add(windowId, y0 + dy); break; } case ORIGIN.BOTTOMRIGHT: { int x0 = Screen.width - LAYOUT_CELL_X; int y0 = Screen.height - LAYOUT_CELL_Y; positionXMap.Add(windowId, x0 + dx); positionYMap.Add(windowId, y0 + dy); break; } case ORIGIN.LEFTEDGE: { int y0 = Screen.height / 2; positionXMap.Add(windowId, dx); positionYMap.Add(windowId, y0 + dy); break; } case ORIGIN.TOPEDGE: { int x0 = Screen.width / 2; positionXMap.Add(windowId, x0 + dx); positionYMap.Add(windowId, dy); break; } case ORIGIN.BOTTOMEDGE: { int x0 = Screen.width / 2; int y0 = Screen.height - LAYOUT_CELL_Y; positionXMap.Add(windowId, x0 + dx); positionYMap.Add(windowId, y0 + dy); break; } case ORIGIN.NAVBALL: { int x0 = Screen.width / 2; int y0 = Screen.height - 200; positionXMap.Add(windowId, x0 + dx); positionYMap.Add(windowId, y0 + dy); break; } default: { Log.Warning("invalid origin in gauge set " + set + ", window id " + windowId); positionXMap.Add(windowId, dx); positionYMap.Add(windowId, dy); break; } } }