Commit graph

1443 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 1ae6cb7a96 [CALC] Use <winuser.rh> instead of <winuser.h> in resource.rc 2023-11-05 17:21:33 +09:00
Katayama Hirofumi MZ 6691cbe889 [REGEDIT] Use <winuser.rh> instead of <winuser.h> in regedit.rc
CORE-18876
2023-11-05 17:18:07 +09:00
Katayama Hirofumi MZ efb9128c24 [NOTEPAD] Use <winuser.rh> instead of <winuser.h> in rsrc.rc
CORE-18837
2023-11-05 17:11:06 +09:00
Whindmar Saksit 4b03981846
[RAPPS] Improve LicenseType handling (#5809)
Tries now to map the "License" text set to "Freeware" to the
LICENSE_FREEWARE "LicenseType" so it is translated correctly (LoadString).

Fixes the following:

- If only the "License" field is set in the DB, nothing will change
  (this applies to 99% of the current entries in the DB).

- If both "LicenseType" and "License" are set, both will be used
  (no observable change in behavior): "Open Source (GPL v2)" etc.

- If only "LicenseType" is set, it will now display just the type
  "Freeware" instead of "Freeware ()".
  This is done only for "Freeware", because the others (the open source ones)
  have many variations. "OpenSource", "Open Source", "Open Source (GPL)" etc.
2023-11-04 22:08:10 +01:00
Katayama Hirofumi MZ fa4b38d902 [MSPAINT] Localize g_ptStart and g_ptEnd into mouse.cpp
And move some ToolsModel code into mouse.cpp
CORE-19094
2023-11-04 23:00:43 +09:00
Katayama Hirofumi MZ 56828b82d9
[MSPAINT] Distinguish between icons and cursors (#5884)
- Convert icons/*_cur.ico to the cursor files (*.cur).
- The hot spot is (16, 16) (default).
- Rename icons/ folder as img/.
- Use LoadCursorW instead of LoadIconW
  for cursors.
- Use CURSOR statements for cursor files
  instead of ICON statements in rsrc.rc.
- I used GIMP to convert the icon files to the PNG files.
- I used RealWorld Cursor Editor to convert the PNG files to the cursor files.
CORE-19297
2023-11-04 22:15:43 +09:00
Katayama Hirofumi MZ d21def4819
[MSPAINT] Use <winuser.rh> instead of <winuser.h> in rsrc.rc (#5883)
CORE-19094
2023-11-04 21:53:04 +09:00
Katayama Hirofumi MZ b69a7460db [MSPAINT] Fix filter string UNICODE_NULL problem
Follow-up to #5882.
Some ATL CString do not append the string if there is
a UNICODE_NULL in the middle.
CORE-19094
2023-11-04 19:50:36 +09:00
Katayama Hirofumi MZ 640d67d12a
[MSPAINT] Adapt to Unicode and <strsafe.h> (#5882)
- TCHAR --> WCHAR
- LPTSTR --> LPWSTR
- LPCTSTR --> LPCWSTR
- CString --> CStringW
- TEXT("...") --> L"..."
- _T("...") --> L"..."
- ::SendMessage( --> ::SendMessageW(
- ::GetWindowText( --> ::GetWindowTextW(
- ::SetWindowText( --> ::SetWindowTextW(
- Replace _tcscat with StringCchCatW.
- Replace _tcslen with wcslen.
etc. CORE-19094
2023-11-04 19:25:45 +09:00
Katayama Hirofumi MZ d7ece626cb
[MSPAINT] Fix Copy-To-File feature (#5877)
The Copy-To-File feature had some bugs that the user couldn't save.
- Modify SelectionModel::GetSelectionContents.
- Delete SelectionModel::CopyBitmap, SelectionModel::LockBitmap,
  and SelectionModel::UnlockBitmap functions.
CORE-19186
2023-11-04 05:56:10 +09:00
Katayama Hirofumi MZ a114169c4d
[MSPAINT] Refactor mouse moving code on canvas (#5878)
Move some mouse moving code to toolsModel.
CORE-19094
2023-11-03 22:41:06 +09:00
Katayama Hirofumi MZ a6418c848c
[MSPAINT] Simplify tool creation (#5876)
Reduce code and binary size. This will reduce 512 bytes in binary.
- Don't use cache for tool creation.
CORE-19094
2023-11-03 16:49:13 +09:00
Katayama Hirofumi MZ 37f56d2448
[MSPAINT] Commonize OnFinishDraw and OnCancelDraw (#5875)
Reduce code and binary size a bit. This will reduce 1024 bytes in binary.
Unify ToolBase::OnFinishDraw and ToolBase::OnCancelDraw to ToolBase::OnEndDraw.
CORE-19094
2023-11-03 16:20:03 +09:00
Joachim Henze 32b883ef2f [NOTEPAD] de-DE.rc: Fix CMD_HELP_ABOUT_NOTEPAD, all rc: strip bloat-spaces before \n and ? 2023-11-03 02:19:34 +01:00
Whindmar Saksit 5d1be078f8
[TASKMGR] Hold Shift to bypass MessageBox confirmation (#5845)
Allow the user to hold shift to automatically answer IDYES when killing/debugging a process or changing the priority.
2023-11-01 13:43:33 +01:00
Katayama Hirofumi MZ 6d7aaaade0 [MSPAINT] Delete needless ImageModel::ResetToPrevious
CORE-19094
2023-10-31 11:13:54 +09:00
Katayama Hirofumi MZ 87f94aa10c [KBSWITCH] Update layout list on WM_NOTIFYICONMSG
The layout list was not updated correctly.
CORE-10667
2023-10-30 10:40:27 +09:00
Katayama Hirofumi MZ aed376e00f [MSPAINT] Fix ImageModel::PushImageForUndo bug
CORE-19274
2023-10-30 07:41:57 +09:00
Katayama Hirofumi MZ be8a6f8af1
[REGEDIT] Improve error handling (#5833)
- Don't exit the main program on error.
- Improve output_message function.
- Use output_message instead of some
  error_exit function calls.
CORE-19188
2023-10-26 19:57:42 +09:00
Katayama Hirofumi MZ fea414b9ed
[REGEDIT] Use <strsafe.h> functions strictly Part 2 (#5832)
Follow-up to #5825. Use StringCchPrintfW instead of swprintf.
CORE-18876
2023-10-26 10:39:12 +09:00
Katayama Hirofumi MZ 8cef980ab9
[REGEDIT] Use <strsafe.h> functions strictly (#5825)
Use safer functions for buffer manipulation to avoid buffer overflow/overrun.
CORE-18876
2023-10-26 10:09:31 +09:00
Katayama Hirofumi MZ ab199cc147
[MSPAINT] Show out-of-memory message (#5817)
- Improve ImageModel::PushImageForUndo.
- Use FormatMessage in newly added
  ShowOutOfMemory function.
- Call ShowOutOfMemory() when out of memory.
CORE-19227, CORE-19094
2023-10-25 02:35:49 +09:00
Joachim Henze ddd1d19b3f
[TASKMGR] Get rid of cplusplus extern c (#5808)
The others in graphctrl.h and graph.h are being handled in the yet-uncommitted PR #5343.
2023-10-20 13:03:59 +02:00
Joachim Henze 63eaf2bd52
[TASKMGR] *.rc Deduplicate dynamic menu strings (#5772)
Some of the Menu-controls are just dummies in the RC,
because those controls are dynamically replaced at runtime
based on which tab/propsheet is active in taskmgr.
They are replaced by the IDS_MENU_* strings then.

Deduplicating them has many advantages:
1.) It shrinks binary size:
    master taskmgr.exe RosBEWin2.2.2 GCC8.4.0dbg  708.608 -> 696.832 bytes
2.) Translators don't get lured into translating dead stuff,
    assuming they translated the menu properly, while in fact they did not.
    This is *real*. Happened even to me multiple times already, although
    I am actually aware of the design.
3.) Some of them were offsync already between the dummy and the real thing.
4.) It reduces diff between en-US and other rc's.


* Aside of that improve alignment in some languages rcs in the "Shutdown"-menu-section,
* and improve a translation in de-DE, sq-AL, and zh-CN.
* [TASKMGR] id-ID.rc 2 accelerators in the same string is definitely wrong
* [TASKMGR] *.rc, make sure that warning is in all 30 langs, especially in en-US.rc
* [TASKMGR] for several translations add FIXME-comments regarding accelerator collisions
2023-10-19 10:19:20 +00:00
Katayama Hirofumi MZ 97e53c6963
[MSPAINT] Implement mouse middle button dragging (#5804)
- Handle WM_MBUTTONDOWN and
  WM_MBUTTONUP messages.
- Implement dragging by mouse middle button.
- Add IDC_HANDDRAG cursor resource.
CORE-19094
2023-10-17 15:58:34 +09:00
Katayama Hirofumi MZ f49919ce5d
[MSPAINT] Simplify canvas mouse message handling (#5803)
- Unify some mouse message handlers of
  CCanvasWindow.
- Add CCanvasWindow::m_nMouseDownMsg 
  member.
CORE-19094
2023-10-17 13:48:19 +09:00
Katayama Hirofumi MZ 8f1eb03ad2
[MSPAINT] Improve Zoom tool (#5798)
- Delete global zoomTo function.
- Add CCanvasWindow::zoomTo and
  CCanvasWindow::getNewZoomRect functions.
- Rename CCanvasWindow::updateScrollInfo as
  CCanvasWindow::updateScrollRange.
- Rename CCanvasWindow::resetScrollPos as
  CCanvasWindow::updateScrollPos.
- Draw the proper zoom rectangle on mouse move.
- Revert the active tool on click when the tool
  was Zoom.
CORE-19094
2023-10-17 07:25:50 +09:00
Katayama Hirofumi MZ fd1e158480
[MSPAINT] Calculate intersection to reduce bits transfer (#5795)
Drawing lines smoothly on big image.
- In CCanvasWindow::DoDraw, calculate the
  intersection to reduce bits transfer.
- Improve SmoothDrawTool in handling Shift key.
CORE-19094, CORE-19237
2023-10-16 09:09:40 +09:00
Katayama Hirofumi MZ 1c4bf2d702 [MSPAINT] Don't include useless <mapicode.h>
CORE-19094
2023-10-13 18:07:55 +09:00
Katayama Hirofumi MZ 1183e797b4
[MSPAINT] Reset scroll position in some situations (#5789)
In some situations, the scroll position should be reset.
- Add CCanvasWindow::resetScrollPos method.
- Reset the scroll position on loading a file.
- Reset the scroll position on mirroring/rotating
  the image.
CORE-19094
2023-10-12 22:59:17 +09:00
Katayama Hirofumi MZ 9a51c8e6c6
[MSPAINT][NOTEPAD][REGEDIT] Don't use CRTDBG for these apps (#5788)
Don't include <crtdbg.h>.
Don't use _CrtSetDbgFlag.
2023-10-12 22:53:02 +09:00
Katayama Hirofumi MZ 70d5c864bc [MSPAINT] Do type-cast (float) for xDpi and yDpi
CORE-19094
2023-10-12 19:43:29 +09:00
Katayama Hirofumi MZ 409df2355e [MSPAINT] Do type-cast (BYTE) for lfItalic and lfUnderline
CORE-19094
2023-10-12 19:38:41 +09:00
Katayama Hirofumi MZ 4306e261ee [MSPAINT] Do type-cast (BOOL) for TB_ISBUTTONCHECKED return
CORE-19094
2023-10-12 19:31:22 +09:00
Katayama Hirofumi MZ bc28675a44 [MSPAINT] s/WINBOOL/BOOL/
CORE-19094
2023-10-12 19:13:20 +09:00
Katayama Hirofumi MZ 62eeb158a5
[MSPAINT] Improve Zoom tool (#5781)
- Delete CCanvasWindow::drawZoomFrame.
- Invalidate the canvas on mouse move when
  the active tool is Zoom tool.
- Add ZoomTool::OnDrawOverlayOnCanvas to
  draw the zoom rectangle without flickering.
- Improve the zoom trackbar position.
- Display the zoom rate on changing the value
  of the zoom trackbar.
- Reverse the direction of the zoom trackbar.
- Don't draw the focus rectangle.
CORE-19215, CORE-19216
2023-10-10 10:59:29 +09:00
Katayama Hirofumi MZ 0c164f081a
[MSPAINT] Check out of image in updating status bar (#5779)
Check out of the image by using ::PtInRect and CCanvasWindow::GetImageRect.
If out, then don't show the status bar text.
CORE-19219
2023-10-09 08:39:31 +09:00
Katayama Hirofumi MZ 611d89eb8b
[MSPAINT] Add border width to tool box (#5780)
Make tool box pixel-perfect. Add two border widths to the tool box.
CORE-19217
2023-10-09 08:37:31 +09:00
Katayama Hirofumi MZ 8d8f4d328c
[MSPAINT] Zoom tool shouldn't use undo buffer (#5778)
Remove PushImageForUndo call in Zoom tool. CORE-19214
2023-10-09 08:07:02 +09:00
Joachim Henze 42c93e3cbb
[TASKMGR] *.rc: Fix accelerator collisions &Priority <-> &Properties (#5758)
We had collisions in many languages.
For most languages (which are derived from en-US) we should use
&Priority
P&roperties

We introduced the collisions during 0.4.15-dev'ing when
MENUITEM ID_PROCESS_PAGE_PROPERTIES
and
MENUITEM ID_PROCESS_PAGE_OPENFILELOCATION
were added.


We verified Win7-en and Win2k3-en to behave as proposed in this PR (R for properties, P for priority).
But *french* Windows (I believe Hermes picture was from WinVista-fr or Win7-fr or Win10-fr maybe) does it differently.

the existing de-DE also has been double-checked to exactly match MS with the accelerators in that menu.
2023-10-07 23:03:47 +00:00
Katayama Hirofumi MZ 1a90009bb9
[MSPAINT] Update scroll info on loading file (#5761)
The scroll info was not updated when the file is loading.
- Rename CCanvasWindow::Update as CCanvasWindow::updateScrollInfo.
- Update scroll info on ImageModel::NotifyImageChanged.
- Improve ImageModel::ClearHistory.
CORE-19094
2023-10-05 20:01:41 +09:00
Katayama Hirofumi MZ 3579ea7888
[MSPAINT] Fix assertion failure on text tool (#5762)
Kill the assertion failure on choosing text tool.
Check whether textEditWindow is not null by using IsWindowVisible.
CORE-19094
2023-10-05 19:51:36 +09:00
Joachim Henze 46b4b5581d
[TASKMGR] Favor _countof(), no functional change intended (#5757)
Taskmgr used a mixture: Sometimes _countof(), sometimes ARRAYSIZE()
and sometimes it calculated the count plain by sizeof(var)/sizeof(TYPE).
Harmonize everywhere to _countof() as it is the shortest solution.

Fix some formatting sins, like placing comments before else-statement.
Shorten the length of some very long line
intentionally *without introducing additional linebreaks* !

Shorten vertical length of some functions to increase their chance to
fit on the screen without scrolling.

Fix wrong indentation level in TaskManagerWndProc().

*.rc: Remove superfluous and redundant comment in all langs

No functional change intended.
2023-10-03 21:00:10 +02:00
Joachim Henze 6528ab8fcb [TASKMGR] de-DE.rc Update part 3
I spotted yet another flip:
translation of IDS_TAB_PFDELTA and IDS_TAB_VMSIZE were flipped.

I spotted that by toggling all columns off entirely
in the View-Options dialog where the columns can be selected
and then added only one column at a time. I did that for all options.

I do recommend translators of other langs to do the same test,
I was shocked about the amount of bugs I spotted for german.
And it is very subtle / easy to miss, if you enable/disable multiple columns
together!

Let's call it a day now!
2023-10-03 06:31:04 +02:00
Joachim Henze 65ce20896a [TASKMGR] *.rc Strip unused IDD_DEBUG_CHANNELS_DIALOG
This is an addendum to 0.4.15-dev-413-g ed7196d964

binary size shrinks slightly although that dlg was unused:
taskmgr.exe RosBEWin2.2.2 GCC8.4.0dbg  715.264 -> 708.608
2023-10-03 03:50:41 +02:00
Joachim Henze 142c35fcce [TASKMGR] de-DE.rc Update
GRAPH == 'Anzeige'. Addendum to last commit
2023-10-03 02:47:10 +02:00
Joachim Henze e15d68ba5d [TASKMGR] de-DE German Update & bug-fixes
This fixes several issues:
- add a few missing translations, e.g. ID_PROCESS_PAGE_PROPERTIES & ID_PROCESS_PAGE_OPENFILELOCATION
- IDS_TAB_PEAKMEMUSAGE translation was flipped with IDS_TAB_MEMDELTA
- IDC_MEM_USAGE_FRAME had text truncation, fix that by structurally switching to "Speicher"
- waste less space for the listview headers in the Processes tab so user can display more columns conveniently without the headers unnecessarily being crippled to "..."
- Sync some controls sizes back to en-US in the performance tab
- Translation for ID_VIEW_CPUHISTORY_ONEGRAPHALL and ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU was swapped accidentally
- Strip comment lines in the end, which were outdated anyway
- avoid monsters that not even a german person can read like "Auslagerungsdateiauslastungs-Verlaufsanzeige" which is like "Donaudampfschifffahrtselektrizitätenhauptbetriebswerkbauunterbeamtengesellschaft"
2023-10-03 02:05:28 +02:00
Sarthak Roy 4ba8af9cae
[CALC] Use pragma once for calc.h (#5754)
It's simpler and only needs to be included once at the beginning of the
header file. It generates an unique identifier for the file automatically,
so maintainers wouldn't need to choose unique names for the macros.
It will be helpful if any future refactoring takes place.

Signed-off-by: Sarthak Roy <sarthakroy2002@gmail.com>
2023-10-02 00:58:32 +03:00
Katayama Hirofumi MZ 945ee4b2a4
[MSPAINT] Larger/smaller Rubber/AirBrush on Ctrl+Plus/Minus (#5740)
- Enable changing rubber/airbrush thickness by Ctrl+Plus / Ctrl+Minus
  key combination in TOOL_AIRBRUSH and TOOL_RUBBER.
CORE-19094
2023-09-28 21:54:32 +09:00
Katayama Hirofumi MZ 8a4787b384
[MSPAINT] Larger/smaller brush nib on Ctrl+Plus/Minus (#5739)
- Introduce the concept of "brush width" to the
  tools model.
- Enable changing the brush width by Ctrl+Plus/Minus
  key combination in TOOL_BRUSH.
- Re-define brush styles.
CORE-19094
2023-09-28 21:30:34 +09:00