first go at some notepad changes

Jonathan Wilson jonwil at tpgi.com.au
Sun Jul 27 07:16:19 CDT 2003


Hopefully, there isnt anything in there thats a derivitave of microsofts 
code :)
changes:
1.change the resource IDs of the 3 buttons in the page setup dialog (for 
all languages) to use IDOK, IDCANCEL and IDHELP which is actually what 
the code is programmed to use.
2.add ... to File-Open menu item
3.add Ctrl+N to File-New menu item
4.add ... and Ctrl+P to File-Print menu item
5.move Find and Find Next to Edit menu and remove Search menu
6.add Replace to Edit menu, with ... and Ctrl+H (not working yet)
7.add Go To to Edit menu with ... and Ctrl+G
8.add seperator to Edit menu before Select All
9.Move Wrap Long Lines and Font to a new Format menu and rename Wrap 
Long Lines as Word Wrap
10.Add new View menu
11.Add Status Bar menu item to View menu
12.Add new GoTo dialog
13.Add comctl32 to imports list in Makefile.in (for the status bar stuff)
14.Include commctrl.h in dialog.c
15.Add code for View-Show Status Bar to dialog.c (status bar doesnt 
actually do anything yet, I am working on it though)
16.modify DIALOG_FileOpen(VOID) to declare the variable I as unsigned 
(to fix some warnings I got about a signed/unsigned mismatch with < on 
msvc win32)
17.Add code for the GoTo menu option
18.Add a dialog procedure for the GoTo dialog
19.Add new functions to dialog.h
20.make main.c #include commctrl.h
21.change aFINDMSGSTRING to be an int not an ATOM since thats what MSDN 
says RegisterWindowMessage returns
22.add handlers for CMD_STATUS and CMD_GOTO to the WM_COMMAND handler
23.change the edit box to have WS_EX_CLIENTEDGE, WS_HSCROLL,  and 
ES_NOHIDESEL set and WS_AUTOVSCROLL not set, makes it look and behave 
more like microsofs notepad.
24.add code to create the status bar (starts out invisible) to WM_CREATE
25.modify WM_SIZE to correctly size the edit controll if the status bar 
is visble and to tell the status bar to resize itself if needed
25.modify the main window class to use IDC_IBEAM instead of IDC_ARROW as 
its cursor (needed for some stuff)
26.modify the Globals structure to add a ¨status bar is enabled¨ value, 
a status bar handle, a status bar height value (so we can size the edit 
box correctly) and a value to hold the line for GoTo
27.modify notepad_res.h to add defines for the GoTo dialog and the 3 new 
menu commands (View-Status Bar, Edit-Replace and Edit-GoTo)
28.modify rsrc.rc to only #include wa.rc if __WINE__ is defined (fixes 
the problem with LANG_WALON not being defined by windows, visual C++, 
MingW etc)
29.modify rsrc.rc to only #include fr.rc if __WINE__ is defined (visual 
C++ and windres both choked on fr.rc and I couldnt work out why, someone 
else might know)
30.add a new accellerator for help contents (such as they are right now :)
31.change all accellerators to use VIRTKEY, CONTROL instead of ^ (fixed 
some problems that poped up when I added ^h as an accellerator for 
Edit-Replace, when I did that, backspace stopped working because windows 
thinks ^h and backspace are the same)
32.add Ctrl-H accelerator for Replace (because its what microsoft used :)
33.add Ctrl-G accelerator for GoTo
34.add Ctrl-N accelerator for New
and 35.add Ctrl-P accelerator for Print

All resource changes are english only (its not like I speak all those 
other languages :)
I am still doing work on this but I am posting this to get feedback on 
what I have so far.
And also to get someone to transfer all the resource changes I have done 
over to the other languages.

