mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 09:50:43 +00:00
activate openfile dialog (doesn't load files yet)
svn path=/trunk/; revision=25298
This commit is contained in:
parent
9b2c97c827
commit
6b47dbcdc8
4 changed files with 18 additions and 14 deletions
|
@ -147,7 +147,7 @@ CreateEditWindow(struct _MAIN_WND_INFO *MainWnd,
|
||||||
Info->OpenInfo = OpenInfo;
|
Info->OpenInfo = OpenInfo;
|
||||||
|
|
||||||
hWndEditor = CreateMDIWindow(szEditWndClass,
|
hWndEditor = CreateMDIWindow(szEditWndClass,
|
||||||
OpenInfo->lpImageName,
|
OpenInfo->lpDocumentName,
|
||||||
WS_MAXIMIZE,
|
WS_MAXIMIZE,
|
||||||
CW_USEDEFAULT,
|
CW_USEDEFAULT,
|
||||||
CW_USEDEFAULT,
|
CW_USEDEFAULT,
|
||||||
|
|
|
@ -160,8 +160,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
||||||
WORD CmdId,
|
WORD CmdId,
|
||||||
HWND hControl)
|
HWND hControl)
|
||||||
{
|
{
|
||||||
//static TCHAR szFileName[MAX_PATH];
|
static TCHAR szFileName[MAX_PATH];
|
||||||
//static TCHAR szImageName[MAX_PATH];
|
static TCHAR szDocumentName[MAX_PATH];
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(hControl);
|
UNREFERENCED_PARAMETER(hControl);
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
||||||
|
|
||||||
LoadAndFormatString(hInstance,
|
LoadAndFormatString(hInstance,
|
||||||
IDS_DEFAULT_NAME,
|
IDS_DEFAULT_NAME,
|
||||||
&OpenInfo.lpImageName,
|
&OpenInfo.lpDocumentName,
|
||||||
++Info->ImagesCreated);
|
++Info->ImagesCreated);
|
||||||
|
|
||||||
Ret = DialogBox(hInstance,
|
Ret = DialogBox(hInstance,
|
||||||
|
@ -200,21 +200,21 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
||||||
|
|
||||||
case ID_OPEN:
|
case ID_OPEN:
|
||||||
{
|
{
|
||||||
/* OPEN_EDIT_INFO OpenInfo;
|
OPEN_EDIT_INFO OpenInfo;
|
||||||
|
|
||||||
if (DoOpenFile(Info->hSelf,
|
if (DoOpenFile(Info->hSelf,
|
||||||
szFileName, / * full file path * /
|
szFileName, /* full file path */
|
||||||
szImageName)) / * file name * /
|
szDocumentName)) /* file name */
|
||||||
{
|
{
|
||||||
OpenInfo.CreateNew = FALSE;
|
OpenInfo.CreateNew = FALSE;
|
||||||
|
|
||||||
OpenInfo.Open.lpImagePath = szFileName;
|
OpenInfo.lpDocumentPath = szFileName;
|
||||||
OpenInfo.lpImageName = szImageName;
|
OpenInfo.lpDocumentName = szDocumentName;
|
||||||
|
|
||||||
CreateEditWindow(Info,
|
CreateEditWindow(Info,
|
||||||
&OpenInfo);
|
&OpenInfo);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,10 @@ DoOpenFile(HWND hwnd,
|
||||||
{
|
{
|
||||||
DWORD err;
|
DWORD err;
|
||||||
|
|
||||||
static TCHAR Filter[] = _T("RichText files (*.rtf)\0*.rtf\0");
|
static TCHAR Filter[] = _T("All documents (*.txt,*.rtf)\0*.txt;*.rtf\0") \
|
||||||
|
_T("Rich Text Document (*.rtf)\0*.rtf\0") \
|
||||||
|
_T("Text Document (*.txt)\0*.txt\0");
|
||||||
|
|
||||||
|
|
||||||
ofn.lpstrFilter = Filter;
|
ofn.lpstrFilter = Filter;
|
||||||
ofn.lpstrFile = szFileName;
|
ofn.lpstrFile = szFileName;
|
||||||
|
@ -56,7 +59,8 @@ BOOL
|
||||||
DoSaveFile(HWND hwnd)
|
DoSaveFile(HWND hwnd)
|
||||||
{
|
{
|
||||||
TCHAR szFileName[MAX_PATH] = _T("");
|
TCHAR szFileName[MAX_PATH] = _T("");
|
||||||
static TCHAR Filter[] = _T("RichText files (*.rtf)\0*.rtf\0");
|
static TCHAR Filter[] = _T("Rich Text Document (*.rtf)\0*.rtf\0") \
|
||||||
|
_T("Text Document (*.txt)\0*.txt\0");
|
||||||
|
|
||||||
ofn.lpstrFilter = Filter;
|
ofn.lpstrFilter = Filter;
|
||||||
ofn.lpstrFile = szFileName;
|
ofn.lpstrFile = szFileName;
|
||||||
|
|
|
@ -47,9 +47,9 @@ typedef struct _OPEN_EDIT_INFO
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
UINT DocType; /* new */
|
UINT DocType; /* new */
|
||||||
LPTSTR lpImagePath; /* open */
|
LPTSTR lpDocumentPath; /* open */
|
||||||
};
|
};
|
||||||
LPTSTR lpImageName;
|
LPTSTR lpDocumentName;
|
||||||
|
|
||||||
} OPEN_EDIT_INFO, *POPEN_EDIT_INFO;
|
} OPEN_EDIT_INFO, *POPEN_EDIT_INFO;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue