Commit 5bc0dfc2 authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

wordpad: Add context menu.

parent 05e6a4e6
...@@ -81,6 +81,19 @@ BEGIN ...@@ -81,6 +81,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Aus&schneiden", ID_EDIT_CUT
MENUITEM "&Kopieren", ID_EDIT_COPY
MENUITEM "&Einfgen", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -81,6 +81,19 @@ BEGIN ...@@ -81,6 +81,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Cu&t", ID_EDIT_CUT
MENUITEM "&Copy", ID_EDIT_COPY
MENUITEM "&Paste", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -81,6 +81,19 @@ BEGIN ...@@ -81,6 +81,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&Couper", ID_EDIT_CUT
MENUITEM "Co&pier", ID_EDIT_COPY
MENUITEM "C&oller", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -81,6 +81,19 @@ BEGIN ...@@ -81,6 +81,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Kiv&gs\tCtrl+X", ID_EDIT_CUT
MENUITEM "M&sols\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Beilleszts\tCtrl+V", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -82,6 +82,19 @@ BEGIN ...@@ -82,6 +82,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "잘라내기(&T)", ID_EDIT_CUT
MENUITEM "복사(&C)", ID_EDIT_COPY
MENUITEM "붙여넣기(&P)", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "날짜와 시간" CAPTION "날짜와 시간"
......
...@@ -81,6 +81,19 @@ BEGIN ...@@ -81,6 +81,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "K&nippen", ID_EDIT_CUT
MENUITEM "&Kopieren", ID_EDIT_COPY
MENUITEM "&Plakken", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -81,6 +81,19 @@ BEGIN ...@@ -81,6 +81,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Klipp u&t" ID_EDIT_CUT
MENUITEM "&Kopier" ID_EDIT_COPY
MENUITEM "&Lim inn" ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Punktmerking" ID_BULLET
MENUITEM "&Avsnitt . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Dato og klokkeslett" CAPTION "Dato og klokkeslett"
......
...@@ -82,6 +82,19 @@ BEGIN ...@@ -82,6 +82,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Wy&tnij", ID_EDIT_CUT
MENUITEM "&Kopiuj", ID_EDIT_COPY
MENUITEM "Wkl&ej", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -40,6 +40,7 @@ BEGIN ...@@ -40,6 +40,7 @@ BEGIN
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "&\tCtrl+X", ID_EDIT_CUT MENUITEM "&\tCtrl+X", ID_EDIT_CUT
MENUITEM "&\tCtrl+C", ID_EDIT_COPY MENUITEM "&\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT MENUITEM "Find &next\tF3", ID_FIND_NEXT
...@@ -79,6 +80,19 @@ BEGIN ...@@ -79,6 +80,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&\tCtrl+X", ID_EDIT_CUT
MENUITEM "&\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -84,6 +84,19 @@ BEGIN ...@@ -84,6 +84,19 @@ BEGIN
END END
END END
IDM_POPUP MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Ke&s", ID_EDIT_CUT
MENUITEM "&Kopyala", ID_EDIT_COPY
MENUITEM "Ya&ptr", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
END
END
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Date and time" CAPTION "Date and time"
......
...@@ -104,6 +104,8 @@ ...@@ -104,6 +104,8 @@
#define IDD_PARAFORMAT 2102 #define IDD_PARAFORMAT 2102
#define IDD_TABSTOPS 2103 #define IDD_TABSTOPS 2103
#define IDM_POPUP 2200
#define IDB_TOOLBAR 100 #define IDB_TOOLBAR 100
#define IDB_FORMATBAR 101 #define IDB_FORMATBAR 101
......
...@@ -61,6 +61,7 @@ static const WCHAR var_pagemargin[] = {'P','a','g','e','M','a','r','g','i','n',0 ...@@ -61,6 +61,7 @@ static const WCHAR var_pagemargin[] = {'P','a','g','e','M','a','r','g','i','n',0
static HWND hMainWnd; static HWND hMainWnd;
static HWND hEditorWnd; static HWND hEditorWnd;
static HWND hFindWnd; static HWND hFindWnd;
static HMENU hPopupMenu;
static UINT ID_FINDMSGSTRING; static UINT ID_FINDMSGSTRING;
...@@ -1657,6 +1658,29 @@ static INT_PTR CALLBACK tabstops_proc(HWND hWnd, UINT message, WPARAM wParam, LP ...@@ -1657,6 +1658,29 @@ static INT_PTR CALLBACK tabstops_proc(HWND hWnd, UINT message, WPARAM wParam, LP
return FALSE; return FALSE;
} }
static int context_menu(LPARAM lParam)
{
int x = (int)(short)LOWORD(lParam);
int y = (int)(short)HIWORD(lParam);
HMENU hPop = GetSubMenu(hPopupMenu, 0);
if(x == -1)
{
int from = 0, to = 0;
POINTL pt;
SendMessageW(hEditorWnd, EM_GETSEL, (WPARAM)&from, (LPARAM)&to);
SendMessageW(hEditorWnd, EM_POSFROMCHAR, (WPARAM)&pt, (LPARAM)to);
ClientToScreen(hEditorWnd, (POINT*)&pt);
x = pt.x;
y = pt.y;
}
TrackPopupMenu(hPop, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RIGHTBUTTON,
x, y, 0, hMainWnd, 0);
return 0;
}
static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam) static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
HWND hToolBarWnd, hFormatBarWnd, hReBarWnd; HWND hToolBarWnd, hFormatBarWnd, hReBarWnd;
...@@ -2330,6 +2354,12 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara ...@@ -2330,6 +2354,12 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
case WM_SIZE: case WM_SIZE:
return OnSize( hWnd, wParam, lParam ); return OnSize( hWnd, wParam, lParam );
case WM_CONTEXTMENU:
if((HWND)wParam == hEditorWnd)
return context_menu(lParam);
else
return DefWindowProcW(hWnd, msg, wParam, lParam);
case WM_DROPFILES: case WM_DROPFILES:
{ {
WCHAR file[MAX_PATH]; WCHAR file[MAX_PATH];
...@@ -2381,6 +2411,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar ...@@ -2381,6 +2411,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar
set_caption(NULL); set_caption(NULL);
set_bar_states(); set_bar_states();
hPopupMenu = LoadMenuW(hInstance, MAKEINTRESOURCEW(IDM_POPUP));
HandleCommandLine(GetCommandLineW()); HandleCommandLine(GetCommandLineW());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment