Commit Graph

130 Commits

Author SHA1 Message Date
Thilo Graf
44346c6417 CComponents: fix some includes
Included header files don't fit after move of components.
2013-03-06 11:28:17 +01:00
Thilo Graf
399eb696d6 CComponents: add some new variables and parameters and modifie debug output
- add var for object index
  can be usefull for identifications of objects for focus operations soon

- add default value for screen  size (30%) to CComponentsPIP constructor
  most size we mostly use is 30% of size

- add setters for screen_w and screen_h
  also this can be usefull t adapt screen sizes e.g. during
  runtime operations
2013-03-06 11:28:17 +01:00
Thilo Graf
2940c4e5f6 CComponents: add more debug output and fix typo in enum CC_ITEMTYPES 2013-03-06 11:28:16 +01:00
Thilo Graf
6175fd989d CComponentsItem: add members getItemType(), cc_item_type
Small helper for detection of item types.
This could be useful, if it is necessary, to track these at runtime or
debugging, because it's not really detectable, which items just be used.
e.g forms could contain very much items, but many of these items
are inherited from CComponentsItem and an assignment to a certain subclass.
2013-03-06 11:28:16 +01:00
Thilo Graf
9605d7438f CComponentsHeader: add member 'setHeaderButtons()'
Gives possibility to set default button types,

possible parameter types are:
CC_BTN_HELP, CC_BTN_INFO, CC_BTN_MENU, CC_BTN_EXIT
2013-03-06 11:28:16 +01:00
Thilo Graf
fa9ffdd46e CComponentsWindow: add sub class CComponentsWindow 2013-03-06 11:28:16 +01:00
Thilo Graf
b9dd3e21bf CComponentsForm: add virtual members to replace cc-item 2013-03-06 11:28:15 +01:00
Thilo Graf
79dd6456b0 CComponentsHeader: add enums for header items 2013-03-06 11:28:14 +01:00
Thilo Graf
41165d7cb2 CComponentsHeader: add member initCCButtonFormSize()
This moves caclulation from initCCHeaderButtons() to its own
member.
2013-03-06 11:28:14 +01:00
Thilo Graf
62f44d7a8c CComponentsHeader: move int of default buttons into its own member 2013-03-06 11:28:13 +01:00
Thilo Graf
4fb3cde45f CComponentsHeader: fix button display
Calculation of button offset was broken.
2013-03-06 11:28:13 +01:00
Thilo Graf
3644abec66 CComponentsHeader: add parameter buttons onto constructors
This adds default buttons to header
2013-03-06 11:28:13 +01:00
Thilo Graf
562b091e66 CComponentsHeader: move init members into its own member 2013-03-06 11:28:12 +01:00
Thilo Graf
949867e4ac CComponentsForm: add virtual members to manipulate ccitems 2013-03-06 11:28:12 +01:00
Thilo Graf
b330d78ff2 CComponentsHeader: add header buttons to header form
Use addHeaderButton() to add any button icon ont header form.
The buttons have a right alignment, this means, the first button
is on the right boarder of header.
For existing instances it's recommended to remove old button icons
before add new buttons, otherwise icons will be append.

See also sample code in CTestMenu.
2013-03-06 11:28:12 +01:00
Thilo Graf
84fe7cf134 CComponents: add sub class CComponentsIconForm based upon CComponentsForm
Collects only icons.You can add icons step by step or
with a vector and paint the form at once.
Width and height are dynamic calculated if parameters
width or height are smaller then summary of lenght of all added icons.

It's also possible to manipulate the icon array with members:
- insertIcon()
- removeIcon()
- removeAllIcons()

TODO: support for resizable images
2013-03-06 11:28:12 +01:00
Thilo Graf
6ee87b95ec CComponentsHeader: add private member variable cch_text_x 2013-03-06 11:28:11 +01:00
Thilo Graf
0dbddbc483 CComponentsForm: remove constructor
Call of overloaded 'CComponentsForm(int, int, int, int)' is ambiguous.
2013-03-06 11:28:11 +01:00
Thilo Graf
dd91340a37 CComponentsForm: paintCCItems() is needed as public member 2013-03-06 11:28:11 +01:00
Thilo Graf
a5adaf854a CComponentsPicture: rework parameter handling
Not shure if pic_max_h/w could still make problems in while usage
of CComponentsPicture, we will see...
2013-03-06 11:28:11 +01:00
Thilo Graf
8061b2938f CComponentsHeader: init code for icon and text outsource
slim down of paint()
2013-03-06 11:28:11 +01:00
Thilo Graf
75fbc08269 CComponents: add option paint_bg and apply in CComponentsHeader 2013-03-06 11:28:10 +01:00
Thilo Graf
d538e807d8 CCompnents: rename hideContainer into hideCCItem() 2013-03-06 11:28:10 +01:00
Thilo Graf
1934ceef69 CComponentsHeader: optimize allocations an deallocations for cc-items
Bequeath of destructor from CComponentsForm into CCcomponentsHeader.
clearCCItems() does already manage deallocations for cc-items,
so some 'delete" calls are unnecessary.
There was also the danger to overfill the cc-item vector with new added
objects, if it is not have been cleaned previously in existing instances.
2013-03-06 11:28:10 +01:00
Thilo Graf
d14b9903f9 CComponents: add new sub class CComponentsHeader()
This should replace CComponentsTitleBar comming soon.

