|
From: Andre R. <and...@us...> - 2004-11-30 13:04:31
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3189/Common/source Modified Files: Tag: sidewinder-branch scripts.c shellwindow.c Log Message: First cut at getting the language selection popup menu of script windows to work on Windows. This version seems to provide the basic functionality, but there are still display glitches. The logic behind the popup turned out to be easy, the problem is to get the popup displayed without disturbing the layout of script windows too much. Index: scripts.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/scripts.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** scripts.c 28 Nov 2004 00:40:48 -0000 1.3.4.1 --- scripts.c 30 Nov 2004 13:04:21 -0000 1.3.4.2 *************** *** 3578,3582 **** ! #ifdef flcomponent typedef boolean (*tyscriptvisitcallback) (OSType, bigstring, long); --- 3578,3582 ---- ! #if defined(flcomponent) || defined(FRONTIER_PYTHON) typedef boolean (*tyscriptvisitcallback) (OSType, bigstring, long); *************** *** 3585,3599 **** static boolean scriptvisitservers (tyscriptvisitcallback visit, long refcon) { ComponentDescription desc, info; Component comp = nil; Handle hname; bigstring bsname; ! #ifdef FRONTIER_PYTHON ! // a naive attempt to inject Python into the list ! copyctopstring("Python", bsname); ! (*visit)(typePython, bsname, refcon); #endif if (!havecomponentmanager ()) return (false); --- 3585,3616 ---- static boolean scriptvisitservers (tyscriptvisitcallback visit, long refcon) { + #ifdef flcomponent ComponentDescription desc, info; Component comp = nil; Handle hname; + #else + long comp = nil; + #endif bigstring bsname; ! ! #ifndef flcomponent ! ! langgetstringlist (usertalkcomponentstring, bsname); ! ! if (!(*visit)(typeLAND, bsname, refcon)) ! return (false); ! ! #endif ! #ifdef FRONTIER_PYTHON ! ! // a naive attempt to inject Python into the list ! if (!(*visit)(typePython, "\x06" "Python", refcon)) ! return (false); ! #endif + #ifdef flcomponent + if (!havecomponentmanager ()) return (false); *************** *** 3630,3633 **** --- 3647,3652 ---- disposehandle (hname); + + #endif return (comp == nil); /*true if all components visited*/ *************** *** 3706,3710 **** } /*scriptfillserverpopup*/ ! #endif #define flstacktrace 0 --- 3725,3729 ---- } /*scriptfillserverpopup*/ ! #endif /*flcomponent || FRONTIER_PYTHON*/ #define flstacktrace 0 *************** *** 3856,3861 **** #endif ! #ifdef flcomponent ! serverarray = (long *) NewPtr (sizeof (long) * 100); if (popupmenuhit (rmsg, flgeneva9, &scriptfillserverpopup, &scriptserverpopupselect)) { --- 3875,3880 ---- #endif ! #if defined(flcomponent) || defined(FRONTIER_PYTHON) ! serverarray = (long *) malloc (sizeof (long) * 100); if (popupmenuhit (rmsg, flgeneva9, &scriptfillserverpopup, &scriptserverpopupselect)) { *************** *** 3866,3870 **** } ! DisposePtr ((Ptr) serverarray); #endif } --- 3885,3889 ---- } ! free ((Ptr) serverarray); #endif } *************** *** 4041,4045 **** cbd.signature = signature; ! #ifdef flcomponent scriptvisitservers (&scriptfindsubtypevisit, (long) &cbd); #endif --- 4060,4064 ---- cbd.signature = signature; ! #if defined(flcomponent) || defined(FRONTIER_PYTHON) scriptvisitservers (&scriptfindsubtypevisit, (long) &cbd); #endif *************** *** 4071,4075 **** */ ! #ifdef flcomponent tyfindservercallbackdata cbd; --- 4090,4094 ---- */ ! #if defined(flcomponent) || defined(FRONTIER_PYTHON) tyfindservercallbackdata cbd; *************** *** 4095,4101 **** 7.0b26 PBS: update the script language popup on Macs only -- since it doesn't exist on Windows. This was the site of a display glitch on Windows. */ ! #ifdef MACVERSION scriptupdateserverpopup (); --- 4114,4122 ---- 7.0b26 PBS: update the script language popup on Macs only -- since it doesn't exist on Windows. This was the site of a display glitch on Windows. + + 2004-11-30 aradke: script language popup for Python on Windows */ ! #if defined(flcomponent) || defined(FRONTIER_PYTHON) scriptupdateserverpopup (); Index: shellwindow.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellwindow.c,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** shellwindow.c 1 Nov 2004 11:50:16 -0000 1.3 --- shellwindow.c 30 Nov 2004 13:04:21 -0000 1.3.4.1 *************** *** 775,781 **** r.right -= scrollbarwidth; ! if (config.flhorizscroll || config.flmessagearea) /*leave room for horiz scrollbar*/ /*7.0b26 PBS: leave room for msg, even if no scrollbar.*/ r.bottom -= scrollbarwidth; ! if ((shellglobals.buttonlist != nil) && (!(**h).flhidebuttons)) { /*window type has attached button list*/ --- 775,787 ---- r.right -= scrollbarwidth; ! if (config.flhorizscroll) /*leave room for horiz scrollbar*/ r.bottom -= scrollbarwidth; ! else if (config.flmessagearea) /*7.0b26 PBS: leave room for msg, even if no scrollbar.*/ ! #ifdef WIN95VERSION ! r.bottom -= 24; /*scrollbarwidth is always zero on Windows!*/ ! #else ! r.bottom -= scrollbarwidth; ! #endif ! if ((shellglobals.buttonlist != nil) && (!(**h).flhidebuttons)) { /*window type has attached button list*/ *************** *** 810,814 **** //messagewidth = (r.right - r.left); /*7.0b26 PBS: if no horiz scrollbar, message gets entire space.*/ ! messagerect.top = r.bottom - scrollbarwidth + 1; messagerect.left = r.left - 1; --- 816,824 ---- //messagewidth = (r.right - r.left); /*7.0b26 PBS: if no horiz scrollbar, message gets entire space.*/ ! #ifdef WIN95VERSION ! messagerect.top = r.bottom - 24 + 1; /*scrollbarwidth is always zero on Windows!*/ ! #else ! messagerect.top = r.bottom - scrollbarwidth + 1; ! #endif messagerect.left = r.left - 1; |