Subversion Repositories filter_foundry

Compare Revisions

Regard whitespace Rev 459 → Rev 460

/trunk/slider_win.c
97,6 → 97,10
}
}
 
LRESULT CALLBACK DummyWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
 
Boolean MakeSimpleSubclass(LPCTSTR targetClass, LPCTSTR sourceClass) {
WNDCLASS clx;
 
114,9 → 118,37
}
}
else {
if ((xstrcmp(sourceClass, WC_BUTTON) == 0) || (xstrcmp(sourceClass, WC_STATIC) == 0)) {
// GetClassInfo(WC_STATIC) and GetClassInfo(WC_BUTTON) fail on Win32s (Windows 3.11)
// So we create a fake-class now. It will be replaced with the real Button/Static WndProc later!
clx.style = 0;
clx.lpfnWndProc = DummyWndProc;
clx.cbClsExtra = 0;
clx.cbWndExtra = 0;
clx.hInstance = hDllInstance;
clx.hIcon = 0;
clx.hCursor = 0;
clx.hbrBackground = 0;
clx.lpszMenuName = 0;
clx.lpszClassName = targetClass;
 
if (RegisterClass(&clx) == 0) {
TCHAR s[0x300];
xstrcpy(s, (TCHAR*)TEXT("RegisterClass failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
return false;
}
else {
return true;
}
}
else {
simplealert(TEXT("GetClassInfo failed"));
}
return false;
}
}
 
void Slider_Uninit_PluginDll() {
 
200,5 → 232,5
 
Boolean Slider_Init_None(LPCTSTR targetClass) {
// Make "FoundrySlider" a subclass of "STATIC" (making it invisible)
return MakeSimpleSubclass(targetClass, TEXT("STATIC"));
return MakeSimpleSubclass(targetClass, WC_STATIC);
}
/trunk/telegraphics_common/tt/str.c
43,6 → 43,9
int xstrcasecmp(const wchar_t* a, const wchar_t* b) {
return _wcsicmp(a, b);
}
int xstrcmp(const wchar_t* a, const wchar_t* b) {
return lstrcmpW(a, b);
}
#else
size_t xstrlen(char* s) {
return strlen(s);
60,6 → 63,9
//return strcasecmp(a, b);
return _stricmp(a, b);
}
int xstrcmp(const char* a, const char* b) {
return strcmp(a, b);
}
#endif
 
// convert C (null-terminated) to Pascal (length byte) string
/trunk/telegraphics_common/tt/str.h
26,6 → 26,7
wchar_t* xstrcat(wchar_t* dst, const wchar_t* src);
wchar_t* xstrrchr(wchar_t* const _Str, const int _Ch);
int xstrcasecmp(const wchar_t* a, const wchar_t* b);
int xstrcmp(const wchar_t* a, const wchar_t* b);
#else
size_t xstrlen(char* s);
char* xstrcpy(char* dst, char* src);
32,6 → 33,7
char* xstrcat(char* dst, const char* src);
char* xstrrchr(char* const _Str, const int _Ch);
int xstrcasecmp(const char* a, const char* b);
int xstrcmp(const char* a, const char* b);
#endif
 
unsigned char *myc2pstr(char *s);
/trunk/ui_win.c
232,6 → 232,8
extern Boolean doupdates;
extern Handle preview_handle;
 
WNDPROC wndProcStatic, wndProcButton;
 
if ((gdata->pluginDllSliderMessageId != 0) && (wMsg == gdata->pluginDllSliderMessageId)) {
// This is for the PLUGIN.DLL sliders only
if (doupdates) {
322,6 → 324,20
 
maindlginit(hDlg);
 
// Win32s (Win3.11) compatibility fix: Since GetClassInfo("Button") and GetClassInfo("Static") won't work,
// we had replaced the WndProc by a dummy. Now, we find out the real Button and Static WndProcs and give them
// to our classes, making them the intended superclasses. Messages which have been sent in between were lost,
// though...
 
wndProcStatic = (WNDPROC)GetWindowLongPtr(GetDlgItem(hDlg, FIRSTCTLLABELITEM), GWLP_WNDPROC);
SetWindowLongPtr(GetDlgItem(hDlg, PREVIEWITEM), GWLP_WNDPROC, (LONG)wndProcStatic);
 
wndProcButton = (WNDPROC)GetWindowLongPtr(GetDlgItem(hDlg, OPENITEM), GWLP_WNDPROC);
SetWindowLongPtr(GetDlgItem(hDlg, FIRSTICONITEM), GWLP_WNDPROC, (LONG)wndProcButton);
SetWindowLongPtr(GetDlgItem(hDlg, FIRSTICONITEM + 1), GWLP_WNDPROC, (LONG)wndProcButton);
SetWindowLongPtr(GetDlgItem(hDlg, FIRSTICONITEM + 2), GWLP_WNDPROC, (LONG)wndProcButton);
SetWindowLongPtr(GetDlgItem(hDlg, FIRSTICONITEM + 3), GWLP_WNDPROC, (LONG)wndProcButton);
 
// Some versions of Windows (NT 3.x) won't show the preview if it is calculated here.
// So we need to put it in a timer.
// Note that 1 millisecond is enough, even if the window needs longer than 1 millisecond to load.
428,14 → 444,13
}
 
// For the preview image and caution symbols, we register subclasses, so that we can assign a mouse cursor to this class.
MakeSimpleSubclass(TEXT("Preview"), TEXT("STATIC"));
MakeSimpleSubclass(TEXT("Caution"), TEXT("Button"));
MakeSimpleSubclass(TEXT("Preview"), WC_STATIC);
MakeSimpleSubclass(TEXT("Caution"), WC_BUTTON);
 
// Now show the dialog
p = (PlatformData*)pb->platformData;
 
// Note: "Invalid Cursor Handle" is the error when an unrecognized control class is detected
// TODO: Win 3.1 mit Win32s: "The parameter is incorrect"
res = DialogBoxParam(hDllInstance,MAKEINTRESOURCE(gdata->standalone ? ID_PARAMDLG : ID_MAINDLG),
(HWND)p->hwnd,maindlgproc,0);
if (res == 0) {
/trunk/ui_win.rc
45,12 → 45,12
BEGIN
DEFPUSHBUTTON "OK", IDOK, 260, 253, 42, 14
 
/* "Preview" is a subclass of "STATIC", defined in ui_win.c */
/* "Preview" is a subclass of "Static", defined in ui_win.c */
CONTROL "", PREVIEWITEM, "Preview", SS_OWNERDRAW|SS_NOTIFY|SS_SUNKEN, 15,10, 100,100
 
CONTROL "+", ZOOMINITEM, "Button", BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 102,115, 14,12
CONTROL "-", ZOOMOUTITEM, "Button", BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 15,115, 14,12
CONTROL "", ZOOMLEVELITEM, "Button", BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 38,115, 55,12
CONTROL "+", ZOOMINITEM, BUTTON, BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 102,115, 14,12
CONTROL "-", ZOOMOUTITEM, BUTTON, BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 15,115, 14,12
CONTROL "", ZOOMLEVELITEM, BUTTON, BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 38,115, 55,12
 
LTEXT "ctl(0)",FIRSTCTLLABELITEM, 129, 10, 25,12
LTEXT "ctl(1)",FIRSTCTLLABELITEM+1, 129, 25, 25,12
110,12 → 110,12
BEGIN
DEFPUSHBUTTON "OK", IDOK, 256,137, 42,14
 
/* "Preview" is a subclass of "STATIC", defined in ui_win.c */
/* "Preview" is a subclass of "Static", defined in ui_win.c */
CONTROL "", PREVIEWITEM, "Preview",SS_OWNERDRAW|SS_NOTIFY|SS_SUNKEN, 15,10, 100,100
 
CONTROL "+", ZOOMINITEM, "Button", BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 103,115, 12,12
CONTROL "-", ZOOMOUTITEM, "Button", BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 15,115, 12,12
CONTROL "", ZOOMLEVELITEM, "Button", BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 37,115, 56,12
CONTROL "+", ZOOMINITEM, BUTTON, BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 103,115, 12,12
CONTROL "-", ZOOMOUTITEM, BUTTON, BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 15,115, 12,12
CONTROL "", ZOOMLEVELITEM, BUTTON, BS_PUSHBUTTON | BS_CENTER | BS_FLAT | WS_CHILD | WS_VISIBLE, 37,115, 56,12
 
LTEXT "ctl(0)",FIRSTCTLLABELITEM, 129, 10, 25,12
LTEXT "ctl(1)",FIRSTCTLLABELITEM+1, 129, 25, 25,12