Some of the things still on my todo list:
The status bar doesnt do anything usefull yet, still working on that. 
(it will display current line and column in the file, among other things)
Also, Replace doesnt do anything (working on it)
And I am going to fix Find and Find Next to actually do something usefull
And there are a few other smaller things (like greying out Cut, Paste, 
Copy and so on when there is mothing to Cut, Paste, Copy or whatever)

-------------- next part --------------
? notepad.pat
Index: Da.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Da.rc,v
retrieving revision 1.11
diff -u -w -r1.11 Da.rc
--- Da.rc	19 May 2003 23:17:41 -0000	1.11
+++ Da.rc	27 Jul 2003 11:46:35 -0000
@@ -86,9 +86,9 @@
 LTEXT    "&Bund:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Annuller",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Hjælp",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Annuller",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Hjælp",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: De.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/De.rc,v
retrieving revision 1.11
diff -u -w -r1.11 De.rc
--- De.rc	19 May 2003 23:17:41 -0000	1.11
+++ De.rc	27 Jul 2003 11:46:35 -0000
@@ -87,9 +87,9 @@
 LTEXT    "&Unten:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Abbrechen",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Hilfe",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Abbrechen",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Hilfe",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: En.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/En.rc,v
retrieving revision 1.13
diff -u -w -r1.13 En.rc
--- En.rc	21 Jul 2003 20:05:33 -0000	1.13
+++ En.rc	27 Jul 2003 11:46:36 -0000
@@ -26,12 +26,12 @@
 MAIN_MENU MENU
 {
  POPUP "&File" {
-  MENUITEM "&New...",           CMD_NEW
-  MENUITEM "&Open\tCtrl+O",     CMD_OPEN
+  MENUITEM "&New...\tCtrl+N",      CMD_NEW
+  MENUITEM "&Open...\tCtrl+O",     CMD_OPEN
   MENUITEM "&Save\tCtrl+S",     CMD_SAVE
   MENUITEM "Save &as...",       CMD_SAVE_AS
   MENUITEM SEPARATOR
-  MENUITEM "&Print",            CMD_PRINT
+  MENUITEM "&Print...\tCtrl+P", CMD_PRINT
   MENUITEM "Page Se&tup...",    CMD_PAGE_SETUP
   MENUITEM "P&rinter Setup...", CMD_PRINTER_SETUP
   MENUITEM SEPARATOR
@@ -45,15 +45,20 @@
   MENUITEM "&Paste\tCtrl+V",    CMD_PASTE
   MENUITEM "&Delete\tDel",      CMD_DELETE
   MENUITEM SEPARATOR
+  MENUITEM "&Find...\tCtrl+F",  CMD_SEARCH
+  MENUITEM "&Find next\tF3",    CMD_SEARCH_NEXT
+  MENUITEM "&Replace...\tCtrl+H",CMD_REPLACE
+  MENUITEM "&Go To...\tCtrl+G", CMD_GOTO
+  MENUITEM SEPARATOR
   MENUITEM "Select &all\tCtrl+A",       CMD_SELECT_ALL
   MENUITEM "&Time/Date\tF5",    CMD_TIME_DATE
-  MENUITEM SEPARATOR
-  MENUITEM "&Wrap long lines",  CMD_WRAP
+ }
+POPUP "F&ormat" {
+  MENUITEM "&Word Wrap",        CMD_WRAP
   MENUITEM "&Font...",          CMD_FONT
  }
-POPUP "&Search" {
-  MENUITEM "&Search\tCtrl+F",   CMD_SEARCH
-  MENUITEM "&Search next\tF3",  CMD_SEARCH_NEXT
+POPUP "&View" {
+  MENUITEM "&Status Bar",       CMD_STATUS
  }
 POPUP "&Help" {
   MENUITEM "&Contents",         CMD_HELP_CONTENTS
@@ -90,9 +95,20 @@
 LTEXT    "&Bottom:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Cancel",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Help",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Cancel",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Help",      IDHELP,                 180, 39, 40, 15, WS_TABSTOP
+}
+
+DIALOG_GOTO DIALOG 0, 0, 180, 57
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+FONT 8, "Helv"
+CAPTION "Goto line"
+{
+LTEXT           "&Line Number:",1200,7,9,50,10, WS_TABSTOP
+EDITTEXT        258,55,7,57,12, WS_TABSTOP
+DEFPUSHBUTTON "OK",IDOK,7,34,50,14, WS_TABSTOP
+PUSHBUTTON    "Cancel",IDCANCEL,78,34,50,14, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Es.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Es.rc,v
retrieving revision 1.10
diff -u -w -r1.10 Es.rc
--- Es.rc	19 May 2003 23:17:41 -0000	1.10
+++ Es.rc	27 Jul 2003 11:46:36 -0000
@@ -88,9 +88,9 @@
 LTEXT    "Aba&jo:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Cancelar",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Ayuda",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Cancelar",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Ayuda",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Fi.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Fi.rc,v
retrieving revision 1.9
diff -u -w -r1.9 Fi.rc
--- Fi.rc	19 May 2003 23:17:41 -0000	1.9
+++ Fi.rc	27 Jul 2003 11:46:36 -0000
@@ -86,9 +86,9 @@
 LTEXT    "&Ala:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Peruuta",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Apua",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Peruuta",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Apua",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Fr.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Fr.rc,v
retrieving revision 1.12
diff -u -w -r1.12 Fr.rc
--- Fr.rc	19 May 2003 23:17:41 -0000	1.12
+++ Fr.rc	27 Jul 2003 11:46:36 -0000
@@ -87,9 +87,9 @@
 LTEXT    "&Bas:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Annuler",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Aide",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Annuler",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Aide",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Hu.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Hu.rc,v
retrieving revision 1.1
diff -u -w -r1.1 Hu.rc
--- Hu.rc	4 Nov 2002 22:45:23 -0000	1.1
+++ Hu.rc	27 Jul 2003 11:46:37 -0000
@@ -88,9 +88,9 @@
 LTEXT    "&Alsó:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Mégse",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Súgó",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Mégse",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Súgó",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
Index: Makefile.in
===================================================================
RCS file: /home/wine/wine/programs/notepad/Makefile.in,v
retrieving revision 1.32
diff -u -w -r1.32 Makefile.in
--- Makefile.in	21 Jul 2003 20:05:33 -0000	1.32
+++ Makefile.in	27 Jul 2003 11:46:37 -0000
@@ -4,7 +4,7 @@
 VPATH     = @srcdir@
 MODULE    = notepad.exe
 APPMODE   = gui
-IMPORTS   = comdlg32 shell32 user32 gdi32 msvcrt advapi32 kernel32
+IMPORTS   = comdlg32 shell32 user32 gdi32 msvcrt advapi32 kernel32 comctl32
 EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
 EXTRADEFS = -DNO_LIBWINE_PORT
 
Index: Pt.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Pt.rc,v
retrieving revision 1.10
diff -u -w -r1.10 Pt.rc
--- Pt.rc	23 Jun 2003 18:15:15 -0000	1.10
+++ Pt.rc	27 Jul 2003 11:46:37 -0000
@@ -89,9 +89,9 @@
 LTEXT    "&Inferior:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Cancelar",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Ajuda",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Cancelar",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Ajuda",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Ru.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Ru.rc,v
retrieving revision 1.1
diff -u -w -r1.1 Ru.rc
--- Ru.rc	4 May 2003 02:33:08 -0000	1.1
+++ Ru.rc	27 Jul 2003 11:46:37 -0000
@@ -85,9 +85,9 @@
 LTEXT    "&Íèæíåå:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Îòìåíà",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Ñïðàâêà",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Îòìåíà",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Ñïðàâêà",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
Index: Si.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Si.rc,v
retrieving revision 1.4
diff -u -w -r1.4 Si.rc
--- Si.rc	19 May 2003 23:17:41 -0000	1.4
+++ Si.rc	27 Jul 2003 11:46:38 -0000
@@ -86,9 +86,9 @@
 LTEXT    "&Spodaj:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "V redu",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Preklièi",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Pomoè",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "V redu",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Preklièi",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Pomoè",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Sk.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Sk.rc,v
retrieving revision 1.8
diff -u -w -r1.8 Sk.rc
--- Sk.rc	19 May 2003 23:17:41 -0000	1.8
+++ Sk.rc	27 Jul 2003 11:46:38 -0000
@@ -87,9 +87,9 @@
 LTEXT    "&Bottom:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Cancel",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Help",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Cancel",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Help",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Sw.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Sw.rc,v
retrieving revision 1.10
diff -u -w -r1.10 Sw.rc
--- Sw.rc	19 May 2003 23:17:41 -0000	1.10
+++ Sw.rc	27 Jul 2003 11:46:38 -0000
@@ -87,9 +87,9 @@
 LTEXT    "&Under:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Avbryt",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Hjälp",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Avbryt",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Hjälp",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Wa.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Wa.rc,v
retrieving revision 1.9
diff -u -w -r1.9 Wa.rc
--- Wa.rc	19 May 2003 23:17:41 -0000	1.9
+++ Wa.rc	27 Jul 2003 11:46:38 -0000
@@ -87,9 +87,9 @@
 LTEXT    "&Bas:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "I Va",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Rinoncî",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "&Aide",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "I Va",        IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Rinoncî",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "&Aide",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE
Index: Zh.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/Zh.rc,v
retrieving revision 1.1
diff -u -w -r1.1 Zh.rc
--- Zh.rc	9 Jan 2003 00:51:09 -0000	1.1
+++ Zh.rc	27 Jul 2003 11:46:39 -0000
@@ -84,9 +84,9 @@
 LTEXT    "Ï£¨&B£©£º",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "È·¶¨",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "È¡Ïû",     0x152,               180, 21, 40, 15, WS_TABSTOP
-PUSHBUTTON    "°ïÖú£¨&£©",       0x153,                180, 39, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "È·¶¨",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "È¡Ïû",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
+PUSHBUTTON    "°ïÖú£¨&£©",       IDHELP,                180, 39, 40, 15, WS_TABSTOP
 }
 
 STRINGTABLE DISCARDABLE LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
Index: dialog.c
===================================================================
RCS file: /home/wine/wine/programs/notepad/dialog.c,v
retrieving revision 1.24
diff -u -w -r1.24 dialog.c
--- dialog.c	21 Jul 2003 20:05:33 -0000	1.24
+++ dialog.c	27 Jul 2003 11:46:40 -0000
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <windows.h>
 #include <commdlg.h>
+#include <commctrl.h>
 
 #include "main.h"
 #include "license.h"
@@ -34,6 +35,7 @@
 static const WCHAR helpfileW[] = { 'n','o','t','e','p','a','d','.','h','l','p',0 };
 
 static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+static INT_PTR WINAPI DIALOG_GOTO_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
 
 VOID ShowLastError(void)
 {
@@ -281,6 +283,30 @@
     }
 }
 
+VOID DIALOG_ShowStatusBar(VOID)
+{
+    RECT rcs;
+    RECT rc;
+    GetClientRect(Globals.hMainWnd, &rc);
+    Globals.bStatusBarEnabled = !Globals.bStatusBarEnabled;
+    if (Globals.bStatusBarEnabled == TRUE)
+    {
+        ShowWindow(Globals.hStatusBar,SW_SHOW);
+        GetClientRect(Globals.hStatusBar,&rcs);
+        Globals.iStatusBarHeight = rcs.bottom - rcs.top;
+        SendMessage(Globals.hStatusBar, WM_SIZE, 0, 0);
+    }
+    else
+    {
+        ShowWindow(Globals.hStatusBar,SW_HIDE);
+        Globals.iStatusBarHeight = 0;
+    }
+    CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_STATUS,
+        MF_BYCOMMAND | (Globals.bStatusBarEnabled ? MF_CHECKED : MF_UNCHECKED));
+    SetWindowPos(Globals.hEdit, NULL, 0, 0, (rc.right-rc.left), ((rc.bottom-rc.top)-Globals.iStatusBarHeight),
+                 SWP_NOOWNERZORDER | SWP_NOZORDER);
+}
+
 VOID DIALOG_FileOpen(VOID)
 {
     OPENFILENAME openfilename;
@@ -360,10 +386,11 @@
     PRINTDLG printer;
     SIZE szMetric;
     int cWidthPels, cHeightPels, border;
-    int xLeft, yTop, i, pagecount, dopage, copycount;
+    int xLeft, yTop, pagecount, dopage, copycount;
     LOGFONT hdrFont;
     HFONT font, old_font=0;
     DWORD size;
+    unsigned int i;
     LPWSTR pTemp;
     static const WCHAR times_new_romanW[] = { 'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0 };
 
@@ -657,6 +684,28 @@
             Globals.hMainWnd, DIALOG_PAGESETUP_DlgProc);
 }
 
+/***********************************************************************
+ *
+ *           DIALOG_GoTo
+ */
+VOID DIALOG_GoTo(void)
+{
+  INT_PTR retval;
+  DWORD selstart;
+  DWORD selend;
+  LRESULT res;
+  SendMessage(Globals.hEdit,EM_GETSEL,(WPARAM)&selstart,(LPARAM)&selend);
+  Globals.iLine = SendMessage(Globals.hEdit,EM_LINEFROMCHAR,(LPARAM)selstart,0) + 1;
+  retval = DialogBox(Globals.hInstance, MAKEINTRESOURCE(DIALOG_GOTO),
+            Globals.hMainWnd, DIALOG_GOTO_DlgProc);
+  if (retval == IDOK)
+  {
+      res = SendMessage(Globals.hEdit,EM_LINEINDEX,(Globals.iLine-1),0);
+      SendMessage(Globals.hEdit,EM_SETSEL,res,res);
+      SendMessage(Globals.hEdit,EM_SCROLLCARET,0,0);
+  }
+}
+
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *
@@ -712,5 +761,40 @@
        break;
     }
 
+  return FALSE;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *           DIALOG_GOTO_DlgProc
+ */
+static INT_PTR WINAPI DIALOG_GOTO_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+   WCHAR temp[MAX_STRING_LEN];
+   static const WCHAR formatW[] = { '%','d',0 };
+   switch (msg)
+    {
+    case WM_COMMAND:
+      switch (wParam)
+        {
+        case IDOK:
+          GetDlgItemText(hDlg, 258, temp, MAX_STRING_LEN);
+          Globals.iLine = _wtoi(temp);
+          EndDialog(hDlg, IDOK);
+          return TRUE;
+        case IDCANCEL:
+          /* discard user input and close dialog */
+          EndDialog(hDlg, IDCANCEL);
+          return TRUE;
+    default:
+        break;
+        }
+      break;
+
+    case WM_INITDIALOG:
+       /* fetch last user input prior to display dialog */
+        wsprintf(temp,formatW,Globals.iLine);
+        SetDlgItemText(hDlg, 258, temp);
+   }
   return FALSE;
 }
