29 #include "../../idlib/precompiled.h"
50 CDialog::DoDataExchange(pDX);
55 static UINT FindDialogMessage = ::RegisterWindowMessage(FINDMSGSTRING);
64 ON_REGISTERED_MESSAGE(FindDialogMessage, OnFindDialogMessage)
71 CDialog::OnSize(nType, cx, cy);
72 if (GetSafeHwnd() ==
NULL) {
77 CWnd *wnd = GetDlgItem(IDC_BUTTON_OPEN);
78 if (wnd ==
NULL || (wnd && wnd->GetSafeHwnd() ==
NULL)) {
81 wnd->GetWindowRect(crect);
82 wnd->SetWindowPos(
NULL, 4, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
83 wnd = GetDlgItem(IDC_BUTTON_SAVE);
84 int left = 8 + crect.Width();
85 wnd->SetWindowPos(
NULL, left, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
86 wnd = GetDlgItem(IDOK);
87 wnd->SetWindowPos(
NULL, rect.Width() - crect.Width() - 4, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
88 editInfo.SetWindowPos(
NULL, 4, 8 + crect.Height(), rect.Width() - 8, rect.Height() - crect.Height() * 2 - 16, SWP_SHOWWINDOW);
89 wnd = GetDlgItem(IDC_BUTTON_GOTO);
90 wnd->SetWindowPos(
NULL, 4, rect.Height() - 4 - crect.Height(), crect.Width(), crect.Height(), SWP_SHOWWINDOW);
92 wnd->SetWindowPos(
NULL, 8 + crect.Width(), rect.Height() - 3 - crect.Height(), crect.Width() + 8, crect.Height() - 3, SWP_SHOWWINDOW);
94 wnd->SetWindowPos(
NULL, 30 + crect.Width() * 2, rect.Height() - crect.Height(), crect.Width() * 2, crect.Height(), SWP_SHOWWINDOW);
96 wnd->SetWindowPos(
NULL, 40 + crect.Width() * 3, rect.Height() - crect.Height(), crect.Width() + 8, crect.Height(), SWP_SHOWWINDOW);
103 findDlg =
new CFindReplaceDialog();
135 if (GetSafeHwnd() &&
editInfo.GetSafeHwnd()) {
149 CDialog::OnInitDialog();
155 LONG lSize =
sizeof(rct);
157 SetWindowPos(
NULL, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW);
165 SetTimer(1, 250,
NULL);
178 CDialog::OnDestroy();
216 CDialog::OnTimer(nIDEvent);
221 wnd->SetWindowText(
va(
"%i",
editInfo.LineFromChar(start)));
230 wnd->GetWindowText(str);
231 if (str.GetLength()) {
246 if (pMsg->message == WM_KEYDOWN && (pMsg->wParam ==
's' || pMsg->wParam ==
'S') && GetAsyncKeyState(VK_CONTROL) & 0x8000) {
251 if (pMsg->message == WM_KEYDOWN && (pMsg->wParam ==
'o' || pMsg->wParam ==
'O') && GetAsyncKeyState(VK_CONTROL) & 0x8000) {
256 if (pMsg->message == WM_KEYDOWN && (pMsg->wParam ==
'f' || pMsg->wParam ==
'F') && GetAsyncKeyState(VK_CONTROL) & 0x8000) {
261 if (pMsg->hwnd ==
editInfo.GetSafeHwnd() && (pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB)) {
271 return CDialog::PreTranslateMessage(pMsg);
279 if (
findDlg->IsTerminating()) {
int GetLineNum(void) const
afx_msg LRESULT OnFindDialogMessage(WPARAM wParam, LPARAM lParam)
afx_msg void OnBnClickedButtonSave()
const char * GetFileName(void) const
CONST PIXELFORMATDESCRIPTOR UINT
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
virtual BOOL PreTranslateMessage(MSG *pMsg)
idFileSystem * fileSystem
CFindReplaceDialog * findDlg
const char * GetName(void) const
virtual BOOL OnInitDialog()
afx_msg void OnTimer(UINT nIDEvent)
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
bool LoadRegistryInfo(const char *pszName, void *pvBuf, long *plSize)
idUserInterfaceManager * uiManager
virtual void FreeFile(void *buffer)=0
virtual int WriteFile(const char *relativePath, const void *buffer, int size, const char *basePath="fs_savepath")=0
virtual void DoDataExchange(CDataExchange *pDX)
afx_msg void OnBnClickedButtonOpen()
void SetGuiInfo(const char *name)
virtual void Reload(bool force)=0
bool SaveRegistryInfo(const char *pszName, void *pvBuf, long lSize)
int Find(const char c, int start=0, int end=-1) const
idDeclManager * declManager
afx_msg void OnBnClickedButtonGoto()
static CPreviewDlg * ShowMaterialChooser()
virtual void Reload(bool all)=0
static CPreviewDlg * ShowGuiChooser()
#define IDD_DIALOG_EDITPREVIEW
const char * c_str(void) const
char * va(const char *fmt,...)
virtual const char * OSPathToRelativePath(const char *OSPath)=0
void SetMaterialInfo(const char *name, const char *file, int line)
CMediaPreviewDlg mediaPreview