activate openfile dialog (doesn't load files yet)
authorChristoph von Wittich <christoph_vw@reactos.org>
Thu, 4 Jan 2007 23:19:11 +0000 (23:19 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Thu, 4 Jan 2007 23:19:11 +0000 (23:19 +0000)
svn path=/trunk/; revision=25298

reactos/base/applications/wordpad/editwnd.c
reactos/base/applications/wordpad/mainwnd.c
reactos/base/applications/wordpad/opensave.c
reactos/base/applications/wordpad/precomp.h

index 561df52..9ef79b2 100644 (file)
@@ -147,7 +147,7 @@ CreateEditWindow(struct _MAIN_WND_INFO *MainWnd,
         Info->OpenInfo = OpenInfo;
 
         hWndEditor = CreateMDIWindow(szEditWndClass,
-                                     OpenInfo->lpImageName,
+                                     OpenInfo->lpDocumentName,
                                      WS_MAXIMIZE,
                                      CW_USEDEFAULT,
                                      CW_USEDEFAULT,
index a9a703f..47db19a 100644 (file)
@@ -160,8 +160,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
                WORD CmdId,
                HWND hControl)
 {
-    //static TCHAR szFileName[MAX_PATH];
-    //static TCHAR szImageName[MAX_PATH];
+    static TCHAR szFileName[MAX_PATH];
+    static TCHAR szDocumentName[MAX_PATH];
 
     UNREFERENCED_PARAMETER(hControl);
 
@@ -176,7 +176,7 @@ MainWndCommand(PMAIN_WND_INFO Info,
 
             LoadAndFormatString(hInstance,
                                 IDS_DEFAULT_NAME,
-                                &OpenInfo.lpImageName,
+                                &OpenInfo.lpDocumentName,
                                 ++Info->ImagesCreated);
 
             Ret = DialogBox(hInstance,
@@ -200,21 +200,21 @@ MainWndCommand(PMAIN_WND_INFO Info,
 
         case ID_OPEN:
         {
-/*            OPEN_EDIT_INFO OpenInfo;
+            OPEN_EDIT_INFO OpenInfo;
 
             if (DoOpenFile(Info->hSelf,
-                           szFileName,   / * full file path * /
-                           szImageName)) / * file name * /
+                           szFileName,   /* full file path */
+                           szDocumentName)) /* file name */
             {
                 OpenInfo.CreateNew = FALSE;
 
-                OpenInfo.Open.lpImagePath = szFileName;
-                OpenInfo.lpImageName = szImageName;
+                OpenInfo.lpDocumentPath = szFileName;
+                OpenInfo.lpDocumentName = szDocumentName;
 
                 CreateEditWindow(Info,
                                  &OpenInfo);
             }
-*/
+
         }
         break;
 
index c3b6f35..8ecc006 100644 (file)
@@ -30,7 +30,10 @@ DoOpenFile(HWND hwnd,
 {
        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.lpstrFile = szFileName;
@@ -56,7 +59,8 @@ BOOL
 DoSaveFile(HWND hwnd)
 {
        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.lpstrFile = szFileName;
index 36e416a..f94ddeb 100644 (file)
@@ -47,9 +47,9 @@ typedef struct _OPEN_EDIT_INFO
     union
     {
         UINT DocType;       /* new */
-        LPTSTR lpImagePath; /* open */
+        LPTSTR lpDocumentPath; /* open */
     };
-    LPTSTR lpImageName;
+    LPTSTR lpDocumentName;
 
 } OPEN_EDIT_INFO, *POPEN_EDIT_INFO;