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
5c9edfd4
Commit
5c9edfd4
authored
Feb 27, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Mar 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Add text alignment buttons.
parent
3386459a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
34 deletions
+69
-34
rsrc.rc
programs/wordpad/rsrc.rc
+53
-32
wordpad.c
programs/wordpad/wordpad.c
+16
-2
No files found.
programs/wordpad/rsrc.rc
View file @
5c9edfd4
...
...
@@ -42,38 +42,59 @@ END
/* BINRES toolbar.bmp */
IDB_TOOLBAR BITMAP "toolbar.bmp"
/* {
'42 4D F6 01 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 30 00 00 00 10 00 00 00 01 00 04 00 00 00'
'00 00 80 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
'00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
'00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF'
'00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
'00 00 FF FF FF 00 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'00 00 00 00 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 80'
'00 00 00 88 88 88 88 88 00 00 08 88 88 88 88 88'
'80 00 00 08 88 88 88 80 08 88 80 08 88 88 88 88'
'88 08 88 88 88 88 88 88 08 88 88 80 88 88 88 80'
'08 88 80 08 88 88 88 88 88 08 88 88 88 88 88 88'
'08 88 88 80 88 88 88 80 08 88 80 08 88 88 88 88'
'88 08 88 88 88 88 88 88 08 88 88 80 88 88 88 80'
'08 88 80 08 88 88 88 88 88 80 88 88 88 88 88 88'
'08 88 88 80 88 88 88 80 00 00 00 88 88 88 88 88'
'88 80 88 88 88 88 88 88 08 88 88 80 88 88 88 80'
'08 88 80 08 88 88 88 88 88 80 88 88 88 88 88 88'
'08 88 88 80 88 88 88 80 08 88 80 08 88 88 88 88'
'88 88 08 88 88 88 88 88 08 88 88 80 88 88 88 80'
'08 88 80 08 88 88 88 88 88 88 08 88 88 88 88 88'
'08 88 88 80 88 88 88 80 00 00 00 88 88 88 88 88'
'88 00 00 08 88 88 88 88 08 88 88 80 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88'
'42 4d 3e 03 00 00 00 00 00 00 3e 00 00 00 28 00'
'00 00 60 00 00 00 10 00 00 00 01 00 04 00 00 00'
'00 00 00 03 00 00 12 0b 00 00 12 0b 00 00 02 00'
'00 00 02 00 00 00 c0 c0 c0 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 11 11 11 11 11 10 00 00 11'
'11 11 11 11 11 00 00 00 01 11 11 11 11 00 00 01'
'11 11 11 00 00 00 00 00 11 11 10 00 00 00 00 00'
'01 11 11 10 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01'
'10 00 01 10 00 00 00 00 00 10 00 00 00 00 00 00'
'10 00 00 01 00 00 00 11 11 11 10 00 00 00 00 00'
'01 11 11 10 00 00 00 11 11 11 11 11 11 00 00 01'
'10 00 01 10 00 00 00 00 00 10 00 00 00 00 00 00'
'10 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01'
'10 00 01 10 00 00 00 00 00 10 00 00 00 00 00 00'
'10 00 00 01 00 00 00 11 11 11 11 11 11 00 00 00'
'11 11 11 11 00 00 00 00 00 11 11 11 11 00 00 01'
'10 00 01 10 00 00 00 00 00 01 00 00 00 00 00 00'
'10 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01'
'11 11 11 00 00 00 00 00 00 01 00 00 00 00 00 00'
'10 00 00 01 00 00 00 11 11 11 11 10 00 00 00 11'
'11 11 11 11 11 00 00 00 00 00 01 11 11 00 00 01'
'10 00 01 10 00 00 00 00 00 01 00 00 00 00 00 00'
'10 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01'
'10 00 01 10 00 00 00 00 00 00 10 00 00 00 00 00'
'10 00 00 01 00 00 00 11 11 11 11 11 11 00 00 00'
'11 11 11 11 00 00 00 01 11 11 11 11 11 00 00 01'
'10 00 01 10 00 00 00 00 00 00 10 00 00 00 00 00'
'10 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01'
'11 11 11 00 00 00 00 00 00 11 11 10 00 00 00 00'
'10 00 00 01 00 00 00 11 11 11 11 00 00 00 00 00'
'01 11 11 10 00 00 00 00 00 11 11 11 11 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 11 11 11 11 11 11 00 00 11'
'11 11 11 11 11 00 00 11 11 11 11 11 11 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00'
} */
#include "De.rc"
...
...
programs/wordpad/wordpad.c
View file @
5c9edfd4
...
...
@@ -292,13 +292,13 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
hToolBarWnd
=
CreateToolbarEx
(
hReBarWnd
,
CCS_NOPARENTALIGN
|
CCS_NOMOVEY
|
WS_VISIBLE
|
WS_CHILD
|
TBSTYLE_TOOLTIPS
|
TBSTYLE_BUTTON
,
IDC_TOOLBAR
,
3
,
hInstance
,
IDB_TOOLBAR
,
6
,
hInstance
,
IDB_TOOLBAR
,
NULL
,
0
,
24
,
24
,
16
,
16
,
sizeof
(
TBBUTTON
));
ab
.
hInst
=
HINST_COMMCTRL
;
ab
.
nID
=
IDB_STD_SMALL_COLOR
;
nStdBitmaps
=
SendMessage
(
hToolBarWnd
,
TB_ADDBITMAP
,
3
,
(
LPARAM
)
&
ab
);
nStdBitmaps
=
SendMessage
(
hToolBarWnd
,
TB_ADDBITMAP
,
6
,
(
LPARAM
)
&
ab
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILENEW
,
ID_FILE_NEW
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILEOPEN
,
ID_FILE_OPEN
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILESAVE
,
ID_FILE_SAVE
);
...
...
@@ -317,6 +317,10 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
AddButton
(
hToolBarWnd
,
0
,
ID_FORMAT_BOLD
);
AddButton
(
hToolBarWnd
,
1
,
ID_FORMAT_ITALIC
);
AddButton
(
hToolBarWnd
,
2
,
ID_FORMAT_UNDERLINE
);
AddSeparator
(
hToolBarWnd
);
AddButton
(
hToolBarWnd
,
3
,
ID_ALIGN_LEFT
);
AddButton
(
hToolBarWnd
,
4
,
ID_ALIGN_CENTER
);
AddButton
(
hToolBarWnd
,
5
,
ID_ALIGN_RIGHT
);
SendMessage
(
hToolBarWnd
,
TB_ADDSTRING
,
0
,
(
LPARAM
)
"Exit
\0
"
);
SendMessage
(
hToolBarWnd
,
TB_AUTOSIZE
,
0
,
0
);
...
...
@@ -361,10 +365,14 @@ static LRESULT OnUser( HWND hWnd, WPARAM wParam, LPARAM lParam)
HWND
hwndToolBar
=
GetDlgItem
(
hwndReBar
,
IDC_TOOLBAR
);
int
from
,
to
;
CHARFORMAT2W
fmt
;
PARAFORMAT2
pf
;
ZeroMemory
(
&
fmt
,
sizeof
(
fmt
));
fmt
.
cbSize
=
sizeof
(
fmt
);
ZeroMemory
(
&
pf
,
sizeof
(
pf
));
pf
.
cbSize
=
sizeof
(
pf
);
SendMessage
(
hwndEditor
,
EM_GETCHARFORMAT
,
TRUE
,
(
LPARAM
)
&
fmt
);
SendMessage
(
hwndEditor
,
EM_GETSEL
,
(
WPARAM
)
&
from
,
(
LPARAM
)
&
to
);
...
...
@@ -380,6 +388,12 @@ static LRESULT OnUser( HWND hWnd, WPARAM wParam, LPARAM lParam)
SendMessage
(
hwndToolBar
,
TB_INDETERMINATE
,
ID_FORMAT_ITALIC
,
!
(
fmt
.
dwMask
&
CFM_ITALIC
));
SendMessage
(
hwndToolBar
,
TB_CHECKBUTTON
,
ID_FORMAT_UNDERLINE
,
(
fmt
.
dwMask
&
CFM_UNDERLINE
)
&&
(
fmt
.
dwEffects
&
CFE_UNDERLINE
));
SendMessage
(
hwndToolBar
,
TB_INDETERMINATE
,
ID_FORMAT_UNDERLINE
,
!
(
fmt
.
dwMask
&
CFM_UNDERLINE
));
SendMessage
(
hwndEditor
,
EM_GETPARAFORMAT
,
0
,
(
LPARAM
)
&
pf
);
SendMessage
(
hwndToolBar
,
TB_CHECKBUTTON
,
ID_ALIGN_LEFT
,
(
pf
.
wAlignment
==
PFA_LEFT
));
SendMessage
(
hwndToolBar
,
TB_CHECKBUTTON
,
ID_ALIGN_CENTER
,
(
pf
.
wAlignment
==
PFA_CENTER
));
SendMessage
(
hwndToolBar
,
TB_CHECKBUTTON
,
ID_ALIGN_RIGHT
,
(
pf
.
wAlignment
==
PFA_RIGHT
));
return
0
;
}
...
...
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