Minor changes

This commit is contained in:
cozman 2003-05-21 02:47:56 +00:00
parent 34068b8b1d
commit 53ac6d7d9c
6 changed files with 42 additions and 30 deletions

View File

@ -13,7 +13,7 @@
\brief Definition file for GContainer. \brief Definition file for GContainer.
Definition file for GContainer, a barebones widget that can contain child widgets. Definition file for GContainer, a barebones widget that can contain child widgets.
<br>$Id: GewiContainer.h,v 1.3 2003/05/19 23:56:05 cozman Exp $<br> <br>$Id: GewiContainer.h,v 1.4 2003/05/21 02:47:56 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -41,9 +41,11 @@ class GContainer : public GWidget
void InsertWidget(WidgetNode *node); void InsertWidget(WidgetNode *node);
public: public:
GContainer(GContainer *parent=NULL); GContainer(GContainer *parent=NULL);
void Move(float x, float y);
void Message(SDL_Event *rawEvent, GewiEvent event, Uint16 mouseX, Uint16 mouseY, char ch); virtual void Kill();
void Show(); virtual void Move(float x, float y);
virtual void Message(SDL_Event *rawEvent, GewiEvent event, Uint16 mouseX, Uint16 mouseY, char ch);
virtual void Show();
}; };
} }

View File

@ -13,7 +13,7 @@
\brief Definition file for GTextField. \brief Definition file for GTextField.
Definition file for GTextField, text input area widget. Definition file for GTextField, text input area widget.
<br>$Id: GewiTextField.h,v 1.3 2003/05/19 23:56:05 cozman Exp $<br> <br>$Id: GewiTextField.h,v 1.4 2003/05/21 02:47:56 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -38,8 +38,7 @@ class GTextField : public GWidget
GTextField(GContainer *parent=NULL); GTextField(GContainer *parent=NULL);
~GTextField(); ~GTextField();
void Kill(); virtual void Kill();
virtual void Create(float x, float y, float width, float height, ResourceID font, ResourceID backgroundImg, int maxChars=256, int leftPad=0); virtual void Create(float x, float y, float width, float height, ResourceID font, ResourceID backgroundImg, int maxChars=256, int leftPad=0);
virtual void Message(SDL_Event *rawEvent, GewiEvent event, Uint16 mouseX, Uint16 mouseY, char ch); virtual void Message(SDL_Event *rawEvent, GewiEvent event, Uint16 mouseX, Uint16 mouseY, char ch);
virtual void Show(); virtual void Show();

View File

@ -13,7 +13,7 @@
\brief Implementation of GContainer. \brief Implementation of GContainer.
Implementation of GContainer, a barebones widget that can contain child widgets. Implementation of GContainer, a barebones widget that can contain child widgets.
<br>$Id: GewiContainer.cpp,v 1.3 2003/05/20 00:08:55 cozman Exp $<br> <br>$Id: GewiContainer.cpp,v 1.4 2003/05/21 02:47:56 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -43,6 +43,12 @@ GContainer::GContainer(GContainer *parent)
{ {
} }
void GContainer::Kill()
{
rChildList.DeleteWidgets();
GWidget::Kill();
}
void GContainer::Move(float x, float y) void GContainer::Move(float x, float y)
{ {
GWidget::Move(x,y); GWidget::Move(x,y);

View File

@ -13,7 +13,7 @@
\brief Implementation of GWidget. \brief Implementation of GWidget.
Implementation of GWidget, virtual widget base class. Implementation of GWidget, virtual widget base class.
<br>$Id: GewiWidget.cpp,v 1.3 2003/05/20 00:08:55 cozman Exp $<br> <br>$Id: GewiWidget.cpp,v 1.4 2003/05/21 02:47:56 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -66,7 +66,6 @@ void GWidget::Kill()
else else
rGewi->DeleteWidget(this); rGewi->DeleteWidget(this);
//rChildList.DeleteWidgets();
rAlive = rVisible = false; rAlive = rVisible = false;
} }

View File

