[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: supercollider:[8304] trunk
Revision: 8304
http://supercollider.svn.sourceforge.net/supercollider/?rev=8304&view=rev
Author: danstowell
Date: 2008-12-26 18:45:08 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
Beginnings of an ID code system for each Psycollider window, in move towards having PsycoDoc able to keep track of window.
Also bugfix in PySCLang/PySCLang_Module_GUIStuff.cpp, was "!result" when should be "result"
Modified Paths:
--------------
trunk/Psycollider/Psycollider/Psycollider.py
trunk/Psycollider/PySCLang/PySCLang_Module_GUIStuff.cpp
trunk/build/SCClassLibrary/Platform/windows/PsycolliderDocument.sc
Modified: trunk/Psycollider/Psycollider/Psycollider.py
===================================================================
--- trunk/Psycollider/Psycollider/Psycollider.py 2008-12-26 18:39:37 UTC (rev 8303)
+++ trunk/Psycollider/Psycollider/Psycollider.py 2008-12-26 18:45:08 UTC (rev 8304)
@@ -89,6 +89,8 @@
# - creates the default menus
# - asks to save a modified file when closing
# - adds file history
+# - holds an ID number for each window, for PsycolliderDocument to refer to self
+nextPsycolliderWindowId = 1
class PsycolliderWindow(wx.Frame):
config = None # wx.FileConfig object
menubar = None # wx.MenuBar object
@@ -98,11 +100,18 @@
title = "" # the window title
isModified = False # whether or not window contents have been modified
filePath = "" # path to file being displayed
+ windowId = -99
def __init__(self, parent, id, title="", winStyle=wx.DEFAULT_FRAME_STYLE):
self.title = title
self.config = wx.GetApp().config
wx.Frame.__init__(self, parent, id, title, style=winStyle)
+ global nextPsycolliderWindowId
+ windowId = nextPsycolliderWindowId
+ nextPsycolliderWindowId = nextPsycolliderWindowId + 1
+ #sys.stdout.write("windowId in pythonland is ")
+ #sys.stdout.write(str(windowId))
+ #sys.stdout.write("\n")
self.config.SetPath("/WindowSettings")
sizeX = self.config.ReadInt('DefaultSizeX', DEFAULT_SIZEX)
@@ -1036,7 +1045,7 @@
# Todo: better error handling? Just print error message for now
wx.MessageBox("Psycollider Error: Could not open file " + path)
return None
-
+
if textContent[0:5] == '{\\rtf':
win = self.NewCodeWindow()
win.codeSubWin.AddTextUTF8('Sorry, still no RTF support, wxRichTextControl does not yet support reading RTF files...')
@@ -1188,6 +1197,7 @@
else:
codeWin = wx.GetApp().OpenFile(path)
#codeWin.SelectRange(rangeStart,rangeSize)
+ return codeWin
# ---------------------------------------------------------------------
# Main
Modified: trunk/Psycollider/PySCLang/PySCLang_Module_GUIStuff.cpp
===================================================================
--- trunk/Psycollider/PySCLang/PySCLang_Module_GUIStuff.cpp 2008-12-26 18:39:37 UTC (rev 8303)
+++ trunk/Psycollider/PySCLang/PySCLang_Module_GUIStuff.cpp 2008-12-26 18:45:08 UTC (rev 8304)
@@ -51,9 +51,9 @@
return errCantCallOS;
PyrSlot *d = g->sp - 3;
- PyrSlot *a = g->sp - 2;
- PyrSlot *b = g->sp - 1;
- PyrSlot *c = g->sp; // tagObj for
+ PyrSlot *a = g->sp - 2; // path
+ PyrSlot *b = g->sp - 1; // rangeStart
+ PyrSlot *c = g->sp; // rangeSize
int rangeStart, rangeSize;
@@ -89,13 +89,13 @@
PyTuple_SetItem(tuple,2,pyRangeSize);
/* make the Python call thread safe (global interpreter clock) */
- PyGILState_STATE gstate;
+ PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
- PyObject* result = PyObject_Call(PySCLang_Module::PyPrOpenWinTextFile_s,tuple,NULL);
+ PyObject* result = PyObject_Call(PySCLang_Module::PyPrOpenWinTextFile_s,tuple,NULL);
PyGILState_Release(gstate);
result = PyErr_Occurred( );
- if (!result) {
+ if (result) {
post("logSink call failed, result: %d\n", result);
return errFailed;
}
@@ -106,7 +106,7 @@
}
//NSString *nsstring = [NSString stringWithCString: string->s length: string->size];
- //SetPtr(d->uo->slots + 0, doc); // what should we do with this
+ // SetInt(a, result---->window->Id);
return errNone;
}
Modified: trunk/build/SCClassLibrary/Platform/windows/PsycolliderDocument.sc
===================================================================
--- trunk/build/SCClassLibrary/Platform/windows/PsycolliderDocument.sc 2008-12-26 18:39:37 UTC (rev 8303)
+++ trunk/build/SCClassLibrary/Platform/windows/PsycolliderDocument.sc 2008-12-26 18:45:08 UTC (rev 8304)
@@ -4,7 +4,8 @@
doesn't connect to all of psyco's potential.
*/
PsycolliderDocument : Document {
- var <path;
+ var <path,
+ <id; // Should be the "windowId" used in psycollider to uniquely identify the window
*initClass{
Document.implementationClass = PsycolliderDocument;
@@ -19,11 +20,11 @@
tempFile = File(path, "w");
tempFile.write(string);
tempFile.close;
- path.openWinTextFile;
+ id = path.openWinTextFile;
}
*findHelpFile { |str|
^Help.findHelpFile(str)
}
}
-
\ No newline at end of file
+
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/