Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
be495630
Commit
be495630
authored
Feb 19, 2002
by
Andriy Palamarchuk
Committed by
Alexandre Julliard
Feb 19, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented parsing of file name, passed in command line, loading new
file on startup.
parent
55cc7d74
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
144 additions
and
36 deletions
+144
-36
Da.rc
programs/notepad/Da.rc
+3
-0
De.rc
programs/notepad/De.rc
+5
-0
En.rc
programs/notepad/En.rc
+3
-0
Es.rc
programs/notepad/Es.rc
+3
-0
Fi.rc
programs/notepad/Fi.rc
+3
-0
Fr.rc
programs/notepad/Fr.rc
+3
-0
Pt.rc
programs/notepad/Pt.rc
+5
-0
Sk.rc
programs/notepad/Sk.rc
+5
-0
Sw.rc
programs/notepad/Sw.rc
+3
-0
Wa.rc
programs/notepad/Wa.rc
+5
-0
dialog.c
programs/notepad/dialog.c
+2
-2
main.c
programs/notepad/main.c
+90
-23
main.h
programs/notepad/main.h
+12
-11
notepad.rc
programs/notepad/notepad.rc
+2
-0
No files found.
programs/notepad/Da.rc
View file @
be495630
...
...
@@ -91,6 +91,9 @@
/* FIXME: */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Filen '%s'\n has been modified.\n\n \
Would you like to save the changes ?"
...
...
programs/notepad/De.rc
View file @
be495630
...
...
@@ -92,6 +92,11 @@ Benutzen Sie bitte einen anderen Editor, um diese Datei zu bearbeiten."
gespeichert\n werden könnte. Geben Sie Text ein, und versuchen Sie es \
\nerneut."
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Datei %s\n wurde geaendert.\n\n \
Moechten Sie die Aenderungen speichern ?"
...
...
programs/notepad/En.rc
View file @
be495630
...
...
@@ -91,6 +91,9 @@ Please use a different editor."
#define STRING_NOTEXT "You didn't enter any text. \
\nPlease type something and try again"
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "File '%s'\nhas been modified\n\n \
Would you like to save the changes ?"
...
...
programs/notepad/Es.rc
View file @
be495630
...
...
@@ -94,6 +94,9 @@ Use otro editor."
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "El texto en el archivo '%s' ha cambiado\n\n \
Desea guardar los cambios?"
...
...
programs/notepad/Fi.rc
View file @
be495630
...
...
@@ -92,6 +92,9 @@ Please use a different editor."
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "File '%s'\nhas been modified\n\n \
Would you like to save your changes ?"
...
...
programs/notepad/Fr.rc
View file @
be495630
...
...
@@ -93,6 +93,9 @@ Veuillez utiliser un autre diteur."
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Le fichier '%s'\n\n a change\n \
Would you like to save your changes ?"
...
...
programs/notepad/Pt.rc
View file @
be495630
...
...
@@ -90,6 +90,11 @@ Por favor use um editor diferente."
#define STRING_NOTEXT "Voc no digitou nenhum texto. \
\nPor favor digite alguma coisa e tente novamente"
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Arquivo '%s'\nfoi modificado\n\n \
Gostaria de salvar as alteraes ?"
...
...
programs/notepad/Sk.rc
View file @
be495630
...
...
@@ -91,6 +91,11 @@ Please use a different editor."
#define STRING_NOTEXT "Ni ste nenapsali. \
\nProsm, napte nejak text a pokste sa znovu."
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Sbor '%s'\nbol zmenenn\n \
Prajete si uloi zmeny ?"
...
...
programs/notepad/Sw.rc
View file @
be495630
...
...
@@ -93,6 +93,9 @@ Anvnd en annan editor."
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Filen '%s'\nhas been modified\n\n \
Would you like to save your changes ?"
...
...
programs/notepad/Wa.rc
View file @
be495630
...
...
@@ -93,6 +93,11 @@ Eployoz on te aspougneu di tekse."
#define STRING_NOTEXT "Vos n' avoz rn sicrt. \
\nTapez ene sacwe t rasayez"
/* FIXME */
#define STRING_DOESNOTEXIST "File '%s'\ndoes not exist\n\n \
Do you want to create a new file ?"
#define STRING_NOTSAVED "Li fitch '%s'\na candj\n\n \
El voloz schaper ?"
...
...
programs/notepad/dialog.c
View file @
be495630
...
...
@@ -89,7 +89,7 @@ VOID AlertOutOfMemory(void) {
}
BOOL
ExistFile
(
LPCSTR
szFilename
)
{
BOOL
FileExists
(
LPCSTR
szFilename
)
{
/*
* Returns: TRUE - if "szFileName" exists
* FALSE - if it does not
...
...
@@ -206,7 +206,7 @@ VOID DIALOG_FileOpen(VOID)
if
(
GetOpenFileName
(
&
openfilename
))
{
if
(
ExistFile
(
openfilename
.
lpstrFile
))
if
(
FileExists
(
openfilename
.
lpstrFile
))
DoOpenFile
(
openfilename
.
lpstrFile
);
else
AlertFileNotFound
(
openfilename
.
lpstrFile
);
...
...
programs/notepad/main.c
View file @
be495630
...
...
@@ -34,6 +34,7 @@
#include "dialog.h"
#include "language.h"
extern
BOOL
FileExists
(
LPCSTR
szFilename
);
extern
BOOL
DoCloseFile
(
void
);
extern
void
DoOpenFile
(
LPCSTR
szFileName
);
...
...
@@ -477,7 +478,6 @@ void LoadBufferFromFile(LPCSTR szFileName)
memmove
(
&
pTemp
[
0
],
&
pTemp
[
i
],
bytes_left
);
}
CloseHandle
(
hFile
);
MessageBox
(
Globals
.
hMainWnd
,
"Finished"
,
"Info"
,
MB_OK
);
}
BOOL
DoInput
(
HDC
hDC
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -847,6 +847,94 @@ LRESULT WINAPI NOTEPAD_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
return
0l
;
}
int
AlertFileDoesNotExist
(
LPSTR
szFileName
)
{
int
nResult
;
CHAR
szMessage
[
MAX_STRING_LEN
];
CHAR
szRessource
[
MAX_STRING_LEN
];
LoadString
(
Globals
.
hInstance
,
IDS_DOESNOTEXIST
,
szRessource
,
sizeof
(
szRessource
));
wsprintf
(
szMessage
,
szRessource
,
szFileName
);
LoadString
(
Globals
.
hInstance
,
IDS_ERROR
,
szRessource
,
sizeof
(
szRessource
));
nResult
=
MessageBox
(
Globals
.
hMainWnd
,
szMessage
,
szRessource
,
MB_ICONEXCLAMATION
|
MB_YESNO
);
return
(
nResult
);
}
void
HandleCommandLine
(
LPSTR
cmdline
)
{
while
(
*
cmdline
&&
(
*
cmdline
==
' '
||
*
cmdline
==
'-'
))
{
CHAR
option
;
if
(
*
cmdline
++
==
' '
)
continue
;
option
=
*
cmdline
;
if
(
option
)
cmdline
++
;
while
(
*
cmdline
&&
*
cmdline
==
' '
)
cmdline
++
;
switch
(
option
)
{
case
'p'
:
case
'P'
:
printf
(
"Print file: "
);
/* Not yet able to print a file */
break
;
}
}
if
(
*
cmdline
)
{
/* file name is passed in the command line */
char
*
file_name
;
BOOL
file_exists
;
char
buf
[
MAX_PATH
];
if
(
FileExists
(
cmdline
))
{
file_exists
=
TRUE
;
file_name
=
cmdline
;
}
else
{
/* try to find file with ".txt" extention */
if
(
!
strcmp
(
".txt"
,
cmdline
+
strlen
(
cmdline
)
-
strlen
(
".txt"
)))
{
file_exists
=
FALSE
;
file_name
=
cmdline
;
}
else
{
strncpy
(
buf
,
cmdline
,
MAX_PATH
-
strlen
(
".txt"
)
-
1
);
strcat
(
buf
,
".txt"
);
file_name
=
buf
;
file_exists
=
FileExists
(
buf
);
}
}
if
(
file_exists
)
{
DoOpenFile
(
file_name
);
InvalidateRect
(
Globals
.
hMainWnd
,
NULL
,
FALSE
);
}
else
{
switch
(
AlertFileDoesNotExist
(
file_name
))
{
case
IDYES
:
DoOpenFile
(
file_name
);
break
;
case
IDNO
:
break
;
}
}
}
}
/***********************************************************************
...
...
@@ -932,28 +1020,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
"Error"
,
MB_ICONEXCLAMATION
);
}
/* now handle command line */
while
(
*
cmdline
&&
(
*
cmdline
==
' '
||
*
cmdline
==
'-'
))
{
CHAR
option
;
/* LPCSTR topic_id; */
if
(
*
cmdline
++
==
' '
)
continue
;
option
=
*
cmdline
;
if
(
option
)
cmdline
++
;
while
(
*
cmdline
&&
*
cmdline
==
' '
)
cmdline
++
;
switch
(
option
)
{
case
'p'
:
case
'P'
:
printf
(
"Print file: "
);
/* Not yet able to print a file */
break
;
}
}
HandleCommandLine
(
cmdline
);
/* Set up Drag&Drop */
...
...
programs/notepad/main.h
View file @
be495630
...
...
@@ -82,17 +82,18 @@ extern CHAR STRING_PAGESETUP_Xx[];
#define IDS_INFO STRINGID(07)
#define IDS_TOOLARGE STRINGID(08)
#define IDS_NOTEXT STRINGID(09)
#define IDS_NOTSAVED STRINGID(0A)
#define IDS_NOTFOUND STRINGID(0B)
#define IDS_OUT_OF_MEMORY STRINGID(0C)
#define IDS_UNTITLED STRINGID(0D)
#define IDS_PAGESETUP_HEADERVALUE STRINGID(0E)
#define IDS_PAGESETUP_FOOTERVALUE STRINGID(0F)
#define IDS_PAGESETUP_LEFTVALUE STRINGID(10)
#define IDS_PAGESETUP_RIGHTVALUE STRINGID(11)
#define IDS_PAGESETUP_TOPVALUE STRINGID(12)
#define IDS_PAGESETUP_BOTTOMVALUE STRINGID(13)
#define IDS_DOESNOTEXIST STRINGID(0A)
#define IDS_NOTSAVED STRINGID(0B)
#define IDS_NOTFOUND STRINGID(0C)
#define IDS_OUT_OF_MEMORY STRINGID(0D)
#define IDS_UNTITLED STRINGID(0E)
#define IDS_PAGESETUP_HEADERVALUE STRINGID(0F)
#define IDS_PAGESETUP_FOOTERVALUE STRINGID(10)
#define IDS_PAGESETUP_LEFTVALUE STRINGID(11)
#define IDS_PAGESETUP_RIGHTVALUE STRINGID(12)
#define IDS_PAGESETUP_TOPVALUE STRINGID(13)
#define IDS_PAGESETUP_BOTTOMVALUE STRINGID(14)
/* main menu */
...
...
programs/notepad/notepad.rc
View file @
be495630
...
...
@@ -102,6 +102,7 @@ ADDSTRING(WARNING)
ADDSTRING(INFO)
ADDSTRING(TOOLARGE)
ADDSTRING(NOTEXT)
ADDSTRING(DOESNOTEXIST)
ADDSTRING(NOTSAVED)
ADDSTRING(NOTFOUND)
ADDSTRING(OUT_OF_MEMORY)
...
...
@@ -182,6 +183,7 @@ ADDSTRING(PAGESETUP_BOTTOMVALUE)
#undef STRING_TEXT_FILES_TXT
#undef STRING_TOOLARGE
#undef STRING_NOTEXT
#undef STRING_DOESNOTEXIST
#undef STRING_NOTSAVED
#undef STRING_NOTFOUND
#undef STRING_OUT_OF_MEMORY
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment