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
10b34839
Commit
10b34839
authored
Jun 06, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jun 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Allow toggling of toolbar.
parent
34d1beed
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
102 additions
and
4 deletions
+102
-4
De.rc
programs/wordpad/De.rc
+4
-0
En.rc
programs/wordpad/En.rc
+4
-0
Fr.rc
programs/wordpad/Fr.rc
+4
-0
Hu.rc
programs/wordpad/Hu.rc
+4
-0
Ko.rc
programs/wordpad/Ko.rc
+4
-0
Nl.rc
programs/wordpad/Nl.rc
+4
-0
No.rc
programs/wordpad/No.rc
+4
-0
Pl.rc
programs/wordpad/Pl.rc
+4
-0
Ru.rc
programs/wordpad/Ru.rc
+4
-0
Tr.rc
programs/wordpad/Tr.rc
+4
-0
resource.h
programs/wordpad/resource.h
+4
-0
wordpad.c
programs/wordpad/wordpad.c
+58
-4
No files found.
programs/wordpad/De.rc
View file @
10b34839
...
@@ -52,6 +52,10 @@ BEGIN
...
@@ -52,6 +52,10 @@ BEGIN
MENUITEM "&Get text", ID_EDIT_GETTEXT
MENUITEM "&Get text", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "F&ormat"
POPUP "F&ormat"
BEGIN
BEGIN
POPUP "&Hintergrund"
POPUP "&Hintergrund"
...
...
programs/wordpad/En.rc
View file @
10b34839
...
@@ -52,6 +52,10 @@ BEGIN
...
@@ -52,6 +52,10 @@ BEGIN
MENUITEM "&Get text", ID_EDIT_GETTEXT
MENUITEM "&Get text", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "F&ormat"
POPUP "F&ormat"
BEGIN
BEGIN
POPUP "&Background"
POPUP "&Background"
...
...
programs/wordpad/Fr.rc
View file @
10b34839
...
@@ -52,6 +52,10 @@ BEGIN
...
@@ -52,6 +52,10 @@ BEGIN
MENUITEM "&Recevoir texte", ID_EDIT_GETTEXT
MENUITEM "&Recevoir texte", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "Forma&t"
POPUP "Forma&t"
BEGIN
BEGIN
POPUP "&Fond"
POPUP "&Fond"
...
...
programs/wordpad/Hu.rc
View file @
10b34839
...
@@ -52,6 +52,10 @@ BEGIN
...
@@ -52,6 +52,10 @@ BEGIN
MENUITEM "Sz&vegszerzs", ID_EDIT_GETTEXT
MENUITEM "Sz&vegszerzs", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "F&ormtum"
POPUP "F&ormtum"
BEGIN
BEGIN
POPUP "&Httr"
POPUP "&Httr"
...
...
programs/wordpad/Ko.rc
View file @
10b34839
...
@@ -53,6 +53,10 @@ BEGIN
...
@@ -53,6 +53,10 @@ BEGIN
MENUITEM "텍스트 얻기(&G)", ID_EDIT_GETTEXT
MENUITEM "텍스트 얻기(&G)", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "형식(&O)"
POPUP "형식(&O)"
BEGIN
BEGIN
POPUP "배경(&B)"
POPUP "배경(&B)"
...
...
programs/wordpad/Nl.rc
View file @
10b34839
...
@@ -52,6 +52,10 @@ BEGIN
...
@@ -52,6 +52,10 @@ BEGIN
MENUITEM "&Haal tekst", ID_EDIT_GETTEXT
MENUITEM "&Haal tekst", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "&Opmaak"
POPUP "&Opmaak"
BEGIN
BEGIN
POPUP "&Achtergrond"
POPUP "&Achtergrond"
...
...
programs/wordpad/No.rc
View file @
10b34839
...
@@ -52,6 +52,10 @@ BEGIN
...
@@ -52,6 +52,10 @@ BEGIN
MENUITEM "&Hent tekst", ID_EDIT_GETTEXT
MENUITEM "&Hent tekst", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&Vis"
BEGIN
MENUITEM "Verk&tylinje", ID_TOGGLE_TOOLBAR
END
POPUP "F&ormat"
POPUP "F&ormat"
BEGIN
BEGIN
POPUP "&Bakgrunn"
POPUP "&Bakgrunn"
...
...
programs/wordpad/Pl.rc
View file @
10b34839
...
@@ -53,6 +53,10 @@ BEGIN
...
@@ -53,6 +53,10 @@ BEGIN
MENUITEM "&Pobie tekst", ID_EDIT_GETTEXT
MENUITEM "&Pobie tekst", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "F&ormat"
POPUP "F&ormat"
BEGIN
BEGIN
POPUP "&To"
POPUP "&To"
...
...
programs/wordpad/Ru.rc
View file @
10b34839
...
@@ -50,6 +50,10 @@ BEGIN
...
@@ -50,6 +50,10 @@ BEGIN
MENUITEM "& ", ID_EDIT_GETTEXT
MENUITEM "& ", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "&"
POPUP "&"
BEGIN
BEGIN
POPUP "&"
POPUP "&"
...
...
programs/wordpad/Tr.rc
View file @
10b34839
...
@@ -54,6 +54,10 @@ BEGIN
...
@@ -54,6 +54,10 @@ BEGIN
MENUITEM "&Metni al", ID_EDIT_GETTEXT
MENUITEM "&Metni al", ID_EDIT_GETTEXT
END
END
END
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_TOGGLE_TOOLBAR
END
POPUP "&Biim"
POPUP "&Biim"
BEGIN
BEGIN
POPUP "&Arkaplan"
POPUP "&Arkaplan"
...
...
programs/wordpad/resource.h
View file @
10b34839
...
@@ -53,6 +53,10 @@
...
@@ -53,6 +53,10 @@
#define ID_FORMAT_ITALIC 1401
#define ID_FORMAT_ITALIC 1401
#define ID_FORMAT_UNDERLINE 1402
#define ID_FORMAT_UNDERLINE 1402
#define ID_TOGGLE_TOOLBAR 1500
#define BANDID_TOOLBAR 0
#define IDC_STATUSBAR 2000
#define IDC_STATUSBAR 2000
#define IDC_EDITOR 2001
#define IDC_EDITOR 2001
#define IDC_TOOLBAR 2002
#define IDC_TOOLBAR 2002
...
...
programs/wordpad/wordpad.c
View file @
10b34839
...
@@ -48,6 +48,8 @@ static HWND hEditorWnd;
...
@@ -48,6 +48,8 @@ static HWND hEditorWnd;
static
WCHAR
wszFilter
[
MAX_STRING_LEN
];
static
WCHAR
wszFilter
[
MAX_STRING_LEN
];
static
LRESULT
OnSize
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
);
/* Load string resources */
/* Load string resources */
static
void
DoLoadStrings
(
void
)
static
void
DoLoadStrings
(
void
)
{
{
...
@@ -324,6 +326,43 @@ static void DoDefaultFont(void)
...
@@ -324,6 +326,43 @@ static void DoDefaultFont(void)
SendMessage
(
hEditorWnd
,
EM_SETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
fmt
);
SendMessage
(
hEditorWnd
,
EM_SETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
fmt
);
}
}
static
void
toggle_toolbar
(
int
bandId
)
{
HWND
hwndReBar
=
GetDlgItem
(
hMainWnd
,
IDC_REBAR
);
REBARBANDINFOW
rbbinfo
;
RECT
rect
;
if
(
!
hwndReBar
)
return
;
rbbinfo
.
cbSize
=
sizeof
(
rbbinfo
);
rbbinfo
.
fMask
=
RBBIM_STYLE
;
SendMessageW
(
hwndReBar
,
RB_GETBANDINFO
,
bandId
,
(
LPARAM
)
&
rbbinfo
);
SendMessageW
(
hwndReBar
,
RB_SHOWBAND
,
bandId
,
(
rbbinfo
.
fStyle
&
RBBS_HIDDEN
));
GetWindowRect
(
hMainWnd
,
&
rect
);
(
void
)
OnSize
(
hMainWnd
,
SIZE_RESTORED
,
MAKELONG
(
rect
.
bottom
,
rect
.
right
));
}
static
int
rebar_height
(
void
)
{
HWND
hwndReBar
=
GetDlgItem
(
hMainWnd
,
IDC_REBAR
);
REBARBANDINFOW
rbbinfo
;
if
(
!
hwndReBar
)
return
0
;
rbbinfo
.
cbSize
=
sizeof
(
rbbinfo
);
rbbinfo
.
fMask
=
RBBIM_STYLE
;
SendMessageW
(
hwndReBar
,
RB_GETBANDINFO
,
BANDID_TOOLBAR
,
(
LPARAM
)
&
rbbinfo
);
return
(
rbbinfo
.
fStyle
&
RBBS_HIDDEN
)
?
0
:
SendMessage
(
hwndReBar
,
RB_GETBARHEIGHT
,
0
,
0
);
}
static
LRESULT
OnCreate
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
)
static
LRESULT
OnCreate
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
{
HWND
hToolBarWnd
,
hReBarWnd
;
HWND
hToolBarWnd
,
hReBarWnd
;
...
@@ -389,7 +428,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
...
@@ -389,7 +428,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
rbb
.
cxMinChild
=
0
;
rbb
.
cxMinChild
=
0
;
rbb
.
cyChild
=
rbb
.
cyMinChild
=
HIWORD
(
SendMessage
(
hToolBarWnd
,
TB_GETBUTTONSIZE
,
0
,
0
));
rbb
.
cyChild
=
rbb
.
cyMinChild
=
HIWORD
(
SendMessage
(
hToolBarWnd
,
TB_GETBUTTONSIZE
,
0
,
0
));
SendMessage
(
hReBarWnd
,
RB_INSERTBAND
,
-
1
,
(
LPARAM
)
&
rbb
);
SendMessage
W
(
hReBarWnd
,
RB_INSERTBAND
,
BANDID_TOOLBAR
,
(
LPARAM
)
&
rbb
);
hDLL
=
LoadLibrary
(
"RICHED20.DLL"
);
hDLL
=
LoadLibrary
(
"RICHED20.DLL"
);
assert
(
hDLL
);
assert
(
hDLL
);
...
@@ -674,6 +713,10 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
...
@@ -674,6 +713,10 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
SendMessage
(
hwndEditor
,
EM_SETBKGNDCOLOR
,
0
,
RGB
(
255
,
255
,
192
));
SendMessage
(
hwndEditor
,
EM_SETBKGNDCOLOR
,
0
,
RGB
(
255
,
255
,
192
));
break
;
break
;
case
ID_TOGGLE_TOOLBAR
:
toggle_toolbar
(
BANDID_TOOLBAR
);
break
;
default:
default:
SendMessage
(
hwndEditor
,
WM_COMMAND
,
wParam
,
lParam
);
SendMessage
(
hwndEditor
,
WM_COMMAND
,
wParam
,
lParam
);
break
;
break
;
...
@@ -685,8 +728,10 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam )
...
@@ -685,8 +728,10 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
{
HMENU
hMenu
=
(
HMENU
)
wParam
;
HMENU
hMenu
=
(
HMENU
)
wParam
;
HWND
hwndEditor
=
GetDlgItem
(
hWnd
,
IDC_EDITOR
);
HWND
hwndEditor
=
GetDlgItem
(
hWnd
,
IDC_EDITOR
);
HWND
hwndReBar
=
GetDlgItem
(
hWnd
,
IDC_REBAR
);
PARAFORMAT
pf
;
PARAFORMAT
pf
;
int
nAlignment
=
-
1
;
int
nAlignment
=
-
1
;
REBARBANDINFOW
rbbinfo
;
pf
.
cbSize
=
sizeof
(
PARAFORMAT
);
pf
.
cbSize
=
sizeof
(
PARAFORMAT
);
SendMessage
(
hwndEditor
,
EM_GETPARAFORMAT
,
0
,
(
LPARAM
)
&
pf
);
SendMessage
(
hwndEditor
,
EM_GETPARAFORMAT
,
0
,
(
LPARAM
)
&
pf
);
...
@@ -701,17 +746,26 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam )
...
@@ -701,17 +746,26 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam )
CheckMenuItem
(
hMenu
,
ID_ALIGN_RIGHT
,
MF_BYCOMMAND
|
(
nAlignment
==
PFA_RIGHT
)
?
MF_CHECKED
:
MF_UNCHECKED
);
CheckMenuItem
(
hMenu
,
ID_ALIGN_RIGHT
,
MF_BYCOMMAND
|
(
nAlignment
==
PFA_RIGHT
)
?
MF_CHECKED
:
MF_UNCHECKED
);
EnableMenuItem
(
hMenu
,
ID_EDIT_UNDO
,
MF_BYCOMMAND
|
(
SendMessage
(
hwndEditor
,
EM_CANUNDO
,
0
,
0
))
?
MF_ENABLED
:
MF_GRAYED
);
EnableMenuItem
(
hMenu
,
ID_EDIT_UNDO
,
MF_BYCOMMAND
|
(
SendMessage
(
hwndEditor
,
EM_CANUNDO
,
0
,
0
))
?
MF_ENABLED
:
MF_GRAYED
);
EnableMenuItem
(
hMenu
,
ID_EDIT_REDO
,
MF_BYCOMMAND
|
(
SendMessage
(
hwndEditor
,
EM_CANREDO
,
0
,
0
))
?
MF_ENABLED
:
MF_GRAYED
);
EnableMenuItem
(
hMenu
,
ID_EDIT_REDO
,
MF_BYCOMMAND
|
(
SendMessage
(
hwndEditor
,
EM_CANREDO
,
0
,
0
))
?
MF_ENABLED
:
MF_GRAYED
);
rbbinfo
.
cbSize
=
sizeof
(
rbbinfo
);
rbbinfo
.
fMask
=
RBBIM_STYLE
;
SendMessageW
(
hwndReBar
,
RB_GETBANDINFO
,
0
,
(
LPARAM
)
&
rbbinfo
);
CheckMenuItem
(
hMenu
,
ID_TOGGLE_TOOLBAR
,
MF_BYCOMMAND
|
(
rbbinfo
.
fStyle
&
RBBS_HIDDEN
)
?
MF_UNCHECKED
:
MF_CHECKED
);
return
0
;
return
0
;
}
}
static
LRESULT
OnSize
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
)
static
LRESULT
OnSize
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
{
int
nStatusSize
=
0
,
nTBSize
=
0
;
int
nStatusSize
=
0
;
RECT
rc
;
RECT
rc
;
HWND
hwndEditor
=
GetDlgItem
(
hWnd
,
IDC_EDITOR
);
HWND
hwndEditor
=
GetDlgItem
(
hWnd
,
IDC_EDITOR
);
HWND
hwndStatusBar
=
GetDlgItem
(
hWnd
,
IDC_STATUSBAR
);
HWND
hwndStatusBar
=
GetDlgItem
(
hWnd
,
IDC_STATUSBAR
);
HWND
hwndReBar
=
GetDlgItem
(
hWnd
,
IDC_REBAR
);
HWND
hwndReBar
=
GetDlgItem
(
hWnd
,
IDC_REBAR
);
HWND
hwndToolBar
=
GetDlgItem
(
hwndReBar
,
IDC_TOOLBAR
);
HWND
hwndToolBar
=
GetDlgItem
(
hwndReBar
,
IDC_TOOLBAR
);
int
rebarHeight
;
if
(
hwndStatusBar
)
if
(
hwndStatusBar
)
{
{
...
@@ -726,14 +780,14 @@ static LRESULT OnSize( HWND hWnd, WPARAM wParam, LPARAM lParam )
...
@@ -726,14 +780,14 @@ static LRESULT OnSize( HWND hWnd, WPARAM wParam, LPARAM lParam )
rc
.
bottom
=
HIWORD
(
lParam
);
rc
.
bottom
=
HIWORD
(
lParam
);
SendMessage
(
hwndToolBar
,
TB_AUTOSIZE
,
0
,
0
);
SendMessage
(
hwndToolBar
,
TB_AUTOSIZE
,
0
,
0
);
SendMessage
(
hwndReBar
,
RB_SIZETORECT
,
0
,
(
LPARAM
)
&
rc
);
SendMessage
(
hwndReBar
,
RB_SIZETORECT
,
0
,
(
LPARAM
)
&
rc
);
nTBSize
=
SendMessage
(
hwndReBar
,
RB_GETBARHEIGHT
,
0
,
0
);
GetClientRect
(
hwndReBar
,
&
rc
);
GetClientRect
(
hwndReBar
,
&
rc
);
MoveWindow
(
hwndReBar
,
0
,
0
,
LOWORD
(
lParam
),
rc
.
right
,
FALSE
);
MoveWindow
(
hwndReBar
,
0
,
0
,
LOWORD
(
lParam
),
rc
.
right
,
FALSE
);
}
}
if
(
hwndEditor
)
if
(
hwndEditor
)
{
{
rebarHeight
=
rebar_height
();
GetClientRect
(
hWnd
,
&
rc
);
GetClientRect
(
hWnd
,
&
rc
);
MoveWindow
(
hwndEditor
,
0
,
nTBSize
,
rc
.
right
,
rc
.
bottom
-
nStatusSize
-
nTBSize
,
TRUE
);
MoveWindow
(
hwndEditor
,
0
,
rebarHeight
,
rc
.
right
,
rc
.
bottom
-
nStatusSize
-
rebarHeight
,
TRUE
);
}
}
return
DefWindowProcW
(
hWnd
,
WM_SIZE
,
wParam
,
lParam
);
return
DefWindowProcW
(
hWnd
,
WM_SIZE
,
wParam
,
lParam
);
...
...
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