|
From: <cre...@us...> - 2007-01-16 19:22:52
|
Revision: 1602
http://svn.sourceforge.net/frontierkernel/?rev=1602&view=rev
Author: creecode
Date: 2007-01-16 11:22:52 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
support for long odb item names and file paths
formatting tweaks
Modified Paths:
--------------
Frontier/branches/Frontier_Long_File_Paths/Common/source/cancoonpopup.c
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/cancoonpopup.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/cancoonpopup.c 2007-01-16 19:17:45 UTC (rev 1601)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/cancoonpopup.c 2007-01-16 19:22:52 UTC (rev 1602)
@@ -44,7 +44,6 @@
#include "cancooninternal.h"
-
typedef struct agentpopupinfo {
hdlmenu hagentmenu;
@@ -52,12 +51,19 @@
short checkedagentitem;
short ctagentsvisited;
+
} tyagentpopupinfo, *ptragentpopupinfo;
-static boolean ccagentpopupvisit (bigstring bsname, hdlhashnode hnode, tyvaluerecord val, ptrvoid refcon) {
-#pragma unused (hnode)
+static boolean ccagentpopupvisit ( const Handle handleName, hdlhashnode hnode, tyvaluerecord val, ptrvoid refcon ) {
+ //
+ // 2007-01-16 creedon: support for long odb item names and file paths
+ //
+
+ #pragma unused (hnode)
+
+ bigstring bsname;
hdltreenode hcode;
ptragentpopupinfo info = (ptragentpopupinfo) refcon;
@@ -72,7 +78,10 @@
if ((*info).hagentmenu == nil) /*not filling out a menu*/
return (false);
- return (!pushpopupitem ((*info).hagentmenu, bsname, true, 0)); /*terminate visit on error*/
+ texthandletostring ( handleName, bsname );
+
+ return ( ! pushpopupitem ( ( *info ).hagentmenu, bsname, true, 0 ) ); // terminate visit on error
+
} /*ccagentpopupvisit*/
@@ -89,33 +98,39 @@
info.ctagentsvisited = 0;
- if (hashsortedinversesearch (agentstable, &ccagentpopupvisit, &info))
- return (false);
+ if ( hashsortedinversesearch ( agentstable, &ccagentpopupvisit, &info ) )
+ return ( false );
*checkeditem = info.checkedagentitem;
return (true);
+
} /*ccfillagentpopup*/
-static boolean ccagentselectvisit (bigstring bsname, hdlhashnode hnode, tyvaluerecord val, ptrvoid refcon) {
+static boolean ccagentselectvisit ( Handle handleName, hdlhashnode hnode, tyvaluerecord val, ptrvoid refcon ) {
+
+ //
+ // 2007-01-16 creedon: support for long odb item names and file paths
+ //
+ // 1991-12-28 dmb: when an agent is selected and it's code isn't found,
+ // install it
+ //
+ // 1991-06-28 dmb: never toggle agent off; selecting current agent does
+ // nothing
+ //
- /*
- 6/28/91 dmb: never toggle agent off; selecting current agent does nothing
-
- 12/28/91 dmb: when an agent is selected and it's code isn't found, install it
- */
-
+ bigstring bs;
hdltreenode hcode;
- bigstring bs;
- ptragentpopupinfo info = (ptragentpopupinfo) refcon;
+ ptragentpopupinfo info = ( ptragentpopupinfo ) refcon;
- if (!langexternalvaltocode (val, &hcode)) /*not a scipt*/
+ if (!langexternalvaltocode (val, &hcode)) // not a scipt
return (false);
+
+ if (++(*info).ctagentsvisited == (*info).checkedagentitem) {
- if (++(*info).ctagentsvisited == (*info).checkedagentitem) {
+ register hdlcancoonrecord hc = cancoondata;
- register hdlcancoonrecord hc = cancoondata;
hdlprocessrecord hprocess;
/*
@@ -124,33 +139,35 @@
else
*/
- (**hc).hprimaryagent = hcode;
+ (**hc).hprimaryagent = hcode;
+
+ if ((*info).hagentmenu != nil) { // responding to a menu click
- if ((*info).hagentmenu != nil) { /*responding to a menu click*/
-
if (processfindcode (hcode, &hprocess))
copystring ((**hprocess).bsmsg, bs);
-
+
else {
-
scriptinstallagent (hnode);
copystring ((ptrstring) "\x01" " ", bs);
+
}
+
+ ccmsg (bs, false); // update existing message
- ccmsg (bs, false); /*update existing message*/
+ ccmsg (zerostring, false); // unblock agents
- ccmsg (zerostring, false); /*unblock agents*/
-
if (keyboardstatus.floptionkey || optionkeydown ())
- langexternalzoom (val, agentstable, bsname);
+ langexternalzoom ( val, agentstable, &handleName );
}
+
+ return (true); // we're done, stop visiting
- return (true); /*we're done, stop visiting*/
}
+
+ return (false); // keep visiting
- return (false); /*keep visiting*/
- } /*ccagentselectvisit*/
+ } // ccagentselectvisit
static boolean ccagentpopupselect (hdlmenu hmenu, short itemselected) {
@@ -197,6 +214,7 @@
boolean ccgetprimaryagent (short *ixagent) {
return (ccfillagentpopup (nil, ixagent));
+
} /*ccgetprimaryagent*/
@@ -207,6 +225,7 @@
ixagent = 1;
return (ccagentpopupselect (nil, ixagent));
+
} /*ccsetprimaryagent*/
@@ -221,8 +240,6 @@
}
return (true);
+
} /*cccodereplaced*/
-
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|