|
From: <ala...@us...> - 2003-10-25 19:27:03
|
Update of /cvsroot/aedgui/aedGUI/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4702
Modified Files:
aedWidget.cpp aedTheme.cpp aedRadioButtonGroup.cpp
aedMenuBar.cpp aedMenu.cpp aedApp.cpp
Log Message:
Various function/variable name changes to make everything more consistant with having aedWidget as the top level component
Index: aedWidget.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedWidget.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** aedWidget.cpp 25 Oct 2003 18:28:54 -0000 1.1
--- aedWidget.cpp 25 Oct 2003 19:23:59 -0000 1.2
***************
*** 19,23 ****
if(pApp->getRoot() == NULL)
{
! std::cerr << "You must first create the root window!\n";
exit(1);
}
--- 19,23 ----
if(pApp->getRoot() == NULL)
{
! std::cerr << "You must first create the root widget!\n";
exit(1);
}
***************
*** 25,35 ****
init();
! // inherit from root window
m_Theme = pApp->getRoot()->m_Theme;
m_Font = pApp->getRoot()->m_Font;
! m_BGColor = m_Theme->colorDefaultWindowBackground;
}
! // This constructor is to be used only by the "root" Window
aedWidget::
aedWidget(Uint16 screenWidth, Uint16 screenHeight, bool takeOverScreen)
--- 25,35 ----
init();
! // inherit from root widget
m_Theme = pApp->getRoot()->m_Theme;
m_Font = pApp->getRoot()->m_Font;
! m_BGColor = m_Theme->colorDefaultWidgetBackground;
}
! // This constructor is to be used only by the "root" Widget
aedWidget::
aedWidget(Uint16 screenWidth, Uint16 screenHeight, bool takeOverScreen)
***************
*** 52,56 ****
// get the default theme
m_Theme = pApp->getDefaultTheme();
! m_BGColor = m_Theme->colorDefaultWindowBackground;
std::string tmp = pApp->getDefaultFontName();
--- 52,56 ----
// get the default theme
m_Theme = pApp->getDefaultTheme();
! m_BGColor = m_Theme->colorDefaultWidgetBackground;
std::string tmp = pApp->getDefaultFontName();
***************
*** 64,72 ****
aedWidget::~aedWidget()
{
! if(pApp->getFocusWindow() == this)
! pApp->setFocusWindow(NULL);
if(m_Parent)
! m_Parent->removeWindow(this);
if(m_Surface)
--- 64,72 ----
aedWidget::~aedWidget()
{
! if(pApp->getFocusWidget() == this)
! pApp->setFocusWidget(NULL);
if(m_Parent)
! m_Parent->removeWidget(this);
if(m_Surface)
***************
*** 80,84 ****
if(parent != NULL)
! parent->addWindow(this);
setPos(pos.getX(), pos.getY());
--- 80,84 ----
if(parent != NULL)
! parent->addWidget(this);
setPos(pos.getX(), pos.getY());
***************
*** 93,97 ****
m_BGColor = aedColor(255, 255, 255, 0);
m_ReRender = true;
! m_ShowWindow = true;
m_IsEnabled = true;
m_IsStatic = false;
--- 93,97 ----
m_BGColor = aedColor(255, 255, 255, 0);
m_ReRender = true;
! m_ShowWidget = true;
m_IsEnabled = true;
m_IsStatic = false;
***************
*** 119,126 ****
return;
! if(pApp->getRoot()->findWindow(id) == NULL)
m_Id = id;
else
! pLog->warning("window ID already exists: '%s'\n", id.c_str());
}
--- 119,126 ----
return;
! if(pApp->getRoot()->findWidget(id) == NULL)
m_Id = id;
else
! pLog->warning("widget ID already exists: '%s'\n", id.c_str());
}
***************
*** 175,179 ****
aedWidget *
! aedWidget::findWindow(const std::string & id)
{
std::stack <aedWidget *> s;
--- 175,179 ----
aedWidget *
! aedWidget::findWidget(const std::string & id)
{
std::stack <aedWidget *> s;
***************
*** 202,206 ****
aedWidget *
! aedWidget::findWindow(aedWidget *pointer)
{
std::stack <aedWidget *> s;
--- 202,206 ----
aedWidget *
! aedWidget::findWidget(aedWidget *pointer)
{
std::stack <aedWidget *> s;
***************
*** 228,232 ****
}
! bool aedWidget::addWindow(aedWidget * win)
{
if(!win || win == this)
--- 228,232 ----
}
! bool aedWidget::addWidget(aedWidget * win)
{
if(!win || win == this)
***************
*** 251,255 ****
}
! bool aedWidget::removeWindow(aedWidget * win)
{
std::vector < aedWidget * >::iterator p =
--- 251,255 ----
}
! bool aedWidget::removeWidget(aedWidget * win)
{
std::vector < aedWidget * >::iterator p =
***************
*** 272,279 ****
/* We need to save parent's pointer here because
! * removeWindow() will set our m_Parent to NULL. */
aedWidget *parent = m_Parent;
! parent->removeWindow(this);
! parent->addWindow(this);
parent->bringToTop();
}
--- 272,279 ----
/* We need to save parent's pointer here because
! * removeWindget() will set our m_Parent to NULL. */
aedWidget *parent = m_Parent;
! parent->removeWidget(this);
! parent->addWidget(this);
parent->bringToTop();
}
***************
*** 291,295 ****
bool aedWidget::hasFocus(void) const
{
! return pApp->getFocusWindow() == this;
}
--- 291,295 ----
bool aedWidget::hasFocus(void) const
{
! return pApp->getFocusWidget() == this;
}
***************
*** 447,451 ****
// this relies on the fact that the user will
! // always call renderAll on the root window
if(pApp->getRoot() == this)
pUpdateMgr->updateRects(screen);
--- 447,451 ----
// this relies on the fact that the user will
! // always call renderAll on the root widget
if(pApp->getRoot() == this)
pUpdateMgr->updateRects(screen);
***************
*** 604,608 ****
aedWidget::wm_sizechanged(Uint16 screenWidth, Uint16 screenHeight)
{
! if(NULL == m_Parent) // we are the root window
{
m_ScreenWidth = screenWidth - 1;
--- 604,608 ----
aedWidget::wm_sizechanged(Uint16 screenWidth, Uint16 screenHeight)
{
! if(NULL == m_Parent) // we are the root widget
{
m_ScreenWidth = screenWidth - 1;
***************
*** 667,671 ****
aedWidget *child;
aedKeyEvent keyevent;
! aedWidget *pFocused = pApp->getFocusWindow();
switch (event->type)
--- 667,671 ----
aedWidget *child;
aedKeyEvent keyevent;
! aedWidget *pFocused = pApp->getFocusWidget();
switch (event->type)
***************
*** 692,696 ****
NO_STATIC);
! last = last ? pApp->getRoot()->findWindow(last) : NULL;
if(last && !last->getRealPos().isPointIn(event->motion.x, event->motion.y))
--- 692,696 ----
NO_STATIC);
! last = last ? pApp->getRoot()->findWidget(last) : NULL;
if(last && !last->getRealPos().isPointIn(event->motion.x, event->motion.y))
***************
*** 715,724 ****
NO_STATIC);
! // Note: after these two lines, pApp->getFocusWindow() may return
// NULL or child
! if(child != pApp->getFocusWindow())
! pApp->setFocusWindow(child);
! pFocused = pApp->getFocusWindow();
if(pFocused != NULL && pFocused->isEnabled())
{
--- 715,724 ----
NO_STATIC);
! // Note: after these two lines, pApp->getFocusWidget() may return
// NULL or child
! if(child != pApp->getFocusWidget())
! pApp->setFocusWidget(child);
! pFocused = pApp->getFocusWidget();
if(pFocused != NULL && pFocused->isEnabled())
{
***************
*** 788,792 ****
}
/*
! // This is not working now, it does but causes all windows to process
// Messages
for(size_t i = 0;i<ChildrenCount;++i)
--- 788,792 ----
}
/*
! // This is not working now, it does but causes all widgets to process
// Messages
for(size_t i = 0;i<ChildrenCount;++i)
Index: aedTheme.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedTheme.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** aedTheme.cpp 25 Oct 2003 00:05:18 -0000 1.21
--- aedTheme.cpp 25 Oct 2003 19:23:59 -0000 1.22
***************
*** 29,33 ****
colorButtonOver2.setAllColors(246, 242, 238, 255);
! colorDefaultWindowBackground.setAllColors(238, 238, 230, 255);
}
--- 29,33 ----
colorButtonOver2.setAllColors(246, 242, 238, 255);
! colorDefaultWidgetBackground.setAllColors(238, 238, 230, 255);
}
Index: aedRadioButtonGroup.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedRadioButtonGroup.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** aedRadioButtonGroup.cpp 17 Sep 2003 14:51:36 -0000 1.12
--- aedRadioButtonGroup.cpp 25 Oct 2003 19:23:59 -0000 1.13
***************
*** 46,50 ****
p = m_Buttons[index];
m_NextY -= p->getPos().getHeight() + 4;
! this->removeWindow(p);
m_Buttons.erase(m_Buttons.begin() + index);
delete p;
--- 46,50 ----
p = m_Buttons[index];
m_NextY -= p->getPos().getHeight() + 4;
! this->removeWidget(p);
m_Buttons.erase(m_Buttons.begin() + index);
delete p;
***************
*** 71,75 ****
m_Buttons[m_Selected]->setState(false);
m_Buttons[index]->setState(true);
! if(pApp->getFocusWindow() == this)
{
m_Buttons[m_Selected]->setActiveBorder(false);
--- 71,75 ----
m_Buttons[m_Selected]->setState(false);
m_Buttons[index]->setState(true);
! if(pApp->getFocusWidget() == this)
{
m_Buttons[m_Selected]->setActiveBorder(false);
***************
*** 83,87 ****
else
{
! if(pApp->getFocusWindow() == this)
{
m_Buttons[m_Selected]->setActiveBorder(true);
--- 83,87 ----
else
{
! if(pApp->getFocusWidget() == this)
{
m_Buttons[m_Selected]->setActiveBorder(true);
Index: aedMenuBar.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedMenuBar.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** aedMenuBar.cpp 25 Oct 2003 00:05:18 -0000 1.3
--- aedMenuBar.cpp 25 Oct 2003 19:23:59 -0000 1.4
***************
*** 137,144 ****
if(i != -1)
{
! // getParent()->addWindow(m_Menus[i]);
// m_Menus[i]->setPos(r.getX() + getRealPos().getX(), getRealPos().getY() + getPos().getHeight());
! this->addWindow(m_Menus[i]);
m_Menus[i]->setPos(r.getX(), getPos().getHeight() - 2);
m_Menus[i]->show();
--- 137,144 ----
if(i != -1)
{
! // getParent()->addWidget(m_Menus[i]);
// m_Menus[i]->setPos(r.getX() + getRealPos().getX(), getRealPos().getY() + getPos().getHeight());
! this->addWidget(m_Menus[i]);
m_Menus[i]->setPos(r.getX(), getPos().getHeight() - 2);
m_Menus[i]->show();
Index: aedMenu.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedMenu.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** aedMenu.cpp 25 Oct 2003 00:05:18 -0000 1.5
--- aedMenu.cpp 25 Oct 2003 19:23:59 -0000 1.6
***************
*** 99,103 ****
pUpdateMgr->addRect(r);
! getParent()->removeWindow(this);
}
return 0;
--- 99,103 ----
pUpdateMgr->addRect(r);
! getParent()->removeWidget(this);
}
return 0;
Index: aedApp.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedApp.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** aedApp.cpp 25 Oct 2003 00:05:18 -0000 1.26
--- aedApp.cpp 25 Oct 2003 19:23:59 -0000 1.27
***************
*** 38,42 ****
pApp = this;
m_Root = NULL;
! m_FocusWindow = NULL;
m_UTF8 = false;
--- 38,42 ----
pApp = this;
m_Root = NULL;
! m_FocusWidget = NULL;
m_UTF8 = false;
***************
*** 68,72 ****
m_Root = NULL;
! m_FocusWindow = NULL;
// m_Themes[0] is the default theme and can't be unloaded so we just
--- 68,72 ----
m_Root = NULL;
! m_FocusWidget = NULL;
// m_Themes[0] is the default theme and can't be unloaded so we just
***************
*** 116,138 ****
}
! void aedApp::setFocusWindow(aedWidget *win)
{
! if(m_FocusWindow != NULL && win != NULL && m_FocusWindow != m_Root)
{
// tell the old widget that it lost focus
! m_FocusWindow->setActiveBorder(false);
! m_FocusWindow->setRenderState(true);
! m_FocusWindow->wm_lostfocus();
! m_FocusWindow->triggerEvent(LOST_FOCUS, m_FocusWindow, NULL);
}
! m_FocusWindow = win;
! if(m_FocusWindow && m_FocusWindow != m_Root)
{
! m_FocusWindow->setActiveBorder(true);
! m_FocusWindow->setRenderState(true);
! m_FocusWindow->bringToTop();
! m_FocusWindow->wm_gotfocus();
! m_FocusWindow->triggerEvent(GOT_FOCUS, m_FocusWindow, NULL);
}
}
--- 116,138 ----
}
! void aedApp::setFocusWidget(aedWidget *win)
{
! if(m_FocusWidget != NULL && win != NULL && m_FocusWidget != m_Root)
{
// tell the old widget that it lost focus
! m_FocusWidget->setActiveBorder(false);
! m_FocusWidget->setRenderState(true);
! m_FocusWidget->wm_lostfocus();
! m_FocusWidget->triggerEvent(LOST_FOCUS, m_FocusWidget, NULL);
}
! m_FocusWidget = win;
! if(m_FocusWidget && m_FocusWidget != m_Root)
{
! m_FocusWidget->setActiveBorder(true);
! m_FocusWidget->setRenderState(true);
! m_FocusWidget->bringToTop();
! m_FocusWidget->wm_gotfocus();
! m_FocusWidget->triggerEvent(GOT_FOCUS, m_FocusWidget, NULL);
}
}
|