00001 #pragma once
00002
00003 #include "..\..\subpic\ISubPic.h"
00004 #include "LineNumberEdit.h"
00005 #include "ShaderAutoCompleteDlg.h"
00006
00007
00008
00009 class CShaderLabelComboBox : public CComboBox
00010 {
00011 public:
00012 CEdit m_edit;
00013
00014 DECLARE_MESSAGE_MAP()
00015 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
00016 afx_msg void OnDestroy();
00017 };
00018
00019 class CShaderEdit : public CLineNumberEdit
00020 {
00021 int m_nEndChar;
00022 UINT m_nIDEvent;
00023
00024 public:
00025 CShaderEdit();
00026 ~CShaderEdit();
00027
00028 CShaderAutoCompleteDlg m_acdlg;
00029
00030 DECLARE_MESSAGE_MAP()
00031 afx_msg void OnUpdate();
00032 afx_msg void OnKillFocus(CWnd* pNewWnd);
00033 afx_msg void OnTimer(UINT nIDEvent);
00034 virtual BOOL PreTranslateMessage(MSG* pMsg);
00035 };
00036
00037
00038
00039 class CPixelShaderCompiler;
00040
00041 class CShaderEditorDlg : public CResizableDialog
00042 {
00043 private:
00044 CString m_label;
00045 CComPtr<ISubPicAllocatorPresenter> m_pCAP;
00046
00047 struct shader_t {CString target, srcdata;};
00048 CMap<CString, LPCTSTR, shader_t, shader_t&> m_shaders;
00049
00050 UINT m_nIDEventShader;
00051
00052 bool m_fSplitterGrabbed;
00053 bool HitTestSplitter(CPoint p);
00054
00055 CPixelShaderCompiler* m_pPSC;
00056
00057 public:
00058 CShaderEditorDlg(CString label, ISubPicAllocatorPresenter* pCAP, CWnd* pParent = NULL);
00059 virtual ~CShaderEditorDlg();
00060
00061
00062 enum { IDD = IDD_SHADEREDITORDIALOG };
00063 CShaderLabelComboBox m_labels;
00064 CComboBox m_targets;
00065 CShaderEdit m_srcdata;
00066 CEdit m_output;
00067
00068 protected:
00069 virtual void DoDataExchange(CDataExchange* pDX);
00070 virtual BOOL OnInitDialog();
00071 virtual BOOL PreTranslateMessage(MSG* pMsg);
00072
00073 DECLARE_MESSAGE_MAP()
00074
00075 public:
00076 afx_msg void OnCbnSelchangeCombo1();
00077 afx_msg void OnBnClickedButton1();
00078 afx_msg void OnBnClickedButton2();
00079 afx_msg void OnTimer(UINT nIDEvent);
00080 afx_msg void OnClose();
00081 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00082 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00083 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00084 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00085 afx_msg void OnKillFocus(CWnd* pNewWnd);
00086 };