summaryrefslogtreecommitdiff
path: root/opengl/gldialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/gldialog.cpp')
-rw-r--r--opengl/gldialog.cpp41
1 files changed, 33 insertions, 8 deletions
diff --git a/opengl/gldialog.cpp b/opengl/gldialog.cpp
index c279944..ae3ef45 100644
--- a/opengl/gldialog.cpp
+++ b/opengl/gldialog.cpp
@@ -22,6 +22,7 @@ static const char rcs_id[]="$Id$";
#include "gldialog.h"
#include "dialog.h"
+#include "config.h"
/////////////////////////////////////////////////////////////////////////////
@@ -40,12 +41,11 @@ GLDialog::GLDialog(Generate& gen)
, m_dir(this,IDC_TXT_DIR,0)
, m_forceCOG(this,IDC_CHK_FORCECOG,0)
, m_blitzMax(this,IDC_CHK_BLITZMAX,0)
+ , m_funcLabel(this,IDC_LBL_FUNCNAME,0)
{
- char path[1024];
+ Config::Load();
- GetCurrentDirectory(sizeof path,path);
-
- m_fname=path;
+ m_path=Config::Path();
m_dirButton.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&GLDialog::OnSelect));
@@ -84,9 +84,15 @@ int GLDialog::ResourceID()
void GLDialog::OnInit()
{
- m_dir.SetText(m_fname);
+ m_dir.SetText(m_path);
m_funcName.SetText(m_gen.GenerateFuncname());
m_genButton.Enable(true);
+
+ m_useInfo.SetState(Config::UseInfo());
+ m_useTexture.SetState(Config::UseTexture());
+ m_forceCOG.SetState(Config::ForceCOG());
+ m_blitzMax.SetState(Config::BlitzMax());
+
Preview();
}
@@ -97,6 +103,13 @@ void GLDialog::OnInit()
BOOL GLDialog::OnGenerate(UINT msg, WPARAM wp, LPARAM lp)
{
+ Config::Path(m_path);
+ Config::UseInfo(m_useInfo.GetState());
+ Config::UseTexture(m_useTexture.GetState());
+ Config::ForceCOG(m_forceCOG.GetState());
+ Config::BlitzMax(m_blitzMax.GetState());
+ Config::Save();
+
Close(IDOK);
return TRUE;
}
@@ -104,7 +117,7 @@ BOOL GLDialog::OnGenerate(UINT msg, WPARAM wp, LPARAM lp)
BOOL GLDialog::OnSelect(UINT msg, WPARAM wp, LPARAM lp)
{
- if (W32DLib::Common::SelectDir(m_wnd,"Select Directory",m_fname))
+ if (W32DLib::Common::SelectDir(m_wnd,"Select Directory",m_path))
{
OnChange(msg,wp,lp);
}
@@ -132,11 +145,23 @@ BOOL GLDialog::OnChange(UINT msg, WPARAM wp, LPARAM lp)
void GLDialog::Preview()
{
- m_gen.Setup(m_fname,
+ m_dir.SetText(m_path);
+
+ m_gen.Setup(m_path,
m_funcName.GetText(),
m_useTexture.GetState(),
m_useInfo.GetState(),
- m_forceCOG.GetState());
+ m_forceCOG.GetState(),
+ m_blitzMax.GetState());
+
+ if (m_blitzMax.GetState())
+ {
+ m_funcLabel.SetText("Class name:");
+ }
+ else
+ {
+ m_funcLabel.SetText("Function name:");
+ }
m_info.SetText(m_gen.Info());
}