@ -13,13 +13,14 @@
#include "ZEngine.h" #include "ZEngine.h"
#include "GewiEngine.h" #include "GewiEngine.h"
#include "GButton.h" #include "GewiButton.h"
#include "GTextButton.h" #include "GewiTextButton.h"
#include "GWindow.h" #include "GewiWindow.h"
#include "GTextField.h" #include "GewiTextField.h"
#include "GSlider.h" #include "GewiSlider.h"
#include "GStaticText.h" #include "GewiStaticText.h"
using namespace ZE; using namespace ZE;
using namespace Gewi;
void Init() void Init()
{ {
@ -43,8 +44,8 @@ void Init()
void Test1() void Test1()
{ {
ZEngine *ze = ZEngine::GetInstance(); ZEngine *ze = ZEngine::GetInstance();
Gewi *gewi = Gewi::GetInstance(); GewiEngine *gewi = GewiEngine::GetInstance();
ZImage bg("rainbow.bmp"),buf; ZImage bg("data/rainbow.bmp"),buf;
ResourceID id1,id2,id3,id4,id5,id6,id7,id8,id9; ResourceID id1,id2,id3,id4,id5,id6,id7,id8,id9;
GWindow w1; GWindow w1;
GTextButton tb1; GTextButton tb1;
@ -59,14 +60,14 @@ void Test1()
ZImage *temp,*temp2,*temp3,*temp4,*temp5,*temp6,*temp7,*temp8; ZImage *temp,*temp2,*temp3,*temp4,*temp5,*temp6,*temp7,*temp8;
ZFont *font; ZFont *font;
temp = new ZImage("b1.bmp"); temp = new ZImage("data/b1.bmp");
temp2 = new ZImage("b2.bmp"); temp2 = new ZImage("data/b2.bmp");
temp3 = new ZImage("skin1.bmp"); temp3 = new ZImage("data/skin1.bmp");
temp4 = new ZImage("text.bmp"); temp4 = new ZImage("data/text.bmp");
temp5 = new ZImage("bg3.bmp"); temp5 = new ZImage("data/bg3.bmp");
temp6 = new ZImage("slider.bmp"); temp6 = new ZImage("data/slider.bmp");
temp7 = new ZImage("bg4.bmp"); temp7 = new ZImage("data/bg4.bmp");
temp8 = new ZImage("slider2.bmp"); temp8 = new ZImage("data/slider2.bmp");
font = new ZFont("c:\\windows\\fonts\\arial.ttf",20); font = new ZFont("c:\\windows\\fonts\\arial.ttf",20);
temp->SetColorKey(255,0,255); temp->SetColorKey(255,0,255);
temp2->SetColorKey(255,0,255); temp2->SetColorKey(255,0,255);
@ -92,7 +93,7 @@ void Test1()
s1.Create(100,500,200,50,id6,id7,0,3,1); s1.Create(100,500,200,50,id6,id7,0,3,1);
s2.Create(700,200,50,200,id8,id9,0,200,5); s2.Create(700,200,50,200,id8,id9,0,200,5);
hb1.Create(70,40,100,100,id1,id2,G_HOVER); hb1.Create(70,40,100,100,id1,id2,G_HOVER);
st1.Create(100,100,100,100,id4,Gewi::InvalidID,"static",GJ_CENTER); st1.Create(100,100,100,100,id4,Gewi::GewiEngine::InvalidID,"static",GJ_CENTER);
do do
{ {
@ -131,7 +132,7 @@ void Test1()
} while(!ze->QuitRequested()); } while(!ze->QuitRequested());
Gewi::ReleaseInstance(); GewiEngine::ReleaseInstance();
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])

View File

@ -21,6 +21,7 @@
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
@ -41,9 +42,10 @@ SDL_net.lib
SDL_image.lib SDL_image.lib
SDL_ttf.lib SDL_ttf.lib
ZEngineS.lib ZEngineS.lib
c:\home\src\gewi\Release\gewi.lib" gewi.lib"
OutputFile="$(OutDir)/gewitest.exe" OutputFile="../test/bin/GewiTest00.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
SubSystem="2" SubSystem="2"
OptimizeReferences="2" OptimizeReferences="2"
@ -69,6 +71,9 @@ c:\home\src\gewi\Release\gewi.lib"
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\test\gewiTest00.cpp">
</File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"