#pragma once #include "stdafx.h" #include "core/Recipe.h" #include "core/InspectEngine.h" // 親へ「カード選択が変わった」を通知(wParam = 選択index)。 #define WM_PV_SELCHANGED (WM_APP + 11) // 親へ「カードを移動した」を通知(wParam = 元index, lParam = 挿入スロット 0..n)。 #define WM_PV_MOVESTEP (WM_APP + 12) // ビジュアル・パイプライン表示: 各ステップをカード化し、適用後サムネイル + 合否を縦に並べる。 class CPipelineView : public CWnd { public: CPipelineView(); BOOL Create(CWnd* parent, UINT id); void SetData(core::Recipe* recipe, core::InspectEngine* engine); void RefreshView(); // スクロール範囲再計算 + 再描画 void SetSel(int idx); int GetSel() const { return m_sel; } protected: afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnLButtonDown(UINT nFlags, CPoint pt); afx_msg void OnMouseMove(UINT nFlags, CPoint pt); afx_msg void OnLButtonUp(UINT nFlags, CPoint pt); afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pBar); afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); afx_msg void OnSize(UINT nType, int cx, int cy); DECLARE_MESSAGE_MAP() private: int CardHeight() const { return 104; } int ContentHeight() const; CRect CardRect(int i) const; // クライアント座標(スクロール込み) void UpdateScroll(); void DrawCard(CDC* dc, int i, const CRect& rc); core::Recipe* m_recipe = nullptr; core::InspectEngine* m_engine = nullptr; int m_sel = -1; int m_scrollY = 0; // ドラッグ並べ替え int m_dragFrom = -1; // 押下したカード(まだ移動と確定していない) bool m_dragging = false; // しきい値を超えて移動中 CPoint m_dragStart; int m_dragY = 0; // 現在のマウスY(挿入位置インジケータ用) int InsertSlotAt(int y) const; // クライアントYから挿入スロット 0..n CFont m_fTitle, m_fHint, m_fBadge, m_fNum; };