TODO:
- add additional icons,
- fix frame painting with other corner types , but this is an issue in
  CFramebuffer.  paintBoxFrame provides parameters for corner radius,
  but no corner types.
2013-03-06 11:28:09 +01:00
Thilo Graf
9601760137 CComponentsForm: members become virtual
Members of CComponentsForm will be used in sub classes.
2013-03-06 11:28:09 +01:00
Thilo Graf
cda02273ea CComponents: add new methodes to create forms
Create forms with default constructor and now you can add
cc-items into form with new member addCCItem().

The x/y values are valid to inside of form dimensions itself not inside of screen.
Addable cc-items are all CComponentItem objects and their inheritances
including CComponentsForm itself. So are even nestings possible.

Some changes on other cc-item classes were necessary.
For example, CComponentsPicture or CComponentsText and it's still
much to do.
2013-03-06 11:28:08 +01:00
Thilo Graf
ce00b0b4a0 CComponentsInfoBox: paint text with innstance of CComponentsText
This should be a stable state for painting info boxes in gui parts.
This fix also an automaticaly correction of font size changes while
runtime.
2013-03-06 11:28:08 +01:00
Thilo Graf
80ffab8999 CComponentsText: fix paint text into Textbox 2013-03-06 11:28:07 +01:00
Thilo Graf
ed5aac229b CComponentsInfoBox: inherit setText 2013-03-06 11:28:07 +01:00
Thilo Graf
ac94ad0d3b CComponentsInfoBox: inherit setTextFont and setTextMode 2013-03-06 11:28:07 +01:00
Thilo Graf
c4ef839ad4 CComponentsInfoBox: inherit setTextColor 2013-03-06 11:28:07 +01:00
Thilo Graf
5c5805d0ea CComponentsText: add member clearCCText() 2013-03-06 11:28:07 +01:00
Thilo Graf
d970c5303f CComponentsText: fix possible segfault
segfault happens on left empty text

CComponentsInfoBox: inherit ct_textbox

CComponentsInfoBox: inherit ct_box

CComponentsInfoBox: inherit ct_box
2013-03-06 11:28:07 +01:00
Thilo Graf
bb39d1f64f CComponentsInfoBox:start inherit of CComponentsText onto CComponentsInfoBox 2013-03-06 11:28:06 +01:00
Thilo Graf
e80a254daa CComponentsInfoBox: move define of x_text onto paint() 2013-03-06 11:28:06 +01:00
Thilo Graf
e37b5d86f4 CComponents: add missing paint-members to circle and square classes
paint () ist in CComponentsItem abstrakt, muss definiert werden
seine eigene in Unterklassen.
2013-03-06 11:28:06 +01:00
Thilo Graf
4df7e4d144 CComponents: move CComponentsText before Infobox 2013-03-06 11:28:06 +01:00
Thilo Graf
e1c9749730 CComponents: rename Container onto Item, make void paint() abstract
CComponentsItem is shorter then CComponentsContainer, but also
plausible and appropriately.
paint() is required in all sub classes and useful for coming functions.
2013-03-06 11:28:06 +01:00
Thilo Graf
28904b79c7 ComponentsInfoBox: arange text to the left border if no picture is painted
changed isPainted() to isPicPainted(), return of isPicPainted() value was
not marked-down to false and isPainted() means the container frame and
isPicPainted() means the picture itself, so the last state was wrong. Now
it should work fine.

Btw: scope of x_text reduced, is only required in member paintText()
2013-03-06 11:28:05 +01:00
Thilo Graf
fcf8a018c5 CComponentsText: ensure an empty default value for AUTO_WIDTH in setText()
AUTO_WIDTH has ugly sideeffects in context with max width
2013-03-06 11:28:05 +01:00
Thilo Graf
d8447b9110 CComponents: add sub class CComponentsText 2013-03-06 11:28:05 +01:00
Thilo Graf
cb8ac750a5 CComponents: clean up, don't use fbadata in paintFbItems()
Use consistently vector v_fbdata, so we don't need all parameters in
paintFbItems()
2013-03-06 11:28:04 +01:00
Thilo Graf
2c6a317b40 CComponentsItemBox: move paint of text into its own method 2013-03-06 11:28:04 +01:00
Thilo Graf
5bbe8e770e CComponentsItemBox: move paint of icons and pictures into it's own member 2013-03-06 11:28:03 +01:00
Thilo Graf
bc764b4653 CComponentsForm: add functionality
Now it's possible to paint forms with defined caption and icon
2013-03-06 11:28:03 +01:00
Thilo Graf
7bbf0375e1 CComponents: remove bgmode handler
bg_mode varible was never used
2013-03-06 11:28:03 +01:00
Thilo Graf
16d12b4243 CComponentsForm: add basics for CComponentsForm 2013-03-06 11:28:02 +01:00
micha-bbg
33b4fc4cfa CComponentsItemBox: Add flag 'isCalculated' for control calculateElements() 2013-03-06 11:28:02 +01:00
Thilo Graf
2c5367bc59 CComponentsItemBox: use also locales in overloaded methode addText() 2013-03-06 11:28:02 +01:00