|
From: <edu...@us...> - 2003-07-12 21:37:30
|
Update of /cvsroot/aedgui/aedGUI/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10246/src
Modified Files:
Makefile.am aedButton.cpp
Added Files:
aedImageButton.cpp
Log Message:
New aedImageButton class. This is the 0.1.6 release.
--- NEW FILE: aedImageButton.cpp ---
#include "aedImageButton.h"
aedImageButton::
aedImageButton()
{
m_IsWidget = true;
m_CanFocus = true;
m_Image.setStatic(true);
m_Image.setPos(0, 0);
m_Image.setSize(TAKEOVERPARENT);
this->addWindow(&m_Image);
}
int
aedImageButton::wm_lbuttondown(Uint16 x, Uint16 y)
{
aedButton::wm_lbuttondown(x, y);
m_Image.setPos(2, 2); // related to its parent
m_Image.setRenderState(true);
return 0;
}
int
aedImageButton::wm_lbuttonup(Uint16 x, Uint16 y)
{
aedButton::wm_lbuttonup(x, y);
m_Image.setPos(0, 0);
m_Image.setRenderState(true);
return 0;
}
void
aedImageButton::
render(SDL_Surface *screen, bool needsToBeUpdated)
{
SDL_Rect rect;
if(screen == NULL)
screen = SDL_GetVideoSurface();
rect = getMyPosition().getSDLRect();
if(rect.w <= 4 || rect.h <= 4) // The minimum size a button can have
return;
getParent()->wm_paint(screen, rect.x, rect.y, rect.w, rect.h);
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile.am 12 Jul 2003 17:13:01 -0000 1.5
--- Makefile.am 12 Jul 2003 21:37:27 -0000 1.6
***************
*** 12,15 ****
aedStaticImage.cpp aedAnimatedImage.cpp \
aedThemeManager.cpp aedSquareButton.cpp aedRadioButtonGroup.cpp \
! aedTimer.cpp aedListBox.cpp aedLog.cpp
!
--- 12,14 ----
aedStaticImage.cpp aedAnimatedImage.cpp \
aedThemeManager.cpp aedSquareButton.cpp aedRadioButtonGroup.cpp \
! aedTimer.cpp aedListBox.cpp aedImageButton.cpp aedLog.cpp
Index: aedButton.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedButton.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aedButton.cpp 12 Jul 2003 12:48:47 -0000 1.2
--- aedButton.cpp 12 Jul 2003 21:37:27 -0000 1.3
***************
*** 23,27 ****
}
-
void
aedButton::setButtonState(bool s)
--- 23,26 ----
|