mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-16 01:43:35 +02:00
Use strictly CComponentsForm as parent parameter in constructors.
Some parts have been cleaned up (Constructors, init methodes removed)
New parameter makes it possible already add current item in constructor.
So in mostly situations is it not necessary to use explicit addCCItem(),
but addCCItem()is still valid and necessary in certain situations.
Affected are all cc-classes and their derivates.
Some classes must or can be adapted later. The function is
not currently restricted, because usage of parent parameter is not explicit
defined in constructors, see CImageInfo, here yet are used addCCItem()
methodes.
Generally this parameter is located in the constructors before bool has_shadow,
but it is not sure whether it would be better to use this parameter as the first.
That remains to be clarified.
Origin commit data
------------------
Commit: 23d7b62cf0
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-03-03 (Mon, 03 Mar 2014)
72 lines
2.2 KiB
C++
72 lines
2.2 KiB
C++
/*
|
|
Based up Neutrino-GUI - Tuxbox-Project
|
|
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
|
|
|
Classes for generic GUI-related components.
|
|
Copyright (C) 2012-2014 Thilo Graf 'dbt'
|
|
|
|
License: GPL
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public
|
|
License along with this program; if not, write to the
|
|
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#ifndef __CC_ITEM_SHAPES_H__
|
|
#define __CC_ITEM_SHAPES_H__
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include "cc_base.h"
|
|
|
|
//! Sub class of CComponentsItem. Shows a shape with given dimensions and color on screen.
|
|
/*!
|
|
Paint of simple shapes on screen.
|
|
*/
|
|
|
|
class CComponentsShapeCircle : public CComponentsItem
|
|
{
|
|
private:
|
|
///property: diam
|
|
int d;
|
|
public:
|
|
CComponentsShapeCircle( const int x_pos, const int y_pos, const int diam,
|
|
CComponentsForm *parent = NULL,
|
|
bool has_shadow = CC_SHADOW_ON,
|
|
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
|
|
|
///set property: diam
|
|
inline void setDiam(const int& diam){d=width=height=diam, corner_rad=d/2;};
|
|
///get property: diam
|
|
inline int getDiam() const {return d;};
|
|
|
|
///paint item
|
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
|
};
|
|
|
|
class CComponentsShapeSquare : public CComponentsItem
|
|
{
|
|
public:
|
|
CComponentsShapeSquare( const int x_pos, const int y_pos, const int w, const int h,
|
|
CComponentsForm *parent = NULL,
|
|
bool has_shadow = CC_SHADOW_ON,
|
|
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
|
|
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
|
};
|
|
|
|
#endif
|