font tool overlapping character fix by heiye. updated const signatures in gui editor and font tool.

git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@980 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
bitplane 2007-09-19 08:03:29 +00:00
parent 9207ed2d76
commit 9be7473508
18 changed files with 47 additions and 48 deletions

View File

@ -54,7 +54,7 @@ namespace gui
AttribName->drop(); AttribName->drop();
} }
virtual bool OnEvent(SEvent e) virtual bool OnEvent(const SEvent &e)
{ {
if (IsEnabled) if (IsEnabled)
{ {

View File

@ -89,7 +89,7 @@ namespace gui
CGUIAttribute::setAttrib(attribs, attribIndex); CGUIAttribute::setAttrib(attribs, attribIndex);
} }
virtual bool OnEvent(SEvent e) virtual bool OnEvent(const SEvent &e)
{ {
switch (e.EventType) switch (e.EventType)
{ {

View File

@ -145,14 +145,14 @@ IGUIElement* CGUIEditFactory::addGUIElement(const c8* typeName, IGUIElement* par
//! returns amount of element types this factory is able to create //! returns amount of element types this factory is able to create
s32 CGUIEditFactory::getCreatableGUIElementTypeCount() s32 CGUIEditFactory::getCreatableGUIElementTypeCount() const
{ {
return EGUIEDIT_COUNT; return EGUIEDIT_COUNT;
} }
//! returns type name of a createable element type //! returns type name of a createable element type
const c8* CGUIEditFactory::getCreateableGUIElementTypeName(s32 idx) const c8* CGUIEditFactory::getCreateableGUIElementTypeName(s32 idx) const
{ {
if (idx>=0 && idx<EGUIEDIT_COUNT) if (idx>=0 && idx<EGUIEDIT_COUNT)
return GUIEditElementTypeNames[idx]; return GUIEditElementTypeNames[idx];

View File

@ -29,17 +29,17 @@ namespace gui
virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0); virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0);
//! returns amount of GUI element types this factory is able to create //! returns amount of GUI element types this factory is able to create
virtual s32 getCreatableGUIElementTypeCount(); virtual s32 getCreatableGUIElementTypeCount() const;
//! returns type name of a createable GUI element type by index //! returns type name of a createable GUI element type by index
/** \param idx: Index of the type in this factory. Must be a value between 0 and /** \param idx: Index of the type in this factory. Must be a value between 0 and
getCreatableGUIElementTypeCount() */ getCreatableGUIElementTypeCount() */
virtual const c8* getCreateableGUIElementTypeName(s32 idx); virtual const c8* getCreateableGUIElementTypeName(s32 idx) const;
// not used: // not used:
virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) {return 0;} ; virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const {return 0;} ;
virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) { return EGUIET_ELEMENT;}; virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) const { return EGUIET_ELEMENT;};
virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) {return 0;}; virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) {return 0;};
private: private:

View File

@ -110,17 +110,17 @@ CGUIEditWindow::~CGUIEditWindow()
ResizeButton->drop(); ResizeButton->drop();
} }
CGUIAttributeEditor* CGUIEditWindow::getEnvironmentEditor() CGUIAttributeEditor* CGUIEditWindow::getEnvironmentEditor() const
{ {
return EnvEditor; return EnvEditor;
} }
CGUIAttributeEditor* CGUIEditWindow::getAttributeEditor() CGUIAttributeEditor* CGUIEditWindow::getAttributeEditor() const
{ {
return AttribEditor; return AttribEditor;
} }
CGUIAttributeEditor* CGUIEditWindow::getOptionEditor() CGUIAttributeEditor* CGUIEditWindow::getOptionEditor() const
{ {
return OptionEditor; return OptionEditor;
} }
@ -181,7 +181,7 @@ void CGUIEditWindow::draw()
//! called if an event happened. //! called if an event happened.
bool CGUIEditWindow::OnEvent(SEvent event) bool CGUIEditWindow::OnEvent(const SEvent &event)
{ {
switch(event.EventType) switch(event.EventType)
{ {
@ -277,6 +277,6 @@ bool CGUIEditWindow::OnEvent(SEvent event)
// we're supposed to supply these if we're creating an IGUIWindow // we're supposed to supply these if we're creating an IGUIWindow
// but we don't need them so we'll just return null // but we don't need them so we'll just return null
IGUIButton* CGUIEditWindow::getCloseButton() {return 0;} IGUIButton* CGUIEditWindow::getCloseButton() const {return 0;}
IGUIButton* CGUIEditWindow::getMinimizeButton() {return 0;} IGUIButton* CGUIEditWindow::getMinimizeButton() const {return 0;}
IGUIButton* CGUIEditWindow::getMaximizeButton() {return 0;} IGUIButton* CGUIEditWindow::getMaximizeButton() const {return 0;}

View File

@ -26,19 +26,19 @@ namespace gui
//! this part draws the window //! this part draws the window
virtual void draw(); virtual void draw();
//! handles events //! handles events
virtual bool OnEvent(SEvent event); virtual bool OnEvent(const SEvent &event);
//! change selection //! change selection
virtual void setSelectedElement(IGUIElement *sel); virtual void setSelectedElement(IGUIElement *sel);
// not used // not used
virtual IGUIButton* getCloseButton(); virtual IGUIButton* getCloseButton() const;
virtual IGUIButton* getMinimizeButton(); virtual IGUIButton* getMinimizeButton() const;
virtual IGUIButton* getMaximizeButton(); virtual IGUIButton* getMaximizeButton() const;
CGUIAttributeEditor* getAttributeEditor(); CGUIAttributeEditor* getAttributeEditor() const;
CGUIAttributeEditor* getOptionEditor(); CGUIAttributeEditor* getOptionEditor() const;
CGUIAttributeEditor* getEnvironmentEditor(); CGUIAttributeEditor* getEnvironmentEditor() const;
//! this shoudln't be serialized, but this is included as it's an example //! this shoudln't be serialized, but this is included as it's an example
virtual const c8* getTypeName() const { return "GUIEditWindow"; } virtual const c8* getTypeName() const { return "GUIEditWindow"; }

View File

@ -221,7 +221,7 @@ void CGUIEditWorkspace::selectPreviousSibling()
} }
//! called if an event happened. //! called if an event happened.
bool CGUIEditWorkspace::OnEvent(SEvent e) bool CGUIEditWorkspace::OnEvent(const SEvent &e)
{ {
IGUIFileOpenDialog* dialog=0; IGUIFileOpenDialog* dialog=0;
switch(e.EventType) switch(e.EventType)
@ -416,7 +416,7 @@ bool CGUIEditWorkspace::OnEvent(SEvent e)
sub->addItem(L"Default factory",-1,true, true); sub->addItem(L"Default factory",-1,true, true);
// add elements from each factory // add elements from each factory
for (i=0; i < Environment->getRegisteredGUIElementFactoryCount(); ++i) for (i=0; u32(i) < Environment->getRegisteredGUIElementFactoryCount(); ++i)
{ {
sub2 = sub->getSubMenu(i); sub2 = sub->getSubMenu(i);
@ -428,7 +428,7 @@ bool CGUIEditWorkspace::OnEvent(SEvent e)
c++; c++;
} }
if (i+1 < Environment->getRegisteredGUIElementFactoryCount()) if (u32(i+1) < Environment->getRegisteredGUIElementFactoryCount())
{ {
core::stringw strFact; core::stringw strFact;
strFact = L"Factory "; strFact = L"Factory ";
@ -574,7 +574,7 @@ bool CGUIEditWorkspace::OnEvent(SEvent e)
// load a gui file // load a gui file
case EGET_FILE_SELECTED: case EGET_FILE_SELECTED:
dialog = (IGUIFileOpenDialog*)e.GUIEvent.Caller; dialog = (IGUIFileOpenDialog*)e.GUIEvent.Caller;
Environment->loadGUI(core::stringc(dialog->getFilename()).c_str()); Environment->loadGUI(core::stringc(dialog->getFileName()).c_str());
break; break;
case EGET_MENU_ITEM_SELECTED: case EGET_MENU_ITEM_SELECTED:

View File

@ -41,7 +41,7 @@ namespace gui
~CGUIEditWorkspace(); ~CGUIEditWorkspace();
//! called if an event happened. //! called if an event happened.
virtual bool OnEvent(SEvent event); virtual bool OnEvent(const SEvent &event);
//! Removes a child. //! Removes a child.
virtual void removeChild(IGUIElement* child); virtual void removeChild(IGUIElement* child);

View File

@ -166,7 +166,7 @@ void CGUIPanel::setHScrollBarMode( E_SCROLL_BAR_MODE mode )
NeedsUpdate = true; NeedsUpdate = true;
} }
bool CGUIPanel::OnEvent( SEvent event ) bool CGUIPanel::OnEvent(const SEvent &event)
{ {
// Redirect mouse wheel to scrollbar // Redirect mouse wheel to scrollbar
if ( event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_MOUSE_WHEEL ) if ( event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_MOUSE_WHEEL )

View File

@ -79,7 +79,7 @@ public:
//! returns the visible area inside the panel, excluding scrollbar and border //! returns the visible area inside the panel, excluding scrollbar and border
core::rect<s32> getClientArea() const; core::rect<s32> getClientArea() const;
virtual bool OnEvent(SEvent event); virtual bool OnEvent(const SEvent &event);
//! adds a child to the panel //! adds a child to the panel
virtual void addChild(IGUIElement* child); virtual void addChild(IGUIElement* child);

View File

@ -61,7 +61,7 @@ namespace gui
AttribButton->drop(); AttribButton->drop();
} }
virtual bool OnEvent(SEvent e) virtual bool OnEvent(const SEvent &e)
{ {
if (IsEnabled) if (IsEnabled)

View File

@ -183,7 +183,7 @@ void CGUITextureCacheBrowser::updateAbsolutePosition()
} }
//! called if an event happened. //! called if an event happened.
bool CGUITextureCacheBrowser::OnEvent(SEvent event) bool CGUITextureCacheBrowser::OnEvent(const SEvent &event)
{ {
switch(event.EventType) switch(event.EventType)
{ {

View File

@ -29,7 +29,7 @@ namespace gui
~CGUITextureCacheBrowser(); ~CGUITextureCacheBrowser();
//! event handler //! event handler
bool OnEvent(SEvent event); virtual bool OnEvent(const SEvent &event);
//! draws the element //! draws the element
virtual void draw(); virtual void draw();
@ -41,13 +41,13 @@ namespace gui
virtual const c8* getTypeName() const { return "textureCacheBrowser"; } virtual const c8* getTypeName() const { return "textureCacheBrowser"; }
//! Returns pointer to the close button //! Returns pointer to the close button
virtual IGUIButton* getCloseButton() { return CloseButton; } virtual IGUIButton* getCloseButton() const { return CloseButton; }
//! Returns pointer to the minimize button //! Returns pointer to the minimize button
virtual IGUIButton* getMinimizeButton() { return 0;} virtual IGUIButton* getMinimizeButton() const { return 0;}
//! Returns pointer to the maximize button //! Returns pointer to the maximize button
virtual IGUIButton* getMaximizeButton() { return 0;} virtual IGUIButton* getMaximizeButton() const { return 0;}
void setSelected(s32 index=-1); void setSelected(s32 index=-1);

View File

@ -14,7 +14,7 @@ CMemoryReadWriteFile::CMemoryReadWriteFile(const c8* filename)
} }
s32 CMemoryReadWriteFile::write(const void* buffer, s32 sizeToWrite) s32 CMemoryReadWriteFile::write(const void* buffer, u32 sizeToWrite)
{ {
// no point in writing 0 bytes // no point in writing 0 bytes
@ -34,7 +34,7 @@ s32 CMemoryReadWriteFile::write(const void* buffer, s32 sizeToWrite)
} }
bool CMemoryReadWriteFile::seek(s32 finalPos, bool relativeMovement) bool CMemoryReadWriteFile::seek(long finalPos, bool relativeMovement)
{ {
if (relativeMovement) if (relativeMovement)
{ {
@ -55,12 +55,12 @@ bool CMemoryReadWriteFile::seek(s32 finalPos, bool relativeMovement)
} }
const c8* CMemoryReadWriteFile::getFileName() const c8* CMemoryReadWriteFile::getFileName() const
{ {
return FileName.c_str(); return FileName.c_str();
} }
s32 CMemoryReadWriteFile::getPos() long CMemoryReadWriteFile::getPos() const
{ {
return Pos; return Pos;
} }
@ -71,7 +71,7 @@ core::array<c8>& CMemoryReadWriteFile::getData()
} }
s32 CMemoryReadWriteFile::getSize() long CMemoryReadWriteFile::getSize() const
{ {
return Data.size(); return Data.size();
} }

View File

@ -27,7 +27,7 @@ namespace io
//! \param buffer: Pointer to buffer of bytes to write. //! \param buffer: Pointer to buffer of bytes to write.
//! \param sizeToWrite: Amount of bytes to wrtie to the file. //! \param sizeToWrite: Amount of bytes to wrtie to the file.
//! \return Returns how much bytes were written. //! \return Returns how much bytes were written.
virtual s32 write(const void* buffer, s32 sizeToWrite); virtual s32 write(const void* buffer, u32 sizeToWrite);
//! Changes position in file, returns true if successful. //! Changes position in file, returns true if successful.
//! \param finalPos: Destination position in the file. //! \param finalPos: Destination position in the file.
@ -35,11 +35,11 @@ namespace io
//! changed relative to current position. Otherwise the position is changed //! changed relative to current position. Otherwise the position is changed
//! from begin of file. //! from begin of file.
//! \return Returns true if successful, otherwise false. //! \return Returns true if successful, otherwise false.
virtual bool seek(s32 finalPos, bool relativeMovement = false); virtual bool seek(long finalPos, bool relativeMovement = false);
//! Returns size of file. //! Returns size of file.
//! \return Returns the size of the file in bytes. //! \return Returns the size of the file in bytes.
virtual s32 getSize(); virtual long getSize() const;
//! Reads an amount of bytes from the file. //! Reads an amount of bytes from the file.
//! \param buffer: Pointer to buffer where to read bytes will be written to. //! \param buffer: Pointer to buffer where to read bytes will be written to.
@ -49,11 +49,11 @@ namespace io
//! Returns the current position in the file. //! Returns the current position in the file.
//! \return Returns the current position in the file in bytes. //! \return Returns the current position in the file in bytes.
virtual s32 getPos(); virtual long getPos() const;
//! Returns name of file. //! Returns name of file.
//! \return Returns the file name as zero terminated character string. //! \return Returns the file name as zero terminated character string.
virtual const c8* getFileName(); virtual const c8* getFileName() const;
//! Returns file data as an array //! Returns file data as an array
core::array<c8>& getData(); core::array<c8>& getData();

View File

@ -124,7 +124,7 @@ inline u32 getTextureSizeFromSurfaceSize(u32 size)
{ {
WCRANGE* current = &glyphs->ranges[range]; WCRANGE* current = &glyphs->ranges[range];
maxy=0; //maxy=0;
// loop through each glyph and write its size and position // loop through each glyph and write its size and position
for (s32 ch=current->wcLow; ch< current->wcLow + current->cGlyphs; ch++) for (s32 ch=current->wcLow; ch< current->wcLow + current->cGlyphs; ch++)

View File

@ -18,4 +18,3 @@ Global
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -100,7 +100,7 @@ public:
device->setEventReceiver(this); device->setEventReceiver(this);
} }
virtual bool OnEvent(SEvent event) virtual bool OnEvent(const SEvent &event)
{ {
if (event.EventType == EET_GUI_EVENT) if (event.EventType == EET_GUI_EVENT)
{ {