diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:26:30 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:32:26 +0200 |
commit | 7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch) | |
tree | b6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/src/mot | |
parent | e9a184546b18cf3b796bd560561f312934004c54 (diff) |
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/src/mot')
-rwxr-xr-x | iup/src/mot/iupmot_filedlg.c | 9 | ||||
-rwxr-xr-x | iup/src/mot/iupmot_tree.c | 14 | ||||
-rwxr-xr-x | iup/src/mot/iupunix_help.c | 2 | ||||
-rwxr-xr-x | iup/src/mot/iupunix_info.c | 19 |
4 files changed, 32 insertions, 12 deletions
diff --git a/iup/src/mot/iupmot_filedlg.c b/iup/src/mot/iupmot_filedlg.c index 0be6319..5d8ebe0 100755 --- a/iup/src/mot/iupmot_filedlg.c +++ b/iup/src/mot/iupmot_filedlg.c @@ -483,6 +483,7 @@ static int motFileDlgPopup(Ihandle* ih, int x, int y) XtVaSetValues(filebox, XmNdialogStyle, style, XmNautoUnmanage, False, + XmNresizePolicy, XmRESIZE_GROW, NULL); if (dialogtype == IUP_DIALOGDIR) @@ -620,6 +621,14 @@ static int motFileDlgPopup(Ihandle* ih, int x, int y) file_cb(ih, NULL, "INIT"); } + if (ih->userwidth && ih->userheight) + { + XtVaSetValues(dialog, + XmNwidth, (XtArgVal)(ih->userwidth), + XmNheight, (XtArgVal)(ih->userheight), + NULL); + } + if (style == XmDIALOG_MODELESS) XtPopup(dialog, XtGrabExclusive); diff --git a/iup/src/mot/iupmot_tree.c b/iup/src/mot/iupmot_tree.c index fa5ef09..0156974 100755 --- a/iup/src/mot/iupmot_tree.c +++ b/iup/src/mot/iupmot_tree.c @@ -1440,7 +1440,7 @@ static int motTreeSetDelNodeAttrib(Ihandle* ih, const char* name_id, const char* else if(iupStrEqualNoCase(value, "MARKED")) /* Delete the array of marked nodes */ { int i; - for(i = 1; i < ih->data->node_count; /* increment only if not removed */) + for(i = 0; i < ih->data->node_count; /* increment only if not removed */) { if (motTreeIsNodeSelected(ih->data->node_cache[i].node_handle)) motTreeRemoveNode(ih, ih->data->node_cache[i].node_handle, 1, 1); @@ -1770,13 +1770,13 @@ static int motTreeConvertXYToPos(Ihandle* ih, int x, int y) static void motTreeCallRightClickCb(Ihandle* ih, int x, int y) { - IFni cbRightClick = (IFni)IupGetCallback(ih, "RIGHTCLICK_CB"); - if (cbRightClick) + Widget wItem = XmObjectAtPoint(ih->handle, (Position)x, (Position)y); + if (wItem) { - int id = motTreeConvertXYToPos(ih, x, y); - if (id != -1) - cbRightClick(ih, id); - } + IFni cbRightClick = (IFni)IupGetCallback(ih, "RIGHTCLICK_CB"); + if (cbRightClick) + cbRightClick(ih, iupTreeFindNodeId(ih, wItem)); + } } static void motTreeCallRenameCb(Ihandle* ih) diff --git a/iup/src/mot/iupunix_help.c b/iup/src/mot/iupunix_help.c index 02be1da..ba268b7 100755 --- a/iup/src/mot/iupunix_help.c +++ b/iup/src/mot/iupunix_help.c @@ -26,7 +26,7 @@ int IupHelp(const char *url) if (iupStrEqualNoCase(system, "Linux") || iupStrEqualNoCase(system, "FreeBSD")) browser = "firefox"; - else if (iupStrEqualNoCase(system, "Darwin")) + else if (iupStrEqualNoCase(system, "MacOS")) browser = "safari"; else if (iupStrEqualPartial(system, "CYGWIN")) browser = "iexplore"; diff --git a/iup/src/mot/iupunix_info.c b/iup/src/mot/iupunix_info.c index f09573c..3bfee08 100755 --- a/iup/src/mot/iupunix_info.c +++ b/iup/src/mot/iupunix_info.c @@ -274,7 +274,10 @@ char *iupdrvGetSystemName(void) char *str = iupStrGetMemory(50); uname(&un); - strcpy(str, un.sysname); + if (iupStrEqualNoCase(un.sysname, "Darwin")) + strcpy(str, "MacOS"); + else + strcpy(str, un.sysname); return str; } @@ -285,9 +288,17 @@ char *iupdrvGetSystemVersion(void) char *str = iupStrGetMemory(100); uname(&un); - strcpy(str, un.release); - strcat(str, "."); - strcat(str, un.version); + if (iupStrEqualNoCase(un.sysname, "Darwin")) + { + int release = atoi(un.release); + sprintf(str, "%d", release-4); + } + else + { + strcpy(str, un.release); + strcat(str, "."); + strcat(str, un.version); + } return str; } |