If is x or y position of embedded item out of allowed form dimension, then
set a new x or y value to item.
Added debug message should help to find issues.
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.
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
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.
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.
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.
CComponentsItem is shorter then CComponentsContainer, but also
plausible and appropriately.
paint() is required in all sub classes and useful for coming functions.
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()