[Sofaswitch-svn] [commit] r135 - sofaswitch/trunk/callflow/src
Author: derek Date: Wed Sep 27 01:25:31 2006 New Revision: 135 Added: sofaswitch/trunk/callflow/src/callstartstop.cpp sofaswitch/trunk/callflow/src/callstartstop.h Modified: sofaswitch/trunk/callflow/src/Makefile.am sofaswitch/trunk/callflow/src/Makefile.in sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callflow.h sofaswitch/trunk/callflow/src/dnd.h sofaswitch/trunk/callflow/src/endcall.cpp sofaswitch/trunk/callflow/src/endcall.h sofaswitch/trunk/callflow/src/fileio.h sofaswitch/trunk/callflow/src/makecall.cpp sofaswitch/trunk/callflow/src/makecall.h Log: Join EndCall and MakeCall together, as there is heaps of similarities in the look and code required. Add new files, callstartstop to handle common pieces of code. Make relevant downstream changes. Modified: sofaswitch/trunk/callflow/src/Makefile.am ============================================================================== --- sofaswitch/trunk/callflow/src/Makefile.am (original) +++ sofaswitch/trunk/callflow/src/Makefile.am Wed Sep 27 01:25:31 2006 @@ -31,6 +31,7 @@ ../bitmaps/Python.xpm \ ../bitmaps/RequestNode.xpm \ ../bitmaps/compile.xpm \ + ../bitmaps/endcall.xpm \ ../bitmaps/eventer.xpm \ ../bitmaps/makecall.xpm \ ../bitmaps/miniclock.xpm \ @@ -43,6 +44,8 @@ ../bitmaps/transfermedia.xpm \ callflow.cpp \ callflow.h \ + callstartstop.h \ + callstartstop.cpp \ canvas.cpp \ canvas.h \ conditional.cpp \ Modified: sofaswitch/trunk/callflow/src/Makefile.in ============================================================================== --- sofaswitch/trunk/callflow/src/Makefile.in (original) +++ sofaswitch/trunk/callflow/src/Makefile.in Wed Sep 27 01:25:31 2006 @@ -48,13 +48,13 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) -am_callflow_OBJECTS = callflow.$(OBJEXT) canvas.$(OBJEXT) \ - conditional.$(OBJEXT) dnd.$(OBJEXT) drawshape.$(OBJEXT) \ - endcall.$(OBJEXT) endfor.$(OBJEXT) endhere.$(OBJEXT) \ - eventer.$(OBJEXT) fileio.$(OBJEXT) information.$(OBJEXT) \ - joinblocks.$(OBJEXT) listpoints.$(OBJEXT) \ - loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) python.$(OBJEXT) \ - readfromfile.$(OBJEXT) requestnode.$(OBJEXT) \ +am_callflow_OBJECTS = callflow.$(OBJEXT) callstartstop.$(OBJEXT) \ + canvas.$(OBJEXT) conditional.$(OBJEXT) dnd.$(OBJEXT) \ + drawshape.$(OBJEXT) endcall.$(OBJEXT) endfor.$(OBJEXT) \ + endhere.$(OBJEXT) eventer.$(OBJEXT) fileio.$(OBJEXT) \ + information.$(OBJEXT) joinblocks.$(OBJEXT) \ + listpoints.$(OBJEXT) loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) \ + python.$(OBJEXT) readfromfile.$(OBJEXT) requestnode.$(OBJEXT) \ senddtmf.$(OBJEXT) shapelist.$(OBJEXT) shapeselect.$(OBJEXT) \ startfor.$(OBJEXT) starthere.$(OBJEXT) stoptimer.$(OBJEXT) \ timer.$(OBJEXT) transfermedia.$(OBJEXT) writetofile.$(OBJEXT) @@ -210,6 +210,7 @@ ../bitmaps/Python.xpm \ ../bitmaps/RequestNode.xpm \ ../bitmaps/compile.xpm \ + ../bitmaps/endcall.xpm \ ../bitmaps/eventer.xpm \ ../bitmaps/makecall.xpm \ ../bitmaps/miniclock.xpm \ @@ -222,6 +223,8 @@ ../bitmaps/transfermedia.xpm \ callflow.cpp \ callflow.h \ + callstartstop.h \ + callstartstop.cpp \ canvas.cpp \ canvas.h \ conditional.cpp \ @@ -347,6 +350,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callflow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callstartstop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canvas.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditional.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnd.Po@am__quote@ Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Wed Sep 27 01:25:31 2006 @@ -39,6 +39,7 @@ #include "bitmaps/Python.xpm" #include "bitmaps/RequestNode.xpm" #include "bitmaps/compile.xpm" +#include "bitmaps/endcall.xpm" #include "bitmaps/eventer.xpm" #include "bitmaps/makecall.xpm" #include "bitmaps/miniclock.xpm" @@ -70,7 +71,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU ( wxH_CONTROLSCOMPILE, MyFrame::OnCompile) EVT_MENU ( wxH_CONTROLSCONNECT_OBJECTS, MyFrame::OnControlsConnectObjects) - EVT_MENU ( wxH_CONTROLSEND, MyFrame::OnControlsend) + EVT_MENU ( wxH_CONTROLSENDCALL, MyFrame::OnControlsEndCall) EVT_MENU ( wxH_CONTROLSENDHERE, MyFrame::OnControlsendhere) EVT_MENU ( wxH_CONTROLSEND_FOR, MyFrame::OnControlsend_for) EVT_MENU ( wxH_CONTROLSEVENTER, MyFrame::OnControlsEventer) @@ -144,7 +145,7 @@ File_menu -> Append ( wxH_FILESAVE__AS, wxT("Save &As"), wxT("")); File_menu -> Append ( wxH_FILEE_XIT, wxT("E&xit"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSCONNECT_OBJECTS, wxT("connect objects"), wxT("")); - Controls_menu -> Append ( wxH_CONTROLSEND, wxT("end"), wxT("")); + Controls_menu -> Append ( wxH_CONTROLSENDCALL, wxT("end a call (send hangup)"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSENDHERE, wxT("end here"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSEND_FOR, wxT("end for"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSEVENTER, wxT("event reg/wait"), wxT("")); @@ -317,6 +318,7 @@ toolBar->AddSeparator() ; + toolBar->AddTool(wxH_CONTROLSENDCALL, wxBitmap ( endcall ), wxT("End a call (send hangup)")); toolBar->AddTool(wxH_CONTROLSSTARTHERE, wxBitmap ( Controlsstart ), wxT("Start processing")); toolBar->AddTool(wxH_CONTROLSENDHERE, wxBitmap ( ControlsEndHere ), wxT("End processing")); toolBar->AddTool(wxH_CONTROLSREQUESTNODE, wxBitmap (RequestNode ), wxT("Query Supervisor for worker node")); @@ -368,7 +370,7 @@ } -void MyFrame::OnControlsend (wxCommandEvent & WXUNUSED(event)) +void MyFrame::OnControlsEndCall (wxCommandEvent & WXUNUSED(event)) { imageTypeForPlacing = DndShape::EndCall; canvas->SetEditingMode(MyCanvas::PlaceOneShape); Modified: sofaswitch/trunk/callflow/src/callflow.h ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.h (original) +++ sofaswitch/trunk/callflow/src/callflow.h Wed Sep 27 01:25:31 2006 @@ -13,7 +13,7 @@ wxH_FILE = 1, wxH_CONTROLSCOMPILE, wxH_CONTROLSCONNECT_OBJECTS, - wxH_CONTROLSEND, + wxH_CONTROLSENDCALL, wxH_CONTROLSENDHERE, wxH_CONTROLSEND_FOR, wxH_CONTROLSEVENTER, @@ -117,9 +117,10 @@ remote sofaswitch worker. */ void OnControlsSendDtmf (wxCommandEvent & event); - /**Called in response to a user comand to add a "End" ??? widget to the - current graph */ - void OnControlsend (wxCommandEvent & event); + /**Called in response to a user comand to add a "End Call" widget to the + current graph. In other words, send a hangup message to the remote + worker node. */ + void OnControlsEndCall (wxCommandEvent & event); /**Called in response to a user comand to add a "Event catcher" widget to the current graph. These widgets have two outputs - a)for an event, or Added: sofaswitch/trunk/callflow/src/callstartstop.cpp ============================================================================== --- (empty file) +++ sofaswitch/trunk/callflow/src/callstartstop.cpp Wed Sep 27 01:25:31 2006 @@ -0,0 +1,127 @@ +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif +#include <wx/textfile.h> +#include <wx/tokenzr.h> +#include "shapelist.h" + + +#include "callstartstop.h" + + +///////////////////////////////////////////////////////////////////////////// +DndShapeCallStartStop::DndShapeCallStartStop(Kind kindToMake) + : DndShape(kindToMake) +{ + wxSize newSize(50, 50); + SetSize(newSize); + + relInputPoints.Add(25, 0); + relOutputPoints.Add(25, 50); + + displayData[displayData.size()] = + InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\"")); + + AdjustIoPoints(); +} + + +bool DndShapeCallStartStop::WriteSystemCode(wxTextFile & file) +{ + wxString header = wxString::Format(" def %s(self, sTuple):", (kind == MakeCall ? "Make_Call" : "End_Call")); + file.AddLine(header); + file.AddLine(" a,b,c = sTuple "); + file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) "); + if (kind == MakeCall) + file.AddLine(" rhost += \":CALLNODE \" + eval(self.data[a][\"call destination\"]) + \"\\0\" "); + else + file.AddLine(" rhost += \":HANGUP \\0\" "); + file.AddLine(" self.transport.write(rhost) "); + file.AddLine(" return self.data[a][\"Output\"] "); + file.AddLine(""); + + return true; +} + +bool DndShapeCallStartStop::WriteThisShapeInfo(wxTextFile & file) +{ + file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().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(" \"worker node\" : ")); + wxString dest = ProtectString(displayData[1].data); + file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + + if (kind == MakeCall) { + file.AddLine(wxString::Format(" \"call destination\" : ")); + dest = ProtectString(displayData[2].data); + file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + } + + file.AddLine(wxString::Format(" },")); + + return true; +} + +void DndShapeCallStartStop::Draw(wxDC& dc) +{ + DrawCompileError(dc); + dc.SetBrush(wxBrush(*wxBLACK, wxSOLID)); + dc.SetPen(*wxBLACK_PEN); + + wxPoint p1(m_rect.GetPosition()); + wxPoint pA(p1.x + 25, p1.y); + wxPoint pB(p1.x + 25, p1.y + 10); + + wxPoint pY(p1.x + 25, p1.y + 40); + wxPoint pZ(p1.x + 25, p1.y + 50); + + wxPoint pL(p1.x + 3, p1.y+14); + wxPoint pR(p1.x + 47, p1.y + 16); + wxPoint pM(p1.x + 22, p1.y + 12); + wxPoint pL1(pL.x + 0, pL.y+1); + wxPoint pR1(pR.x + 0, pR.y + 1); + dc.DrawLine(pL, pM); + dc.DrawLine(pR, pM); + dc.DrawLine(pL1, pM); + dc.DrawLine(pR1, pM); + + dc.DrawLine(pA, pB); + if (InputPointConnected(0)) + DrawArrow(dc, pB, ArrowDown, Connected); + else + DrawArrow(dc, pB, ArrowDown, Loose); + + dc.DrawLine(pY, pZ); + if (OutputPointConnected(0)) + DrawArrow(dc, pZ, ArrowDown, Connected); + else + DrawArrow(dc, pZ, ArrowDown, Loose); + + wxFont f = wxFont(*wxITALIC_FONT); + f.SetPointSize(7); + dc.SetFont(f); + for (int i = 0; i < 9; i++){ + wxString text = wxString::Format("%d", i+1); + wxCoord w, h; + dc.GetTextExtent(text, &w, &h); + int xPos = m_rect.x + 17 + ((i%3)*9) - (w/2); + int yPos = m_rect.y + 18 + ((i/3)*9) - (h/2); + dc.DrawText(text, xPos, yPos); + } + + + DndShape::Draw(dc); // Draw the selected overlay if required. +} Added: sofaswitch/trunk/callflow/src/callstartstop.h ============================================================================== --- (empty file) +++ sofaswitch/trunk/callflow/src/callstartstop.h Wed Sep 27 01:25:31 2006 @@ -0,0 +1,36 @@ +#ifndef CALL_START_STOP_H +#define CALL_START_STOP_H + +#include "dnd.h" + +////////////////////////////////////////////////////////////////////////////////////////////// +/**Define a call shape. This shape will be used to to either start a call, or + end a call. Starting or ending a call is done with two different + sofaswitch commands, "CALLNODE" or "HANGUP". When making a call, the + destination has to be specified. Store values for size, location, input & + output points. This instance has the ability to draw this shape to a + specified location on the canvas */ +class DndShapeCallStartStop : public DndShape +{ +public: + /**Construtor, Define this shape in terms of size and points etc */ + DndShapeCallStartStop(Kind kindToWrite); + + /**Draw this particular shape to the screen..*/ + virtual void Draw(wxDC& dc); + + /**Write the dictionary containing relevant points for this shape This + shape is drawn slightly differently for make or end call. It accesses + the kind member variable, form the ancestor class DndShape. to + determine how it should be drawn exactly. */ + virtual bool WriteThisShapeInfo(wxTextFile & file); + + /**Write the code generic to this shape. If it is make call, or end call, + it is determined by the kind member variable in the ancestor class + DndShape. */ + virtual bool WriteSystemCode(wxTextFile & file); + +}; + + +#endif // CALL_START_STOP_H Modified: sofaswitch/trunk/callflow/src/dnd.h ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.h (original) +++ sofaswitch/trunk/callflow/src/dnd.h Wed Sep 27 01:25:31 2006 @@ -250,14 +250,14 @@ /**The currently defined shapes that we can draw */ enum Kind { - /* 0 */ None /**The default kind, which is a placeholder, and is no shape at all */, - /* 1 */ StartHere, /**Start processing here */ - /* 2 */ EndHere, /**Finish processing here */ - /* 3 */ StartFor, - /* 4 */ EndFor, - /* 5 */ Conditional /**An If statement. This is the beginning - the end is handled by joining wires. */, - /* 6 */ MakeCall, - /* 7 */ EndCall, + /* 0 */ None /**The default kind, which is a placeholder, and is no shape at all */, + /* 1 */ StartHere, /**Start processing here */ + /* 2 */ EndHere, /**Finish processing here */ + /* 3 */ StartFor /**Start of a for loop */, + /* 4 */ EndFor /**End of a for loop */, + /* 5 */ Conditional /**An If statement. This is the beginning - the end is handled by joining wires. */, + /* 6 */ MakeCall /**Get a call started. In other words, start calling some entity outside of the building*/, + /* 7 */ EndCall /**End a call. In other words, send a hangup message to the node */, /* 8 */ Select /**Used to indicate the rectangle on the screen we are selecting */, /* 9 */ JoinBlocks /**The multi line segment shape which joins two structures on the screen */, /* 10*/ Python /**The user can enter arbitary python here */, Modified: sofaswitch/trunk/callflow/src/endcall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/endcall.cpp (original) +++ sofaswitch/trunk/callflow/src/endcall.cpp Wed Sep 27 01:25:31 2006 @@ -18,40 +18,15 @@ ///////////////////////////////////////////////////////////////////////////// DndShapeEndCall::DndShapeEndCall() - : DndShape(EndCall) + : DndShapeCallStartStop(EndCall) { - wxSize newSize(50, 50); - SetSize(newSize); - relInputPoints.Add(25, 0); - AdjustIoPoints(); } -void DndShapeEndCall::Draw(wxDC& dc) -{ - DrawCompileError(dc); - dc.SetPen(*wxBLACK_PEN); - - wxPoint p1(m_rect.GetPosition()); - wxPoint pA(p1.x + 25, p1.y); - wxPoint pB(p1.x + 25, p1.y + 15); - - DrawBox(dc, 0, 15, 50, 35); - dc.DrawLine(pA, pB); - if (InputPointConnected(0)) - DrawArrow(dc, pB, ArrowDown, Connected); - else - DrawArrow(dc, pB, ArrowDown, Loose); - - DndShape::Draw(dc); // Draw the selected overlay if required. -} -bool DndShapeEndCall::WriteSystemCode(wxTextFile & file) -{ - file.AddLine(" def End_Call(self, sTuple): "); - file.AddLine(" a,b,c = sTuple"); - file.AddLine(" return self.data[a][\"Output\"]"); - file.AddLine(""); - return true; -} + +void DndShapeEndCall::Draw(wxDC & dc) +{ + DndShapeCallStartStop::Draw(dc); +} Modified: sofaswitch/trunk/callflow/src/endcall.h ============================================================================== --- sofaswitch/trunk/callflow/src/endcall.h (original) +++ sofaswitch/trunk/callflow/src/endcall.h Wed Sep 27 01:25:31 2006 @@ -1,32 +1,26 @@ #ifndef END_CALL_H #define END_CALL_H -#include "dnd.h" +#include "callstartstop.h" - ////////////////////////////////////////////////////////////////////////////////////////////// /**Define a end call shape. Store values for size, location, input & output points. This instance has the ability to draw this shape to a specified location on the canvas */ -class DndShapeEndCall : public DndShape +class DndShapeEndCall : public DndShapeCallStartStop { public: /**Construtor, Define this shape in terms of size and points etc */ DndShapeEndCall(); + - /**Destroy this shape, and log it */ - virtual ~DndShapeEndCall() - { - } - - /**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("End Call"); } + /**Draw the additional things to indicate we are ending a call. Thus, we + add graphics to the base image provided by CallStartStop::Draw(wxDC & + dc) */ + void Draw(wxDC & dc); - /**Write the code generic to this End Call shape */ - virtual bool WriteSystemCode(wxTextFile & file); + /** Used to report the name of this particular class. */ + static wxString GetKindName() { return wxString("End Call"); } }; Modified: sofaswitch/trunk/callflow/src/fileio.h ============================================================================== --- sofaswitch/trunk/callflow/src/fileio.h (original) +++ sofaswitch/trunk/callflow/src/fileio.h Wed Sep 27 01:25:31 2006 @@ -26,7 +26,7 @@ /**Write the code generic to this shape. If it is a write to file, or read from file type, is determined by the kind member variable in the - ancesort class DndShape. */ + ancestor class DndShape. */ virtual bool WriteSystemCode(wxTextFile & file); }; Modified: sofaswitch/trunk/callflow/src/makecall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/makecall.cpp (original) +++ sofaswitch/trunk/callflow/src/makecall.cpp Wed Sep 27 01:25:31 2006 @@ -18,108 +18,18 @@ ///////////////////////////////////////////////////////////////////////////// DndShapeMakeCall::DndShapeMakeCall() - : DndShape(MakeCall) + : DndShapeCallStartStop(MakeCall) { - wxSize newSize(50, 50); - SetSize(newSize); - relInputPoints.Add(25, 0); - relOutputPoints.Add(25, 50); - displayData[displayData.size()] = - InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\"")); - - displayData[displayData.size()] = InformationSection(wxT("Call destination (python code)"), wxT("\"h323:h323.voxgratia.org\"")); - AdjustIoPoints(); -} -bool DndShapeMakeCall::WriteSystemCode(wxTextFile & file) -{ - file.AddLine(" def Make_Call(self, sTuple): "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) "); - file.AddLine(" rhost += \":CALLNODE \" + eval(self.data[a][\"call destination\"]) + \"\\0\" "); - file.AddLine(" self.transport.write(rhost) "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(""); - - return true; } -bool DndShapeMakeCall::WriteThisShapeInfo(wxTextFile & file) -{ - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().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(" \"worker node\" : ")); - wxString dest = ProtectString(displayData[1].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); - file.AddLine(wxString::Format(" \"call destination\" : ")); - dest = ProtectString(displayData[2].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); - - file.AddLine(wxString::Format(" },")); - - return true; -} - - -void DndShapeMakeCall::Draw(wxDC& dc) +void DndShapeMakeCall::Draw(wxDC & dc) { - DrawCompileError(dc); - dc.SetBrush(wxBrush(*wxBLACK, wxSOLID)); - dc.SetPen(*wxBLACK_PEN); - wxPoint p1(m_rect.GetPosition()); - wxPoint pA(p1.x + 25, p1.y); - wxPoint pB(p1.x + 25, p1.y + 10); - - wxPoint pY(p1.x + 25, p1.y + 40); - wxPoint pZ(p1.x + 25, p1.y + 50); - - wxPoint pL(p1.x + 3, p1.y+14); - wxPoint pR(p1.x + 47, p1.y + 16); - wxPoint pM(p1.x + 22, p1.y + 12); - wxPoint pL1(pL.x + 0, pL.y+1); - wxPoint pR1(pR.x + 0, pR.y + 1); - dc.DrawLine(pL, pM); - dc.DrawLine(pR, pM); - dc.DrawLine(pL1, pM); - dc.DrawLine(pR1, pM); - - dc.DrawLine(pA, pB); - if (InputPointConnected(0)) - DrawArrow(dc, pB, ArrowDown, Connected); - else - DrawArrow(dc, pB, ArrowDown, Loose); - - dc.DrawLine(pY, pZ); - if (OutputPointConnected(0)) - DrawArrow(dc, pZ, ArrowDown, Connected); - else - DrawArrow(dc, pZ, ArrowDown, Loose); - - wxFont f = wxFont(*wxITALIC_FONT); - f.SetPointSize(7); - dc.SetFont(f); - for (int i = 0; i < 9; i++){ - wxString text = wxString::Format("%d", i+1); - wxCoord w, h; - dc.GetTextExtent(text, &w, &h); - int xPos = m_rect.x + 17 + ((i%3)*9) - (w/2); - int yPos = m_rect.y + 18 + ((i/3)*9) - (h/2); - dc.DrawText(text, xPos, yPos); - } - - - DndShape::Draw(dc); // Draw the selected overlay if required. + DndShapeCallStartStop::Draw(dc); } - Modified: sofaswitch/trunk/callflow/src/makecall.h ============================================================================== --- sofaswitch/trunk/callflow/src/makecall.h (original) +++ sofaswitch/trunk/callflow/src/makecall.h Wed Sep 27 01:25:31 2006 @@ -1,30 +1,21 @@ #ifndef MAKE_CALL_H #define MAKE_CALL_H -#include "dnd.h" +#include "callstartstop.h" ////////////////////////////////////////////////////////////////////////////////////////////// /**Define a create a call shape. Store values for size, location, input & output points. This instance has the ability to draw this shape to a specified location on the canvas */ -class DndShapeMakeCall : public DndShape +class DndShapeMakeCall : public DndShapeCallStartStop { public: /**Construtor, Define this shape in terms of size and points etc */ DndShapeMakeCall(); - /**Destroy this shape, and log it */ - virtual ~DndShapeMakeCall() - { - } - - /**Draw this particular shape to the screen..*/ - virtual void Draw(wxDC& dc); - - /**Write the code generic to this Make Call shape */ - virtual bool WriteSystemCode(wxTextFile & file); - - /**Write the dictionary containing relevant points for this shape */ - virtual bool WriteThisShapeInfo(wxTextFile & file); + /**Draw the additional things to indicate we are making a call. Thus, we + add graphics to the base image provided by CallStartStop::Draw(wxDC & + dc) */ + void Draw(wxDC & dc); /** Used to report the name of this particular class. */ static wxString GetKindName() { return wxString("Make Call"); }
participants (1)
-
SofaSWITCH SVN