Warning fixes and deprecated method elimination from ABX.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-11-09 21:40:34 +00:00
parent 6937991694
commit 8552e6f031
42 changed files with 370 additions and 416 deletions

View File

@@ -222,7 +222,7 @@ bool DiagramCommand::Do(void)
}
case OGLEDIT_ADD_SHAPE:
{
wxShape *theShape = NULL;
wxShape *theShape;
if (shape)
theShape = shape; // Saved from undoing the shape
else
@@ -253,7 +253,7 @@ bool DiagramCommand::Do(void)
}
case OGLEDIT_ADD_LINE:
{
wxShape *theShape = NULL;
wxShape *theShape;
if (shape)
theShape = shape; // Saved from undoing the line
else
@@ -424,13 +424,13 @@ bool DiagramCommand::Undo(void)
// Remove each individual line connected to a shape by sending a command.
void DiagramCommand::RemoveLines(wxShape *shape)
{
wxNode *node = shape->GetLines().First();
wxNode *node = shape->GetLines().GetFirst();
while (node)
{
wxLineShape *line = (wxLineShape *)node->Data();
wxLineShape *line = (wxLineShape *)node->GetData();
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
node = shape->GetLines().First();
node = shape->GetLines().GetFirst();
}
}
@@ -455,10 +455,10 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
{
// Ensure no other shape is selected, to simplify Undo/Redo code
bool redraw = FALSE;
wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *eachShape = (wxShape *)node->Data();
wxShape *eachShape = (wxShape *)node->GetData();
if (eachShape->GetParent() == NULL)
{
if (eachShape->Selected())
@@ -467,7 +467,7 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
redraw = TRUE;
}
}
node = node->Next();
node = node->GetNext();
}
GetShape()->Select(TRUE, &dc);
if (redraw)

View File

@@ -72,7 +72,6 @@ bool MyApp::OnInit(void)
//// Make a menubar
wxMenu *file_menu = new wxMenu;
wxMenu *edit_menu = NULL;
file_menu->Append(wxID_NEW, _T("&New..."));
file_menu->Append(wxID_OPEN, _T("&Open..."));
@@ -85,7 +84,7 @@ bool MyApp::OnInit(void)
file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup..."));
file_menu->Append(wxID_PREVIEW, _T("Print Pre&view"));
edit_menu = new wxMenu;
wxMenu *edit_menu = new wxMenu;
edit_menu->Append(wxID_UNDO, _T("&Undo"));
edit_menu->Append(wxID_REDO, _T("&Redo"));
edit_menu->AppendSeparator();

View File

@@ -127,16 +127,16 @@ void DiagramView::OnDraw(wxDC *dc)
if (diagram_p->GetShapeList())
{
/* wxCursor *old_cursor = NULL; */
wxNode *current = diagram_p->GetShapeList()->First();
wxNode *current = diagram_p->GetShapeList()->GetFirst();
while (current) // Loop through the entire list of shapes
{
wxShape *object = (wxShape *)current->Data();
wxShape *object = (wxShape *)current->GetData();
if (!object->GetParent())
{
object->Draw(* dc); // Draw the shape onto our printing dc
}
current = current->Next(); // Procede to the next shape in the list
current = current->GetNext(); // Procede to the next shape in the list
}
}
dc->EndDrawing(); // Allows optimization of drawing code under MS Windows.
@@ -177,16 +177,16 @@ wxShape *DiagramView::FindSelectedShape(void)
{
DiagramDocument *doc = (DiagramDocument *)GetDocument();
wxShape *theShape = NULL;
wxNode *node = doc->GetDiagram()->GetShapeList()->First();
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *eachShape = (wxShape *)node->Data();
wxShape *eachShape = (wxShape *)node->GetData();
if ((eachShape->GetParent() == NULL) && eachShape->Selected())
{
theShape = eachShape;
node = NULL;
}
else node = node->Next();
else node = node->GetNext();
}
return theShape;
}