28 #include "../../idlib/precompiled.h"
37 #define EDIT_HEIGHT 25
39 #define EDIT_TAB_CONTROL 0x2006
40 #define NAME_CONTROL 0x2007
54 MaterialEditView::MaterialEditView()
55 : CFormView(MaterialEditView::IDD) {
59 sourceChanged =
false;
82 int sel =
m_tabs.GetCurSel();
115 text.
Insert(
"\r\n\r\n", 0 );
175 CFormView::DoDataExchange(pDX);
185 CFormView::OnInitialUpdate();
203 if (CFormView::OnCreate(lpCreateStruct) == -1)
206 m_nameEdit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER | ES_READONLY, CRect(0,0,0,0),
this,
NAME_CONTROL);
211 TRACE0(
"Failed to create stage property pane\n");
216 TRACE0(
"Failed to create property pane\n");
225 m_tabs.Create(TCS_BOTTOM | TCS_FLATBUTTONS | WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0),
this,
EDIT_TAB_CONTROL);
226 m_tabs.InsertItem(0,
"Properties");
227 m_tabs.InsertItem(1,
"Text");
238 CFormView::OnSize(nType, cx, cy);
241 m_tabs.GetItemRect(0, tabRect);
243 int tabHeight = tabRect.Height()+5;
250 if(
m_tabs.GetSafeHwnd()) {
251 m_tabs.MoveWindow(0, cy-tabHeight, cx, tabHeight);
259 m_textView.MoveWindow(1, 22, cx-2, cy-tabHeight-22);
269 int sel =
m_tabs.GetCurSel();
View that displays material and stage properties and allows the user to edit the properties.
void StripLeading(const char c)
CONST PIXELFORMATDESCRIPTOR UINT
void GetText(idStr &text) const
afx_msg void OnEnChangeEdit(NMHDR *pNMHDR, LRESULT *pResult)
Called when the user changes text in the edit control.
void SourceModify(SourceModifyOwner *owner)
Called when the editor modifies the source of the material.
void StripTrailing(const char c)
CSplitterWnd m_editSplitter
void ApplyMaterialSource()
Takes the source out of the edit control and applies it to the material.
int Icmp(const char *text) const
void SetText(const char *text)
const char * GetEditSourceText()
Returns the appropriate source for the editing.
#define IDC_MATERIALEDITOR_EDIT_TEXT
Responsible for managing a single material that is being viewed and/or edited.
afx_msg void OnTcnSelChange(NMHDR *pNMHDR, LRESULT *pResult)
Called when the user changes the properties/text tab selection.
View that contains the material edit controls.
View that handles managing the material stages.
afx_msg void OnSize(UINT nType, int cx, int cy)
Windows message called when the window is resized.
bool IsSourceModified()
Returns true if the source text of this material has been edited.
MaterialDoc * CreateMaterialDoc(const char *materialName)
Creates a MaterialDoc object for the specified material name.
virtual void MV_OnMaterialNameChanged(MaterialDoc *pMaterial, const char *oldName)
Called when the material name has changed.
void Insert(const char a, int index)
virtual void DoDataExchange(CDataExchange *pDX)
Transfers data to and from the controls in the console.
void RefreshStageList()
Rebuilds the list of stages based on the currently selected material.
IMPLEMENT_DYNCREATE(CCamWnd, CWnd)
void Append(const char a)
MaterialDocManager * materialDocManager
virtual ~MaterialEditView()
Destructor for MaterialEditView.
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
Called by the MFC framework when the view is being created.
CFont * materialEditorFont
void ApplySourceModify(idStr &text)
Applies any source changes to the edit representation of the material.
virtual idStr GetSourceText()
Returns the current source text in the source edit control.
virtual void MV_OnMaterialSelectionChange(MaterialDoc *pMaterial)
Called when the selected material has changed.
MaterialPropTreeView * m_materialPropertyView
MaterialDoc * GetCurrentMaterialDoc()
void Replace(const char *old, const char *nw)
idStr currentMaterialName
virtual void OnInitialUpdate()
Called by the MFC framework when the view is being created.
bool LoadKeyWordsFromFile(const char *fileName)
CSyntaxRichEditCtrl m_textView
void GetMaterialSource()
Gets the source of the current document and populates the source edit control.