diff options
author | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
commit | eed0eb6a476d54ce19aeff137984aa981d9e3976 (patch) | |
tree | 807891636efd2f87dcbd261e971216269973ae07 /iup/src/win/iupwin_common.c | |
parent | ccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff) |
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/win/iupwin_common.c')
-rwxr-xr-x | iup/src/win/iupwin_common.c | 55 |
1 files changed, 43 insertions, 12 deletions
diff --git a/iup/src/win/iupwin_common.c b/iup/src/win/iupwin_common.c index a1a7c0f..ba68b78 100755 --- a/iup/src/win/iupwin_common.c +++ b/iup/src/win/iupwin_common.c @@ -94,16 +94,17 @@ void iupdrvBaseLayoutUpdateMethod(Ihandle *ih) SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOOWNERZORDER); } -void iupdrvDisplayRedraw(Ihandle *ih) +void iupdrvRedrawNow(Ihandle *ih) { /* REDRAW Now */ - RedrawWindow(ih->handle,NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_INTERNALPAINT|RDW_NOCHILDREN|RDW_UPDATENOW); + RedrawWindow(ih->handle,NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_INTERNALPAINT|RDW_UPDATENOW); } -void iupdrvDisplayUpdate(Ihandle *ih) +void iupdrvPostRedraw(Ihandle *ih) { /* Post a REDRAW */ - RedrawWindow(ih->handle,NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_INTERNALPAINT|RDW_NOCHILDREN); + /* can NOT use RDW_NOCHILDREN because IupList has internal children that needs to be redraw */ + RedrawWindow(ih->handle,NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_INTERNALPAINT); } void iupdrvScreenToClient(Ihandle* ih, int *x, int *y) @@ -534,6 +535,8 @@ int iupdrvBaseSetZorderAttrib(Ihandle* ih, const char* value) void iupdrvSetVisible(Ihandle* ih, int visible) { + if (iupStrEqual(ih->iclass->name, "colorbar")) + ih=ih; ShowWindow(ih->handle, visible? SW_SHOWNORMAL: SW_HIDE); } @@ -618,6 +621,18 @@ char* iupdrvBaseGetClientSizeAttrib(Ihandle* ih) #define IDC_HELP MAKEINTRESOURCE(32651) #endif +static HCURSOR winLoadComCtlCursor(LPCTSTR lpCursorName) +{ + HCURSOR cur = NULL; + HINSTANCE hinstDll = LoadLibrary("comctl32.dll"); + if (hinstDll) + { + cur = LoadCursor(hinstDll, lpCursorName); + FreeLibrary(hinstDll); + } + return cur; +} + static HCURSOR winGetCursor(Ihandle* ih, const char* name) { static struct { @@ -649,7 +664,7 @@ static HCURSOR winGetCursor(Ihandle* ih, const char* name) {"APPSTARTING", IDC_APPSTARTING} }; - HCURSOR cur; + HCURSOR cur = NULL; char str[50]; int i, count = sizeof(table)/sizeof(table[0]); @@ -676,14 +691,22 @@ static HCURSOR winGetCursor(Ihandle* ih, const char* name) if (i == count) { /* check other system cursors */ - /* cursor PEN is handled here */ + if (iupStrEqualNoCase(name, "PEN")) - name = "CURSOR_PEN"; + name = "CURSOR_PEN"; /* name in "iup.rc" */ /* check for an name defined cursor */ cur = iupImageGetCursor(name); } + if (!cur) + { + if (iupStrEqualNoCase(name, "SPLITTER_VERT")) + cur = winLoadComCtlCursor(MAKEINTRESOURCE(107)); + else if (iupStrEqualNoCase(name, "SPLITTER_HORIZ")) + cur = winLoadComCtlCursor(MAKEINTRESOURCE(135)); + } + iupAttribSetStr(ih, str, (char*)cur); return cur; } @@ -758,29 +781,29 @@ int iupwinButtonUp(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp) if (msg==WM_LBUTTONUP) { b = IUP_BUTTON1; - iupKEYSETBUTTON1(status); + iupKEY_SETBUTTON1(status); } else if (msg==WM_MBUTTONUP) { b = IUP_BUTTON2; - iupKEYSETBUTTON2(status); + iupKEY_SETBUTTON2(status); } else if (msg==WM_RBUTTONUP) { b = IUP_BUTTON3; - iupKEYSETBUTTON3(status); + iupKEY_SETBUTTON3(status); } else if (msg==WM_XBUTTONUP) { if (HIWORD(wp) == XBUTTON1) { b = IUP_BUTTON4; - iupKEYSETBUTTON4(status); + iupKEY_SETBUTTON4(status); } else { b = IUP_BUTTON5; - iupKEYSETBUTTON5(status); + iupKEY_SETBUTTON5(status); } } @@ -807,6 +830,14 @@ int iupwinMouseMove(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp) return 0; } +void iupwinGetNativeParentStyle(Ihandle* ih, DWORD *dwExStyle, DWORD *dwStyle) +{ + *dwStyle |= WS_CLIPCHILDREN; + + if (iupAttribGetBoolean(IupGetDialog(ih), "COMPOSITED")) + *dwExStyle |= WS_EX_COMPOSITED; +} + int iupwinCreateWindowEx(Ihandle* ih, LPCSTR lpClassName, DWORD dwExStyle, DWORD dwStyle) { ih->serial = iupDialogGetChildId(ih); |