Index: dialog.h
===================================================================
RCS file: /home/wine/wine/programs/notepad/dialog.h,v
retrieving revision 1.8
diff -u -w -r1.8 dialog.h
--- dialog.h	21 Jul 2003 20:05:33 -0000	1.8
+++ dialog.h	27 Jul 2003 11:46:41 -0000
@@ -41,6 +41,8 @@
 
 VOID DIALOG_SelectFont(VOID);
 
+VOID DIALOG_ShowStatusBar(VOID);
+
 VOID DIALOG_HelpContents(VOID);
 VOID DIALOG_HelpSearch(VOID);
 VOID DIALOG_HelpHelp(VOID);
@@ -49,6 +51,7 @@
 VOID DIALOG_HelpAboutWine(VOID);
 
 VOID DIALOG_TimeDate(VOID);
+VOID DIALOG_GoTo(VOID);
 
 /* utility functions */
 VOID ShowLastError();
Index: main.c
===================================================================
RCS file: /home/wine/wine/programs/notepad/main.c,v
retrieving revision 1.28
diff -u -w -r1.28 main.c
--- main.c	21 Jul 2003 20:05:33 -0000	1.28
+++ main.c	27 Jul 2003 11:46:41 -0000
@@ -25,6 +25,7 @@
 #define UNICODE
 
 #include <windows.h>
