public void ManualStartPortalMove(InputState istate) { _gdScreen.SetMode(LevelEditorMode.Mouse); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = Vector2.Zero; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.PortalMove; }
public SpendReport(DMode d, Button printerBtn) { mode = d; InitializeComponent(); SQLite = new SQLite(); Title.Location = new Point(380, 20); spend.ClearSelection(); // 인쇄할 버튼 나중에 설정 printBtn = printerBtn; pd = new PrintDocument(); pgSettings = new PageSettings(); Paint += SpendReport_Paint; pd.PrintPage += Pd_PrintPage; printBtn.Click += PrintBtn_Click; }
public Budget(DMode d, DateTimePicker dtp, DateTime dt) { InitializeComponent(); mode = d; dateTimePicker1 = dtp; date = dt; SQLite = new SQLite(); if( mode == DMode.spend) { spend = new DataGridView(); spend_Worship = new DataGridView(); spend_Mission = new DataGridView(); spend_Edu = new DataGridView(); spend_Human = new DataGridView(); spend_Vol = new DataGridView(); spend_Main = new DataGridView(); spend_Loan = new DataGridView(); spend.CellEndEdit += Spend_CellEndEdit; spend_Worship.CellEndEdit += Spend_Worship_CellEndEdit; spend_Mission.CellEndEdit += Spend_Mission_CellEndEdit; spend_Edu.CellEndEdit += Spend_Edu_CellEndEdit; spend_Human.CellEndEdit += Spend_Human_CellEndEdit; spend_Vol.CellEndEdit += Spend_Vol_CellEndEdit; spend_Main.CellEndEdit += Spend_Main_CellEndEdit; spend_Loan.CellEndEdit += Spend_Loan_CellEndEdit; spend.CellMouseDown += Spend_CellMouseDown; AddGridView(); } before.Hide(); dgv.Hide(); SetView(); CreateTable(); GetValues(); SetRows(); dgv.CellEndEdit += Dgv_CellEndEdit; }
public Device(DMode mode, string description) { Mode = mode; Description = description; }
protected override void OnUpdate(LevelEditorScreen screen, SAMTime gameTime, InputState istate) { const float raster = (GDConstants.TILE_WIDTH / 2f); var rx = raster * FloatMath.Round((istate.GamePointerPositionOnMap.X - _dragOffCenter.X) / raster); var ry = raster * FloatMath.Round((istate.GamePointerPositionOnMap.Y - _dragOffCenter.Y) / raster); _boundsWorkingAreaOuter = _gdScreen.VAdapterGame.VirtualTotalBoundingBox.AsDeflated( 0, 4 * GDConstants.TILE_WIDTH, _gdScreen.GDHUD.AttrPanel.IsVisible ? 4 * GDConstants.TILE_WIDTH : 0, 0); _boundsWorkingAreaInner = _boundsWorkingAreaOuter.AsDeflated(GDConstants.TILE_WIDTH, GDConstants.TILE_WIDTH, GDConstants.TILE_WIDTH, GDConstants.TILE_WIDTH); _boundsMap = FRectangle.CreateByTopLeft( _gdScreen.MapOffsetX, _gdScreen.MapOffsetY, _gdScreen.LevelData.Width * GDConstants.TILE_WIDTH, _gdScreen.LevelData.Height * GDConstants.TILE_WIDTH); if (_dragMode == DMode.MapDrag) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown) { var delta = istate.GamePointerPosition - _mouseStartPos; _gdScreen.MapOffsetX = _startOffset.X + delta.X; _gdScreen.MapOffsetY = _startOffset.Y + delta.Y; } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.CannonMove) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown && _gdScreen.Selection is CannonStub cs) { var ins = _gdScreen.CanInsertCannonStub(new FPoint(rx, ry), cs.Scale, cs); if (ins != null) { cs.Center = ins.Position; } } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.ObstacleMove) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown && _gdScreen.Selection is ObstacleStub os) { var ins = _gdScreen.CanInsertObstacleStub(new FPoint(rx, ry), os.ObstacleType, os.Width, os.Height, os.Rotation, os); if (ins != null) { os.Center = ins.Position; } } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.WallMove) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown && _gdScreen.Selection is WallStub ws) { var ins = _gdScreen.CanInsertWallStub(new FPoint(rx, ry), new FPoint(rx, ry) + _wallRelativeP2, ws); if (ins != null) { ws.Point1 = ins.Point1; ws.Point2 = ins.Point2; } } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.WallDragP1) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown && _gdScreen.Selection is WallStub ws) { var ins = _gdScreen.CanInsertWallStub(new FPoint(rx, ry), ws.Point2, ws); if (ins != null) { ws.Point1 = ins.Point1; } } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.WallDragP2) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown && _gdScreen.Selection is WallStub ws) { var ins = _gdScreen.CanInsertWallStub(ws.Point1, new FPoint(rx, ry), ws); if (ins != null) { ws.Point2 = ins.Point2; } } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.PortalMove) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsRealDown && _gdScreen.Selection is PortalStub ps) { var ins = _gdScreen.CanInsertPortalStub(new FPoint(rx, ry), ps.Length, ps.Normal, ps); if (ins != null) { ps.Center = ins.Center; } } else { _dragMode = DMode.Nothing; } } else if (_dragMode == DMode.Nothing) { if (_gdScreen.Mode == LevelEditorMode.Mouse && istate.IsExclusiveJustDown) { var clickedCannon = _gdScreen.GetEntities <CannonStub>().FirstOrDefault(s => s.GetClickArea().Contains(istate.GamePointerPositionOnMap)); var clickedObstacle = _gdScreen.GetEntities <ObstacleStub>().FirstOrDefault(s => s.GetClickArea().Contains(istate.GamePointerPositionOnMap)); var clickedWallBase = _gdScreen.GetEntities <WallStub>().FirstOrDefault(s => s.GetClickArea().Contains(istate.GamePointerPositionOnMap)); var clickedWallP1 = _gdScreen.GetEntities <WallStub>().FirstOrDefault(s => s.IsClickP1(istate.GamePointerPositionOnMap)); var clickedWallP2 = _gdScreen.GetEntities <WallStub>().FirstOrDefault(s => s.IsClickP2(istate.GamePointerPositionOnMap)); var clickedPortal = _gdScreen.GetEntities <PortalStub>().FirstOrDefault(s => s.GetClickArea().Contains(istate.GamePointerPositionOnMap)); if (clickedCannon != null) { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(clickedCannon); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = istate.GamePointerPositionOnMap - clickedCannon.Center; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.CannonMove; } else if (clickedPortal != null) { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(clickedPortal); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = istate.GamePointerPositionOnMap - clickedPortal.Center; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.PortalMove; } else if (clickedObstacle != null) { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(clickedObstacle); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = istate.GamePointerPositionOnMap - clickedObstacle.Center; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.ObstacleMove; } else if (clickedWallP1 != null) { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(clickedWallP1); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = Vector2.Zero; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.WallDragP1; } else if (clickedWallP2 != null) { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(clickedWallP2); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = Vector2.Zero; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.WallDragP2; } else if (clickedWallBase != null) { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(clickedWallBase); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = istate.GamePointerPositionOnMap - clickedWallBase.Point1; _wallRelativeP2 = clickedWallBase.Point2 - clickedWallBase.Point1; _dragMode = DMode.WallMove; } else { istate.Swallow(InputConsumer.GameBackground); _gdScreen.SelectStub(null); _mouseStartPos = istate.GamePointerPosition; _startOffset = _gdScreen.MapOffset; _dragOffCenter = Vector2.Zero; _wallRelativeP2 = Vector2.Zero; _dragMode = DMode.MapDrag; } } } _oobForce = CalculateOOB(); if (!_oobForce.IsZero() && _dragMode != DMode.MapDrag) { UpdateMapRestDrag(gameTime); } }
public SpendDetail(DMode d, Button btn) { mode = d; InitializeComponent(); SQLite = new SQLite(); #region 변수 초기화 budgetPray = new Pray(); budgetMissionWork = new MissionWork(); budgetEdu = new Education(); budgetPerson = new Person(); budgetService = new Service(); budgetManage = new Manage(); budgetLoan = new Loan(); curPray = new Pray(); curMissionWork = new MissionWork(); curEdu = new Education(); curPerson = new Person(); curService = new Service(); curManage = new Manage(); curLoan = new Loan(); #endregion printBtn = btn; // 표 설정 setView(); Paint += SpendDetail_Paint; }
/// <summary> /// 생성자 /// </summary> public IncomeProgress(DMode drawMode, Button button2) { InitializeComponent(); printDocument1.PrintPage += PrintDocument1_PrintPage; SQLite = new SQLite(); mode = drawMode; Paint += IncomeProgress_Paint; date = DateTime.Now; title.Location = new Point(360, 10); titleInvalidate(); if (mode == DMode.income || mode == DMode.Y_income) { AdditionalView.Visible = true; SumView.Visible = true; setAdditionalView(); setSumView(); } else if (mode == DMode.spend || mode == DMode.Y_spend) { AdditionalView.Visible = false; SumView.Visible = false; } setViews(); button2.Click += Button2_Click; pgSettings = new PageSettings(); }