CComponentsItem: move/rename doCenter()to base class CComponentsItem

So it's possible to use this method for all cc-items.
setCenterPos() comes now with parameter 'along_mode' (CC_ALONG_X, CC_ALONG_Y).
So it's possible to center in x or y direction. As default are
both directions predefined.
This commit is contained in:
2014-02-27 19:43:30 +01:00
parent 38dffb8456
commit 8a897103ac
6 changed files with 22 additions and 12 deletions

View File

@@ -29,7 +29,6 @@
#include <global.h>
#include <neutrino.h>
#include "cc_frm_window.h"
#include <driver/screen_max.h>
using namespace std;
@@ -146,11 +145,6 @@ void CComponentsWindow::initWindowPos()
y = frameBuffer->getScreenY();
}
void CComponentsWindow::doCenter(){
x = cc_parent ? cc_parent->getWidth() - width/2 : getScreenStartX(width);
y = cc_parent ? cc_parent->getHeight() - height/2 : getScreenStartY(height);
}
void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text, const int& align_mode)
{
ccw_caption = g_Locale->getText(locale_text);