+#include <commctrl.h>
 #include <stdio.h>
 
 #include "main.h"
@@ -32,7 +33,7 @@
 #include "notepad_res.h"
 
 NOTEPAD_GLOBALS Globals;
-static ATOM aFINDMSGSTRING;
+static int aFINDMSGSTRING;
 
 /***********************************************************************
  *
@@ -86,6 +87,8 @@
     case CMD_LICENSE:          DIALOG_HelpLicense(); break;
     case CMD_NO_WARRANTY:      DIALOG_HelpNoWarranty(); break;
     case CMD_ABOUT_WINE:       DIALOG_HelpAboutWine(); break;
+    case CMD_STATUS:           DIALOG_ShowStatusBar(); break;
+    case CMD_GOTO:             DIALOG_GoTo(); break;
 
     default:
 	break;
@@ -127,11 +130,13 @@
         static const WCHAR editW[] = { 'e','d','i','t',0 };
         RECT rc;
         GetClientRect(hWnd, &rc);
-        Globals.hEdit = CreateWindow(editW, NULL,
-                             WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL |
-                             ES_AUTOVSCROLL | ES_MULTILINE,
+        Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL,
+                             WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL |
+                             ES_NOHIDESEL | ES_MULTILINE,
                              0, 0, rc.right, rc.bottom, hWnd,
                              NULL, Globals.hInstance, NULL);
+        Globals.hStatusBar = CreateStatusWindow(WS_CHILD, 0, hWnd, 0);
+        Globals.iStatusBarHeight = 0;
         break;
     }
 
@@ -139,6 +144,7 @@
         NOTEPAD_MenuCommand(LOWORD(wParam));
         break;
 
+
     case WM_DESTROYCLIPBOARD:
         /*MessageBox(Globals.hMainWnd, "Empty clipboard", "Debug", MB_ICONEXCLAMATION);*/
         break;
