summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorleo2001-01-25 23:06:11 +0000
committerleo2001-01-25 23:06:11 +0000
commitfdaeae206f67ce36fcc58e72897a731489691768 (patch)
treebbc33ffb413ceca9a42fbf75e9695a695eedc939 /common
parent789d7a2a8eabb75bdc7d13d34b07bc219252b084 (diff)
Multiple project views
git-svn-id: http://svn.leocad.org/trunk@227 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common')
-rw-r--r--common/basewnd.h19
-rw-r--r--common/glwindow.h6
-rw-r--r--common/project.cpp4
-rw-r--r--common/view.cpp3
4 files changed, 28 insertions, 4 deletions
diff --git a/common/basewnd.h b/common/basewnd.h
index a767f68..1380ad4 100644
--- a/common/basewnd.h
+++ b/common/basewnd.h
@@ -2,6 +2,20 @@
#define _BASEWND_H_
#include <string.h>
+
+// FIXME: move this to another place
+#ifdef WIN32
+#include "stdafx.h"
+typedef CWnd* BaseWndXID;
+typedef struct
+{
+ CWnd* wnd;
+ int index;
+ UINT command;
+} BaseMenuItem;
+
+#else
+
#include <gtk/gtk.h>
typedef GtkWidget* BaseWndXID;
typedef struct
@@ -9,6 +23,7 @@ typedef struct
GtkWidget* widget;
GtkAccelGroup* accel;
} BaseMenuItem;
+#endif
// =============================================================================
// Message Box constants
@@ -56,10 +71,14 @@ class BaseWnd
BaseWndXID GetXID () const
{ return m_pXID; }
+ void SetXID (BaseWndXID id)
+ { m_pXID = id; }
+#ifndef WIN32
// FIXME: remove
operator GtkWidget* () const
{ return m_pXID; }
+#endif
BaseMenuItem* GetMenuItem (int id) const
{ return &m_pMenuItems[id]; }
diff --git a/common/glwindow.h b/common/glwindow.h
index 837a9c2..3354884 100644
--- a/common/glwindow.h
+++ b/common/glwindow.h
@@ -7,12 +7,16 @@ class GLWindow
GLWindow (GLWindow *share);
virtual ~GLWindow ();
- void Create (void* data);
+ bool Create (void* data);
void DestroyContext ();
bool MakeCurrent ();
void SwapBuffers ();
void Redraw ();
+ int GetWidth () const
+ { return m_nWidth; }
+ int GetHeight () const
+ { return m_nHeight; }
virtual void OnDraw () { };
virtual void OnSize (int cx, int cy)
diff --git a/common/project.cpp b/common/project.cpp
index c2b54e6..92be49d 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -745,7 +745,7 @@ void Project::LoadDefaults(bool cameras)
strcpy(m_strBackground, Sys_ProfileLoadString ("Default", "BMP", ""));
m_pTerrain->LoadDefaults((m_nDetail & LC_DET_LINEAR) != 0);
- for (int i = 0; i < m_ViewList.GetSize (); i++)
+ for (i = 0; i < m_ViewList.GetSize (); i++)
{
m_ViewList[i]->MakeCurrent ();
RenderInitialize();
@@ -1192,7 +1192,7 @@ bool Project::FileLoad(File* file, bool bUndo, bool bMerge)
}
}
- for (int i = 0; i < m_ViewList.GetSize (); i++)
+ for (i = 0; i < m_ViewList.GetSize (); i++)
{
m_ViewList[i]->MakeCurrent ();
RenderInitialize();
diff --git a/common/view.cpp b/common/view.cpp
index abd8435..27e0595 100644
--- a/common/view.cpp
+++ b/common/view.cpp
@@ -2,8 +2,9 @@
// View the project contents
//
-#include "view.h"
+#include <stdlib.h>
#include "project.h"
+#include "view.h"
View::View (Project *pProject, GLWindow *share)
: GLWindow (share)