[commit] r89 - in sofaswitch/trunk/callflow: bitmaps src
Author: derek Date: Wed Sep 13 17:55:05 2006 New Revision: 89 Modified: sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm sofaswitch/trunk/callflow/src/dnd.h sofaswitch/trunk/callflow/src/starthere.cpp sofaswitch/trunk/callflow/src/stoptimer.cpp sofaswitch/trunk/callflow/src/stoptimer.h sofaswitch/trunk/callflow/src/timer.cpp sofaswitch/trunk/callflow/src/timer.h Log: Improve stop timer bitmap. Get stoptimer widget & handler to operate correctly. Tidy up format of output code. Modified: sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm ============================================================================== --- sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm (original) +++ sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm Wed Sep 13 17:55:05 2006 @@ -1,25 +1,24 @@ /* XPM */ static char *stoptimer[]={ -"16 16 6 1", +"16 16 5 1", +"c c None", ". c None", -"# c #000000", -"d c #303030", -"c c #800000", -"b c #c0c0c0", -"a c #ffffff", -"................", -"......#####.....", -"....##aaaaa##...", -"...#baaa#aaab#..", -"################", -"ccc#ccc#ccc#ccc#", -"c####c##c#c#c#c#", -"ccc##c##c#c#ccc#", -"ddc##c##c#c#c###", -"ccc##c##ccc#c###", -"##d#############", -"...#baaaaaaab#..", -"....##aaaaa##...", -"......#####.....", -"................", -"................"}; +"a c #000000", +"# c #ff0000", +"b c #ffffff", +".#.#.........#.#", +"#.#.#.aaaaa.#.#.", +".#.#a#bbbbb#a#.#", +"..#a#b#bab#b#a#.", +"...#b#b#a#b#b#..", +"..ab#b#b#b#b#ba.", +"..abb#b#a#b#bba.", +"..abbb#a#b#bbba.", +"..abb#b#a#b#bba.", +"..ab#b#bab#b#ba.", +"...#b#b#b#b#b#..", +"..#c#b#bbb#b#a#.", +".#.#a#bbbbb#a#.#", +"#c#.#.aaaaa.#.#.", +".c.#.........#.#", +".#.............."}; Modified: sofaswitch/trunk/callflow/src/dnd.h ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.h (original) +++ sofaswitch/trunk/callflow/src/dnd.h Wed Sep 13 17:55:05 2006 @@ -313,7 +313,7 @@ /**Get the name of this shape, based on the "kind" variable that describes which particular shape we are */ - wxString GetName() const { return GetKindName(GetKind()); } + virtual wxString GetName() const { return GetKindName(GetKind()); } /** Used to report the name of this particular class. */ static wxString GetKindName() Modified: sofaswitch/trunk/callflow/src/starthere.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/starthere.cpp (original) +++ sofaswitch/trunk/callflow/src/starthere.cpp Wed Sep 13 17:55:05 2006 @@ -63,8 +63,8 @@ wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxString::Format(" \"Output\" : ")); + file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); file.AddLine(wxString::Format(" },")); Modified: sofaswitch/trunk/callflow/src/stoptimer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/stoptimer.cpp (original) +++ sofaswitch/trunk/callflow/src/stoptimer.cpp Wed Sep 13 17:55:05 2006 @@ -18,10 +18,8 @@ ///////////////////////////////////////////////////////////////////////////// DndShapeStopTimer::DndShapeStopTimer() - : DndShapeTimer() + : DndShapeTimer(StopTimer) { - kind = StopTimer; - InformationData::iterator it = displayData.begin(); while (it != displayData.end()) { InformationData::iterator it_del = it; @@ -55,7 +53,7 @@ { file.AddLine(" def Stop_Timer(self, sTuple): "); file.AddLine(" a,b,c = sTuple"); - file.AddLine(" killTimer = self.data[a][\"Timer label\"]"); + file.AddLine(" killTimer = self.data[a][\"Stop Timer label\"]"); file.AddLine(" self.DeleteThisEvent(killTimer) "); file.AddLine(" return self.data[a][\"Output\"]"); file.AddLine(""); @@ -65,22 +63,22 @@ bool DndShapeStopTimer::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format("\"%s\" : { ", GetKey().c_str())); + file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); wxNode *inputNode = (wxNode *)GetInputPoints().GetFirst(); const wxString & inputLabel = ((LabelledPoint *)inputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Input\" : ")); - file.AddLine(wxString::Format(" %s, ", inputLabel.c_str())); + file.AddLine(wxString::Format(" \"Input\" : ")); + file.AddLine(wxString::Format(" %s, ", inputLabel.c_str())); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxString::Format(" \"Output\" : ")); + file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); - file.AddLine(wxString::Format(" \"Stop Timer label\" : ")); - file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str())); + file.AddLine(wxString::Format(" \"Stop Timer label\" : ")); + file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str())); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxString::Format(" },")); return true; } Modified: sofaswitch/trunk/callflow/src/stoptimer.h ============================================================================== --- sofaswitch/trunk/callflow/src/stoptimer.h (original) +++ sofaswitch/trunk/callflow/src/stoptimer.h Wed Sep 13 17:55:05 2006 @@ -25,6 +25,9 @@ /** Used to report the name of this particular class. */ static wxString GetKindName() { return wxString("Stop Timer"); } + /** Used to report the name of this particular class. */ + virtual wxString GetName() { return wxString("Stop Timer"); } + /**Write the code generic to this End For loop shape */ virtual bool WriteSystemCode(wxTextFile & file); Modified: sofaswitch/trunk/callflow/src/timer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/timer.cpp (original) +++ sofaswitch/trunk/callflow/src/timer.cpp Wed Sep 13 17:55:05 2006 @@ -20,21 +20,33 @@ DndShapeTimer::DndShapeTimer() : DndShape(Timer) { - wxSize newSize(50, 50); - SetSize(newSize); - - relInputPoints.Add(25, 0); - relOutputPoints.Add(25, 50); + Construct(); +} - displayData[displayData.size()] = - InformationSection(wxT("Timer period (seconds)"), wxT("2")); +DndShapeTimer::DndShapeTimer(Kind shapeDrawn) + : DndShape(shapeDrawn) +{ + Construct(); +} - displayData[displayData.size()] = - InformationSection(wxT("Timer label"), wxT("thistimer")); - - AdjustIoPoints(); +void DndShapeTimer::Construct() +{ + wxSize newSize(50, 50); + SetSize(newSize); + + relInputPoints.Add(25, 0); + relOutputPoints.Add(25, 50); + + displayData[displayData.size()] = + InformationSection(wxT("Timer period (seconds)"), wxT("2")); + + displayData[displayData.size()] = + InformationSection(wxT("Timer label"), wxT("thistimer")); + + AdjustIoPoints(); } + wxPoint DndShapeTimer::HourLocation(int hour, int radius) { double angle = (2 * M_PI * (hour + 9))/12.0; @@ -104,7 +116,7 @@ file.AddLine(wxString::Format(" %s, ", displayData[1].data.c_str())); file.AddLine(wxString::Format(" \"Timer label\" : ")); - file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str())); + file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str())); file.AddLine(wxString::Format(" },")); Modified: sofaswitch/trunk/callflow/src/timer.h ============================================================================== --- sofaswitch/trunk/callflow/src/timer.h (original) +++ sofaswitch/trunk/callflow/src/timer.h Wed Sep 13 17:55:05 2006 @@ -12,17 +12,28 @@ public: /**Construtor, Define this shape in terms of size and points etc */ DndShapeTimer(); + + /**Construtor, Define this shape in terms of size and points etc. This + shape accepts an arguement, which is required to set the kind variable, + which is used when we create a descendant of this class. */ + DndShapeTimer(Kind shapeDrawn); /**Destroy this shape, and log it */ virtual ~DndShapeTimer() { } + + /**Do the work of construction, which is common to the above two constructors */ + void Construct(); /**Draw this particular shape to the screen..*/ virtual void Draw(wxDC& dc); /** Used to report the name of this particular class. */ static wxString GetKindName() { return wxString("Timer"); } + + /** Used to report the name of this particular class. */ + virtual wxString GetName() const { return wxString("Timer"); } /**Write the code generic to this End For loop shape */ virtual bool WriteSystemCode(wxTextFile & file);
participants (1)
-
SofaSWITCH SVN