@@ -154,8 +160,12 @@
         break;
 
     case WM_SIZE:
-        SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam),
+        SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), (HIWORD(lParam)-Globals.iStatusBarHeight),
                      SWP_NOOWNERZORDER | SWP_NOZORDER);
+        if (Globals.bStatusBarEnabled == TRUE)
+        {
+            SendMessage(Globals.hStatusBar, WM_SIZE, 0, 0);
+        }
         break;
 
     case WM_SETFOCUS:
@@ -312,7 +322,7 @@
     class.lpfnWndProc   = NOTEPAD_WndProc;
     class.hInstance     = Globals.hInstance;
     class.hIcon         = LoadIcon(0, IDI_APPLICATION);
-    class.hCursor       = LoadCursor(0, IDC_ARROW);
+    class.hCursor       = LoadCursor(0, IDC_IBEAM);
     class.hbrBackground = (HBRUSH)(COLOR_WINDOW);
     class.lpszMenuName  = MAKEINTRESOURCE(MAIN_MENU);
     class.lpszClassName = className;
Index: main.h
===================================================================
RCS file: /home/wine/wine/programs/notepad/main.h,v
retrieving revision 1.15
diff -u -w -r1.15 main.h
--- main.h	21 Jul 2003 20:05:33 -0000	1.15
+++ main.h	27 Jul 2003 11:46:41 -0000
@@ -31,6 +31,10 @@
   HWND    hMainWnd;
   HWND    hFindReplaceDlg;
   HWND    hEdit;
