mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 13:03:47 +00:00
[PAINT] cleanup:
- formatting for enhanced readability - removal of superfluous variables/assignments - corrected or added header comment in all files - change if ... else ... to ?-operator where sensible and readable - small bugfix in mouse.c concerning rectangle drawing - fixed some possible string buffer overruns svn path=/trunk/; revision=43671
This commit is contained in:
parent
9647ae1f0c
commit
f2e66d0408
44 changed files with 1319 additions and 1085 deletions
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: definitions.h
|
||||
* PURPOSE: Defines the resource ids
|
||||
* FILE: base/applications/paint/definitions.h
|
||||
* PURPOSE: Defines the resource ids and other stuff
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
|||
/* HISTORYSIZE = number of possible undo-steps + 1 */
|
||||
|
||||
#define SIZEOF(a) (sizeof(a) / sizeof((a)[0]))
|
||||
/* sizeof for string constants; equals max. number of characters */
|
||||
|
||||
#define IDI_APPICON 500
|
||||
|
||||
|
@ -72,7 +73,7 @@
|
|||
#define IDM_IMAGEINVERTCOLORS 253
|
||||
#define IDM_IMAGEATTRIBUTES 254
|
||||
#define IDM_IMAGEDELETEIMAGE 255
|
||||
#define IDM_IMAGEDRAWOPAQUE 256
|
||||
#define IDM_IMAGEDRAWOPAQUE 256
|
||||
|
||||
#define IDM_COLORSEDITPALETTE 260
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: dialogs.c
|
||||
* FILE: base/applications/paint/dialogs.c
|
||||
* PURPOSE: Window procedures of the dialog windows plus launching functions
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -15,7 +15,8 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
LRESULT CALLBACK MRDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK
|
||||
MRDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
|
@ -63,44 +64,46 @@ LRESULT CALLBACK MRDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
int mirrorRotateDlg()
|
||||
int
|
||||
mirrorRotateDlg()
|
||||
{
|
||||
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC)MRDlgWinProc);
|
||||
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC) MRDlgWinProc);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK
|
||||
ATTDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
TCHAR strrc[100];
|
||||
TCHAR res[100];
|
||||
|
||||
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED);
|
||||
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED);
|
||||
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE);
|
||||
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE);
|
||||
|
||||
if (isAFile)
|
||||
{
|
||||
TCHAR strrc[100];
|
||||
TCHAR res[100];
|
||||
|
||||
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED);
|
||||
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED);
|
||||
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE);
|
||||
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE);
|
||||
|
||||
if (isAFile)
|
||||
{
|
||||
TCHAR date[100];
|
||||
TCHAR size[100];
|
||||
TCHAR temp[100];
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, sizeof(date));
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, sizeof(temp));
|
||||
_tcscat(date, _T(" "));
|
||||
_tcscat(date, temp);
|
||||
LoadString(hProgInstance, IDS_FILESIZE, strrc, sizeof(strrc));
|
||||
_stprintf(size, strrc, fileSize);
|
||||
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date);
|
||||
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size);
|
||||
}
|
||||
LoadString(hProgInstance, IDS_PRINTRES, strrc, sizeof(strrc));
|
||||
_stprintf(res, strrc, fileHPPM, fileVPPM);
|
||||
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res);
|
||||
return TRUE;
|
||||
TCHAR date[100];
|
||||
TCHAR size[100];
|
||||
TCHAR temp[100];
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, SIZEOF(date));
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, SIZEOF(temp));
|
||||
_tcscat(date, _T(" "));
|
||||
_tcscat(date, temp);
|
||||
LoadString(hProgInstance, IDS_FILESIZE, strrc, SIZEOF(strrc));
|
||||
_stprintf(size, strrc, fileSize);
|
||||
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date);
|
||||
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size);
|
||||
}
|
||||
LoadString(hProgInstance, IDS_PRINTRES, strrc, SIZEOF(strrc));
|
||||
_stprintf(res, strrc, fileHPPM, fileVPPM);
|
||||
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res);
|
||||
return TRUE;
|
||||
}
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, 0);
|
||||
break;
|
||||
|
@ -108,7 +111,10 @@ LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
|||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
EndDialog(hwnd, GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, NULL, FALSE) | (GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, NULL, FALSE)<<16));
|
||||
EndDialog(hwnd,
|
||||
GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, NULL,
|
||||
FALSE) | (GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, NULL,
|
||||
FALSE) << 16));
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hwnd, 0);
|
||||
|
@ -127,12 +133,14 @@ LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
int attributesDlg()
|
||||
int
|
||||
attributesDlg()
|
||||
{
|
||||
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC)ATTDlgWinProc);
|
||||
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC) ATTDlgWinProc);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK
|
||||
CHSIZEDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
|
@ -147,7 +155,10 @@ LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
EndDialog(hwnd, GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT1, NULL, FALSE) | (GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT2, NULL, FALSE)<<16));
|
||||
EndDialog(hwnd,
|
||||
GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT1, NULL,
|
||||
FALSE) | (GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT2, NULL,
|
||||
FALSE) << 16));
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hwnd, 0);
|
||||
|
@ -160,7 +171,8 @@ LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
int changeSizeDlg()
|
||||
int
|
||||
changeSizeDlg()
|
||||
{
|
||||
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_CHANGESIZE), hMainWnd, (DLGPROC)CHSIZEDlgWinProc);
|
||||
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_CHANGESIZE), hMainWnd, (DLGPROC) CHSIZEDlgWinProc);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: dialogs.h
|
||||
* FILE: base/applications/paint/dialogs.h
|
||||
* PURPOSE: Window procedures of the dialog windows plus launching functions
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: dib.c
|
||||
* FILE: base/applications/paint/dib.c
|
||||
* PURPOSE: Some DIB related functions
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -12,7 +12,8 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
HBITMAP CreateDIBWithProperties(int width, int height)
|
||||
HBITMAP
|
||||
CreateDIBWithProperties(int width, int height)
|
||||
{
|
||||
BITMAPINFO bmi;
|
||||
ZeroMemory(&bmi, sizeof(BITMAPINFO));
|
||||
|
@ -25,21 +26,24 @@ HBITMAP CreateDIBWithProperties(int width, int height)
|
|||
return CreateDIBSection(NULL, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
int GetDIBWidth(HBITMAP hBitmap)
|
||||
int
|
||||
GetDIBWidth(HBITMAP hBitmap)
|
||||
{
|
||||
BITMAP bm;
|
||||
GetObject(hBitmap, sizeof(BITMAP), &bm);
|
||||
return bm.bmWidth;
|
||||
}
|
||||
|
||||
int GetDIBHeight(HBITMAP hBitmap)
|
||||
int
|
||||
GetDIBHeight(HBITMAP hBitmap)
|
||||
{
|
||||
BITMAP bm;
|
||||
GetObject(hBitmap, sizeof(BITMAP), &bm);
|
||||
return bm.bmHeight;
|
||||
}
|
||||
|
||||
void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes)
|
||||
void
|
||||
SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes)
|
||||
{
|
||||
BITMAP bm;
|
||||
HANDLE hFile;
|
||||
|
@ -47,7 +51,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
|
|||
BITMAPINFOHEADER bi;
|
||||
int imgDataSize;
|
||||
DWORD dwBytesWritten;
|
||||
char* buffer;
|
||||
char *buffer;
|
||||
|
||||
GetObject(hBitmap, sizeof(BITMAP), &bm);
|
||||
|
||||
|
@ -55,7 +59,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
|
|||
ZeroMemory(&bi, sizeof(BITMAPINFOHEADER));
|
||||
|
||||
imgDataSize = bm.bmWidthBytes * bm.bmHeight;
|
||||
bf.bfType = 0x4d42; /* BM */
|
||||
bf.bfType = 0x4d42; /* BM */
|
||||
bf.bfSize = imgDataSize + 52;
|
||||
bf.bfOffBits = 54;
|
||||
bi.biSize = sizeof(BITMAPINFOHEADER);
|
||||
|
@ -68,7 +72,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
|
|||
bi.biYPelsPerMeter = vRes;
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, imgDataSize);
|
||||
GetDIBits(hDC, hBitmap, 0, bm.bmHeight, buffer, (LPBITMAPINFO)&bi, DIB_RGB_COLORS);
|
||||
GetDIBits(hDC, hBitmap, 0, bm.bmHeight, buffer, (LPBITMAPINFO) & bi, DIB_RGB_COLORS);
|
||||
|
||||
hFile = CreateFile(FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
|
@ -91,18 +95,20 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
|
|||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
}
|
||||
|
||||
void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
|
||||
void
|
||||
LoadDIBFromFile(HBITMAP * hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
|
||||
{
|
||||
BITMAPFILEHEADER bfh;
|
||||
BITMAPINFO *bi;
|
||||
PVOID pvBits;
|
||||
DWORD dwBytesRead;
|
||||
HANDLE hFile;
|
||||
|
||||
|
||||
if (!hBitmap)
|
||||
return;
|
||||
|
||||
hFile = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
hFile =
|
||||
CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
|
||||
|
@ -113,7 +119,7 @@ void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size
|
|||
CloseHandle(hFile);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (time)
|
||||
{
|
||||
FILETIME ft;
|
||||
|
@ -130,12 +136,12 @@ void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size
|
|||
ReadFile(hFile, bi, bfh.bfOffBits - sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL);
|
||||
*hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, &pvBits, NULL, 0);
|
||||
ReadFile(hFile, pvBits, bfh.bfSize - bfh.bfOffBits, &dwBytesRead, NULL);
|
||||
|
||||
|
||||
if (hRes)
|
||||
*hRes = (*bi).bmiHeader.biXPelsPerMeter;
|
||||
if (vRes)
|
||||
*vRes = (*bi).bmiHeader.biYPelsPerMeter;
|
||||
|
||||
|
||||
CloseHandle(hFile);
|
||||
HeapFree(GetProcessHeap(), 0, bi);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: dib.h
|
||||
* FILE: base/applications/paint/dib.h
|
||||
* PURPOSE: Some DIB related functions
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -12,6 +12,7 @@ int GetDIBWidth(HBITMAP hbm);
|
|||
|
||||
int GetDIBHeight(HBITMAP hbm);
|
||||
|
||||
void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes);
|
||||
void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes,
|
||||
int vRes);
|
||||
|
||||
void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: drawing.c
|
||||
* FILE: base/applications/paint/drawing.c
|
||||
* PURPOSE: The drawing functions used by the tools
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -12,7 +12,8 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness)
|
||||
void
|
||||
Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness)
|
||||
{
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color));
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
|
@ -20,13 +21,14 @@ void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickn
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
|
||||
void
|
||||
Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
|
||||
{
|
||||
HBRUSH oldBrush;
|
||||
LOGBRUSH logbrush;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
|
||||
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
|
||||
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
|
||||
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
|
||||
logbrush.lbColor = (style == 2) ? fg : bg;
|
||||
logbrush.lbHatch = 0;
|
||||
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
|
||||
Rectangle(hdc, x1, y1, x2, y2);
|
||||
|
@ -34,13 +36,14 @@ void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int t
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
|
||||
void
|
||||
Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
|
||||
{
|
||||
HBRUSH oldBrush;
|
||||
LOGBRUSH logbrush;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
|
||||
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
|
||||
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
|
||||
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
|
||||
logbrush.lbColor = (style == 2) ? fg : bg;
|
||||
logbrush.lbHatch = 0;
|
||||
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
|
||||
Ellipse(hdc, x1, y1, x2, y2);
|
||||
|
@ -48,13 +51,14 @@ void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int t
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
|
||||
void
|
||||
RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
HBRUSH oldBrush;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
|
||||
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
|
||||
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
|
||||
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
|
||||
logbrush.lbColor = (style == 2) ? fg : bg;
|
||||
logbrush.lbHatch = 0;
|
||||
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
|
||||
RoundRect(hdc, x1, y1, x2, y2, 16, 16);
|
||||
|
@ -62,13 +66,14 @@ void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed)
|
||||
void
|
||||
Poly(HDC hdc, POINT * lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed)
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
HBRUSH oldBrush;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
|
||||
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
|
||||
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
|
||||
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
|
||||
logbrush.lbColor = (style == 2) ? fg : bg;
|
||||
logbrush.lbHatch = 0;
|
||||
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
|
||||
if (closed)
|
||||
|
@ -79,7 +84,8 @@ void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, i
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness)
|
||||
void
|
||||
Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness)
|
||||
{
|
||||
HPEN oldPen;
|
||||
POINT fourPoints[4];
|
||||
|
@ -92,42 +98,55 @@ void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thic
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void Fill(HDC hdc, int x, int y, int color)
|
||||
void
|
||||
Fill(HDC hdc, int x, int y, int color)
|
||||
{
|
||||
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
|
||||
ExtFloodFill(hdc, x, y, GetPixel(hdc, x, y), FLOODFILLSURFACE);
|
||||
DeleteObject(SelectObject(hdc, oldBrush));
|
||||
}
|
||||
|
||||
void Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius)
|
||||
void
|
||||
Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius)
|
||||
{
|
||||
short a;
|
||||
HPEN oldPen;
|
||||
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
|
||||
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
|
||||
for (a=0; a<=100; a++)
|
||||
Rectangle(hdc, (x1*(100-a)+x2*a)/100-radius+1, (y1*(100-a)+y2*a)/100-radius+1, (x1*(100-a)+x2*a)/100+radius+1, (y1*(100-a)+y2*a)/100+radius+1);
|
||||
for(a = 0; a <= 100; a++)
|
||||
Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - radius + 1,
|
||||
(y1 * (100 - a) + y2 * a) / 100 - radius + 1, (x1 * (100 - a) + x2 * a) / 100 + radius + 1,
|
||||
(y1 * (100 - a) + y2 * a) / 100 + radius + 1);
|
||||
DeleteObject(SelectObject(hdc, oldBrush));
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius)
|
||||
void
|
||||
Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius)
|
||||
{
|
||||
short a, x, y;
|
||||
for (a=0; a<=100; a++)
|
||||
for (y=(y1*(100-a)+y2*a)/100-radius+1; y<(y1*(100-a)+y2*a)/100+radius+1; y++)
|
||||
for (x=(x1*(100-a)+x2*a)/100-radius+1; x<(x1*(100-a)+x2*a)/100+radius+1; x++)
|
||||
if (GetPixel(hdc, x, y)==fg) SetPixel(hdc, x, y, bg);
|
||||
for(a = 0; a <= 100; a++)
|
||||
for(y = (y1 * (100 - a) + y2 * a) / 100 - radius + 1;
|
||||
y < (y1 * (100 - a) + y2 * a) / 100 + radius + 1; y++)
|
||||
for(x = (x1 * (100 - a) + x2 * a) / 100 - radius + 1;
|
||||
x < (x1 * (100 - a) + x2 * a) / 100 + radius + 1; x++)
|
||||
if (GetPixel(hdc, x, y) == fg)
|
||||
SetPixel(hdc, x, y, bg);
|
||||
}
|
||||
|
||||
void Airbrush(HDC hdc, short x, short y, int color, int r)
|
||||
void
|
||||
Airbrush(HDC hdc, short x, short y, int color, int r)
|
||||
{
|
||||
short a;
|
||||
short b;
|
||||
for (b=-r; b<=r; b++) for (a=-r; a<=r; a++) if ((a*a+b*b<=r*r)&&(rand()%4==0)) SetPixel(hdc, x+a, y+b, color);
|
||||
for(b = -r; b <= r; b++)
|
||||
for(a = -r; a <= r; a++)
|
||||
if ((a * a + b * b <= r * r) && (rand() % 4 == 0))
|
||||
SetPixel(hdc, x + a, y + b, color);
|
||||
}
|
||||
|
||||
void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style)
|
||||
void
|
||||
Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style)
|
||||
{
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
|
||||
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
|
||||
|
@ -135,12 +154,14 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
|
|||
switch (style)
|
||||
{
|
||||
case 0:
|
||||
for (a=0; a<=100; a++)
|
||||
Ellipse(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, (x1*(100-a)+x2*a)/100+4, (y1*(100-a)+y2*a)/100+4);
|
||||
for(a = 0; a <= 100; a++)
|
||||
Ellipse(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3,
|
||||
(x1 * (100 - a) + x2 * a) / 100 + 4, (y1 * (100 - a) + y2 * a) / 100 + 4);
|
||||
break;
|
||||
case 1:
|
||||
for (a=0; a<=100; a++)
|
||||
Ellipse(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3);
|
||||
for(a = 0; a <= 100; a++)
|
||||
Ellipse(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1,
|
||||
(x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
|
||||
break;
|
||||
case 2:
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
|
@ -148,57 +169,60 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
|
|||
SetPixel(hdc, x2, y2, color);
|
||||
break;
|
||||
case 3:
|
||||
for (a=0; a<=100; a++)
|
||||
Rectangle(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100+5);
|
||||
for(a = 0; a <= 100; a++)
|
||||
Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3,
|
||||
(x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 + 5);
|
||||
break;
|
||||
case 4:
|
||||
for (a=0; a<=100; a++)
|
||||
Rectangle(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100-2, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3);
|
||||
for(a = 0; a <= 100; a++)
|
||||
Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 - 2,
|
||||
(x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
|
||||
break;
|
||||
case 5:
|
||||
for (a=0; a<=100; a++)
|
||||
Rectangle(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100+1);
|
||||
for(a = 0; a <= 100; a++)
|
||||
Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1,
|
||||
(x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 + 1);
|
||||
break;
|
||||
case 6:
|
||||
for (a=0; a<=100; a++)
|
||||
for(a = 0; a <= 100; a++)
|
||||
{
|
||||
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100+5, NULL);
|
||||
LineTo(hdc, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100-3);
|
||||
MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 + 5, NULL);
|
||||
LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 - 3);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
for (a=0; a<=100; a++)
|
||||
for(a = 0; a <= 100; a++)
|
||||
{
|
||||
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100+3, NULL);
|
||||
LineTo(hdc, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100-2);
|
||||
MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 + 3, NULL);
|
||||
LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 - 2);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
for (a=0; a<=100; a++)
|
||||
for(a = 0; a <= 100; a++)
|
||||
{
|
||||
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100+1, NULL);
|
||||
LineTo(hdc, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100-1);
|
||||
MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 + 1, NULL);
|
||||
LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 - 1);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
for (a=0; a<=100; a++)
|
||||
for(a = 0; a <= 100; a++)
|
||||
{
|
||||
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, NULL);
|
||||
LineTo(hdc, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100+5);
|
||||
MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3, NULL);
|
||||
LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 + 5);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
for (a=0; a<=100; a++)
|
||||
for(a = 0; a <= 100; a++)
|
||||
{
|
||||
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100-2, NULL);
|
||||
LineTo(hdc, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3);
|
||||
MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 - 2, NULL);
|
||||
LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
for (a=0; a<=100; a++)
|
||||
for(a = 0; a <= 100; a++)
|
||||
{
|
||||
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, NULL);
|
||||
LineTo(hdc, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100+1);
|
||||
MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1, NULL);
|
||||
LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -206,7 +230,8 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void RectSel(HDC hdc, short x1, short y1, short x2, short y2)
|
||||
void
|
||||
RectSel(HDC hdc, short x1, short y1, short x2, short y2)
|
||||
{
|
||||
HBRUSH oldBrush;
|
||||
LOGBRUSH logbrush;
|
||||
|
@ -220,7 +245,8 @@ void RectSel(HDC hdc, short x1, short y1, short x2, short y2)
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
||||
void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
|
||||
void
|
||||
SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
HBRUSH oldBrush;
|
||||
LOGBRUSH logbrush;
|
||||
|
@ -234,14 +260,14 @@ void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, 0x00000000));
|
||||
oldBrush = SelectObject(hdc, CreateSolidBrush(0x00000000));
|
||||
Rectangle(hdc, x1-1, y1-1, x1+2, y1+2);
|
||||
Rectangle(hdc, x2-2, y1-1, x2+2, y1+2);
|
||||
Rectangle(hdc, x1-1, y2-2, x1+2, y2+1);
|
||||
Rectangle(hdc, x2-2, y2-2, x2+2, y2+1);
|
||||
Rectangle(hdc, (x1+x2)/2-1, y1-1, (x1+x2)/2+2, y1+2);
|
||||
Rectangle(hdc, (x1+x2)/2-1, y2-2, (x1+x2)/2+2, y2+1);
|
||||
Rectangle(hdc, x1-1, (y1+y2)/2-1, x1+2, (y1+y2)/2+2);
|
||||
Rectangle(hdc, x2-2, (y1+y2)/2-1, x2+1, (y1+y2)/2+2);
|
||||
Rectangle(hdc, x1 - 1, y1 - 1, x1 + 2, y1 + 2);
|
||||
Rectangle(hdc, x2 - 2, y1 - 1, x2 + 2, y1 + 2);
|
||||
Rectangle(hdc, x1 - 1, y2 - 2, x1 + 2, y2 + 1);
|
||||
Rectangle(hdc, x2 - 2, y2 - 2, x2 + 2, y2 + 1);
|
||||
Rectangle(hdc, (x1 + x2) / 2 - 1, y1 - 1, (x1 + x2) / 2 + 2, y1 + 2);
|
||||
Rectangle(hdc, (x1 + x2) / 2 - 1, y2 - 2, (x1 + x2) / 2 + 2, y2 + 1);
|
||||
Rectangle(hdc, x1 - 1, (y1 + y2) / 2 - 1, x1 + 2, (y1 + y2) / 2 + 2);
|
||||
Rectangle(hdc, x2 - 2, (y1 + y2) / 2 - 1, x2 + 1, (y1 + y2) / 2 + 2);
|
||||
DeleteObject(SelectObject(hdc, oldBrush));
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: drawing.h
|
||||
* FILE: base/applications/paint/drawing.h
|
||||
* PURPOSE: The drawing functions used by the tools
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: globalvar.h
|
||||
* FILE: base/applications/paint/globalvar.h
|
||||
* PURPOSE: Declaring global variables for later initialization
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -45,13 +45,16 @@ extern HWND hImageArea;
|
|||
extern HBITMAP hSelBm;
|
||||
|
||||
extern int palColors[28];
|
||||
|
||||
extern int fgColor;
|
||||
extern int bgColor;
|
||||
|
||||
extern HWND hStatusBar;
|
||||
extern HWND hScrollbox;
|
||||
extern HWND hMainWnd;
|
||||
extern HWND hPalWin;
|
||||
extern HWND hToolSettings;
|
||||
extern HWND hTrackbarZoom;
|
||||
extern CHOOSECOLOR choosecolor;
|
||||
extern OPENFILENAME ofn;
|
||||
extern OPENFILENAME sfn;
|
||||
|
@ -92,9 +95,7 @@ extern HWND hSizeboxLeftBottom;
|
|||
extern HWND hSizeboxCenterBottom;
|
||||
extern HWND hSizeboxRightBottom;
|
||||
|
||||
extern HWND hTrackbarZoom;
|
||||
|
||||
/* VARIABLES declared in mouse.c *************************************/
|
||||
/* VARIABLES declared in mouse.c ************************************/
|
||||
|
||||
extern POINT pointStack[256];
|
||||
extern short pointSP;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: history.c
|
||||
* FILE: base/applications/paint/history.c
|
||||
* PURPOSE: Undo and redo functionality
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -17,9 +17,10 @@
|
|||
|
||||
extern void updateCanvasAndScrollbars(void);
|
||||
|
||||
void setImgXYRes(int x, int y)
|
||||
void
|
||||
setImgXYRes(int x, int y)
|
||||
{
|
||||
if ((imgXRes!=x)||(imgYRes!=y))
|
||||
if ((imgXRes != x) || (imgYRes != y))
|
||||
{
|
||||
imgXRes = x;
|
||||
imgYRes = y;
|
||||
|
@ -27,12 +28,14 @@ void setImgXYRes(int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
void newReversible()
|
||||
void
|
||||
newReversible()
|
||||
{
|
||||
DeleteObject(hBms[(currInd+1)%HISTORYSIZE]);
|
||||
hBms[(currInd+1)%HISTORYSIZE] = CopyImage( hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
|
||||
currInd = (currInd+1)%HISTORYSIZE;
|
||||
if (undoSteps<HISTORYSIZE-1) undoSteps++;
|
||||
DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
|
||||
hBms[(currInd + 1) % HISTORYSIZE] = CopyImage(hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
|
||||
currInd = (currInd + 1) % HISTORYSIZE;
|
||||
if (undoSteps < HISTORYSIZE - 1)
|
||||
undoSteps++;
|
||||
redoSteps = 0;
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
imgXRes = GetDIBWidth(hBms[currInd]);
|
||||
|
@ -40,74 +43,85 @@ void newReversible()
|
|||
imageSaved = FALSE;
|
||||
}
|
||||
|
||||
void undo()
|
||||
void
|
||||
undo()
|
||||
{
|
||||
if (undoSteps>0)
|
||||
if (undoSteps > 0)
|
||||
{
|
||||
ShowWindow(hSelection, SW_HIDE);
|
||||
currInd = (currInd+HISTORYSIZE-1)%HISTORYSIZE;
|
||||
currInd = (currInd + HISTORYSIZE - 1) % HISTORYSIZE;
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
undoSteps--;
|
||||
if (redoSteps<HISTORYSIZE-1) redoSteps++;
|
||||
if (redoSteps < HISTORYSIZE - 1)
|
||||
redoSteps++;
|
||||
setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
|
||||
}
|
||||
}
|
||||
|
||||
void redo()
|
||||
void
|
||||
redo()
|
||||
{
|
||||
if (redoSteps>0)
|
||||
if (redoSteps > 0)
|
||||
{
|
||||
ShowWindow(hSelection, SW_HIDE);
|
||||
currInd = (currInd+1)%HISTORYSIZE;
|
||||
currInd = (currInd + 1) % HISTORYSIZE;
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
redoSteps--;
|
||||
if (undoSteps<HISTORYSIZE-1) undoSteps++;
|
||||
if (undoSteps < HISTORYSIZE - 1)
|
||||
undoSteps++;
|
||||
setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
|
||||
}
|
||||
}
|
||||
|
||||
void resetToU1()
|
||||
void
|
||||
resetToU1()
|
||||
{
|
||||
DeleteObject(hBms[currInd]);
|
||||
hBms[currInd] = CopyImage( hBms[(currInd+HISTORYSIZE-1)%HISTORYSIZE], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
|
||||
hBms[currInd] =
|
||||
CopyImage(hBms[(currInd + HISTORYSIZE - 1) % HISTORYSIZE], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
imgXRes = GetDIBWidth(hBms[currInd]);
|
||||
imgYRes = GetDIBHeight(hBms[currInd]);
|
||||
}
|
||||
|
||||
void clearHistory()
|
||||
void
|
||||
clearHistory()
|
||||
{
|
||||
undoSteps = 0;
|
||||
redoSteps = 0;
|
||||
}
|
||||
|
||||
void insertReversible(HBITMAP hbm)
|
||||
void
|
||||
insertReversible(HBITMAP hbm)
|
||||
{
|
||||
DeleteObject(hBms[(currInd+1)%HISTORYSIZE]);
|
||||
hBms[(currInd+1)%HISTORYSIZE] = hbm;
|
||||
currInd = (currInd+1)%HISTORYSIZE;
|
||||
if (undoSteps<HISTORYSIZE-1) undoSteps++;
|
||||
DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
|
||||
hBms[(currInd + 1) % HISTORYSIZE] = hbm;
|
||||
currInd = (currInd + 1) % HISTORYSIZE;
|
||||
if (undoSteps < HISTORYSIZE - 1)
|
||||
undoSteps++;
|
||||
redoSteps = 0;
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
|
||||
}
|
||||
|
||||
void cropReversible(int width, int height, int xOffset, int yOffset)
|
||||
void
|
||||
cropReversible(int width, int height, int xOffset, int yOffset)
|
||||
{
|
||||
HDC hdc;
|
||||
HPEN oldPen;
|
||||
HBRUSH oldBrush;
|
||||
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
DeleteObject(hBms[(currInd+1)%HISTORYSIZE]);
|
||||
hBms[(currInd+1)%HISTORYSIZE] = CreateDIBWithProperties(width, height);
|
||||
currInd = (currInd+1)%HISTORYSIZE;
|
||||
if (undoSteps<HISTORYSIZE-1) undoSteps++;
|
||||
DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
|
||||
hBms[(currInd + 1) % HISTORYSIZE] = CreateDIBWithProperties(width, height);
|
||||
currInd = (currInd + 1) % HISTORYSIZE;
|
||||
if (undoSteps < HISTORYSIZE - 1)
|
||||
undoSteps++;
|
||||
redoSteps = 0;
|
||||
|
||||
|
||||
hdc = CreateCompatibleDC(hDrawingDC);
|
||||
SelectObject(hdc, hBms[currInd]);
|
||||
|
||||
|
||||
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, bgColor));
|
||||
oldBrush = SelectObject(hdc, CreateSolidBrush(bgColor));
|
||||
Rectangle(hdc, 0, 0, width, height);
|
||||
|
@ -116,6 +130,6 @@ void cropReversible(int width, int height, int xOffset, int yOffset)
|
|||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
DeleteDC(hdc);
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
|
||||
|
||||
setImgXYRes(width, height);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Bulgarian Language resource file
|
||||
* Translated by:
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/bg-BG.rc
|
||||
* PURPOSE: Bulgarian Language resource file
|
||||
* TRANSLATORS: unknown
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
|
||||
|
@ -138,9 +141,9 @@ BEGIN
|
|||
LTEXT "Äàòà íà ôàéëà:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Ôàéëîâ ðàçìåð:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Ðàçäåëèòåëíà:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Åäèíèöè", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Öîëîâå", IDD_ATTRIBUTESRB1, 12, 69, 40, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "ñì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* FILE: ??rospaint??/lang/cs-CZ.rc
|
||||
* TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
|
||||
* UPDATED: 2009-04-28
|
||||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/cs-CZ.rc
|
||||
* PURPOSE: Czech Language resource file
|
||||
* TRANSLATORS: Radek Liska aka Black_Fox (radekliska at gmail dot com)
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Datum zmìny:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Velikost souboru:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Rozlišení:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Jednotka", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Palce", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "Centimetry", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* German Language resource file / Deutsche Sprachresourcendatei
|
||||
* Program's initial language / anfängliche Programmsprache, Benedikt Freisen
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: base/applications/paint/lang/de-DE.rc
|
||||
* PURPOSE: German Language resource file (reference language file)
|
||||
* TRANSLATORS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* British English language resource file
|
||||
* Translated by: Benedikt Freisen
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: base/applications/paint/lang/en-GB.rc
|
||||
* PURPOSE: British English Language resource file
|
||||
* TRANSLATORS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
|
@ -138,9 +141,9 @@ BEGIN
|
|||
LTEXT "File date:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "File size:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Resolution:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Unit", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Inch", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* US-English Language resource file
|
||||
* Translated by: first times touched from en-GB.rc file by Mario Kacmar
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/en-US.rc
|
||||
* PURPOSE: US-English Language resource file
|
||||
* TRANSLATORS: first times touched from en-GB.rc file by Mario Kacmar
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
@ -138,9 +141,9 @@ BEGIN
|
|||
LTEXT "File date:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "File size:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Resolution:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Units", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Inches", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Spanish Language resource file
|
||||
* Traducido por: Gabriel Ilardi febrero 2009
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/es-ES.rc
|
||||
* PURPOSE: Spanish Language resource file
|
||||
* TRANSLATORS: Gabriel Ilardi
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
@ -138,9 +141,9 @@ BEGIN
|
|||
LTEXT "Fecha modificación:", IDD_ATTRIBUTESTEXT3, 10, 5, 80, 10
|
||||
LTEXT "Espacio en disco:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Resolución:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "No disponible", IDD_ATTRIBUTESTEXT6, 73, 5, 60, 10
|
||||
LTEXT "No disponible", IDD_ATTRIBUTESTEXT7, 73, 15, 60, 10
|
||||
LTEXT "No disponible", IDD_ATTRIBUTESTEXT8, 73, 25, 60, 10
|
||||
LTEXT "No disponible", IDD_ATTRIBUTESTEXT6, 73, 5, 80, 10
|
||||
LTEXT "No disponible", IDD_ATTRIBUTESTEXT7, 73, 15, 80, 10
|
||||
LTEXT "No disponible", IDD_ATTRIBUTESTEXT8, 73, 25, 80, 10
|
||||
GROUPBOX "Unidades ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Pulgadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 60, 69, 35, 10
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
/* Basque language resource file */
|
||||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/eu-ES.rc
|
||||
* PURPOSE: Basque Language resource file
|
||||
* TRANSLATORS: unknown
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_BASQUE, SUBLANG_DEFAULT
|
||||
|
||||
|
@ -135,9 +141,9 @@ BEGIN
|
|||
LTEXT "Azken gordetze-data:", IDD_ATTRIBUTESTEXT3, 10, 5, 80, 10
|
||||
LTEXT "Diskoko tamaina:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Bereizmena:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT6, 80, 5, 60, 10
|
||||
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT7, 80, 15, 60, 10
|
||||
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT8, 80, 25, 60, 10
|
||||
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT6, 80, 5, 70, 10
|
||||
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT7, 80, 15, 70, 10
|
||||
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT8, 80, 25, 70, 10
|
||||
GROUPBOX "Unitateak ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Hazbetea", IDD_ATTRIBUTESRB1, 12, 69, 42, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 60, 69, 30, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* FR-French Language resource file
|
||||
* Translated by:
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/fr-FR.rc
|
||||
* PURPOSE: FR-French Language resource file
|
||||
* TRANSLATORS: unknown
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Dernier enregistrement du fichier :", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Taille sur le disque :", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Résolution :", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Unités", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Pouces", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "Cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Italian Language resource file
|
||||
* Tradotto da: gabriel ilardi, febbraio 2009
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/it-IT.rc
|
||||
* PURPOSE: Italian Language resource file
|
||||
* TRANSLATORS: gabriel ilardi
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Ultimo salvataggio:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Dimensioni su disco:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Risoluzione:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Unità di misura", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Pollici", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "Cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Japanese Language resource file
|
||||
* Translated by: pcds90net, Tomoya Kitagawa
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/ja-JP.rc
|
||||
* PURPOSE: Japanese Language resource file
|
||||
* TRANSLATORS: pcds90net, Tomoya Kitagawa
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||
|
@ -138,9 +141,9 @@ BEGIN
|
|||
LTEXT "ファイルの日付:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "ファイルのサイズ:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "解像度:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "単位", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "インチ", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Dutch Language resource file
|
||||
* Translated by: Wouter De Vlieger
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/nl-NL.rc
|
||||
* PURPOSE: Dutch Language resource file
|
||||
* TRANSLATORS: Wouter De Vlieger
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Datum laatst gewijzigd:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Bestandsgrootte:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Resolutie:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Eenheden", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Inch", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* NO-Norwegian Language resource file
|
||||
* Translated by: first times touched from no-NO.rc file by Lars Martin Hambro
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/no-NO.rc
|
||||
* PURPOSE: NO-Norwegian Language resource file
|
||||
* TRANSLATORS: first times touched from no-NO.rc file by Lars Martin Hambro
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Fildato:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Filstørrelse:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Oppløsning:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Enheter", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Tommer", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "Centimeter", IDD_ATTRIBUTESRB2, 52, 69, 55, 10
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* translated by Caemyr - Olaf Siejka (May,2009)
|
||||
* Use ReactOS forum PM or IRC to contact me
|
||||
* http://www.reactos.org
|
||||
* IRC: irc.freenode.net #reactos-pl;
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/pl-PL.rc
|
||||
* PURPOSE: Polish Language resource file
|
||||
* TRANSLATORS: Caemyr - Olaf Siejka (May,2009), Use ReactOS forum PM or IRC to contact me
|
||||
*/
|
||||
|
||||
|
||||
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
|
||||
|
||||
ID_MENU MENU
|
||||
|
@ -140,9 +140,9 @@ BEGIN
|
|||
LTEXT "Data:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Rozmiar:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "RozdzielczoϾ:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Jednostki", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "Cale", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Portuguese Brazilian Language resource file
|
||||
* Translated by: Wagner Leandro Bueno Angelo
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/pt-BR.rc
|
||||
* PURPOSE: Portuguese Brazilian Language resource file
|
||||
* TRANSLATORS: Wagner Leandro Bueno Angelo
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Data do arquivo:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Tamanho do arquivo:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Resolução:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Unidades", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "P&olegadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "c&m", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Portuguese Language resource file
|
||||
* Translated by: Manuel D V Silva
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/pt-PT.rc
|
||||
* PURPOSE: Portuguese Language resource file
|
||||
* TRANSLATORS: Manuel D V Silva
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
|
||||
|
@ -137,9 +140,9 @@ BEGIN
|
|||
LTEXT "Data do arquivo:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Tamanho do arquivo:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Resolução:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Unidades", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "P&olegadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "c&m", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Romanian Language resource file
|
||||
* Translated by: Petru Dimitriu
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/ro-RO.rc
|
||||
* PURPOSE: Romanian Language resource file
|
||||
* TRANSLATORS: Petru Dimitriu
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
|
||||
|
@ -140,9 +143,9 @@ BEGIN
|
|||
LTEXT "Dată:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Mărime:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Rezoluție:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Unitate", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "țoli", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/ru-RU.rc
|
||||
* PURPOSE: Russian Language resource file
|
||||
* TRANSLATORS: unknown
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
ID_MENU MENU
|
||||
|
@ -132,9 +140,9 @@ BEGIN
|
|||
LTEXT "Äàòà ñîõðàíåíèÿ:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Ðàçìåð íà äèñêå:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Ðàçðåøåíèå:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "не доступно", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "не доступно", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "не доступно", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "íå äîñòóïíî", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "íå äîñòóïíî", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "íå äîñòóïíî", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Åäèíèöû èçìåðåíèÿ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "ä&þéìû", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "ñ&ì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/*
|
||||
* Slovak Language resource file
|
||||
* Translated by: Mário Kačmár /Mario Kacmar/ aka Kario (kario@szm.sk)
|
||||
* Last changed: 02-07-2009
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: unknown (LGPL assumed)
|
||||
* FILE: base/applications/paint/lang/sk-SK.rc
|
||||
* PURPOSE: Slovak Language resource file
|
||||
* TRANSLATORS: Mário Kačmár /Mario Kacmar/ aka Kario (kario@szm.sk)
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
|
||||
|
@ -139,9 +141,9 @@ BEGIN
|
|||
LTEXT "Dátum zmeny:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 //File date
|
||||
LTEXT "Ve¾kos<6F> súboru:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 //File size
|
||||
LTEXT "Rozlíšenie:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Jednotky", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "palce", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* PROJECT: Paint for ReactOS
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: base/applications/devmgmt/lang/uk-UA.rc
|
||||
* FILE: base/applications/paint/lang/uk-UA.rc
|
||||
* PURPOSE: Ukraianian Language File for Paint
|
||||
* TRANSLATOR: Artem Reznikov, Sakara Yevhen
|
||||
* TRANSLATORS: Artem Reznikov, Sakara Yevhen
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
|
||||
|
@ -140,9 +140,9 @@ BEGIN
|
|||
LTEXT "Äàòà ôàéëà:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
|
||||
LTEXT "Ðîçì³ð ôàéëà:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
|
||||
LTEXT "Ðîçä³ëüíà çäàòí³ñòü:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
|
||||
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
|
||||
GROUPBOX "Îäèíèö³ âèì³ðþâàííÿ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
|
||||
AUTORADIOBUTTON "äþéìè", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
|
||||
AUTORADIOBUTTON "ñì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: main.c
|
||||
* FILE: base/applications/paint/main.c
|
||||
* PURPOSE: Initializing everything
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -43,8 +43,6 @@ int undoSteps = 0;
|
|||
int redoSteps = 0;
|
||||
BOOL imageSaved = TRUE;
|
||||
|
||||
// global status variables
|
||||
|
||||
short startX;
|
||||
short startY;
|
||||
short lastX;
|
||||
|
@ -63,25 +61,23 @@ HWND hSelection;
|
|||
HWND hImageArea;
|
||||
HBITMAP hSelBm;
|
||||
|
||||
|
||||
// global declarations and WinMain
|
||||
|
||||
|
||||
// initial palette colors; may be changed by the user during execution
|
||||
int palColors[28] =
|
||||
{0x000000, 0x464646, 0x787878, 0x300099, 0x241ced, 0x0078ff, 0x0ec2ff,
|
||||
/* initial palette colors; may be changed by the user during execution */
|
||||
int palColors[28] = { 0x000000, 0x464646, 0x787878, 0x300099, 0x241ced, 0x0078ff, 0x0ec2ff,
|
||||
0x00f2ff, 0x1de6a8, 0x4cb122, 0xefb700, 0xf36d4d, 0x99362f, 0x98316f,
|
||||
0xffffff, 0xdcdcdc, 0xb4b4b4, 0x3c5a9c, 0xb1a3ff, 0x7aaae5, 0x9ce4f5,
|
||||
0xbdf9ff, 0xbcf9d3, 0x61bb9d, 0xead999, 0xd19a70, 0x8e6d54, 0xd5a5b5};
|
||||
// foreground and background colors with initial value
|
||||
0xbdf9ff, 0xbcf9d3, 0x61bb9d, 0xead999, 0xd19a70, 0x8e6d54, 0xd5a5b5
|
||||
};
|
||||
|
||||
/* foreground and background colors with initial value */
|
||||
int fgColor = 0x00000000;
|
||||
int bgColor = 0x00ffffff;
|
||||
// the current zoom in percent*10
|
||||
|
||||
HWND hStatusBar;
|
||||
HWND hScrollbox;
|
||||
HWND hMainWnd;
|
||||
HWND hPalWin;
|
||||
HWND hToolSettings;
|
||||
HWND hTrackbarZoom;
|
||||
CHOOSECOLOR choosecolor;
|
||||
OPENFILENAME ofn;
|
||||
OPENFILENAME sfn;
|
||||
|
@ -122,17 +118,20 @@ HWND hSizeboxLeftBottom;
|
|||
HWND hSizeboxCenterBottom;
|
||||
HWND hSizeboxRightBottom;
|
||||
|
||||
HWND hTrackbarZoom;
|
||||
/* entry point */
|
||||
|
||||
int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil)
|
||||
int WINAPI
|
||||
_tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil)
|
||||
{
|
||||
HWND hwnd; /* This is the handle for our window */
|
||||
MSG messages; /* Here messages to the application are saved */
|
||||
|
||||
WNDCLASSEX wclScroll;
|
||||
WNDCLASSEX wincl;
|
||||
WNDCLASSEX wclPal;
|
||||
WNDCLASSEX wclSettings;
|
||||
WNDCLASSEX wclSelection;
|
||||
|
||||
TCHAR progtitle[1000];
|
||||
TCHAR resstr[100];
|
||||
HMENU menu;
|
||||
|
@ -142,6 +141,7 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
HBITMAP tempBm;
|
||||
int i;
|
||||
TCHAR tooltips[16][30];
|
||||
|
||||
TCHAR *c;
|
||||
TCHAR sfnFilename[1000];
|
||||
TCHAR sfnFiletitle[256];
|
||||
|
@ -150,9 +150,9 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
TCHAR ofnFiletitle[256];
|
||||
TCHAR ofnFilter[1000];
|
||||
TCHAR miniaturetitle[100];
|
||||
int custColors[16] =
|
||||
{0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
|
||||
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff};
|
||||
int custColors[16] = { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
|
||||
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
|
||||
};
|
||||
|
||||
hProgInstance = hThisInstance;
|
||||
|
||||
|
@ -164,10 +164,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
wincl.lpszClassName = _T("WindowsApp");
|
||||
wincl.lpfnWndProc = WindowProcedure;
|
||||
wincl.style = CS_DBLCLKS;
|
||||
wincl.cbSize = sizeof (WNDCLASSEX);
|
||||
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
|
||||
wincl.hIconSm = LoadIcon (hThisInstance, MAKEINTRESOURCE(500));
|
||||
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wincl.cbSize = sizeof(WNDCLASSEX);
|
||||
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wincl.hIconSm = LoadIcon(hThisInstance, MAKEINTRESOURCE(500));
|
||||
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wincl.lpszMenuName = NULL;
|
||||
wincl.cbClsExtra = 0;
|
||||
wincl.cbWndExtra = 0;
|
||||
|
@ -179,10 +179,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
wclScroll.lpszClassName = _T("Scrollbox");
|
||||
wclScroll.lpfnWndProc = WindowProcedure;
|
||||
wclScroll.style = 0;
|
||||
wclScroll.cbSize = sizeof (WNDCLASSEX);
|
||||
wclScroll.cbSize = sizeof(WNDCLASSEX);
|
||||
wclScroll.hIcon = NULL;
|
||||
wclScroll.hIconSm = NULL;
|
||||
wclScroll.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wclScroll.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wclScroll.lpszMenuName = NULL;
|
||||
wclScroll.cbClsExtra = 0;
|
||||
wclScroll.cbWndExtra = 0;
|
||||
|
@ -194,10 +194,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
wclPal.lpszClassName = _T("Palette");
|
||||
wclPal.lpfnWndProc = PalWinProc;
|
||||
wclPal.style = CS_DBLCLKS;
|
||||
wclPal.cbSize = sizeof (WNDCLASSEX);
|
||||
wclPal.cbSize = sizeof(WNDCLASSEX);
|
||||
wclPal.hIcon = NULL;
|
||||
wclPal.hIconSm = NULL;
|
||||
wclPal.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wclPal.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wclPal.lpszMenuName = NULL;
|
||||
wclPal.cbClsExtra = 0;
|
||||
wclPal.cbWndExtra = 0;
|
||||
|
@ -209,10 +209,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
wclSettings.lpszClassName = _T("ToolSettings");
|
||||
wclSettings.lpfnWndProc = SettingsWinProc;
|
||||
wclSettings.style = CS_DBLCLKS;
|
||||
wclSettings.cbSize = sizeof (WNDCLASSEX);
|
||||
wclSettings.cbSize = sizeof(WNDCLASSEX);
|
||||
wclSettings.hIcon = NULL;
|
||||
wclSettings.hIconSm = NULL;
|
||||
wclSettings.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wclSettings.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wclSettings.lpszMenuName = NULL;
|
||||
wclSettings.cbClsExtra = 0;
|
||||
wclSettings.cbWndExtra = 0;
|
||||
|
@ -224,14 +224,14 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
wclSelection.lpszClassName = _T("Selection");
|
||||
wclSelection.lpfnWndProc = SelectionWinProc;
|
||||
wclSelection.style = CS_DBLCLKS;
|
||||
wclSelection.cbSize = sizeof (WNDCLASSEX);
|
||||
wclSelection.cbSize = sizeof(WNDCLASSEX);
|
||||
wclSelection.hIcon = NULL;
|
||||
wclSelection.hIconSm = NULL;
|
||||
wclSelection.hCursor = LoadCursor (NULL, IDC_SIZEALL);
|
||||
wclSelection.hCursor = LoadCursor(NULL, IDC_SIZEALL);
|
||||
wclSelection.lpszMenuName = NULL;
|
||||
wclSelection.cbClsExtra = 0;
|
||||
wclSelection.cbWndExtra = 0;
|
||||
wclSelection.hbrBackground = NULL;//GetSysColorBrush(COLOR_BTNFACE);
|
||||
wclSelection.hbrBackground = NULL;
|
||||
RegisterClassEx (&wclSelection);
|
||||
|
||||
/* initializing and registering the window class for the size boxes */
|
||||
|
@ -239,10 +239,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
wclSettings.lpszClassName = _T("Sizebox");
|
||||
wclSettings.lpfnWndProc = SizeboxWinProc;
|
||||
wclSettings.style = CS_DBLCLKS;
|
||||
wclSettings.cbSize = sizeof (WNDCLASSEX);
|
||||
wclSettings.cbSize = sizeof(WNDCLASSEX);
|
||||
wclSettings.hIcon = NULL;
|
||||
wclSettings.hIconSm = NULL;
|
||||
wclSettings.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wclSettings.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wclSettings.lpszMenuName = NULL;
|
||||
wclSettings.cbClsExtra = 0;
|
||||
wclSettings.cbWndExtra = 0;
|
||||
|
@ -255,10 +255,15 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
LoadString(hThisInstance, IDS_MINIATURETITLE, miniaturetitle, SIZEOF(miniaturetitle));
|
||||
|
||||
/* create main window */
|
||||
hwnd = CreateWindowEx (0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544, 375, HWND_DESKTOP, NULL, hThisInstance, NULL);
|
||||
|
||||
hwnd =
|
||||
CreateWindowEx(0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544,
|
||||
375, HWND_DESKTOP, NULL, hThisInstance, NULL);
|
||||
hMainWnd = hwnd;
|
||||
hwndMiniature = CreateWindowEx(WS_EX_PALETTEWINDOW, _T("WindowsApp"), miniaturetitle, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 180, 200, 120, 100, hwnd, NULL, hThisInstance, NULL);
|
||||
|
||||
hwndMiniature =
|
||||
CreateWindowEx(WS_EX_PALETTEWINDOW, _T("WindowsApp"), miniaturetitle,
|
||||
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 180, 200, 120, 100, hwnd,
|
||||
NULL, hThisInstance, NULL);
|
||||
|
||||
/* loading and setting the window menu from resource */
|
||||
menu = LoadMenu(hThisInstance, MAKEINTRESOURCE(ID_MENU));
|
||||
|
@ -266,94 +271,121 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800));
|
||||
|
||||
/* preloading the draw transparent/nontransparent icons for later use */
|
||||
hNontranspIcon = LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
|
||||
hTranspIcon = LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
|
||||
hNontranspIcon =
|
||||
LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
|
||||
hTranspIcon =
|
||||
LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
|
||||
|
||||
hCurFill = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_FILL));
|
||||
hCurColor = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_COLOR));
|
||||
hCurZoom = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_ZOOM));
|
||||
hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN));
|
||||
hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH));
|
||||
hCurFill = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_FILL));
|
||||
hCurColor = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_COLOR));
|
||||
hCurZoom = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_ZOOM));
|
||||
hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN));
|
||||
hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH));
|
||||
|
||||
CreateWindowEx (0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL);
|
||||
CreateWindowEx(0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL,
|
||||
hThisInstance, NULL);
|
||||
|
||||
/* creating the 16 bitmap radio buttons and setting the bitmap */
|
||||
|
||||
|
||||
/* FIXME: Unintentionally there is a line above the tool bar. To prevent cropping of the buttons height has been increased from 200 to 205 */
|
||||
hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS, 3, 3, 50, 205, hwnd, NULL, hThisInstance, NULL);
|
||||
/*
|
||||
* FIXME: Unintentionally there is a line above the tool bar.
|
||||
* To prevent cropping of the buttons height has been increased from 200 to 205
|
||||
*/
|
||||
hToolbar =
|
||||
CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
|
||||
WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS,
|
||||
3, 3, 50, 205, hwnd, NULL, hThisInstance, NULL);
|
||||
hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0);
|
||||
SendMessage(hToolbar, TB_SETIMAGELIST, 0, (LPARAM)hImageList);
|
||||
SendMessage(hToolbar, TB_SETIMAGELIST, 0, (LPARAM) hImageList);
|
||||
tempBm = LoadImage(hThisInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0);
|
||||
ImageList_AddMasked(hImageList, tempBm, 0xff00ff);
|
||||
DeleteObject(tempBm);
|
||||
SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
|
||||
for (i=0; i<16; i++)
|
||||
|
||||
for(i = 0; i < 16; i++)
|
||||
{
|
||||
TBBUTTON tbbutton;
|
||||
int wrapnow = 0;
|
||||
|
||||
if (i % 2 == 1) wrapnow = TBSTATE_WRAP;
|
||||
if (i % 2 == 1)
|
||||
wrapnow = TBSTATE_WRAP;
|
||||
|
||||
LoadString(hThisInstance, IDS_TOOLTIP1 + i, tooltips[i], 30);
|
||||
ZeroMemory(&tbbutton, sizeof(TBBUTTON));
|
||||
tbbutton.iString = (INT_PTR)tooltips[i];
|
||||
tbbutton.fsStyle = TBSTYLE_CHECKGROUP;
|
||||
tbbutton.fsState = TBSTATE_ENABLED | wrapnow;
|
||||
tbbutton.iString = (INT_PTR) tooltips[i];
|
||||
tbbutton.fsStyle = TBSTYLE_CHECKGROUP;
|
||||
tbbutton.fsState = TBSTATE_ENABLED | wrapnow;
|
||||
tbbutton.idCommand = ID_FREESEL + i;
|
||||
tbbutton.iBitmap = i;
|
||||
SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&tbbutton);
|
||||
tbbutton.iBitmap = i;
|
||||
SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM) &tbbutton);
|
||||
}
|
||||
/* SendMessage(hToolbar, TB_SETROWS, MAKEWPARAM(8, FALSE), (LPARAM)NULL); */
|
||||
|
||||
SendMessage(hToolbar, TB_CHECKBUTTON, ID_PEN, MAKELONG(TRUE, 0));
|
||||
SendMessage(hToolbar, TB_SETMAXTEXTROWS, 0, 0);
|
||||
|
||||
SendMessage(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(25, 25));
|
||||
/* SendMessage(hToolbar, TB_AUTOSIZE, 0, 0); */
|
||||
|
||||
/* creating the tool settings child window */
|
||||
hToolSettings = CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL, hThisInstance, NULL);
|
||||
hTrackbarZoom = CreateWindowEx(0, TRACKBAR_CLASS, _T(""), WS_CHILD | TBS_VERT | TBS_AUTOTICKS, 1, 1, 40, 64, hToolSettings, NULL, hThisInstance, NULL);
|
||||
SendMessage(hTrackbarZoom, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 6));
|
||||
SendMessage(hTrackbarZoom, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)3);
|
||||
hToolSettings =
|
||||
CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL,
|
||||
hThisInstance, NULL);
|
||||
hTrackbarZoom =
|
||||
CreateWindowEx(0, TRACKBAR_CLASS, _T(""), WS_CHILD | TBS_VERT | TBS_AUTOTICKS, 1, 1, 40, 64,
|
||||
hToolSettings, NULL, hThisInstance, NULL);
|
||||
SendMessage(hTrackbarZoom, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG(0, 6));
|
||||
SendMessage(hTrackbarZoom, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 3);
|
||||
|
||||
/* creating the palette child window */
|
||||
hPalWin = CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL, hThisInstance, NULL);
|
||||
hPalWin =
|
||||
CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL,
|
||||
hThisInstance, NULL);
|
||||
|
||||
/* creating the scroll box */
|
||||
hScrollbox = CreateWindowEx (WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""), WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd, NULL, hThisInstance, NULL);
|
||||
hScrollbox =
|
||||
CreateWindowEx(WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""),
|
||||
WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd,
|
||||
NULL, hThisInstance, NULL);
|
||||
|
||||
/* creating the status bar */
|
||||
hStatusBar = CreateWindowEx (0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, NULL, hThisInstance, NULL);
|
||||
hStatusBar =
|
||||
CreateWindowEx(0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd,
|
||||
NULL, hThisInstance, NULL);
|
||||
SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0);
|
||||
|
||||
hScrlClient = CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL, hThisInstance, NULL);
|
||||
hScrlClient =
|
||||
CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL,
|
||||
hThisInstance, NULL);
|
||||
|
||||
/* create selection window (initially hidden) */
|
||||
hSelection = CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSelection =
|
||||
CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100,
|
||||
hScrlClient, NULL, hThisInstance, NULL);
|
||||
|
||||
/* creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn */
|
||||
hImageArea = CreateWindowEx (0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hImageArea =
|
||||
CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient,
|
||||
NULL, hThisInstance, NULL);
|
||||
|
||||
hDrawingDC = CreateCompatibleDC(GetDC(hImageArea));
|
||||
hSelDC = CreateCompatibleDC(GetDC(hImageArea));
|
||||
hSelDC = CreateCompatibleDC(GetDC(hImageArea));
|
||||
SelectObject(hDrawingDC, CreatePen(PS_SOLID, 0, fgColor));
|
||||
SelectObject(hDrawingDC, CreateSolidBrush(bgColor));
|
||||
|
||||
hBms[0] = CreateDIBWithProperties(imgXRes, imgYRes);
|
||||
SelectObject(hDrawingDC, hBms[0]);
|
||||
Rectangle(hDrawingDC, 0-1, 0-1, imgXRes+1, imgYRes+1);
|
||||
Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1);
|
||||
|
||||
if (lpszArgument[0] != 0)
|
||||
{
|
||||
HBITMAP bmNew = NULL;
|
||||
LoadDIBFromFile(&bmNew, lpszArgument, &fileTime, &fileSize, &fileHPPM, &fileVPPM);
|
||||
if (bmNew!=NULL)
|
||||
if (bmNew != NULL)
|
||||
{
|
||||
TCHAR tempstr[1000];
|
||||
TCHAR resstr[100];
|
||||
TCHAR *temp;
|
||||
insertReversible(bmNew);
|
||||
GetFullPathName(lpszArgument, sizeof(filepathname), filepathname, &temp);
|
||||
GetFullPathName(lpszArgument, SIZEOF(filepathname), filepathname, &temp);
|
||||
_tcscpy(filename, temp);
|
||||
LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr));
|
||||
_stprintf(tempstr, resstr, filename);
|
||||
|
@ -364,53 +396,75 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
}
|
||||
|
||||
/* initializing the CHOOSECOLOR structure for use with ChooseColor */
|
||||
choosecolor.lStructSize = sizeof(CHOOSECOLOR);
|
||||
choosecolor.hwndOwner = hwnd;
|
||||
choosecolor.hInstance = NULL;
|
||||
choosecolor.rgbResult = 0x00ffffff;
|
||||
choosecolor.lpCustColors = (COLORREF*)&custColors;
|
||||
choosecolor.Flags = 0;
|
||||
choosecolor.lCustData = 0;
|
||||
choosecolor.lpfnHook = NULL;
|
||||
choosecolor.lpTemplateName = NULL;
|
||||
choosecolor.lStructSize = sizeof(CHOOSECOLOR);
|
||||
choosecolor.hwndOwner = hwnd;
|
||||
choosecolor.hInstance = NULL;
|
||||
choosecolor.rgbResult = 0x00ffffff;
|
||||
choosecolor.lpCustColors = (COLORREF*) &custColors;
|
||||
choosecolor.Flags = 0;
|
||||
choosecolor.lCustData = 0;
|
||||
choosecolor.lpfnHook = NULL;
|
||||
choosecolor.lpTemplateName = NULL;
|
||||
|
||||
/* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */
|
||||
CopyMemory(ofnFilename, filename, sizeof(filename));
|
||||
LoadString(hThisInstance, IDS_OPENFILTER, ofnFilter, SIZEOF(ofnFilter));
|
||||
for (c = ofnFilter; *c; c++) if (*c == '\1') *c = '\0';
|
||||
for(c = ofnFilter; *c; c++)
|
||||
if (*c == '\1')
|
||||
*c = '\0';
|
||||
ZeroMemory(&ofn, sizeof(OPENFILENAME));
|
||||
ofn.lStructSize = sizeof (OPENFILENAME);
|
||||
ofn.hwndOwner = hwnd;
|
||||
ofn.hInstance = hThisInstance;
|
||||
ofn.lpstrFilter = ofnFilter;
|
||||
ofn.lpstrFile = ofnFilename;
|
||||
ofn.nMaxFile = SIZEOF(ofnFilename);
|
||||
ofn.lpstrFileTitle = ofnFiletitle;
|
||||
ofn.nMaxFileTitle = SIZEOF(ofnFiletitle);
|
||||
ofn.Flags = OFN_HIDEREADONLY;
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = hwnd;
|
||||
ofn.hInstance = hThisInstance;
|
||||
ofn.lpstrFilter = ofnFilter;
|
||||
ofn.lpstrFile = ofnFilename;
|
||||
ofn.nMaxFile = SIZEOF(ofnFilename);
|
||||
ofn.lpstrFileTitle = ofnFiletitle;
|
||||
ofn.nMaxFileTitle = SIZEOF(ofnFiletitle);
|
||||
ofn.Flags = OFN_HIDEREADONLY;
|
||||
|
||||
CopyMemory(sfnFilename, filename, sizeof(filename));
|
||||
LoadString(hThisInstance, IDS_SAVEFILTER, sfnFilter, SIZEOF(sfnFilter));
|
||||
for (c = sfnFilter; *c; c++) if (*c == '\1') *c = '\0';
|
||||
for(c = sfnFilter; *c; c++)
|
||||
if (*c == '\1')
|
||||
*c = '\0';
|
||||
ZeroMemory(&sfn, sizeof(OPENFILENAME));
|
||||
sfn.lStructSize = sizeof (OPENFILENAME);
|
||||
sfn.hwndOwner = hwnd;
|
||||
sfn.hInstance = hThisInstance;
|
||||
sfn.lpstrFilter = sfnFilter;
|
||||
sfn.lpstrFile = sfnFilename;
|
||||
sfn.nMaxFile = SIZEOF(sfnFilename);
|
||||
sfn.lpstrFileTitle = sfnFiletitle;
|
||||
sfn.nMaxFileTitle = SIZEOF(sfnFiletitle);
|
||||
sfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
|
||||
sfn.lStructSize = sizeof(OPENFILENAME);
|
||||
sfn.hwndOwner = hwnd;
|
||||
sfn.hInstance = hThisInstance;
|
||||
sfn.lpstrFilter = sfnFilter;
|
||||
sfn.lpstrFile = sfnFilename;
|
||||
sfn.nMaxFile = SIZEOF(sfnFilename);
|
||||
sfn.lpstrFileTitle = sfnFiletitle;
|
||||
sfn.nMaxFileTitle = SIZEOF(sfnFiletitle);
|
||||
sfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
|
||||
|
||||
hSizeboxLeftTop = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxCenterTop = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxRightTop = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxLeftCenter = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxRightCenter = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxLeftBottom = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxCenterBottom= CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
hSizeboxRightBottom = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL);
|
||||
/* creating the size boxes */
|
||||
hSizeboxLeftTop =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxCenterTop =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxRightTop =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxLeftCenter =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxRightCenter =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxLeftBottom =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxCenterBottom =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
hSizeboxRightBottom =
|
||||
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
|
||||
hThisInstance, NULL);
|
||||
/* placing the size boxes around the image */
|
||||
SendMessage(hImageArea, WM_SIZE, 0, 0);
|
||||
|
||||
/* by moving the window, the things in WM_SIZE are done */
|
||||
|
@ -420,7 +474,7 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
|
|||
ShowWindow (hwnd, nFunsterStil);
|
||||
|
||||
/* Run the message loop. It will run until GetMessage() returns 0 */
|
||||
while (GetMessage (&messages, NULL, 0, 0))
|
||||
while (GetMessage(&messages, NULL, 0, 0))
|
||||
{
|
||||
TranslateAccelerator(hwnd, haccel, &messages);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: mouse.c
|
||||
* FILE: base/applications/paint/mouse.c
|
||||
* PURPOSE: Things which should not be in the mouse event handler itself
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -15,9 +15,11 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
void placeSelWin()
|
||||
void
|
||||
placeSelWin()
|
||||
{
|
||||
MoveWindow(hSelection, rectSel_dest[0]*zoom/1000, rectSel_dest[1]*zoom/1000, rectSel_dest[2]*zoom/1000+6, rectSel_dest[3]*zoom/1000+6, TRUE);
|
||||
MoveWindow(hSelection, rectSel_dest[0] * zoom / 1000, rectSel_dest[1] * zoom / 1000,
|
||||
rectSel_dest[2] * zoom / 1000 + 6, rectSel_dest[3] * zoom / 1000 + 6, TRUE);
|
||||
BringWindowToTop(hSelection);
|
||||
SendMessage(hImageArea, WM_PAINT, 0, 0);
|
||||
//SendMessage(hSelection, WM_PAINT, 0, 0);
|
||||
|
@ -26,7 +28,8 @@ void placeSelWin()
|
|||
POINT pointStack[256];
|
||||
short pointSP;
|
||||
|
||||
void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
||||
void
|
||||
startPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
||||
{
|
||||
startX = x;
|
||||
startY = y;
|
||||
|
@ -37,6 +40,7 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
case 1:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13:
|
||||
case 15:
|
||||
case 16:
|
||||
newReversible();
|
||||
|
@ -67,7 +71,7 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
case 12:
|
||||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
if (pointSP==0)
|
||||
if (pointSP == 0)
|
||||
{
|
||||
newReversible();
|
||||
pointSP++;
|
||||
|
@ -76,8 +80,9 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
case 14:
|
||||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, fg, bg, lineWidth, shapeStyle, FALSE);
|
||||
if (pointSP==0)
|
||||
if (pointSP + 1 >= 2)
|
||||
Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE);
|
||||
if (pointSP == 0)
|
||||
{
|
||||
newReversible();
|
||||
pointSP++;
|
||||
|
@ -86,24 +91,25 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
}
|
||||
}
|
||||
|
||||
void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
|
||||
void
|
||||
whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
|
||||
{
|
||||
switch (activeTool)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
short tempX;
|
||||
short tempY;
|
||||
resetToU1();
|
||||
tempX = max(0, min(x, imgXRes));
|
||||
tempY = max(0, min(y, imgYRes));
|
||||
rectSel_dest[0] = rectSel_src[0] = min(startX, tempX);
|
||||
rectSel_dest[1] = rectSel_src[1] = min(startY, tempY);
|
||||
rectSel_dest[2] = rectSel_src[2] = max(startX, tempX)-min(startX, tempX);
|
||||
rectSel_dest[3] = rectSel_src[3] = max(startY, tempY)-min(startY, tempY);
|
||||
RectSel(hdc, startX, startY, tempX, tempY);
|
||||
}
|
||||
{
|
||||
short tempX;
|
||||
short tempY;
|
||||
resetToU1();
|
||||
tempX = max(0, min(x, imgXRes));
|
||||
tempY = max(0, min(y, imgYRes));
|
||||
rectSel_dest[0] = rectSel_src[0] = min(startX, tempX);
|
||||
rectSel_dest[1] = rectSel_src[1] = min(startY, tempY);
|
||||
rectSel_dest[2] = rectSel_src[2] = max(startX, tempX) - min(startX, tempX);
|
||||
rectSel_dest[3] = rectSel_src[3] = max(startY, tempY) - min(startY, tempY);
|
||||
RectSel(hdc, startX, startY, tempX, tempY);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
Erase(hdc, lastX, lastY, x, y, bg, rubberRadius);
|
||||
break;
|
||||
|
@ -126,9 +132,16 @@ void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
pointStack[pointSP].y = y;
|
||||
switch (pointSP)
|
||||
{
|
||||
case 1: Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, fg, lineWidth); break;
|
||||
case 2: Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], fg, lineWidth); break;
|
||||
case 3: Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], fg, lineWidth); break;
|
||||
case 1:
|
||||
Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, fg,
|
||||
lineWidth);
|
||||
break;
|
||||
case 2:
|
||||
Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], fg, lineWidth);
|
||||
break;
|
||||
case 3:
|
||||
Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], fg, lineWidth);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
|
@ -139,7 +152,8 @@ void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
resetToU1();
|
||||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, fg, bg, lineWidth, shapeStyle, FALSE);
|
||||
if (pointSP + 1 >= 2)
|
||||
Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE);
|
||||
break;
|
||||
case 15:
|
||||
resetToU1();
|
||||
|
@ -150,21 +164,25 @@ void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
RRect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
|
||||
void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
||||
void
|
||||
endPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
||||
{
|
||||
switch (activeTool)
|
||||
{
|
||||
case 2:
|
||||
resetToU1();
|
||||
if ((rectSel_src[2]!=0)&&(rectSel_src[3]!=0))
|
||||
if ((rectSel_src[2] != 0) && (rectSel_src[3] != 0))
|
||||
{
|
||||
DeleteObject(SelectObject(hSelDC, hSelBm = (HBITMAP)CreateDIBWithProperties(rectSel_src[2], rectSel_src[3])));
|
||||
BitBlt(hSelDC, 0, 0, rectSel_src[2], rectSel_src[3], hDrawingDC, rectSel_src[0], rectSel_src[1], SRCCOPY);
|
||||
DeleteObject(SelectObject
|
||||
(hSelDC, hSelBm =
|
||||
(HBITMAP) CreateDIBWithProperties(rectSel_src[2], rectSel_src[3])));
|
||||
BitBlt(hSelDC, 0, 0, rectSel_src[2], rectSel_src[3], hDrawingDC, rectSel_src[0],
|
||||
rectSel_src[1], SRCCOPY);
|
||||
placeSelWin();
|
||||
ShowWindow(hSelection, SW_SHOW);
|
||||
}
|
||||
|
@ -182,7 +200,8 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
break;
|
||||
case 12:
|
||||
pointSP++;
|
||||
if (pointSP==4) pointSP = 0;
|
||||
if (pointSP == 4)
|
||||
pointSP = 0;
|
||||
break;
|
||||
case 13:
|
||||
resetToU1();
|
||||
|
@ -193,9 +212,10 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
pointSP++;
|
||||
if (pointSP>=2)
|
||||
if (pointSP >= 2)
|
||||
{
|
||||
if ( (pointStack[0].x-x)*(pointStack[0].x-x) + (pointStack[0].y-y)*(pointStack[0].y-y) <= lineWidth*lineWidth+1)
|
||||
if ((pointStack[0].x - x) * (pointStack[0].x - x) +
|
||||
(pointStack[0].y - y) * (pointStack[0].y - y) <= lineWidth * lineWidth + 1)
|
||||
{
|
||||
Poly(hdc, pointStack, pointSP, fg, bg, lineWidth, shapeStyle, TRUE);
|
||||
pointSP = 0;
|
||||
|
@ -205,7 +225,8 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
Poly(hdc, pointStack, pointSP, fg, bg, lineWidth, shapeStyle, FALSE);
|
||||
}
|
||||
}
|
||||
if (pointSP==255) pointSP--;
|
||||
if (pointSP == 255)
|
||||
pointSP--;
|
||||
break;
|
||||
case 15:
|
||||
resetToU1();
|
||||
|
@ -218,7 +239,8 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
|
|||
}
|
||||
}
|
||||
|
||||
void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
||||
void
|
||||
startPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
||||
{
|
||||
startX = x;
|
||||
startY = y;
|
||||
|
@ -229,6 +251,7 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
case 1:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13:
|
||||
case 15:
|
||||
case 16:
|
||||
newReversible();
|
||||
|
@ -255,7 +278,7 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
case 12:
|
||||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
if (pointSP==0)
|
||||
if (pointSP == 0)
|
||||
{
|
||||
newReversible();
|
||||
pointSP++;
|
||||
|
@ -264,8 +287,9 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
case 14:
|
||||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, bg, fg, lineWidth, shapeStyle, FALSE);
|
||||
if (pointSP==0)
|
||||
if (pointSP + 1 >= 2)
|
||||
Poly(hdc, pointStack, pointSP + 1, bg, fg, lineWidth, shapeStyle, FALSE);
|
||||
if (pointSP == 0)
|
||||
{
|
||||
newReversible();
|
||||
pointSP++;
|
||||
|
@ -274,7 +298,8 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
}
|
||||
}
|
||||
|
||||
void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
|
||||
void
|
||||
whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
|
||||
{
|
||||
switch (activeTool)
|
||||
{
|
||||
|
@ -300,9 +325,16 @@ void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
pointStack[pointSP].y = y;
|
||||
switch (pointSP)
|
||||
{
|
||||
case 1: Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, bg, lineWidth); break;
|
||||
case 2: Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], bg, lineWidth); break;
|
||||
case 3: Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], bg, lineWidth); break;
|
||||
case 1:
|
||||
Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, bg,
|
||||
lineWidth);
|
||||
break;
|
||||
case 2:
|
||||
Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], bg, lineWidth);
|
||||
break;
|
||||
case 3:
|
||||
Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], bg, lineWidth);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
|
@ -313,7 +345,8 @@ void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
resetToU1();
|
||||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, bg, fg, lineWidth, shapeStyle, FALSE);
|
||||
if (pointSP + 1 >= 2)
|
||||
Poly(hdc, pointStack, pointSP + 1, bg, fg, lineWidth, shapeStyle, FALSE);
|
||||
break;
|
||||
case 15:
|
||||
resetToU1();
|
||||
|
@ -324,12 +357,13 @@ void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
RRect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
|
||||
void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
||||
void
|
||||
endPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
||||
{
|
||||
switch (activeTool)
|
||||
{
|
||||
|
@ -346,7 +380,8 @@ void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
break;
|
||||
case 12:
|
||||
pointSP++;
|
||||
if (pointSP==4) pointSP = 0;
|
||||
if (pointSP == 4)
|
||||
pointSP = 0;
|
||||
break;
|
||||
case 13:
|
||||
resetToU1();
|
||||
|
@ -357,9 +392,10 @@ void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
pointStack[pointSP].x = x;
|
||||
pointStack[pointSP].y = y;
|
||||
pointSP++;
|
||||
if (pointSP>=2)
|
||||
if (pointSP >= 2)
|
||||
{
|
||||
if ( (pointStack[0].x-x)*(pointStack[0].x-x) + (pointStack[0].y-y)*(pointStack[0].y-y) <= lineWidth*lineWidth+1)
|
||||
if ((pointStack[0].x - x) * (pointStack[0].x - x) +
|
||||
(pointStack[0].y - y) * (pointStack[0].y - y) <= lineWidth * lineWidth + 1)
|
||||
{
|
||||
Poly(hdc, pointStack, pointSP, bg, fg, lineWidth, shapeStyle, TRUE);
|
||||
pointSP = 0;
|
||||
|
@ -369,7 +405,8 @@ void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
|
|||
Poly(hdc, pointStack, pointSP, bg, fg, lineWidth, shapeStyle, FALSE);
|
||||
}
|
||||
}
|
||||
if (pointSP==255) pointSP--;
|
||||
if (pointSP == 255)
|
||||
pointSP--;
|
||||
break;
|
||||
case 15:
|
||||
resetToU1();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: mouse.h
|
||||
* FILE: base/applications/paint/mouse.h
|
||||
* PURPOSE: Things which should not be in the mouse event handler itself
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: palette.c
|
||||
* FILE: base/applications/paint/palette.c
|
||||
* PURPOSE: Window procedure of the palette window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -13,92 +13,94 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
LRESULT CALLBACK PalWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK
|
||||
PalWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
RECT rc = { 0, 0, 31, 32 };
|
||||
HDC hDC = GetDC(hwnd);
|
||||
HPEN oldPen;
|
||||
HBRUSH oldBrush;
|
||||
int i, a, b;
|
||||
|
||||
DefWindowProc(hwnd, message, wParam, lParam);
|
||||
|
||||
for(b = 2; b < 30; b++)
|
||||
for(a = 2; a < 29; a++)
|
||||
if ((a + b) % 2 == 1)
|
||||
SetPixel(hDC, a, b, GetSysColor(COLOR_BTNHILIGHT));
|
||||
|
||||
DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT);
|
||||
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_TOPLEFT | BF_BOTTOMRIGHT);
|
||||
SetRect(&rc, 11, 12, 26, 27);
|
||||
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
|
||||
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
|
||||
oldBrush = SelectObject(hDC, CreateSolidBrush(bgColor));
|
||||
Rectangle(hDC, rc.left, rc.top + 2, rc.right - 1, rc.bottom - 1);
|
||||
DeleteObject(SelectObject(hDC, oldBrush));
|
||||
SetRect(&rc, 4, 5, 19, 20);
|
||||
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
|
||||
oldBrush = SelectObject(hDC, CreateSolidBrush(fgColor));
|
||||
Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1);
|
||||
DeleteObject(SelectObject(hDC, oldBrush));
|
||||
DeleteObject(SelectObject(hDC, oldPen));
|
||||
|
||||
for(i = 0; i < 28; i++)
|
||||
{
|
||||
RECT rc = {0, 0, 31, 32};
|
||||
HDC hDC = GetDC(hwnd);
|
||||
HPEN oldPen;
|
||||
HBRUSH oldBrush;
|
||||
int i, a, b;
|
||||
|
||||
DefWindowProc (hwnd, message, wParam, lParam);
|
||||
|
||||
for (b = 2; b < 30; b++)
|
||||
for (a = 2; a < 29; a++)
|
||||
if ((a + b) % 2 == 1)
|
||||
SetPixel(hDC, a, b, GetSysColor(COLOR_BTNHILIGHT));
|
||||
|
||||
SetRect(&rc, 31 + (i % 14) * 16,
|
||||
0 + (i / 14) * 16, 16 + 31 + (i % 14) * 16, 16 + 0 + (i / 14) * 16);
|
||||
DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT);
|
||||
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_TOPLEFT|BF_BOTTOMRIGHT);
|
||||
SetRect(&rc, 11, 12, 26, 27);
|
||||
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT|BF_MIDDLE);
|
||||
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
|
||||
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
|
||||
oldBrush = SelectObject(hDC, CreateSolidBrush(bgColor));
|
||||
Rectangle(hDC, rc.left, rc.top + 2, rc.right -1, rc.bottom - 1);
|
||||
DeleteObject(SelectObject(hDC, oldBrush));
|
||||
SetRect(&rc, 4, 5, 19, 20);
|
||||
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT|BF_MIDDLE);
|
||||
oldBrush = SelectObject(hDC, CreateSolidBrush(fgColor));
|
||||
Rectangle( hDC, rc.left + 2,rc.top + 2, rc.right - 1, rc.bottom - 1);
|
||||
oldBrush = SelectObject(hDC, CreateSolidBrush(palColors[i]));
|
||||
Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1);
|
||||
DeleteObject(SelectObject(hDC, oldBrush));
|
||||
DeleteObject(SelectObject(hDC, oldPen));
|
||||
|
||||
for (i=0; i<28; i++)
|
||||
{
|
||||
SetRect(&rc, 31 + (i % 14) * 16,
|
||||
0 + (i / 14) * 16,
|
||||
16 + 31 + (i % 14) * 16,
|
||||
16 + 0 + (i / 14) * 16);
|
||||
DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT);
|
||||
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
|
||||
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
|
||||
oldBrush = SelectObject(hDC, CreateSolidBrush(palColors[i]));
|
||||
Rectangle(hDC, rc.left + 2,rc.top + 2,rc.right - 1, rc.bottom - 1);
|
||||
DeleteObject(SelectObject(hDC, oldBrush));
|
||||
DeleteObject(SelectObject(hDC, oldPen));
|
||||
}
|
||||
ReleaseDC(hwnd, hDC);
|
||||
}
|
||||
ReleaseDC(hwnd, hDC);
|
||||
break;
|
||||
}
|
||||
case WM_LBUTTONDOWN:
|
||||
if (LOWORD(lParam)>=31)
|
||||
if (LOWORD(lParam) >= 31)
|
||||
{
|
||||
fgColor = palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14];
|
||||
fgColor = palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14];
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case WM_RBUTTONDOWN:
|
||||
if (LOWORD(lParam)>=31)
|
||||
if (LOWORD(lParam) >= 31)
|
||||
{
|
||||
bgColor = palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14];
|
||||
bgColor = palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14];
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case WM_LBUTTONDBLCLK:
|
||||
if (LOWORD(lParam)>=31) if (ChooseColor(&choosecolor))
|
||||
{
|
||||
palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14] = choosecolor.rgbResult;
|
||||
fgColor = choosecolor.rgbResult;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
if (LOWORD(lParam) >= 31)
|
||||
if (ChooseColor(&choosecolor))
|
||||
{
|
||||
palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14] =
|
||||
choosecolor.rgbResult;
|
||||
fgColor = choosecolor.rgbResult;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case WM_RBUTTONDBLCLK:
|
||||
if (LOWORD(lParam)>=31) if (ChooseColor(&choosecolor))
|
||||
{
|
||||
palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14] = choosecolor.rgbResult;
|
||||
bgColor = choosecolor.rgbResult;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
if (LOWORD(lParam) >= 31)
|
||||
if (ChooseColor(&choosecolor))
|
||||
{
|
||||
palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14] =
|
||||
choosecolor.rgbResult;
|
||||
bgColor = choosecolor.rgbResult;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return DefWindowProc (hwnd, message, wParam, lParam);
|
||||
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: palette.h
|
||||
* FILE: base/applications/paint/palette.h
|
||||
* PURPOSE: Window procedure of the palette window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: registry.c
|
||||
* FILE: base/applications/paint/registry.c
|
||||
* PURPOSE: Offering functions dealing with registry values
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -13,27 +13,30 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
void SetWallpaper(TCHAR *FileName, DWORD dwStyle, DWORD dwTile) //FIXME: The pattern (tiled/stretched) is not set
|
||||
void
|
||||
SetWallpaper(TCHAR * FileName, DWORD dwStyle, DWORD dwTile) //FIXME: The pattern (tiled/stretched) is not set
|
||||
{
|
||||
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) FileName, SPIF_UPDATEINIFILE);
|
||||
|
||||
|
||||
/*HKEY hDesktop;
|
||||
TCHAR szStyle[3], szTile[3];
|
||||
|
||||
if ((dwStyle > 2) || (dwTile > 2))
|
||||
return;
|
||||
|
||||
if (RegOpenKeyEx(HKEY_CURRENT_USER,
|
||||
_T("Control Panel\\Desktop"), 0,
|
||||
KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS)
|
||||
if (RegOpenKeyEx(HKEY_CURRENT_USER,
|
||||
_T("Control Panel\\Desktop"), 0, KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS)
|
||||
{
|
||||
RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName, _tcslen(FileName) * sizeof(TCHAR));
|
||||
RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName,
|
||||
_tcslen(FileName) * sizeof(TCHAR));
|
||||
|
||||
_stprintf(szStyle, _T("%i"), dwStyle);
|
||||
_stprintf(szTile, _T("%i"), dwTile);
|
||||
_stprintf(szTile, _T("%i"), dwTile);
|
||||
|
||||
RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle, _tcslen(szStyle) * sizeof(TCHAR));
|
||||
RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile, _tcslen(szTile) * sizeof(TCHAR));
|
||||
RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle,
|
||||
_tcslen(szStyle) * sizeof(TCHAR));
|
||||
RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile,
|
||||
_tcslen(szTile) * sizeof(TCHAR));
|
||||
|
||||
RegCloseKey(hDesktop);
|
||||
}*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: registry.h
|
||||
* FILE: base/applications/paint/registry.h
|
||||
* PURPOSE: Offering functions dealing with registry values
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: rsrc.rc
|
||||
* FILE: base/applications/paint/rsrc.rc
|
||||
* PURPOSE: Managing the resources
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: selection.c
|
||||
* FILE: base/applications/paint/selection.c
|
||||
* PURPOSE: Window procedure of the selection window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -20,21 +20,23 @@ BOOL moving = FALSE;
|
|||
short xPos;
|
||||
short yPos;
|
||||
|
||||
LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK
|
||||
SelectionWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
if (!moving)
|
||||
{
|
||||
if (!moving)
|
||||
{
|
||||
HDC hDC = GetDC(hwnd);
|
||||
DefWindowProc (hwnd, message, wParam, lParam);
|
||||
SelectionFrame(hDC, 1, 1, rectSel_dest[2]*zoom/1000+5, rectSel_dest[3]*zoom/1000+5);
|
||||
ReleaseDC(hwnd, hDC);
|
||||
}
|
||||
HDC hDC = GetDC(hwnd);
|
||||
DefWindowProc(hwnd, message, wParam, lParam);
|
||||
SelectionFrame(hDC, 1, 1, rectSel_dest[2] * zoom / 1000 + 5,
|
||||
rectSel_dest[3] * zoom / 1000 + 5);
|
||||
ReleaseDC(hwnd, hDC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_LBUTTONDOWN:
|
||||
xPos = LOWORD(lParam);
|
||||
yPos = HIWORD(lParam);
|
||||
|
@ -45,15 +47,19 @@ LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||
if (moving)
|
||||
{
|
||||
resetToU1();
|
||||
rectSel_dest[0]+=(short)LOWORD(lParam)-xPos;
|
||||
rectSel_dest[1]+=(short)HIWORD(lParam)-yPos;
|
||||
|
||||
Rect(hDrawingDC, rectSel_src[0], rectSel_src[1], rectSel_src[0]+rectSel_src[2], rectSel_src[1]+rectSel_src[3], bgColor, bgColor, 0, TRUE);
|
||||
if (transpBg==0)
|
||||
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3], hSelDC, 0, 0, SRCCOPY);
|
||||
rectSel_dest[0] += (short)LOWORD(lParam) - xPos;
|
||||
rectSel_dest[1] += (short)HIWORD(lParam) - yPos;
|
||||
|
||||
Rect(hDrawingDC, rectSel_src[0], rectSel_src[1], rectSel_src[0] + rectSel_src[2],
|
||||
rectSel_src[1] + rectSel_src[3], bgColor, bgColor, 0, TRUE);
|
||||
if (transpBg == 0)
|
||||
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3],
|
||||
hSelDC, 0, 0, SRCCOPY);
|
||||
else
|
||||
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3], hSelDC, 0, 0, SRCAND);
|
||||
//TransparentBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3], hSelDC, 0, 0, rectSel_dest[2], rectSel_dest[3], bgColor);
|
||||
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3],
|
||||
hSelDC, 0, 0, SRCAND);
|
||||
//TransparentBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3],
|
||||
// hSelDC, 0, 0, rectSel_dest[2], rectSel_dest[3], bgColor);
|
||||
SendMessage(hImageArea, WM_PAINT, 0, 0);
|
||||
xPos = LOWORD(lParam);
|
||||
yPos = HIWORD(lParam);
|
||||
|
@ -71,7 +77,7 @@ LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||
}
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc (hwnd, message, wParam, lParam);
|
||||
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: selection.h
|
||||
* FILE: base/applications/paint/selection.h
|
||||
* PURPOSE: Window procedure of the selection window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK SelectionWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
|
|
@ -20,21 +20,20 @@ BOOL resizing = FALSE;
|
|||
short xOrig;
|
||||
short yOrig;
|
||||
|
||||
LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK
|
||||
SizeboxWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_SETCURSOR:
|
||||
{
|
||||
if ((hwnd==hSizeboxLeftTop)||(hwnd==hSizeboxRightBottom))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
|
||||
if ((hwnd==hSizeboxLeftBottom)||(hwnd==hSizeboxRightTop))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZENESW));
|
||||
if ((hwnd==hSizeboxLeftCenter)||(hwnd==hSizeboxRightCenter))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZEWE));
|
||||
if ((hwnd==hSizeboxCenterTop)||(hwnd==hSizeboxCenterBottom))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZENS));
|
||||
}
|
||||
if ((hwnd == hSizeboxLeftTop) || (hwnd == hSizeboxRightBottom))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
|
||||
if ((hwnd == hSizeboxLeftBottom) || (hwnd == hSizeboxRightTop))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZENESW));
|
||||
if ((hwnd == hSizeboxLeftCenter) || (hwnd == hSizeboxRightCenter))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZEWE));
|
||||
if ((hwnd == hSizeboxCenterTop) || (hwnd == hSizeboxCenterBottom))
|
||||
SetCursor(LoadCursor(NULL, IDC_SIZENS));
|
||||
break;
|
||||
case WM_LBUTTONDOWN:
|
||||
resizing = TRUE;
|
||||
|
@ -48,25 +47,25 @@ LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||
TCHAR sizeStr[100];
|
||||
short xRel;
|
||||
short yRel;
|
||||
xRel = ((short)LOWORD(lParam)-xOrig)*1000/zoom;
|
||||
yRel = ((short)HIWORD(lParam)-yOrig)*1000/zoom;
|
||||
if (hwnd==hSizeboxLeftTop)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes-yRel);
|
||||
if (hwnd==hSizeboxCenterTop)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes-yRel);
|
||||
if (hwnd==hSizeboxRightTop)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes-yRel);
|
||||
if (hwnd==hSizeboxLeftCenter)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes);
|
||||
if (hwnd==hSizeboxRightCenter)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes);
|
||||
if (hwnd==hSizeboxLeftBottom)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes+yRel);
|
||||
if (hwnd==hSizeboxCenterBottom)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes+yRel);
|
||||
if (hwnd==hSizeboxRightBottom)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes+yRel);
|
||||
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)sizeStr);
|
||||
xRel = ((short)LOWORD(lParam) - xOrig) * 1000 / zoom;
|
||||
yRel = ((short)HIWORD(lParam) - yOrig) * 1000 / zoom;
|
||||
if (hwnd == hSizeboxLeftTop)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes - yRel);
|
||||
if (hwnd == hSizeboxCenterTop)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes - yRel);
|
||||
if (hwnd == hSizeboxRightTop)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes - yRel);
|
||||
if (hwnd == hSizeboxLeftCenter)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes);
|
||||
if (hwnd == hSizeboxRightCenter)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes);
|
||||
if (hwnd == hSizeboxLeftBottom)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes + yRel);
|
||||
if (hwnd == hSizeboxCenterBottom)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes + yRel);
|
||||
if (hwnd == hSizeboxRightBottom)
|
||||
_stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes + yRel);
|
||||
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
|
||||
}
|
||||
break;
|
||||
case WM_LBUTTONUP:
|
||||
|
@ -76,30 +75,30 @@ LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||
short yRel;
|
||||
ReleaseCapture();
|
||||
resizing = FALSE;
|
||||
xRel = ((short)LOWORD(lParam)-xOrig)*1000/zoom;
|
||||
yRel = ((short)HIWORD(lParam)-yOrig)*1000/zoom;
|
||||
if (hwnd==hSizeboxLeftTop)
|
||||
cropReversible(imgXRes-xRel, imgYRes-yRel, xRel, yRel);
|
||||
if (hwnd==hSizeboxCenterTop)
|
||||
cropReversible(imgXRes, imgYRes-yRel, 0, yRel);
|
||||
if (hwnd==hSizeboxRightTop)
|
||||
cropReversible(imgXRes+xRel, imgYRes-yRel, 0, yRel);
|
||||
if (hwnd==hSizeboxLeftCenter)
|
||||
cropReversible(imgXRes-xRel, imgYRes, xRel, 0);
|
||||
if (hwnd==hSizeboxRightCenter)
|
||||
cropReversible(imgXRes+xRel, imgYRes, 0, 0);
|
||||
if (hwnd==hSizeboxLeftBottom)
|
||||
cropReversible(imgXRes-xRel, imgYRes+yRel, xRel, 0);
|
||||
if (hwnd==hSizeboxCenterBottom)
|
||||
cropReversible(imgXRes, imgYRes+yRel, 0, 0);
|
||||
if (hwnd==hSizeboxRightBottom)
|
||||
cropReversible(imgXRes+xRel, imgYRes+yRel, 0, 0);
|
||||
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)_T(""));
|
||||
xRel = ((short)LOWORD(lParam) - xOrig) * 1000 / zoom;
|
||||
yRel = ((short)HIWORD(lParam) - yOrig) * 1000 / zoom;
|
||||
if (hwnd == hSizeboxLeftTop)
|
||||
cropReversible(imgXRes - xRel, imgYRes - yRel, xRel, yRel);
|
||||
if (hwnd == hSizeboxCenterTop)
|
||||
cropReversible(imgXRes, imgYRes - yRel, 0, yRel);
|
||||
if (hwnd == hSizeboxRightTop)
|
||||
cropReversible(imgXRes + xRel, imgYRes - yRel, 0, yRel);
|
||||
if (hwnd == hSizeboxLeftCenter)
|
||||
cropReversible(imgXRes - xRel, imgYRes, xRel, 0);
|
||||
if (hwnd == hSizeboxRightCenter)
|
||||
cropReversible(imgXRes + xRel, imgYRes, 0, 0);
|
||||
if (hwnd == hSizeboxLeftBottom)
|
||||
cropReversible(imgXRes - xRel, imgYRes + yRel, xRel, 0);
|
||||
if (hwnd == hSizeboxCenterBottom)
|
||||
cropReversible(imgXRes, imgYRes + yRel, 0, 0);
|
||||
if (hwnd == hSizeboxRightBottom)
|
||||
cropReversible(imgXRes + xRel, imgYRes + yRel, 0, 0);
|
||||
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) _T(""));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return DefWindowProc (hwnd, message, wParam, lParam);
|
||||
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: sizebox.h
|
||||
* FILE: base/applications/paint/sizebox.h
|
||||
* PURPOSE: Window procedure of the size boxes
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK SizeboxWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: toolsettings.c
|
||||
* FILE: base/applications/paint/toolsettings.c
|
||||
* PURPOSE: Window procedure of the tool settings window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
@ -16,244 +16,242 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
LRESULT CALLBACK SettingsWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
extern void zoomTo(int, int, int);
|
||||
|
||||
LRESULT CALLBACK
|
||||
SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_VSCROLL:
|
||||
{
|
||||
zoomTo(125<<SendMessage(hTrackbarZoom, TBM_GETPOS, 0, 0), 0, 0);
|
||||
}
|
||||
zoomTo(125 << SendMessage(hTrackbarZoom, TBM_GETPOS, 0, 0), 0, 0);
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
HDC hdc = GetDC(hwnd);
|
||||
RECT rect1 = { 0, 0, 42, 66 };
|
||||
RECT rect2 = { 0, 70, 42, 136 };
|
||||
|
||||
DefWindowProc(hwnd, message, wParam, lParam);
|
||||
|
||||
DrawEdge(hdc, &rect1, BDR_SUNKENOUTER, (activeTool == 6) ? BF_RECT : BF_RECT | BF_MIDDLE);
|
||||
DrawEdge(hdc, &rect2, (activeTool >= 13) ? BDR_SUNKENOUTER : 0, BF_RECT | BF_MIDDLE);
|
||||
switch (activeTool)
|
||||
{
|
||||
HDC hdc = GetDC(hwnd);
|
||||
int rectang[4] = {0, 0, 42, 66};
|
||||
int rectang2[4] = {0, 70, 42, 136};
|
||||
|
||||
DefWindowProc (hwnd, message, wParam, lParam);
|
||||
|
||||
if (activeTool!=6)
|
||||
DrawEdge(hdc, (LPRECT)&rectang, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
|
||||
else
|
||||
DrawEdge(hdc, (LPRECT)&rectang, BDR_SUNKENOUTER, BF_RECT);
|
||||
if (activeTool>=13)
|
||||
DrawEdge(hdc, (LPRECT)&rectang2, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
|
||||
else
|
||||
DrawEdge(hdc, (LPRECT)&rectang2, 0, BF_RECT | BF_MIDDLE);
|
||||
switch (activeTool)
|
||||
case 1:
|
||||
case 2:
|
||||
case 10:
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 10:
|
||||
{
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, transpBg*31+2, 41, transpBg*31+33);
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
DrawIconEx(hdc, 1, 2, hNontranspIcon, 40, 30, 0, NULL, DI_NORMAL);
|
||||
DrawIconEx(hdc, 1, 33, hTranspIcon, 40, 30, 0, NULL, DI_NORMAL);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
if (rubberRadius==i+2)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 14, i*15+2, 29, i*15+17);
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
|
||||
} else SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
|
||||
Rectangle(hdc, 19-i, i*14+7, 24+i, i*16+12);
|
||||
}
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, brushStyle%3*13+2, brushStyle/3*15+2, brushStyle%3*13+15, brushStyle/3*15+17);
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
for (i=0; i<12; i++)
|
||||
if (i==brushStyle)
|
||||
Brush(hdc, i%3*13+7, i/3*15+8, i%3*13+7, i/3*15+8, GetSysColor(COLOR_HIGHLIGHTTEXT), i);
|
||||
else
|
||||
Brush(hdc, i%3*13+7, i/3*15+8, i%3*13+7, i/3*15+8, GetSysColor(COLOR_WINDOWTEXT), i);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
switch (airBrushWidth)
|
||||
{
|
||||
case 5:
|
||||
Rectangle(hdc, 2, 2, 21, 31);
|
||||
break;
|
||||
case 8:
|
||||
Rectangle(hdc, 20, 2, 41, 31);
|
||||
break;
|
||||
case 3:
|
||||
Rectangle(hdc, 2, 30, 16, 61);
|
||||
break;
|
||||
case 12:
|
||||
Rectangle(hdc, 15, 30, 41, 61);
|
||||
break;
|
||||
}
|
||||
if (airBrushWidth==5)
|
||||
Airbrush(hdc, 10, 15, GetSysColor(COLOR_HIGHLIGHTTEXT), 5);
|
||||
else
|
||||
Airbrush(hdc, 10, 15, GetSysColor(COLOR_WINDOWTEXT), 5);
|
||||
if (airBrushWidth==8)
|
||||
Airbrush(hdc, 30, 15, GetSysColor(COLOR_HIGHLIGHTTEXT), 8);
|
||||
else
|
||||
Airbrush(hdc, 30, 15, GetSysColor(COLOR_WINDOWTEXT), 8);
|
||||
if (airBrushWidth==3)
|
||||
Airbrush(hdc, 8, 45, GetSysColor(COLOR_HIGHLIGHTTEXT), 3);
|
||||
else
|
||||
Airbrush(hdc, 8, 45, GetSysColor(COLOR_WINDOWTEXT), 3);
|
||||
if (airBrushWidth==12)
|
||||
Airbrush(hdc, 27, 45, GetSysColor(COLOR_HIGHLIGHTTEXT), 12);
|
||||
else
|
||||
Airbrush(hdc, 27, 45, GetSysColor(COLOR_WINDOWTEXT), 12);
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
for (i=0; i<5; i++)
|
||||
{
|
||||
if (lineWidth==i+1)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, i*12+2, 41, i*12+14);
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
|
||||
} else SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
|
||||
Rectangle(hdc, 5, i*12+6, 38, i*12+8+i);
|
||||
}
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
for (i=0; i<3; i++)
|
||||
{
|
||||
if (shapeStyle==i)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, i*20+2, 41, i*20+22);
|
||||
}
|
||||
}
|
||||
if (shapeStyle==0)
|
||||
Rect(hdc, 5, 6, 37, 16, GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 0);
|
||||
else
|
||||
Rect(hdc, 5, 6, 37, 16, GetSysColor(COLOR_WINDOWTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 0);
|
||||
if (shapeStyle==1)
|
||||
Rect(hdc, 5, 26, 37, 36, GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 1);
|
||||
else
|
||||
Rect(hdc, 5, 26, 37, 36, GetSysColor(COLOR_WINDOWTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 1);
|
||||
Rect(hdc, 5, 46, 37, 56, GetSysColor(COLOR_APPWORKSPACE), GetSysColor(COLOR_APPWORKSPACE), 1, 1);
|
||||
for (i=0; i<5; i++)
|
||||
{
|
||||
if (lineWidth==i+1)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, i*12+72, 41, i*12+84);
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
|
||||
} else SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
|
||||
Rectangle(hdc, 5, i*12+76, 38, i*12+78+i);
|
||||
}
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
}
|
||||
break;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, transpBg * 31 + 2, 41, transpBg * 31 + 33);
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
DrawIconEx(hdc, 1, 2, hNontranspIcon, 40, 30, 0, NULL, DI_NORMAL);
|
||||
DrawIconEx(hdc, 1, 33, hTranspIcon, 40, 30, 0, NULL, DI_NORMAL);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
if (rubberRadius == i + 2)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 14, i * 15 + 2, 29, i * 15 + 17);
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
|
||||
}
|
||||
else
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
|
||||
Rectangle(hdc, 19 - i, i * 14 + 7, 24 + i, i * 16 + 12);
|
||||
}
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, brushStyle % 3 * 13 + 2, brushStyle / 3 * 15 + 2, brushStyle % 3 * 13 + 15,
|
||||
brushStyle / 3 * 15 + 17);
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
for(i = 0; i < 12; i++)
|
||||
Brush(hdc, i % 3 * 13 + 7, i / 3 * 15 + 8, i % 3 * 13 + 7, i / 3 * 15 + 8,
|
||||
GetSysColor((i == brushStyle) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), i);
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
switch (airBrushWidth)
|
||||
{
|
||||
case 5:
|
||||
Rectangle(hdc, 2, 2, 21, 31);
|
||||
break;
|
||||
case 8:
|
||||
Rectangle(hdc, 20, 2, 41, 31);
|
||||
break;
|
||||
case 3:
|
||||
Rectangle(hdc, 2, 30, 16, 61);
|
||||
break;
|
||||
case 12:
|
||||
Rectangle(hdc, 15, 30, 41, 61);
|
||||
break;
|
||||
}
|
||||
Airbrush(hdc, 10, 15,
|
||||
GetSysColor((airBrushWidth == 5) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 5);
|
||||
Airbrush(hdc, 30, 15,
|
||||
GetSysColor((airBrushWidth == 8) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 8);
|
||||
Airbrush(hdc, 8, 45,
|
||||
GetSysColor((airBrushWidth == 3) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 3);
|
||||
Airbrush(hdc, 27, 45,
|
||||
GetSysColor((airBrushWidth == 12) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 12);
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
for(i = 0; i < 5; i++)
|
||||
{
|
||||
if (lineWidth == i + 1)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, i * 12 + 2, 41, i * 12 + 14);
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
|
||||
}
|
||||
else
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
|
||||
Rectangle(hdc, 5, i * 12 + 6, 38, i * 12 + 8 + i);
|
||||
}
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
{
|
||||
int i;
|
||||
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
if (shapeStyle == i)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, i * 20 + 2, 41, i * 20 + 22);
|
||||
}
|
||||
}
|
||||
Rect(hdc, 5, 6, 37, 16,
|
||||
GetSysColor((shapeStyle == 0) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT),
|
||||
GetSysColor(COLOR_APPWORKSPACE), 1, 0);
|
||||
Rect(hdc, 5, 26, 37, 36,
|
||||
GetSysColor((shapeStyle == 1) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT),
|
||||
GetSysColor(COLOR_APPWORKSPACE), 1, 1);
|
||||
Rect(hdc, 5, 46, 37, 56, GetSysColor(COLOR_APPWORKSPACE), GetSysColor(COLOR_APPWORKSPACE),
|
||||
1, 1);
|
||||
for(i = 0; i < 5; i++)
|
||||
{
|
||||
if (lineWidth == i + 1)
|
||||
{
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
Rectangle(hdc, 2, i * 12 + 72, 41, i * 12 + 84);
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
|
||||
}
|
||||
else
|
||||
SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
|
||||
Rectangle(hdc, 5, i * 12 + 76, 38, i * 12 + 78 + i);
|
||||
}
|
||||
DeleteObject(SelectObject(hdc, oldPen));
|
||||
break;
|
||||
}
|
||||
ReleaseDC(hwnd, hdc);
|
||||
}
|
||||
ReleaseDC(hwnd, hdc);
|
||||
break;
|
||||
}
|
||||
case WM_LBUTTONDOWN:
|
||||
{
|
||||
switch (activeTool)
|
||||
{
|
||||
switch (activeTool)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 10:
|
||||
if ((HIWORD(lParam)>1)&&(HIWORD(lParam)<64))
|
||||
case 1:
|
||||
case 2:
|
||||
case 10:
|
||||
if ((HIWORD(lParam) > 1) && (HIWORD(lParam) < 64))
|
||||
{
|
||||
transpBg = (HIWORD(lParam) - 2) / 31;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((HIWORD(lParam) > 1) && (HIWORD(lParam) < 62))
|
||||
{
|
||||
rubberRadius = (HIWORD(lParam) - 2) / 15 + 2;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if ((LOWORD(lParam) > 1) && (LOWORD(lParam) < 40) && (HIWORD(lParam) > 1)
|
||||
&& (HIWORD(lParam) < 62))
|
||||
{
|
||||
brushStyle = (HIWORD(lParam) - 2) / 15 * 3 + (LOWORD(lParam) - 2) / 13;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (HIWORD(lParam) < 62)
|
||||
{
|
||||
if (HIWORD(lParam) < 30)
|
||||
{
|
||||
transpBg = (HIWORD(lParam)-2)/31;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
if (LOWORD(lParam) < 20)
|
||||
airBrushWidth = 5;
|
||||
else
|
||||
airBrushWidth = 8;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((HIWORD(lParam)>1)&&(HIWORD(lParam)<62))
|
||||
else
|
||||
{
|
||||
rubberRadius = (HIWORD(lParam)-2)/15+2;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
if (LOWORD(lParam) < 15)
|
||||
airBrushWidth = 3;
|
||||
else
|
||||
airBrushWidth = 12;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if ((LOWORD(lParam)>1)&&(LOWORD(lParam)<40)&&(HIWORD(lParam)>1)&&(HIWORD(lParam)<62))
|
||||
{
|
||||
brushStyle = (HIWORD(lParam)-2)/15*3+(LOWORD(lParam)-2)/13;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (HIWORD(lParam)<62)
|
||||
{
|
||||
if (HIWORD(lParam)<30)
|
||||
{
|
||||
if (LOWORD(lParam)<20) airBrushWidth=5; else airBrushWidth=8;
|
||||
}else
|
||||
{
|
||||
if (LOWORD(lParam)<15) airBrushWidth=3; else airBrushWidth=12;
|
||||
}
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
if (HIWORD(lParam)<=62)
|
||||
{
|
||||
lineWidth = (HIWORD(lParam)-2)/12+1;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
if (HIWORD(lParam)<=60)
|
||||
{
|
||||
shapeStyle = (HIWORD(lParam)-2)/20;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
if ((HIWORD(lParam)>=70)&&(HIWORD(lParam)<=132))
|
||||
{
|
||||
lineWidth = (HIWORD(lParam)-72)/12+1;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
if (HIWORD(lParam) <= 62)
|
||||
{
|
||||
lineWidth = (HIWORD(lParam) - 2) / 12 + 1;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
if (HIWORD(lParam) <= 60)
|
||||
{
|
||||
shapeStyle = (HIWORD(lParam) - 2) / 20;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
if ((HIWORD(lParam) >= 70) && (HIWORD(lParam) <= 132))
|
||||
{
|
||||
lineWidth = (HIWORD(lParam) - 72) / 12 + 1;
|
||||
SendMessage(hwnd, WM_PAINT, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
default:
|
||||
return DefWindowProc (hwnd, message, wParam, lParam);
|
||||
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: toolsettings.h
|
||||
* FILE: base/applications/paint/toolsettings.h
|
||||
* PURPOSE: Window procedure of the tool settings window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
LRESULT CALLBACK SettingsWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,12 +1,10 @@
|
|||
/*
|
||||
* PROJECT: PAINT for ReactOS
|
||||
* LICENSE: LGPL
|
||||
* FILE: winproc.h
|
||||
* FILE: base/applications/paint/winproc.h
|
||||
* PURPOSE: Window procedure of the main window and all children apart from
|
||||
* hPalWin, hToolSettings and hSelection
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
*/
|
||||
|
||||
void ZoomTo(int newZoom);
|
||||
|
||||
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue