Merge branch 'pu/fb-setmode' of https://github.com/tuxbox-neutrino/gui-neutrino into ni/tuxbox

Origin commit data
------------------
Commit: b47a570fd2
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-03 (Fri, 03 Mar 2017)
This commit is contained in:
vanhofen
2017-03-03 10:34:35 +01:00
7 changed files with 32 additions and 20 deletions

View File

@@ -169,13 +169,13 @@ void CComponentsWindow::initWindowSize()
if (cc_parent)
return;
if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent
width = frameBuffer->getScreenWidth()*width/100;
if (width < 0 && width >= -100) //percentage conversion TODO: behavior inside parent
width = frameBuffer->getScreenWidth()*abs(width)/100;
if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth())
width = frameBuffer->getScreenWidth();
if (height > 0 && height <= 100) //percentage conversion TODO: behavior inside parent
height = frameBuffer->getScreenHeight()*height/100;
if (height < 0 && height >= -100) //percentage conversion TODO: behavior inside parent
height = frameBuffer->getScreenHeight()*abs(height)/100;
if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight())
height = frameBuffer->getScreenHeight();
}

View File

@@ -29,6 +29,8 @@
#include "cc_frm_header.h"
#include "cc_frm_footer.h"
#define CCW_PERCENT - //placeholder for negative sign '-', used for discret dimensions parameters
//! Sub class of CComponentsForm. Shows a window with prepared items.
/*!
CComponentsWindow provides prepared items like header, footer and a container for
@@ -135,6 +137,7 @@ class CComponentsWindow : public CComponentsForm
CC_WINDOW_RIGHT_SIDEBAR = 2
};
/**simple constructor for CComponentsWindow, this shows a window over full screen
* @param[in] parent
* @li optional: expects type CComponentsForm * as possible parent object, default = NULL
@@ -148,9 +151,9 @@ class CComponentsWindow : public CComponentsForm
* @param[in] y_pos
* @li expects type const &int, defines y position on screen
* @param[in] w
* @li expects type const &int, width of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen
* @li expects type const &int, width of window, Note: value = 0 uses full screen
* @param[in] h
* @li expects type const &int, height of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen
* @li expects type const &int, height of window, Note: value = 0 uses full screen
* @param[in] caption
* @li optional: expects type const std::string&, defines title of window header
* @param[in] iconname
@@ -158,16 +161,24 @@ class CComponentsWindow : public CComponentsForm
* @param[in] parent
* @li optional: expects type CComponentsForm * as possible parent object, default = NULL
* @param[in] shadow_mode
* @li optional: expects type int as mode, default = CC_SHADOW_OFF
* possible values are
* CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT)
* @see cc_types.h
* @li optional: expects type int as mode, default = CC_SHADOW_OFF \n
* possible values are \n
* CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) \n
* Take a look into cc_types.h
* @param[in] color_frame
* @li optional: expects type fb_pixel_t, defines frame color, default = COL_FRAME_PLUS_0
* @param[in] color_body
* @li optional: expects type fb_pixel_t, defines color color, default = COL_MENUCONTENT_PLUS_0
* @param[in] color_shadow
* @li optional: expects type fb_pixel_t, defines shadow color, default = COL_SHADOW_PLUS_0
*
* @note Discret dimensions parameters: values < 0 to -100 will be interpreted as percent values related to screen.
* For better readability please use placeholder 'CCW_PERCENT' as negative sign '-' \n
* Example: \n
* this inits a window with position x100 y100 on screen with dimensions 700px x 800px \n
* CComponentsWindow win(100, 100, 700, 800, "Test window");\n
* this inits a window with position x100 y100 on screen with 50% of screen size assigned with discret percental screen dimensions \n
* CComponentsWindow win(100, 100, CCW_PERCENT 50, CCW_PERCENT 50, "Test window");
*/
CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h,
const std::string& caption = "",