+  BOOL    bStatusBarEnabled;
+  HWND    hStatusBar;
+  int     iStatusBarHeight;
+  int     iLine;
   HFONT   hFont; /* Font used by the edit control */
   LOGFONT lfFont;
   BOOL    bWrapLongLines;
Index: notepad_res.h
===================================================================
RCS file: /home/wine/wine/programs/notepad/notepad_res.h,v
retrieving revision 1.3
diff -u -w -r1.3 notepad_res.h
--- notepad_res.h	28 Jan 2003 01:10:28 -0000	1.3
+++ notepad_res.h	27 Jul 2003 11:46:42 -0000
@@ -21,6 +21,7 @@
 
 #define MAIN_MENU               0x201
 #define DIALOG_PAGESETUP        0x202
+#define DIALOG_GOTO             0x204
 #define ID_ACCEL                0x203
 
 /* Commands */
@@ -47,6 +48,10 @@
 #define CMD_WRAP                0x119
 #define CMD_FONT                0x140
 
+#define CMD_STATUS				0x122
+#define CMD_REPLACE             0x123
+#define CMD_GOTO                0x124
+
 #define CMD_HELP_CONTENTS       0x130
 #define CMD_HELP_SEARCH         0x131
 #define CMD_HELP_ON_HELP        0x132
Index: rsrc.rc
===================================================================
RCS file: /home/wine/wine/programs/notepad/rsrc.rc,v
retrieving revision 1.9
diff -u -w -r1.9 rsrc.rc
--- rsrc.rc	21 Jul 2003 20:05:33 -0000	1.9
+++ rsrc.rc	27 Jul 2003 11:46:42 -0000
@@ -26,14 +26,19 @@
 
 ID_ACCEL ACCELERATORS
 {
-    "^A", CMD_SELECT_ALL
-    "^C", CMD_COPY
-    "^F", CMD_SEARCH
-    "^O", CMD_OPEN
-    "^S", CMD_SAVE
-    "^V", CMD_PASTE
-    "^X", CMD_CUT
-    "^Z", CMD_UNDO
+    "A", CMD_SELECT_ALL, VIRTKEY, CONTROL
+    "C", CMD_COPY, VIRTKEY, CONTROL
+    "F", CMD_SEARCH, VIRTKEY, CONTROL
+    "G", CMD_GOTO, VIRTKEY, CONTROL
+    "H", CMD_REPLACE, VIRTKEY, CONTROL
+    "N", CMD_NEW, VIRTKEY, CONTROL
+    "O", CMD_OPEN, VIRTKEY, CONTROL
+    "P", CMD_PRINT, VIRTKEY, CONTROL
+    "S", CMD_SAVE, VIRTKEY, CONTROL
+    "V", CMD_PASTE, VIRTKEY, CONTROL
+    "X", CMD_CUT, VIRTKEY, CONTROL
+    "Z", CMD_UNDO, VIRTKEY, CONTROL
+    VK_F1, CMD_HELP_CONTENTS, VIRTKEY
     VK_F3, CMD_SEARCH_NEXT, VIRTKEY
     VK_F5, CMD_TIME_DATE, VIRTKEY
 }
@@ -43,12 +48,16 @@
 #include "En.rc"
 #include "Es.rc"
 #include "Fi.rc"
+#ifdef __WINE__
 #include "Fr.rc"
+#endif
 #include "Hu.rc"
 #include "Pt.rc"
 #include "Ru.rc"
 #include "Si.rc"
 #include "Sk.rc"
 #include "Sw.rc"
+#ifdef __WINE__
 #include "Wa.rc"
+#endif
 #include "Zh.rc"


More information about the wine-patches mailing list