r2100: *** empty log message ***
[ctsim.git] / src / graph3dview.cpp
index 8855cdade69acebd39f0de729b63c5ea8c952bd1..0349444d506b52f9e7b2d6f67377758f93206d69 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: graph3dview.cpp,v 1.23 2001/09/24 10:05:01 kevin Exp $
+**  $Id: graph3dview.cpp,v 1.25 2002/06/02 19:01:58 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -173,8 +173,6 @@ Graph3dFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
 {
   m_pFrame = CreateChildFrame(doc, this);
   
-  int width, height;
-  m_pFrame->GetClientSize (&width, &height);
   m_pFrame->SetTitle("Graph3dFileView");
   m_pCanvas = CreateCanvas (m_pFrame);
   
@@ -183,9 +181,6 @@ Graph3dFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
   
   InitGL();
   
-  int x, y;  // X requires a forced resize
-  m_pFrame->GetSize(&x, &y);
-  m_pFrame->SetSize(-1, -1, x, y);
   m_pFrame->SetFocus();
   m_pFrame->Show(true);
   Activate(true);
@@ -204,7 +199,7 @@ Graph3dFileView::CreateCanvas (wxFrame* parent)
   int width, height;
   parent->GetClientSize (&width, &height);
   
-  pCanvas = new Graph3dFileCanvas (this, parent, wxPoint(0, 0), wxSize(200, 200), 0);
+  pCanvas = new Graph3dFileCanvas (this, parent, wxPoint(0, 0), wxSize(width,height), 0);
   
   pCanvas->SetBackgroundColour(*wxWHITE);
   pCanvas->Clear();
@@ -287,7 +282,8 @@ Graph3dFileView::CreateDisplayList()
   dYOffset = 0;
 
   double dXPos = -dXOffset;
-  for (unsigned ix = 0; ix < nx - 1; ix++, dXPos++) {
+  unsigned int ix;
+  for (ix = 0; ix < nx - 1; ix++, dXPos++) {
     double dYPos = -dYOffset;
     glBegin(GL_QUAD_STRIP);
     double p1[3], p2[3], p3[3], n1[3]; 
@@ -335,7 +331,7 @@ Graph3dFileView::CreateDisplayList()
 
   glNewList (DISPLAYLIST_NO_COLOR, GL_COMPILE);
   dXPos = -dXOffset;
-  for (unsigned int ix = 0; ix < nx - 1; ix++, dXPos++) {
+  for (ix = 0; ix < nx - 1; ix++, dXPos++) {
     double dYPos = -dYOffset;
     glBegin(GL_QUAD_STRIP);
     double p1[3], p2[3], p3[3], n1[3]; 
@@ -847,6 +843,13 @@ Graph3dFileCanvas::OnDraw (wxDC& dc)
     m_pView->OnDraw(& dc);
 }
 
+
+wxSize
+Graph3dFileCanvas::GetBestSize() const
+{
+  return wxSize (400,400);
+}
+
 void 
 Graph3dFileCanvas::OnSize (wxSizeEvent& event)
 {